[Bug]: Cline extension and preset commands have `speckit.*.md` file names rewritten to `speckit-*-md`
維護者通常 1 天內回覆
評估
研究方向
從 src/specify_cli/agents.py 中的 CommandRegistrar._hyphenate_body_refs 和 _hyphenate_frontmatter_refs 著手,接著檢查擴充命令在參照行中的註冊方式。使用命令路徑和斜線命令重現範例,並檢查是否有涵蓋 Cline 參照重寫的相關測試。當命令參照轉換為連字號形式,而檔名保留 .md 副檔名時,即算完成;為這兩種情況新增或更新專項測試。
由索引模型根據 Issue 內容生成。
描述
Bug Description
When an extension or preset command is registered for Cline (src/specify_cli/agents.py:718, 831-833), the command body goes through CommandRegistrar._hyphenate_body_refs (agents.py:114-120). This replaces every dot in any speckit.<a>.<b>... token with a hyphen, so that command references match Cline's hyphenated file names. The regex also matches file names, so a path such as speckit.git.commit.md becomes speckit-git-commit-md, which names no file. The frontmatter goes through the same rewrite in _hyphenate_frontmatter_refs (agents.py:96-111).
The expectation here is inferred rather than documented. The bundled extensions name their command files speckit.<ext>.<cmd>.md (extensions/git/extension.yml:21-33). The extension development guide refers to files by those names (extensions/EXTENSION-DEVELOPMENT-GUIDE.md:306-308). The method's docstring describes its purpose as hyphenating "dotted speckit references". I could not find a doc or test that says file names should be rewritten too.
Steps to Reproduce
From a fresh clone, after uv sync, save the script below and run uv run python -I repro.py from the repository root.
from specify_cli.agents import CommandRegistrar
body = "Edit `.specify/extensions/git/commands/speckit.git.commit.md`, then run /speckit.git.commit."
print("in :", body)
print("out:", CommandRegistrar._hyphenate_body_refs(body))
Expected Behavior
The command reference /speckit.git.commit should become /speckit-git-commit, and the file name speckit.git.commit.md should be left alone (or at least keep its .md extension). This is inferred from the file naming in extensions/git/extension.yml:21-33 and extensions/EXTENSION-DEVELOPMENT-GUIDE.md:306-308, as described above.
Actual Behavior
in : Edit `.specify/extensions/git/commands/speckit.git.commit.md`, then run /speckit.git.commit.
out: Edit `.specify/extensions/git/commands/speckit-git-commit-md`, then run /speckit-git-commit.
Specify CLI Version
1.2.4.dev0 (main at 27d14e2)
AI Agent
Cline
Operating System
Linux 6.18 (Ubuntu container)
Python Version
Python 3.12.3
Additional Context
This only affects Cline, and only command bodies (from extensions or presets) that mention spec-kit command file names.
Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.
AI Disclosure
Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.
- 主要語言
- Python
- 星號
- 144k
- 分支
- 12.9k
- 平均合併
- 1 天 6 小時
- 30 天內合併 PR
- 194
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/spec-kit 的其他 Issue
-
The Python branch-creation port accepts an oversized `--number` and crashes at `int()` instead of rejecting it可能已有人在做 @github-actions 於 4 天前認領。 未關閉bug-assess bug-fix bug-test fix-proposed severity-low tests-passing triage-can-wait
難度 2/5 1-3 小時 新手友好度 84/100
github/spec-kit#5194 · 4 則留言 ·
維護者通常 1 天內回覆
-
[Bug]: `create-new-feature.sh` rejects the feature descriptions `-n`, `-e` and `-E`, which the Python script accepts可能已有人在做 @WOLIKIMCHENG 於 8 天前認領。 未關閉triage-can-wait
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
[Bug]: `bundle init <bundle>` initialises with the default integration instead of the bundle's, then aborts with a clash可能已有人在做 @chelsealong 於 9 天前認領。 未關閉triage-must-have
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
[Bug]: `specify preset set-priority` does not update agent command files that are already written可能已有人在做 @mikamikasuki 於 9 天前認領。 未關閉triage-must-have
難度 2/5 1-3 小時 新手友好度 77/100
維護者通常 1 天內回覆
-
[Bug]: Local config override file name differs between the docs (`<id>-config.local.yml`) and ConfigManager (`local-config.yml`)可能已有人在做 @gavenren 於 6 天前認領。 未關閉triage-must-have
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
相似的 Issue
-
New Internship未關閉new_internship
難度 2/5 1-3 小時 新手友好度 68/100
-
get_graph warns that the oneway column is missing when no way has a oneway tag可能已有人在做 @HTenkanen 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
fix: security 🔐 style: article/section 📝 system: data-mgmt 🗃️ system: security 🔐 system: software 💻
難度 2/5 1-3 小時 新手友好度 65/100
uabrc/uabrc.github.io#1267 ·
-
Bot Type: Bug Type: Documentation
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆