chore(skills): Auto-generate .claude/skills mirror from .agents/skills - #386
Merged
Conversation
leviem1
force-pushed
the
chore/single-source-skills
branch
from
June 22, 2026 08:15
cd38ad8 to
701db68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the tracked sources the single source of truth for the Claude-Code-facing files, and treats the copies Claude Code consumes as generated, gitignored output:
.agents/skills/is canonical (shared with other agents)..claude/skills/is a generated mirror — Claude Code only discovers skills there.AGENTS.mdis canonical.CLAUDE.mdis a generated copy of it.This removes the byte-identical committed duplicates and the manual
cpworkflow that had already drifted.How it works
.claude/hooks/sync-agent-files.shregenerates both outputs: it mirrors.agents/skills/→.claude/skills/(wiping stale/renamed folders) and copiesAGENTS.md→CLAUDE.md..claude/settings.jsonruns it onSessionStart(withreloadSkillsso mirrored skills load in-session) and onPostToolUseafter edits under.agents/skills/**or toAGENTS.md..gitattributespins*.shto LF so the hook script runs under Git Bash on Windows.Cleanup
update-local-skillsskill (both trees).fill-template-plugin/run-pluginskill mirror, andCLAUDE.md(was a tracked@AGENTS.mdimport; now a full generated copy, gitignored alongside the skill mirror).Verified
sh .claude/hooks/sync-agent-files.shregenerates the mirror (onlyfill-template-plugin/+run-plugin/, stale dirs self-heal) and writes aCLAUDE.mdidentical toAGENTS.md.git check-ignoreconfirms.claude/skills/*andCLAUDE.mdare ignored.SessionStartrun emits thereloadSkillsJSON.git statusis clean — no generated files tracked.