Skip to content

Commit cee1b1c

Browse files
authored
feat(skills): add skills-update, drive install from SKILLS.txt (#176)
1 parent 2ac703d commit cee1b1c

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

‎Makefile‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ 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 from skills-lock.json (skips already installed).
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
8790
@lock="$(SKILLS_LOCK_FILE)"; \
8891
skills_dir="$(SKILLS_EXTERNAL_SOURCE_DIR)"; \
8992
force="$${DOTAGENTS_FORCE_SKILLS_INSTALL:-0}"; \
@@ -120,12 +123,20 @@ skills-install: ## Install external skills from skills-lock.json (skips already
120123
fi; \
121124
done; \
122125
rm -f "$$tmp_missing"; \
126+
if [ -f "$(SKILLS_GLOBAL_LOCK)" ]; then \
127+
$(MAKE) skills-lock; \
128+
fi; \
123129
exit $$failed
124130

125131
.PHONY: skills-refresh
126132
skills-refresh: ## Force a reinstall of all external skills from skills-lock.json.
127133
@DOTAGENTS_FORCE_SKILLS_INSTALL=1 $(MAKE) skills-install
128134

135+
.PHONY: skills-update
136+
skills-update: ## Update installed external skills to latest and refresh the lock.
137+
@bun x skills update --global --yes </dev/null
138+
@$(MAKE) skills-lock
139+
129140
.PHONY: skills-lock
130141
skills-lock: ## Regenerate skills-lock.json from SKILLS.txt.
131142
@global_lock="$(SKILLS_GLOBAL_LOCK)"; \

‎README.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@ This runs the full pipeline: prepares `.ruler/`, generates agent instruction fil
1414
External skills are declared in `SKILLS.txt` (canonical: repo plus comma-separated selection, no selection installs all) and locked in `skills-lock.json`, both committed. Installs go through the [skills CLI](https://github.com/vercel-labs/skills); global scope is scripted here because the CLI's own lock restore is project-only (see [vercel-labs/skills#549](https://github.com/vercel-labs/skills/issues/549)).
1515

1616
```bash
17-
# Regenerate skills-lock.json from SKILLS.txt
18-
make skills-lock
19-
20-
# Install everything in the lock that is missing (idempotent)
17+
# Install everything declared in SKILLS.txt that is missing (idempotent;
18+
# regenerates skills-lock.json automatically)
2119
make skills-install
2220

21+
# Update installed skills to latest and refresh the lock
22+
make skills-update
23+
24+
# Regenerate skills-lock.json from SKILLS.txt without installing
25+
make skills-lock
26+
2327
# Force a reinstall of everything in the lock
2428
make skills-refresh
2529
```
2630

27-
To add skills: edit `SKILLS.txt`, run `make skills-lock && make skills-install && make skills-lock` (the second lock captures resolved metadata), and commit both files. To remove: delete from `SKILLS.txt`, run `bunx skills remove <name> --global --yes`, then `make skills-lock`.
31+
To add skills: edit `SKILLS.txt`, run `make skills-install`, and commit both files. To remove: delete from `SKILLS.txt`, run `bunx skills remove <name> --global --yes`, then `make skills-lock`.
2832

2933
Installs track each source's default branch: the skills CLI does not record commit SHAs in its lock yet, so entries are not pinned to a commit.

‎rules/skills-management.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ 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. Regenerate the lock, install, then re-lock to capture resolved metadata
27-
cd dotagents && make skills-lock && make skills-install && make skills-lock
26+
# 3. Install (regenerates skills-lock.json from SKILLS.txt automatically)
27+
cd dotagents && make skills-install
2828

2929
# 4. Commit SKILLS.txt and skills-lock.json together
3030
```
@@ -37,6 +37,15 @@ bunx skills remove <name> --global --yes
3737
cd dotagents && make skills-lock
3838
```
3939

40+
## Updating Installed Skills
41+
42+
```bash
43+
cd dotagents && make skills-update
44+
```
45+
46+
Runs `bun x skills update --global` and refreshes `skills-lock.json`; commit
47+
the resulting diff.
48+
4049
## Restoring (fresh machine or CI)
4150

4251
```bash

0 commit comments

Comments
 (0)