spec-driven-auto
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYou are running the full spec-driven workflow end-to-end for a single change.
您正在针对单一变更端到端运行完整的规范驱动工作流。
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
步骤
-
Assess complexity — before doing anything, evaluate whether this change is suitable for the auto workflow:
- Read for project context
.spec-driven/config.yaml - Read and relevant spec files to understand the current system
.spec-driven/specs/INDEX.md - Read the codebase files that the change will likely touch — estimate the number of files, modules, and cross-cutting concerns involved
- Reject if any of these are true:
- The change touches more than 3 modules or packages
- The change requires modifying more than ~10 files
- The change involves database schema migrations
- The change affects authentication, authorization, or payment flows
- The change requires coordinating across multiple services or repositories
- The scope is vague or open-ended (e.g. "refactor the codebase", "improve performance")
- If rejected, explain why and suggest using the step-by-step workflow (→
/spec-driven-propose→ ...) instead/spec-driven-apply - If suitable, proceed
- Read
-
Propose — run:
/spec-driven-propose- Run
node {{SKILL_DIR}}/scripts/spec-driven.js propose <name> - Fill all artifacts: proposal.md (with Unchanged Behavior), specs/ delta files, design.md, tasks.md (with ## Testing), questions.md (open questions)
- Show the user a summary: scope, key decisions, task count, unchanged behaviors, and any open questions
- Wait for explicit confirmation before proceeding — this is the only mandatory checkpoint
- If questions.md has open questions, list them and ask the user to resolve them before confirming
- If the user requests changes, apply them and re-confirm
- Run
-
Apply — implement all tasks:
- Run to show task summary
node {{SKILL_DIR}}/scripts/spec-driven.js apply <name> - Check questions.md for open entries — if any, ask the user and resolve before continuing
- [ ] Q: - Work through each task in order: read code, implement, verify Unchanged Behavior, mark
- [ ]- [x] - For tasks: actually run the tests and confirm they pass
## Testing - Run to confirm
node {{SKILL_DIR}}/scripts/spec-driven.js apply <name>remaining === 0
- Run
-
Verify — check completeness:
- Run
node {{SKILL_DIR}}/scripts/spec-driven.js verify <name> - If errors or CRITICALs: fix them automatically, then re-verify
- If CRITICALs cannot be auto-fixed: stop and ask the user
- Re-read delta spec files and update them to match what was actually implemented
- Run
-
Review — check code quality:
- Read every file changed by this change
- Check: readability, security, error handling, performance, best practices, test quality
- MUST FIX issues: fix them automatically, then re-review
- If MUST FIX issues cannot be auto-fixed: stop and ask the user
- SHOULD FIX and NITS: fix if straightforward, otherwise note in the final report
-
Archive — close out the change:
- List all delta files in and merge each into the corresponding main spec file
specs/ - Update if new spec files were created
.spec-driven/specs/INDEX.md - Run
node {{SKILL_DIR}}/scripts/spec-driven.js archive <name> - Report the final result: what was built, files changed, tests passing
- List all delta files in
-
评估复杂度 — 在执行任何操作之前,评估此变更是否适合自动化工作流:
- 读取以了解项目上下文
.spec-driven/config.yaml - 读取及相关规范文件,理解当前系统
.spec-driven/specs/INDEX.md - 读取变更可能涉及的代码库文件 — 估算涉及的文件数量、模块和跨领域关注点
- 如果满足以下任一条件,则拒绝使用此工作流:
- 变更涉及超过3个模块或包
- 变更需要修改约10个以上文件
- 变更涉及数据库架构迁移
- 变更影响认证、授权或支付流程
- 变更需要跨多个服务或仓库协调
- 范围模糊或开放式(例如“重构代码库”、“提升性能”)
- 如果被拒绝,请说明原因,并建议使用分步工作流(→
/spec-driven-propose→ ...)替代/spec-driven-apply - 如果适合,则继续
- 读取
-
提议 — 运行:
/spec-driven-propose- 运行
node {{SKILL_DIR}}/scripts/spec-driven.js propose <name> - 填充所有工件:proposal.md(包含未变更行为)、specs/增量文件、design.md、tasks.md(包含## 测试部分)、questions.md(未解决问题)
- 向用户展示摘要:范围、关键决策、任务数量、未变更行为以及任何未解决问题
- 继续前需等待用户明确确认 — 这是唯一的强制检查点
- 如果questions.md中有未解决问题,请列出并要求用户在确认前解决
- 如果用户要求修改,则应用修改后重新确认
- 运行
-
实施 — 完成所有任务:
- 运行查看任务摘要
node {{SKILL_DIR}}/scripts/spec-driven.js apply <name> - 检查questions.md中是否有未标记的条目 — 如果有,请询问用户并解决后再继续
- [ ] Q: - 按顺序处理每个任务:读取代码、实施、验证未变更行为、标记为
- [ ]- [x] - 对于任务:实际运行测试并确认通过
## 测试 - 运行确认
node {{SKILL_DIR}}/scripts/spec-driven.js apply <name>remaining === 0
- 运行
-
验证 — 检查完整性:
- 运行
node {{SKILL_DIR}}/scripts/spec-driven.js verify <name> - 如果存在错误或严重问题:自动修复,然后重新验证
- 如果严重问题无法自动修复:停止并询问用户
- 重新读取增量规范文件,并更新使其与实际实现内容匹配
- 运行
-
审核 — 检查代码质量:
- 读取此变更修改的所有文件
- 检查:可读性、安全性、错误处理、性能、最佳实践、测试质量
- 必须修复的问题:自动修复,然后重新审核
- 如果必须修复的问题无法自动修复:停止并询问用户
- 建议修复和小问题:如果容易修复则处理,否则在最终报告中注明
-
归档 — 完成变更收尾:
- 列出specs/中的所有增量文件,并将每个文件合并到对应的主规范文件中
- 如果创建了新的规范文件,请更新
.spec-driven/specs/INDEX.md - 运行
node {{SKILL_DIR}}/scripts/spec-driven.js archive <name> - 报告最终结果:构建内容、修改的文件、通过的测试
Rules
规则
- The complexity check in Step 1 is mandatory — never skip it
- The user confirmation in Step 2 is mandatory — never skip it
- All other steps run automatically unless blocked by an unresolvable issue
- Follow all config.yaml rules (specs, change, code, test) throughout
- If anything goes wrong mid-flow, stop and explain — do not silently continue
- Mark tasks complete one at a time, not in bulk
- 步骤1中的复杂度检查是强制性的 — 绝不能跳过
- 步骤2中的用户确认是强制性的 — 绝不能跳过
- 所有其他步骤自动运行,除非遇到无法解决的问题而受阻
- 全程遵循config.yaml中的所有规则(规范、变更、代码、测试)
- 如果流程中途出现任何问题,请停止并说明原因 — 不要静默继续
- 逐个标记任务完成,不要批量标记