关于 spec-driven-workflow
默认的软件工程工作流,使用包含 `SPEC.md`、`PLAN.md`、`TASKS.md` 和 `REVIEW.md` 的 `workflow/` 目录。开始功能开发、Bug 修复、重构、架构变更或代码审查时,将此技能作为标准流程,用于定义需求、规划执行、协调并行任务并跟踪审查结果。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ alexbruno/ dev-skills --skill spec-driven-workflow安装后在 Claude Code 中输入/spec-driven-workflow确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
resources/PLAN.mdREVIEW.mdSPEC.mdTASKS.mdREADME 原文English
来自项目 READMEREADME 暂无中文译文,以下为英文原文;中文介绍见上方。
Spec-Driven Workflow
Adopt this workflow as the standard software engineering process for any non-trivial change. Do not jump straight into writing code; follow the gated lifecycle below using the workflow/ directory to separate what needs to change (SPEC.md), how it will be built (PLAN.md), who executes independent pieces (TASKS.md), and what needs attention after implementation (REVIEW.md).
Standard Operating Flow
Follow these phases in order:
- Specify (
SPEC.md) — Define the problem, scope, constraints, and acceptance criteria before designing or coding. - Plan (
PLAN.md) — Map the technical approach, affected files, ordered steps, and verification strategy. - Shard (
TASKS.md, conditional) — Break the plan into trackable tasks only when complexity, multi-scope work, or parallel execution warrants it. - Implement — Execute against
PLAN.md(orTASKS.md), keeping artifact statuses current as work progresses. - Review (
REVIEW.md) — Record code review findings (human or agent) and resolve blockers/major issues before completion.
Trivial changes exception: Skip
workflow/artifacts only for trivial, self-contained edits (e.g., typo fixes, single-line formatting, or minor comment updates) where specification and planning add no value.
Directory Layout
By default, create artifacts at the repository root under workflow/:
workflow/
├── SPEC.md # Required for any non-trivial change
├── PLAN.md # Required before implementation starts
├── TASKS.md # Optional: only for large plans or parallel/async agent work
└── REVIEW.md # Created during human or agent code review
If multiple independent initiatives run concurrently in the same repository, scope each one under workflow/<change-slug>/ instead of overwriting root files.
If the workflow/ directory or any required artifact does not exist yet, create the directory and initialize the missing files automatically using the templates in ./resources/.
Artifact Lifecycle
1. workflow/SPEC.md — Define the Change
Create SPEC.md first for any new feature, bug fix, or architectural change.
- Purpose: Align on scope, behavior, constraints, and acceptance criteria before writing code.
- Template: Start from SPEC.md.
- Rules:
- State both Goals and Non-Goals to prevent scope creep.
- Write testable Acceptance Criteria so completion is objective.
- For bug fixes, document reproduction steps, expected vs. actual behavior, and root cause (once known).
2. workflow/PLAN.md — Map Execution Steps
Create PLAN.md once SPEC.md is clear.
- Purpose: Translate the specification into concrete, ordered engineering steps.
- Template: Start from PLAN.md.
- Rules:
- Reference
SPEC.mdrequirements; do not duplicate the full spec. - List affected files/modules, ordered implementation steps, and a concrete verification strategy (tests, linters, manual checks).
- Highlight risks, migrations, or rollback considerations if applicable.
- Reference
3. workflow/TASKS.md — Shard Large or Parallel Work (Conditional)
Create TASKS.md only when at least one of these conditions holds:
- The
PLAN.mdis too large or comprehensive to execute cleanly in a single pass. - The
PLAN.mdspans two or more distinct project scopes (e.g., frontend, backend, infra, or multiple packages), task types (feature,bugfix,refactor,docs), or independent deliverables that benefit from separate tracking. - Work can be split into independent units executed in parallel or asynchronously by different agents or contributors.
- Template: Start from TASKS.md.
- Rules:
- Skip
TASKS.mdfor small, linear changes wherePLAN.mdis sufficient. - Every task must specify an ID, status (
pending,in_progress,blocked,done), dependencies, owned files/scope (to avoid merge conflicts between parallel agents), and clear done criteria. - Keep task statuses updated as work progresses.
- Skip
4. workflow/REVIEW.md — Record Code Review Findings
Create or update REVIEW.md when a human or reviewing agent inspects the implemented changes.
- Purpose: Centralize actionable review observations that require attention before merging.
- Template: Start from REVIEW.md.
- Rules:
- Categorize every observation by severity (
blocker,major,minor,question). - Point to exact file paths, line ranges, or symbols, and explain why the issue matters.
- Track resolution status (
open,resolved,wontfix) so nothing is lost across review rounds.
- Categorize every observation by severity (
Verification & Cleanup
Before considering the workflow complete:
- Every acceptance criterion in
workflow/SPEC.mdis satisfied and verified by tests or explicit checks. - All steps in
workflow/PLAN.md(andworkflow/TASKS.md, if used) are completed or explicitly deferred. - All
blockerandmajoritems inworkflow/REVIEW.mdare markedresolved(orwontfixwith rationale). - Ask the user for final sign-off and cleanup: Once the plan, tasks (if any), and review are complete, explicitly ask the user if everything is ready and whether the
workflow/artifacts can be cleaned up.- Never delete the root
workflow/directory or its root files (SPEC.md,PLAN.md,TASKS.md,REVIEW.md). - When the user confirms cleanup, clear/reset the contents of the root files (e.g., emptying them or resetting them to their blank templates) while keeping the directory and files intact.
- Exception: Subdirectories created inside
workflow/by agents working in parallel on independent executions (e.g.,workflow/<change-slug>/) may be deleted upon user confirmation.
- Never delete the root