allow hyphen in command ref token names - #4356
Open
HuzaifaChaudary wants to merge 1 commit into
Open
Conversation
the token pattern was matching only A-Z 0-9 and underscore so a command name like speckit.agent-context.update can not be written as a token and the token stays in the output as plain text now the character class allows a hyphen also in both places that resolve the token
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The extension authoring guide still explicitly contradicts the newly supported syntax.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
Comment on lines
+639
to
+641
| A hyphen belongs to the segment it sits in rather than separating | ||
| segments, so ``__SPECKIT_COMMAND_AGENT-CONTEXT_UPDATE__`` resolves to | ||
| ``/speckit.agent-context.update``. |
Collaborator
|
This is now the canonical implementation for #4198. We selected this PR because it applies the requested option 2 with the smallest backward-compatible code change. Please address the existing focused documentation feedback so the authoring guide reflects the newly supported literal-hyphen syntax; no broader refactor is requested. #4204, #4361, and duplicate issue #4328 are being closed to consolidate the work here. Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol). |
This was referenced Sep 1, 2026
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.
problem
the command ref token can not hold a command name that has a hyphen in it. the pattern is
the bundled command speckit.agent-context.update has a hyphen in the middle segment so there is no way to write a token for it. the text SPECKIT_COMMAND_AGENT-CONTEXT_UPDATE matches nothing and it stays in the generated file as plain text. the agent then reads a raw token instead of a real command.
fix
allow a literal hyphen in the character class in the two places that resolve the token
src/specify_cli/integrations/base.pyinresolve_command_refssrc/specify_cli/extensions/__init__.pyin the extension skills resolverno decode change is needed. the existing replace call already leaves a hyphen untouched. so
AGENT-CONTEXT_UPDATEbecomesagent-context.updatewith the dot separator andagent-context-updatewith the hyphen separator.this is option 2 from the review on #4204 which is the direction that was asked for there.
tests
i added 4 tests
[A-Z]all 4 fail before the change and pass after it.
full suite after the change is 7139 passed and 9 failed. the same 9 fail on main without my change so they are not from this. they are the python parity template tests.
ruff 0.15.0 check src testspasses which is what the workflow runs.ai disclosure
i used an ai assistant to help me read the code and write the tests. i reviewed the change myself and ran the suite locally.
Fixes #4198