Skip to content

Commit .claude skills to the repo so the agent setup is portable #543

Description

@vivek7405

Problem

The repo's .claude/ ships the HOOKS (.claude/settings.json + block-prose-punctuation.sh / nudge-uncommitted.sh / require-tests-with-src.sh / route-skills.sh), so a fresh git clone on another computer gets the guardrails. But the SKILLS those hooks depend on (webjs-file-issue, webjs-start-work, webjs-list-todos, use-railway) live ONLY in the maintainer's machine-local ~/.claude/skills/ and are NOT committed. So on another computer the setup is half-broken:

  • The skills do not exist, so /webjs-start-work, /webjs-file-issue, etc. are unavailable.
  • Worse, the committed route-skills.sh keyword-matches prompts against those exact skill names and INJECTS a directive to "invoke before other work". On a clone where the skill is absent, the hook points the agent at a skill that does not exist.

The hooks and the skills they route to are split across two homes (repo vs ~/.claude), so the repo is not self-sufficient.

Design / approach

Commit the skills into the repo's .claude/skills/<name>/SKILL.md (Claude Code loads project-level skills from there), so a clone is self-sufficient and route-skills.sh's references resolve. This fits the repo's existing AI-first posture (it already commits hooks + AGENTS.md + the scaffold's per-agent configs).

  • The three webjs-* skills are webjs-project-specific (the project board, the start-work lifecycle), so they belong in the repo.
  • use-railway is general-purpose; commit a copy too so the repo's deploy-verification workflow is portable, but it can also remain a personal skill for other repos.
  • Drift: a skill living in both ~/.claude/skills/ and the repo can diverge. The repo copy is canonical for webjs work. SAFE DEFAULT for this issue: commit COPIES (additive, non-destructive); do NOT delete the maintainer's ~/.claude copies as part of this change. A follow-up can decide whether to remove the home copies of the webjs-* ones or symlink them, since that affects the maintainer's other repos.

Implementation notes (for the implementing agent)

  • Where to put them: .claude/skills/webjs-file-issue/SKILL.md, .claude/skills/webjs-start-work/SKILL.md, .claude/skills/webjs-list-todos/SKILL.md, .claude/skills/use-railway/ (the last has a references/ + scripts/ tree; copy it whole). Source is ~/.claude/skills/<name>/.
  • The committed router .claude/hooks/route-skills.sh already references all four skills by name; once they are committed the references resolve on a clone. Re-read it to confirm no path assumptions break when the skills are project-level rather than user-level.
  • Skill precedence: project-level and user-level skills can both be present on the maintainer's machine. Verify Claude Code does not error or double-load when a skill name exists in BOTH ~/.claude/skills/ and .claude/skills/ (it should prefer/merge, but confirm there is no conflict; this is why the safe default is copies + a documented canonical).
  • use-railway is a multi-file skill (SKILL.md + references/*.md + scripts/*.py + scripts/railway-api.sh). Copy the entire directory, not just SKILL.md.
  • Tests / validation surface: there is a test/hooks/route-skills.test.mjs (per AGENTS.md). Confirm it still passes, and extend it if it should assert the routed skills now exist in-repo.
  • Docs: note in the repo AGENTS.md (the "Skills are routed deterministically" section) that the skills are now committed under .claude/skills/, so the routing is self-contained.

Acceptance criteria

  • .claude/skills/{webjs-file-issue,webjs-start-work,webjs-list-todos,use-railway} are committed (use-railway with its full references/ + scripts/ tree).
  • A fresh clone has working /webjs-* + /use-railway skills, and route-skills.sh's name references all resolve (no dangling skill).
  • test/hooks/route-skills.test.mjs passes; extended if appropriate to assert the in-repo skills exist.
  • No secrets are committed (the skills reference the public project board + railway telemetry caller, no tokens).
  • The maintainer's ~/.claude copies are left intact (non-destructive); drift handling is documented as a follow-up.
  • AGENTS.md updated to note the skills are now in-repo.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions