Repository navigation
fix(agents): apply argument-hint and skill post-processing in render_skill_command - #5449
adityajai119 wants to merge 2 commits into
Conversation
…skill_command Fixes github#5448. CommandRegistrar.render_skill_command() writes SKILL.md files for native /SKILL.md integrations during extension installation and preset command alias registration, before _register_extension_skills() or _register_skills() can touch those targets. Look up the target integration, apply apply_argument_hint() prior to frontmatter serialization, and run post_process_skill_content() afterward so generated skills match the other SKILL.md generators. Assisted-by: OpenCode (model: Gemini 4 Carbon, autonomous)
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the update aligning native skill rendering with other generators.
No open issues 🎉
What changed in this PR
Fixes #5448 by bringing native SKILL.md command rendering in line with other skill generators, preserving supported argument hints and applying integration-specific post-processing.
Changes:
- Applies argument hints before YAML serialization and post-processes rendered skills to add invocation flags and hook-command guidance.
- Adds CLI regression coverage for extension commands, aliases, agent-specific behavior, bundled GitHub hooks, and preset aliases.
The PR reports that all five regression cases fail before the fix and pass afterward; tests were not rerun during this review.
| File | Description |
|---|---|
tests/specify_cli/test_agents.py |
Adds CLI regression tests for skill metadata and hook guidance. |
src/specify_cli/agents.py |
Applies argument hints and integration post-processing in render_skill_command(). |
Review effort: Balanced (dynamic)
| except (ImportError, ValueError, KeyError): | ||
| pass | ||
|
|
||
| self.apply_argument_hint(frontmatter, skill_frontmatter, integration) |
There was a problem hiding this comment.
Updated docs/integrations/claude.md, docs/integrations/alquimia.md, and docs/integrations/cli.md in 9c3e20a to document extension and preset alias argument-hint retention and the shared skills-mode hook-command guidance.
AI disclosure: drafted and verified autonomously by OpenCode (model: Gemini 4 Carbon).
…ommand guidance Assisted-by: OpenCode (model: Gemini 4 Carbon, autonomous)

Description
Fixes #5448.
For native
/SKILL.mdintegrations (claude,alquimia,droid,vibe,codex,kimi,agy,hermes),specify extension add,specify init --extension, and preset command alias registration renderSKILL.mdfiles viaCommandRegistrar.register_commands()->CommandRegistrar.render_skill_command().Because
_register_commands_for_active_agent()runs before_register_extension_skills()duringExtensionManager.install_from_directory(..., register_commands=True),_register_extension_skills()sees the file already on disk and skips it, and_PresetSkillMethods._register_skills()only re-renders primary command names (leaving aliases as rendered byrender_skill_command()). Unlike the otherSKILL.mdgenerators,render_skill_command()neither appliedapply_argument_hint()(left as a follow-up in #2978) nor calledintegration.post_process_skill_content(). As a result:argument-hint:lostargument-hinton Claude Code and Alquimia when installed through the CLI.user-invocable: trueanddisable-model-invocation: false.speckit-github-taskstoissuesfrom thegithubextension) omitted the skills-mode hook-command invocation note fromSkillsIntegration.post_process_skill_content().CommandRegistrar.render_skill_command()now resolves the target integration viaget_integration(agent_name), callsself.apply_argument_hint(frontmatter, skill_frontmatter, integration)before YAML serialization so folded descriptions remain valid YAML, and runsintegration.post_process_skill_content()when available.Testing
Set up this checkout's
.venvand editable install using the local development guide. Run commands from the checkout root..venv/bin/specify --help(Windows PowerShell:.\.venv\Scripts\specify.exe --help).venv/bin/python -m pytest tests -q(Windows PowerShell:.\.venv\Scripts\python.exe -m pytest tests -q); use affected test paths for focused checks andLC_ALL=en_US.UTF-8on macOSVerification details (Windows 11, Python 3.14.7):
tests/specify_cli/test_agents.pycovering positive and negative cases through the CLI (claudeextension command and alias with a folding description andargument-hint,codexanddroidgating ofargument-hintvsuser-invocable/disable-model-invocation, bundledgithubextension hook-command note forclaudeandcodex, andclaudepreset command alias preservation). Confirmed all 5 test cases fail onmain(3050be0) and pass with the fix..\.venv\Scripts\python.exe -m pytest -n 2 tests/specify_cli/test_agents.py tests/test_extension_skills.py tests/test_extensions.py tests/test_presets.py tests/test_agent_config_consistency.py tests/specify_cli/extensions tests/extensions/github tests/integrations/test_integration_claude.py tests/integrations/test_integration_alquimia.py tests/integrations/test_integration_droid.py tests/integrations/test_integration_vibe.py -q: 1419 passed, 64 skipped..\.venv\Scripts\python.exe -m pytest -n 2 tests/specify_cli/presets tests/specify_cli/artifacts -q: 1149 passed, 1 skipped.uvx ruff@0.15.0 check src testsandgit diff --check: clean..\.venv\Scripts\specify.exe init <temp>/speckit-sample-verify --integration claude --extension github --ignore-agent-tools --non-interactiveand verified.claude/skills/speckit-github-taskstoissues/SKILL.mdcarriesuser-invocable: true,disable-model-invocation: false, and the skills-mode hook-command note.AI Disclosure
AI disclosure: Prepared on behalf of @adityajai119 by OpenCode using Gemini 4 Carbon (high reasoning effort, autonomous agent mode); bug discovery, root-cause diagnosis, code and regression test generation, local test and CLI verification, and PR drafting. No personal human line-by-line review is claimed.