fix(extensions): hyphenate in-body command refs when rendering skills#3476
Open
Quratulain-bilal wants to merge 1 commit into
Open
fix(extensions): hyphenate in-body command refs when rendering skills#3476Quratulain-bilal wants to merge 1 commit into
Quratulain-bilal wants to merge 1 commit into
Conversation
extension command bodies were copied verbatim into generated SKILL.md files for skills-based integrations (codex, claude, etc.), so an in-body reference like /speckit.foo.bar kept its slash-dot spelling. skills agents dispatch speckit-foo-bar skills, not /speckit.foo.bar slash commands, so the reference was not runnable and the agent fell back to a markdown-only path. the skill dir name and frontmatter hook refs were already hyphenated; the body was the missing piece. _register_extension_skills only ran resolve_skill_placeholders (script/args/paths) and post_process_skill_content (a hook-note only), never _hyphenate_body_refs. that helper already exists and is applied on the cline extension path; apply it here too. added a regression test that installs an extension whose command body references a sibling command and asserts the dotted ref is rewritten to the hyphenated skill name. confirmed it fails on the pre-fix code.
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.
fixes #3451
extension command bodies were copied verbatim into generated SKILL.md files for skills-based integrations (codex, claude, etc.), so an in-body reference like
/speckit.foo.barkept its slash-dot spelling. skills agents dispatchspeckit-foo-barskills, not/speckit.foo.barslash commands, so the reference was not runnable and the agent fell back to a markdown-only path (as reported in discussion #3422 with codex + spec-kit-memory-hub).root cause (matches the issue):
_register_extension_skillsonly ranresolve_skill_placeholders(script/args/__AGENT__/project-relative paths) andpost_process_skill_content(which forSkillsIntegrationonly injects a hook-note), never a body-ref rewrite. the skill dir name and frontmatter hook refs were already hyphenated elsewhere; the body was the missing piece.fix: apply the existing
CommandRegistrar._hyphenate_body_refshelper in the skills render path, right afterresolve_skill_placeholders. that helper is already used on the cline extension path (agents.py); this reuses it. skills integrations always dispatch hyphenated skills, so the rewrite is unconditionally correct there.added a regression test: it installs an extension whose command body references a sibling command (
/speckit.test-ext.world) and asserts the generated skill body has the dotted ref rewritten tospeckit-test-ext-world. i confirmed it fails on the pre-fix code (the verbatimspeckit.test-ext.worldleaks into the body); the full extension-skills suite (58 tests) passes with the fix.this covers part 1 (code) of the issue's proposed fix. i left the docs-portability note (part 2) out of this PR to keep it focused; happy to follow up if you'd like it here.