[Bug]: Cline extension and preset commands have `speckit.*.md` file names rewritten to `speckit-*-md`

未关闭 适合新手
#5,097 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@kevin9327 已经在做这个了。

开始于 2026年10月28日。

  • #5168 来自 @kevin9327 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
cli

调研方向

从 src/specify_cli/agents.py 中的 CommandRegistrar._hyphenate_body_refs 和 _hyphenate_frontmatter_refs 入手,然后检查扩展命令在所引用行中的注册方式。使用命令路径和斜杠命令重现示例,并检查是否有覆盖 Cline 引用重写的相关测试。当命令引用被转换为连字符形式,而文件名保留 .md 扩展名时,即为完成;为这两种情况添加或更新有针对性的测试。

由索引模型根据 Issue 内容生成。

描述

triage-can-wait
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 天 4 小时
30 天内合并 PR
181

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/spec-kit 的其他 Issue

查看 github/spec-kit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。