Sync Ecosystem to Chezmoi
This is the chezmoi-specific tail of the sync-ecosystem workflow. The base skill audits a repo against ecosystem conventions and emits a drift report. This skill takes that report and applies it to the chezmoi-managed canonical skill source, then redeploys.
When to Use
- You ran
sync-ecosystem <repo>and have a drift report to apply. - You maintain your agent skills in a chezmoi source tree and need the deployed copies under
${CLAUDE_SKILL_DIR:-$HOME/.agents/skills}/to follow. - A new or stale skill needs to be promoted from a project repo into the canonical store.
If you don’t use chezmoi, stop here. The portable audit lives in sync-ecosystem; you can substitute your own deploy step.
Prerequisites
chezmoi --version # CLI present
chezmoi source-path # confirm the source dir, typically ~/.local/share/chezmoi
The canonical skill source lives under <chezmoi-source>/dot_agents/skills/. Deployed copies under ${CLAUDE_SKILL_DIR:-$HOME/.agents/skills}/ are overwritten on every chezmoi apply, so never edit them directly.
Workflow
-
Receive the drift report. Typically produced by running
sync-ecosystem <repo-path>first. The report lists missing artifacts, content drift, and canonical-store coverage issues per skill. -
For each finding, decide the target file.
Finding type Target Skill in repo but not in canonical store New dir under <chezmoi-source>/dot_agents/skills/<name>/Stale canonical skill (frontmatter / body drift) Existing <chezmoi-source>/dot_agents/skills/<name>/SKILL.mdAsset / script drift inside a skill Matching file under that skill’s assets/orscripts/Required ecosystem doc missing Owner skill in the chezmoi source (e.g. community-health/assets/) -
Apply edits in the source, never in
~/.agents/skills/. UseEdit/Writeagainst the chezmoi source paths. Preserve frontmatter formatting and the rest of the file. -
Redeploy. After every batch of edits:
chezmoi apply agentspec sync --fast # if installed; refreshes the deployed skill index -
Verify. Re-run the relevant
sync-ecosystemaudit against the original repo. The findings you just merged should now be clear.
Gotchas
- Edit the source, not the deployed copy.
~/.agents/skills/<name>/SKILL.mdis the rendered output of the chezmoi template. Any edits there are lost on nextchezmoi apply. - Frontmatter sensitivity. Skill loaders are strict about YAML. After editing frontmatter, run
chezmoi applyand reload your agent so the change actually takes effect. - Don’t auto-promote drafts. Skills that live only in a project repo because they’re in-progress should stay there until the user signals they’re ready for the canonical store.
- One commit per logical change. When the chezmoi source is itself a git repo, commit per skill batch so the change history matches the drift report.
Hand-off Back
After applying the report, hand control back to the user with a short summary: which skills were created, which were edited, what chezmoi apply reported, and any items deferred for human review.