fix: support SKILL.md rendering for the generic integration - #4562
Open
chelsealong wants to merge 2 commits into
Open
fix: support SKILL.md rendering for the generic integration#4562chelsealong wants to merge 2 commits into
chelsealong wants to merge 2 commits into
Conversation
The generic (bring-your-own-agent) escape hatch could only ever emit flat speckit.<name>.md command files, with no way to opt into the speckit-<name>/SKILL.md layout every skills-format agent (Claude, Codex, etc.) uses. Add a --skills flag to --integration-options that renders the same command templates as SKILL.md directories under --commands-dir instead, matching the agentskills.io layout used elsewhere. Default behavior (flat .md files) is unchanged. Fixes github#4561
_build_skill_content() duplicated SkillsIntegration.setup()'s per-file body but dropped the call to post_process_skill_content(), which injects the dot-to-hyphen hook-invocation note before every "For each executable hook" instruction. Without it, a configured extension hook (e.g. speckit.git.commit) would be invoked verbatim as /speckit.git.commit, which doesn't exist under the speckit-<name>/SKILL.md layout this feature introduces. Add a small _GenericSkillsHelper(SkillsIntegration) — the same delegation pattern CopilotIntegration uses for its own skills mode — and call its post_process_skill_content() after building the SKILL.md body. Add a regression test asserting the note appears.
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 #4561
Problem
--integration generic(the "bring your own agent" escape hatch) could onlyever emit flat
speckit.<name>.mdcommand files. There was no way to get thespeckit-<name>/SKILL.mdlayout that every skills-format agent (Claude,Codex, Kimi, Bob, Copilot in skills mode, …) uses, even though
GenericIntegrationalready has all the machinery (
process_template,write_file_and_record,manifest tracking) needed to produce it.
Fix
Added a
--skillsflag toGenericIntegration.options()(parsed the same wayevery other integration's
--integration-optionsflags are — no specialcasing needed). When set,
setup()renders each command template as<commands-dir>/speckit-<name>/SKILL.mdwith the same frontmatter shape(
name,description,compatibility,metadata) thatSkillsIntegration.setup()produces for other agents, instead of the flatspeckit.<name>.mdfile. Default behavior (no--skills) is unchangedbyte-for-byte.
This is scoped to
GenericIntegration's ownsetup()only — it does nottouch
CommandRegistrar.AGENT_CONFIGS, presets, or extensions, which alreadyexclude
genericentirely (its output directory is a runtime CLI option, nota static per-agent convention) regardless of layout. So skills-mode
genericgets the exact same (lack of) preset/extension registration support that
flat-mode
genericalready has today — no new inconsistency introduced.Also,
_build_skill_content()now callspost_process_skill_content()(via asmall internal
_GenericSkillsHelper(SkillsIntegration), the same delegationpattern
CopilotIntegrationuses for its own skills mode) so generatedSKILL.mdbodies get the shared dot-to-hyphen hook-invocation note(
_HOOK_COMMAND_NOTEinbase.py) before every "For each executable hook,output the following" instruction — matching what every other
SkillsIntegrationsubclass (Claude, Codex, Kimi, Bob, …) already emits.Without it, a hook configured in
.specify/extensions.yml(e.g.speckit.git.commit) would have been invoked verbatim as/speckit.git.commit,which doesn't exist under the
speckit-<name>/SKILL.mdlayout this PRintroduces — the real skill lives at
speckit-git-commit/SKILL.md, invokedas
/speckit-git-commit.Testing
Added tests to
tests/integrations/test_integration_generic.py:--skillsis a declared, non-required boolean flag defaulting toFalsesetup()with--skillswritesspeckit-<name>/SKILL.mdfiles under--commands-dirSKILL.mdhas the expected frontmatter and fully-processedbody (no leftover
{SCRIPT}/__AGENT__/__SPECKIT_COMMAND_*__tokens)SKILL.mdbody includes the dot-to-hyphen hook-invocationnote with the
/-prefixed (not$- or/skill:-prefixed) example, sincegenericisn't inDOLLAR_SKILLS_AGENTS/SKILL_COLON_AGENTS--skills, output is still flatspeckit.<name>.md(regressionguard)
round trip
Verified the new tests fail without the fix and pass with it:
Separately, reverting only the
post_process_skill_content()call (keepingeverything else) reproduces the missing-hook-note failure in isolation:
test_skill_content_has_hook_command_notefails with the note absent, andpasses once the call is restored. Also ran the full
tests/integrations/suite: 2911 passed, 5 skipped — no regressions.
Also ran the full suite (
.venv/bin/python -m pytest tests -q): 8049 passed,12 skipped, 10 failed. The 10 failures are pre-existing
*_python_paritytests (
test_check_prerequisites_python_parity.py,test_create_new_feature_python_parity.py,test_resolve_template_python_parity.py,test_setup_plan_python_parity.py,test_setup_tasks_python_parity.py) thatfail identically on unmodified
mainin this sandbox (verified viagit stash), unrelated to this change.Manually exercised the CLI end-to-end:
and confirmed omitting
--skillsstill produces the original flat.myagent/commands/speckit.<name>.mdlayout.AI disclosure
This PR was written by an autonomous Claude Code agent (Claude Sonnet 5),
including the code change, tests, and this description. I (the human
submitter) reviewed the diff and the test run output above before opening it.
🤖 Generated with Claude Code