spec-driven-spec-edit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYou are helping the user create or modify main spec files under
directly, without going through the change workflow.
This is for lightweight corrections — fixing typos, correcting inaccurate
requirements, or adding missing spec entries.
.spec-driven/specs/你正在协助用户直接在目录下创建或修改主规范文件,无需走变更工作流。该操作适用于轻量修正场景——修复拼写错误、校正不准确的需求,或是补充缺失的规范条目。
.spec-driven/specs/Prerequisites
前置条件
The directory must exist at the project root. Before
proceeding, verify:
.spec-driven/ls .spec-driven/If this fails, the project is not initialized. Run first.
/spec-driven-init.spec-driven/ls .spec-driven/如果执行失败,说明项目未初始化,请先运行。
/spec-driven-initSteps
操作步骤
-
Read spec context first — before making any changes, read:
.spec-driven/config.yaml.spec-driven/specs/INDEX.md- any existing main spec files relevant to the user's request
-
Understand the request — identify whether the user wants to:
- add a new spec file or category
- add new requirements to an existing spec file
- modify an existing requirement
- remove one or more existing requirements
-
Choose the target — useto determine where the content belongs:
INDEX.md- If one or more existing spec files cover the behavior, use those
- Only create a new spec file if no existing file fits
- Only create a new category if no existing category fits
-
Prepare the changes — draft the exact modifications:
- For additions: write the new heading and body
### Requirement: - For modifications: show the before and after content
- For removals: identify the exact heading(s) to remove
### Requirement: - Describe observable behavior only, not implementation details
- For additions: write the new
-
Present and confirm — show the user:
- which file or files will be changed
- the exact content that will be added, modified, or removed
- whether needs updating
INDEX.md
Wait for explicit user confirmation before writing anything. -
Apply the changes — after confirmation:
- Edit the target spec file(s) under
.spec-driven/specs/ - Preserve existing and
mapping.implementationfrontmattermapping.tests - If the edit changes which implementation or test files evidence the spec, update only the mapping frontmatter with repo-relative file paths
- If a new file or category was created, update
.spec-driven/specs/INDEX.md - For removals, delete the exact heading(s) cleanly — do not leave orphaned headings or vague remnants
### Requirement:
- Edit the target spec file(s) under
-
Validate the result — after editing, verify:
- Each edited file still follows the standard heading format
### Requirement: - Edited files still have valid mapping frontmatter
- correctly reflects all spec files under
INDEX.md.spec-driven/specs/ - If format issues are found, fix them immediately
Run when mapping frontmatter changed.
node {{SKILL_DIR}}/scripts/spec-driven.js verify-spec-mappings
- Each edited file still follows the standard
-
Summarize — tell the user:
- which file(s) were changed
- what was added, modified, or removed
- whether INDEX.md was updated
-
优先读取规范上下文 —— 做任何修改前,先读取:
.spec-driven/config.yaml.spec-driven/specs/INDEX.md- 所有和用户请求相关的现有主规范文件
-
理解请求 —— 明确用户的需求类型:
- 新增规范文件或分类
- 为现有规范文件添加新需求
- 修改现有需求
- 删除一条或多条现有需求
-
选择目标位置 —— 参考确定内容归属:
INDEX.md- 如果已有一个或多个规范文件覆盖该行为,就使用现有文件
- 仅当没有适配的现有文件时才创建新的规范文件
- 仅当没有适配的现有分类时才创建新分类
-
准备变更内容 —— 起草准确的修改内容:
- 新增场景:编写新的标题和正文
### Requirement: - 修改场景:展示修改前后的内容
- 删除场景:明确要删除的具体标题
### Requirement: - 仅描述可观测的行为,不要涉及实现细节
- 新增场景:编写新的
-
展示并确认 —— 向用户展示:
- 将要修改的文件
- 将要新增、修改或删除的具体内容
- 是否需要更新
INDEX.md
写入任何内容前必须等待用户明确确认。 -
应用变更 —— 获得确认后:
- 编辑下的目标规范文件
.spec-driven/specs/ - 保留现有和
mapping.implementation前置元数据mapping.tests - 如果本次编辑修改了支撑规范的实现或测试文件,仅更新前置元数据中的仓库相对文件路径即可
- 如果创建了新文件或新分类,更新
.spec-driven/specs/INDEX.md - 删除场景下,干净地删除对应的标题——不要留下孤立标题或模糊的残留内容
### Requirement:
- 编辑
-
校验结果 —— 编辑完成后验证:
- 每个编辑后的文件仍遵循标准的标题格式
### Requirement: - 编辑后的文件仍包含有效的映射前置元数据
- 准确反映
INDEX.md下的所有规范文件.spec-driven/specs/ - 如果发现格式问题,立即修复
若修改了映射前置元数据,执行
node {{SKILL_DIR}}/scripts/spec-driven.js verify-spec-mappings
- 每个编辑后的文件仍遵循标准的
-
总结 —— 告知用户:
- 哪些文件被修改了
- 新增、修改或删除了什么内容
- 是否更新了INDEX.md
Rules
规则
- Always read existing specs before editing — never edit blind
- Present changes and wait for confirmation before writing
- Prefer existing categories and files unless the content clearly requires a new path
- Describe observable behavior only, not implementation details
- Do not implement product code — this skill edits planning artifacts only
- Do not create or interact with
.spec-driven/changes/ - Keep implementation and test mappings in frontmatter, not in requirement prose
- 编辑前务必读取现有规范——切勿盲目编辑
- 写入前先展示变更内容并等待确认
- 优先使用现有分类和文件,除非内容明确需要新路径
- 仅描述可观测行为,不涉及实现细节
- 不要编写产品代码——本技能仅编辑规划类产物
- 不要创建或操作目录
.spec-driven/changes/ - 实现和测试映射放在前置元数据中,不要写在需求正文里