Skip to content

chore(skills): Auto-generate .claude/skills mirror from .agents/skills - #386

Merged
leviem1 merged 4 commits into
mainfrom
chore/single-source-skills
Jun 26, 2026
Merged

chore(skills): Auto-generate .claude/skills mirror from .agents/skills#386
leviem1 merged 4 commits into
mainfrom
chore/single-source-skills

Conversation

@leviem1

@leviem1 leviem1 commented Jun 22, 2026

Copy link
Copy Markdown
Member

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:

  • Skills: .agents/skills/ is canonical (shared with other agents). .claude/skills/ is a generated mirror — Claude Code only discovers skills there.
  • Project instructions: AGENTS.md is canonical. CLAUDE.md is a generated copy of it.

This removes the byte-identical committed duplicates and the manual cp workflow that had already drifted.

How it works

  • .claude/hooks/sync-agent-files.sh regenerates both outputs: it mirrors .agents/skills/.claude/skills/ (wiping stale/renamed folders) and copies AGENTS.mdCLAUDE.md.
  • .claude/settings.json runs it on SessionStart (with reloadSkills so mirrored skills load in-session) and on PostToolUse after edits under .agents/skills/** or to AGENTS.md.
  • .gitattributes pins *.sh to LF so the hook script runs under Git Bash on Windows.

Cleanup

  • Removed the update-local-skills skill (both trees).
  • Untracked the generated copies: the fill-template-plugin / run-plugin skill mirror, and CLAUDE.md (was a tracked @AGENTS.md import; now a full generated copy, gitignored alongside the skill mirror).

Verified

  • sh .claude/hooks/sync-agent-files.sh regenerates the mirror (only fill-template-plugin/ + run-plugin/, stale dirs self-heal) and writes a CLAUDE.md identical to AGENTS.md.
  • git check-ignore confirms .claude/skills/* and CLAUDE.md are ignored.
  • The SessionStart run emits the reloadSkills JSON.
  • git status is clean — no generated files tracked.

@leviem1
leviem1 force-pushed the chore/single-source-skills branch from cd38ad8 to 701db68 Compare June 22, 2026 08:15
@leviem1
leviem1 merged commit 9c98c58 into main Jun 26, 2026
6 checks passed
@leviem1
leviem1 deleted the chore/single-source-skills branch June 26, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant