fix(extensions): render hyphenated hook invocations for Forge projects#3641
Merged
mnriem merged 1 commit intoJul 22, 2026
Merged
Conversation
Forge is a hyphenated slash-command agent: it registers its commands as
`/speckit-<name>` (see `format_forge_command_name` and
`ForgeIntegration.build_command_invocation`), exactly like Cline.
`HookExecutor._render_hook_invocation` special-cases dollar-skills agents,
kimi, cline, and slash-skills agents, but had no Forge branch. Forge
matches none of those, so it fell through to `return f"/{command_id}"`
and rendered the DOTTED form — `/speckit.plan`, `/speckit.git.commit` —
which Forge does not recognize as a registered command.
Add a Forge branch mirroring the adjacent Cline branch, using
`format_forge_command_name` (idempotent, same contract as the Cline
formatter). Non-Forge agents are unaffected.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Forge hook messages to use registered hyphenated slash-command names.
Changes:
- Formats Forge hook invocations with
format_forge_command_name. - Adds coverage for built-in and extension commands.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions/__init__.py |
Adds Forge-specific hook invocation rendering. |
tests/test_extensions.py |
Tests Forge hook command formatting. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
Collaborator
|
Thank you! |
mnriem
pushed a commit
that referenced
this pull request
Jul 23, 2026
…sting (#3669) After `specify extension add`, the "Provided commands" summary hyphenated command names only for Cline. For a Forge project the names were printed in dotted form (e.g. `speckit.test-ext.hello`), but Forge registers them hyphenated (`speckit-test-ext-hello`), so the printed names didn't match what the user actually invokes in Forge. Extend the existing Cline handling to Forge via `format_forge_command_name`, completing the Forge command-name parity already fixed for hook invocations (#3641) and the init next-steps panel (#3642). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Forge is a hyphenated slash-command agent — it registers its commands as
/speckit-<name>(seeformat_forge_command_nameandForgeIntegration.build_command_invocationinsrc/specify_cli/integrations/forge/__init__.py), exactly like Cline.But
HookExecutor._render_hook_invocation(src/specify_cli/extensions/__init__.py) special-cases only dollar-skills agents,kimi,cline, and slash-skills agents. Forge matches none of them, so it fell through to:rendering the dotted form —
/speckit.plan,/speckit.git.commit— which Forge does not recognize as a registered command. Hook execution messages therefore told Forge users to run commands that don't exist under that name.Fix
Add a Forge branch mirroring the adjacent Cline branch:
format_forge_command_nameis idempotent and has the same contract as the Cline formatter already used one branch above. Non-Forge agents are unaffected.Tests
tests/test_extensions.py::TestHookInvocationRendering— two tests mirroring the existing Cline hook tests:test_forge_hooks_render_hyphenated_invocation→speckit.tasksrenders/speckit-taskstest_forge_hooks_render_extension_command→my-extension.do-somethingrenders/speckit-my-extension-do-somethingVerified fail-before / pass-after (reverting only the source hunk makes both fail, rendering the dotted
/my-extension.do-something).ruff checkclean.AI-assisted: authored with Claude Code. I confirmed Forge's hyphenated command registration and that the Cline branch is the exact sibling precedent, and verified fail-before/pass-after.