Skip to content

Commit f8b3e29

Browse files
fix(skills): stop rewriting lock on every install (#183)
make sync was regenerating skills-lock.json even when all skills were already installed, dirtying the submodule and breaking make reset. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 082de5d commit f8b3e29

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎Makefile‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ ruler-rules-copy: ## Copy rules to .ruler directory.
8383
# External skills are declared in SKILLS.txt and locked in skills-lock.json.
8484

8585
.PHONY: skills-install
86-
skills-install: ## Install external skills declared in SKILLS.txt (skips already installed).
87-
@if [ -f "$(SKILLS_GLOBAL_LOCK)" ]; then \
88-
$(MAKE) skills-lock; \
89-
fi
86+
skills-install: ## Install external skills from skills-lock.json (skips already installed; does not rewrite the lock).
9087
@lock="$(SKILLS_LOCK_FILE)"; \
9188
skills_dir="$(SKILLS_EXTERNAL_SOURCE_DIR)"; \
9289
force="$${DOTAGENTS_FORCE_SKILLS_INSTALL:-0}"; \
@@ -123,7 +120,7 @@ skills-install: ## Install external skills declared in SKILLS.txt (skips already
123120
fi; \
124121
done; \
125122
rm -f "$$tmp_missing"; \
126-
if [ -f "$(SKILLS_GLOBAL_LOCK)" ]; then \
123+
if [ "$$failed" = "0" ] && [ -f "$(SKILLS_GLOBAL_LOCK)" ]; then \
127124
$(MAKE) skills-lock || failed=1; \
128125
fi; \
129126
exit $$failed

‎rules/skills-management.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ bunx skills add owner/repo --global --list
2323
# Repos with <10 skills: install all (no selection)
2424
# Repos with 10+ skills: always specify selections
2525

26-
# 3. Install (regenerates skills-lock.json from SKILLS.txt automatically)
27-
cd dotagents && make skills-install
28-
29-
# Install-all repos (no selection) need a one-time bootstrap to enter the lock:
26+
# 3. Bootstrap into the global lock, then regenerate the committed lock
27+
bunx skills add owner/repo --global --yes --skill name
28+
# Install-all repos (no selection):
3029
# bunx skills add owner/repo --global --yes --skill '*'
30+
cd dotagents && make skills-lock
31+
32+
# 4. Install any still-missing skills from the lock (does not rewrite the lock
33+
# when everything is already installed; make sync relies on that)
34+
cd dotagents && make skills-install
3135

32-
# 4. Commit SKILLS.txt and skills-lock.json together
36+
# 5. Commit SKILLS.txt and skills-lock.json together
3337
```
3438

3539
## Removing Skills

0 commit comments

Comments
 (0)