Skip to content

fix(setup): mirror support files + asset dirs alongside SKILL.md in link_claude_skill_dirs#1502

Open
NikhileshNanduri wants to merge 1 commit into
garrytan:mainfrom
NikhileshNanduri:fix/1499-link-claude-skill-support-files
Open

fix(setup): mirror support files + asset dirs alongside SKILL.md in link_claude_skill_dirs#1502
NikhileshNanduri wants to merge 1 commit into
garrytan:mainfrom
NikhileshNanduri:fix/1499-link-claude-skill-support-files

Conversation

@NikhileshNanduri
Copy link
Copy Markdown

Summary

Closes #1499.

link_claude_skill_dirs in ./setup previously only symlinked SKILL.md into each skill directory. Skills like /review reference sibling files — checklist.md, greptile-triage.md, design-checklist.md, TODOS-format.md, and specialists/ — via the .claude/skills/review/ path. Those files were never linked, so /review hit its own STOP point ("If the file cannot be read, STOP and report the error") on every global install. 20 releases since the regression was introduced.

This is Option B from the issue — the durable fix. It teaches the linker to mirror all sibling assets, not just SKILL.md. No SKILL.md.tmpl path hacks needed.

What changed

setuplink_claude_skill_dirs(): after the existing SKILL.md symlink, two new loops:

  1. Supporting .md files — iterates $gstack_dir/$dir_name/*.md, skips SKILL.md (already linked), links the rest (checklist.md, greptile-triage.md, TODOS-format.md, etc.)
  2. Asset directories — iterates $gstack_dir/$dir_name/*/, skips build/source dirs (dist, src, test, tests, scripts, node_modules), links the rest (specialists/, bin/, references/, templates/, migrations/, etc.)

Both loops are idempotent (rm then ln -snf) — ./setup re-runs cleanly over existing installs.

test/gen-skill-docs.test.ts: two new unit tests that verify the linker body contains the new loops and the correct exclusion list.

Affected skills (verified by functional test)

Skill Previously missing Now linked
review/ checklist.md, greptile-triage.md, design-checklist.md, TODOS-format.md, specialists/ ✅ All 5
qa/ references/, templates/ ✅ Both
careful/ bin/
freeze/ bin/
plan-devex-review/ dx-hall-of-fame.md
cso/ ACKNOWLEDGEMENTS.md
setup-gbrain/ memory.md
gstack-upgrade/ migrations/

browse/ correctly gets bin/ but NOT src/, dist/, test/, scripts/ (all excluded).

Supersedes #1486

PR #1486 added only bin/ symlinks. This PR is a superset — it covers bin/ and all other asset types — so #1486 can be closed if this merges.

Testing scenarios

Scenario 1: /review checklist loads on a fresh global install

# Before fix
ls ~/.claude/skills/review/
# → SKILL.md only

# After ./setup with this fix
ls ~/.claude/skills/review/
# → SKILL.md  checklist.md  design-checklist.md  greptile-triage.md  TODOS-format.md  specialists/

# Verify /review Step 2 can now read the checklist
cat ~/.claude/skills/review/checklist.md  # must not 404
ls ~/.claude/skills/review/specialists/   # must show testing.md, security.md, etc.

Scenario 2: Idempotency — re-running ./setup doesn't break existing installs

# Run ./setup twice
./setup --host claude
./setup --host claude

# review/ should still have all support files, no duplicates, no broken symlinks
ls -la ~/.claude/skills/review/
find ~/.claude/skills/review/ -maxdepth 1 -name "*.md" | wc -l  # stable count

Scenario 3: build dirs are excluded from browse/

ls ~/.claude/skills/browse/
# Must contain: SKILL.md  bin/  PLAN-snapshot-dropdown-interactive.md
# Must NOT contain: src/  dist/  test/  scripts/

Scenario 4: careful/ and freeze/ get their bin/ dirs (hooks now resolve)

ls ~/.claude/skills/careful/bin/   # must show check-careful.sh or equivalent
ls ~/.claude/skills/freeze/bin/    # must show check-freeze.sh

Scenario 5: Upgrade from old install (symlinks overwrite old state)

# Manually break the state first
rm ~/.claude/skills/review/checklist.md
./setup --host claude
# checklist.md must be restored
ls ~/.claude/skills/review/checklist.md

Scenario 6: bun test passes (no regressions)

bun test
# 3 known pre-existing failures (document-generate doc inventory, gbrain CLI not in PATH)
# All other tests pass — including the 2 new unit tests for this fix

Notes

🤖 Generated with Claude Code

…ink_claude_skill_dirs

Closes garrytan#1499.

`link_claude_skill_dirs` previously only symlinked SKILL.md into each skill
directory. Skills like /review reference sibling files (checklist.md,
greptile-triage.md, specialists/, TODOS-format.md) via the
`.claude/skills/review/` path — but those files were never linked, so the
skill hit its own STOP point on every global install.

After this fix, link_claude_skill_dirs also:
- Symlinks all .md support files (except SKILL.md and *.tmpl) alongside SKILL.md
- Symlinks support asset directories (specialists/, bin/, references/,
  templates/, migrations/, etc.) while excluding build dirs (dist/, src/,
  test/, tests/, scripts/, node_modules/)

Idempotent — re-running ./setup upgrades existing installs cleanly.
Supersedes the partial fix in garrytan#1486 (bin/ only); this covers all asset types.

Affected skills: review (checklist.md, greptile-triage.md, design-checklist.md,
TODOS-format.md, specialists/), qa (references/, templates/), careful (bin/),
freeze (bin/), plan-devex-review (dx-hall-of-fame.md), cso (ACKNOWLEDGEMENTS.md),
setup-gbrain (memory.md), gstack-upgrade (migrations/).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant