fix: patch SKILL.md name: field when --prefix is used#686
Open
garagon wants to merge 1 commit intogarrytan:mainfrom
Open
fix: patch SKILL.md name: field when --prefix is used#686garagon wants to merge 1 commit intogarrytan:mainfrom
garagon wants to merge 1 commit intogarrytan:mainfrom
Conversation
`./setup --prefix` creates symlinks like `gstack-qa -> gstack/qa`, but the SKILL.md inside still says `name: qa`. Claude Code uses the `name:` frontmatter field for skill registration, not the symlink name — so the skill registers as `/qa` instead of `/gstack-qa`. After creating each symlink, patch the `name:` field in SKILL.md to match the linked name. Uses portable sed (tmpfile + mv) for macOS/Linux compat. The patch only applies when `link_name != skill_name`, so unprefixed mode and already-prefixed skills (gstack-upgrade) are unaffected. Same fix applied to `bin/gstack-relink` for prefix changes after setup. Fixes garrytan#620
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.
Summary
./setup --prefixcreates symlinks (gstack-qa → gstack/qa) but doesn't update thename:frontmatter field inside each SKILL.md. Claude Code usesname:for skill registration — so the skill registers as/qainstead of/gstack-qa, making the prefix mode non-functional.After creating each symlink,
setupnow patches thename:field to match the linked name. Same fix applied tobin/gstack-relinkfor prefix changes after initial setup.Root cause
link_claude_skill_dirs()readsname:from SKILL.md (line 279) and computes the correctlink_namewith prefix (line 282-288), but only uses it for the symlink target — the SKILL.mdname:field stays unchanged. Claude Code ignores the symlink name and readsname:from frontmatter.What changed
setup: afterln -snf, patchesname:in SKILL.md whenlink_name != skill_namebin/gstack-relink: same patch logic for prefix changes after setupUses portable sed (tmpfile + mv) — works on both macOS and Linux. No-op for unprefixed mode and already-prefixed skills (
gstack-upgrade).Verified
Test plan
sedpatch correctly rewritesname: qa→name: gstack-qagstack-upgrade) are unaffected (link_name == skill_name)--no-prefix) does not trigger the patchgstack-relinkpatches in both directionsFixes #620