GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: support hyphenated command names in __SPECKIT_COMMAND_<NAME>__ tokens by minzzang144 · Pull Request #4361 · github/spec-kit

Conversation

@minzzang144

@minzzang144 minzzang144 commented Aug 28, 2026

Copy link
Copy Markdown

Description

__SPECKIT_COMMAND_<NAME>__ tokens can't represent a hyphen in a command name, so referencing a hyphenated command (e.g. the bundled speckit.agent-context.update) silently resolves to the wrong path. This widens the character class in both resolve_command_refs() (src/specify_cli/integrations/base.py) and the extension-skills resolver (src/specify_cli/extensions/__init__.py) from [A-Z][A-Z0-9_]* to [A-Z][A-Z0-9_-]*. No decode-logic change is needed — .replace("_", separator) already leaves a literal hyphen untouched. Also updates extensions/EXTENSION-DEVELOPMENT-GUIDE.md's "Referencing other commands" section, which still stated hyphens couldn't be represented and had a stale skills-mode limitation note.

Fixes #4198, Fixes #4328

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest (ran via .venv/bin/python -m pytest tests per the guidance in CONTRIBUTING.md/AGENTS.md to avoid resolving specify_cli to another checkout): 7145 passed. The 9 failures present are Python-parity template tests that also fail on main without this change, unrelated to this fix.
  • Tested with a sample project (if applicable): ran specify init --integration claude --script sh --non-interactive against this branch and confirmed the scaffolded project has no unresolved __SPECKIT_COMMAND tokens left in it.

Added 9 new unit test cases covering hyphen + each separator style, multiple hyphens within one segment, a hyphen adjacent to a digit, and an unlimited number of dotted segments.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

This change was written with AI assistance (Claude Code). I reviewed the diff and ran the test suite myself before opening this PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
minzzang144 added 3 commits August 22, 2026 17:15
@minzzang144
fix: allow literal hyphens in __SPECKIT_COMMAND_<NAME>__ tokens
d4a0a4c
Widens the uppercase command-ref token's character class from
[A-Z0-9_] to [A-Z0-9_-] in both resolve_command_refs() and the
extension-skills resolver, so a hyphenated command name (e.g.
speckit.agent-context.update) round-trips without a second token
grammar. Decode logic is unchanged since replace("_", separator)
already leaves literal hyphens untouched.

Implements the "Option 2" direction agreed with @mnriem in the
review discussion on github#4204, as an alternative to that PR's verbatim
__SPECKIT_COMMAND(...)__ form.

Fixes github#4198

This change was implemented with AI assistance (Claude Code); I
reviewed the diff and ran the full test suite myself before opening
this PR.
@minzzang144
test: cover multi-segment and multi-hyphen command-ref tokens
919714d
Adds cases for a hyphen adjacent to a digit, multiple hyphens within
one segment, and more than two dotted segments, confirming the
widened character class has no arbitrary limit on segment count.
@minzzang144
test: use clearer synthetic values for hyphen edge cases
36dfdb7
STEP-2/RUN and MULTI-WORD-SEGMENT read unambiguously as synthetic
test data, instead of awkwardly extending the real agent-context
extension's command name with made-up suffixes.
@minzzang144
minzzang144 requested a review from mnriem as a code owner August 28, 2026 05:44
@KSchlobohm
KSchlobohm requested a balanced review from Copilot August 28, 2026 18:34
Copilot started reviewing on behalf of KSchlobohm August 28, 2026 18:34
View session
Copilot AI reviewed Aug 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for literal hyphens in command-reference tokens across command and extension-skill rendering.

Changes:

  • Expands both token resolvers to accept hyphens.
  • Updates extension-author documentation.
  • Adds unit and integration-style regression tests.
Show a summary per file
File Description
src/specify_cli/integrations/base.py Expands the shared token grammar.
src/specify_cli/extensions/__init__.py Expands the extension-skills token grammar.
tests/integrations/test_base.py Tests hyphenated token variants.
tests/test_extensions.py Tests skill-format command registration.
extensions/EXTENSION-DEVELOPMENT-GUIDE.md Documents hyphen encoding and skills behavior.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/specify_cli/extensions/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@minzzang144
test: add regression coverage for _register_extension_skills hyphen s…
51ed61f
…upport

The existing hyphen tests in tests/test_extensions.py go through
CommandRegistrar.register_commands_for_agent(), which only exercises
the shared resolve_command_refs() resolver. _register_extension_skills()
in extensions/__init__.py is a separate resolver (the sole writer of
extension SKILL.md content in skills mode, per @mnriem's note on
github#4204) that was left without direct coverage even though its own
character class was widened in the same commit.

Adds test_skill_registration_resolves_hyphenated_command_ref_tokens,
parametrized across all 6 agents like its sibling
test_skill_registration_resolves_command_ref_tokens, exercising
_register_extension_skills() directly via
install_from_directory(..., register_commands=False).

Verified this is a real regression test: reverting the character
class in extensions/__init__.py makes all 6 cases fail with the raw
token leaking into SKILL.md; restoring it makes all 6 pass.
@mnriem
mnriem requested a balanced review from Copilot August 31, 2026 22:55
Copilot started reviewing on behalf of mnriem August 31, 2026 22:56
View session
Copilot AI reviewed Aug 31, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both resolver paths are updated consistently and have focused regression coverage.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mnriem

mnriem commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Thank you for preparing this fix. We are consolidating the work in #4356 as the earlier, narrower option-2 implementation, now linked directly to canonical issue #4198. Closing this duplicate avoids maintaining parallel fixes.

Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mnriem mnriem closed this Sep 1, 2026
This was referenced Sep 1, 2026
allow hyphen in command ref token names #4356
Merged
[Bug]: __SPECKIT_COMMAND_*__ tokens can't reference commands whose names contain hyphens #4198
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mnriem mnriem Awaiting requested review from mnriem mnriem is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: __SPECKIT_COMMAND_<NAME>__ still can't represent hyphenated command names — #4204 stalled after review [Bug]: __SPECKIT_COMMAND_*__ tokens can't reference commands whose names contain hyphens

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@minzzang144 @mnriem
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.