name: update-skills description: "Update declared agent skills for this chezmoi repo: edit the skills manifest, run the apply-time installer, and reconcile drift via skills-review. Use when editing home/.chezmoidata/skills/*.yaml, the skills install scripts, the local skills/ directory, or when reviewing drift with ~/.scripts/skills-review."
Update Skills
Use this skill when changing declared agent skills in this repo.
Source of truth
- Canonical manifest:
home/.chezmoidata/skills/*.yaml(overlay-friendly map merge) - Schema:
schemas/skills.schema.json - Local skill source root:
skills/at repo root (not underhome/, not chezmoi state) - Unix install script:
home/.chezmoiscripts/run_onchange_after_skills.sh.tmpl - Windows install script:
home/.chezmoiscripts/run_onchange_after_skills_windows.ps1.tmpl - Drift-review tool:
home/dot_scripts/executable_skills-review(deployed to~/.scripts/skills-review) - Removal tombstones: entries in
home/.chezmoiremove
Treat home/.chezmoidata/skills/*.yaml as the single source of truth.
Canonical schema
Manifest top-level key is skills with sub-keys:
defaults(optional)defaults.targets: array of agent IDs to use when a source doesn't specify its own.
sources(required map, keyed by source ID)- Each
sources.<sourceId>value has exactly one of:path— local source, relative to{{ .chezmoi.workingTree }}(the git working tree / repo root, NOT the chezmoi source dir which would put it underhome/)repo— GitHub shorthand (org/repo) or full git URL
- Optional per-source overrides:
targets: narrows the agent list for this sourceskills: selective install of named skills only
- Each
Source IDs are kebab-case: ^[a-z0-9][a-z0-9-]*$.
Supported agent IDs: claude-code, opencode, cursor, codex, pi. Adding a new agent requires editing both the schema enum and the install scripts.
Installation model
- The
vercel-labs/skillsCLI owns skill distribution. The install scripts only invokenpx skills@latest add <source> -a <agent> -g ...for the manifest targets. - Do not manually create per-agent symlinks, junctions, or copies for agents that the CLI supports. If the CLI skips an agent-specific directory, treat that as intentional or rely on that agent's native discovery of
~/.agents/skills. - Legacy gap-fill links are pruned by the install scripts for Codex, Cursor, and OpenCode. Safety: cleanup removes only symlinks/junctions that point under
~/.agents/skills. - Pi is omitted from default targets because it natively discovers
~/.agents/skills; installing copies into~/.pi/agent/skillsduplicates every skill and produces name-collision warnings. The Unix install script still prunes old byte-identical Pi duplicates left behind by earlier manifests. - The install scripts otherwise are install-and-update only. To remove a declared skill/source, edit the manifest and run
~/.scripts/skills-review.
Editing rules
- Use map-keyed source entries (matches the
mcps/,agent-permissions/, etc. overlay convention). - Use overlays in separate files under
home/.chezmoidata/skills/for personal/fork-specific additions; map keys deep-merge. - Exactly one of
pathorrepoper source. - For local sources,
pathis relative to{{ .chezmoi.workingTree }}(the git working tree, e.g.~/.local/share/chezmoi), NOT{{ .chezmoi.sourceDir }}(which is the source state root, e.g.~/.local/share/chezmoi/home). The canonical local skills source lives atskills/at the repo root, outside chezmoi source state. For remote sources, prefer GitHub shorthand (org/repo) over full URLs unless you need a non-GitHub host. - Do not add manual gap-fill distribution for supported agents. Let the
vercel-labs/skillsCLI and each agent's native discovery paths define where skills appear. - To remove a skill, delete it from the manifest and run
~/.scripts/skills-reviewinteractively. Apply alone never removes.
Validation workflow
After manifest or script changes:
chezmoi apply <changed-path>for targeted application.- Confirm expected entries exist in the locations created by the
skillsCLI or by the agent's native discovery path. Do not require Codex, Cursor, or OpenCode per-agent directories to be populated by dotfiles. - On Unix, verify legacy gap-fill symlinks under
~/.codex/skills,~/.cursor/skills, and${XDG_CONFIG_HOME:-~/.config}/opencode/skillswere pruned when they point under~/.agents/skills. - On Windows, verify legacy gap-fill junctions under
~/.codex/skills,~/.cursor/skills, and~/.config/opencode/skillswere pruned when they point under~/.agents\skills. - Run
~/.scripts/skills-reviewand confirm no false-positive drift is reported when the manifest matches the install state.
Drift review (skills-review)
- Run
~/.scripts/skills-reviewafter editing the manifest to remove a source. - Run it periodically to catch hand-installed skills (someone ran
npx skills addoutside the manifest). - The tool is interactive; it won't run in non-tty contexts. Apply scripts never invoke it.
Adding a new agent target
- Add the agent ID to the
agentIdenum inschemas/skills.schema.json. - Confirm the agent is supported by the
vercel-labs/skillsCLI (npx skills@latest list-agents, or check the CLI'sagents.ts). - Add it to
defaults.targetsin the manifest (or to per-sourcetargets). - The install scripts iterate dynamically over
defaults.targetsand per-sourcetargets; no script change required.