Repository navigation
Conversation
Cline's dot-to-hyphen rewrite matched `speckit.git.commit.md` as a command reference and produced `speckit-git-commit-md`, dropping the extension. Leave matches that end in `.md` untouched in both body and frontmatter. Fixes github#5097 Assisted-by: Grok Bot (model: unknown, autonomous) Signed-off-by: kevin9327 <5299031+kevin9327@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active issue remains because the .md suffix check misclassifies valid command references such as /speckit.foo.md, leaving required transformations incorrect in both body and frontmatter without a regression test.
1 open issue
What changed in this PR
This pull request updates Cline reference rewriting so command filenames ending in .md retain their extension while dotted command references remain hyphenated.
Changes:
- Shares compiled matching and replacement logic for body and frontmatter references.
- Preserves
.md-suffixed command filenames. - Adds regression tests for body and frontmatter handling.
| File | Summary |
|---|---|
tests/integrations/test_integration_cline.py |
Adds regression coverage for preserving .md command filenames in body and frontmatter references. |
src/specify_cli/agents.py |
Centralizes Cline reference rewriting, but the .md suffix check also leaves valid command references such as /speckit.foo.md unchanged; this requires a context-aware distinction. |
Review effort: Lite (auto)
| if ref.endswith(".md"): | ||
| # ``speckit.git.commit.md`` is a command file name, not a command | ||
| # reference; rewriting it would drop the extension. | ||
| return ref |
There was a problem hiding this comment.
Good catch, fixed in c901e96. The .md suffix alone no longer decides it: a speckit.*.md token is left as a file name only when it has more segments than a command reference can have (speckit.git.commit.md) or sits inside a path (commands/speckit.plan.md). A bare or slash-prefixed speckit.foo.md is treated as the md command of extension foo and becomes speckit-foo-md, in both body and frontmatter.
Added test_cline_body_refs_hyphenate_a_command_named_md, which fails on the previous commit and passes now; tests/integrations passes (3147 passed, 8 skipped).
|
Please address Copilot feedback |
A speckit.<ext>.md token is a command reference unless it has more segments than a command can have or sits inside a path. Assisted-by: Grok Bot (model: unknown, autonomous) Signed-off-by: kevin9327 <5299031+kevin9327@users.noreply.github.com>

Fixes #5097
Problem
For Cline extension/preset commands,
_hyphenate_body_refs(and_hyphenate_frontmatter_refs) rewrite everyspeckit.<a>.<b>token. A file name such asspeckit.git.commit.mdmatches as a reference, so.specify/extensions/git/commands/speckit.git.commit.mdbecomes.../speckit-git-commit-md(extension lost).Fix
Both helpers now share one compiled pattern and a small replacer that leaves a match ending in
.mdunchanged. Command references such as/speckit.git.commitare still hyphenated.Evidence
test_cline_body_refs_keep_md_file_namesandtest_cline_frontmatter_refs_keep_md_file_namesintests/integrations/test_integration_cline.py.mainboth fail; with this change both pass.pytest tests/integrations tests/test_extensions.py: 3632 passed, 8 skipped.AI disclosure
Implemented by Grok Bot (an AI coding agent) acting on behalf of @kevin9327, running autonomously; model unknown/not exposed to the agent. Extent: code generation, tests, and this description. The commit carries an
Assisted-by:trailer. I ran the tests above locally.