spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

fix(extensions): hyphenate in-body command refs when rendering skills

Open Quratulain-bilal opened this issue 4 months ago • 0 comments

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.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 (as reported in discussion #3422 with codex + spec-kit-memory-hub).

root cause (matches the issue): _register_extension_skills only ran resolve_skill_placeholders (script/args/__AGENT__/project-relative paths) and post_process_skill_content (which for SkillsIntegration only 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_refs helper in the skills render path, right after resolve_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 to speckit-test-ext-world. i confirmed it fails on the pre-fix code (the verbatim speckit.test-ext.world leaks 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.

Quratulain-bilal avatar Jul 11 '26 22:07 Quratulain-bilal