Spec Mode creates three standardized documents before implementation: spec.md, tasks.md, checklist.md.
Core principle: specs first, code second
Use for: Complex long-term tasks requiring clear specifications.
Benefits: Less rework, fewer misunderstandings, easy tracking, clear acceptance.
Trigger: User explicitly says "spec", "specification", "spec-mode", "写规范", "写 specs".
Suitable for:
Not needed for:
Rule of thumb: Small/clear/low-risk → optional spec. Large/vague/risky → use spec.
Key principle: This skill is ONLY loaded by explicit user request.
| Document | Purpose | Key Sections |
|---|---|---|
spec.md | What & Why | Why, What Changes, Impact, ADDED/MODIFIED/REMOVED |
tasks.md | How to implement | Small verifiable work items with dependencies |
checklist.md | Verification | Must-pass checkpoints, itemized & checkable |
Output directory: <project-root>/.specs/<change-id>/
Naming: <change-id> uses verb-first, hyphen-separated (e.g., add-user-export, refactor-auth-middleware)
The Iron Law:
SPECS FIRST, CODE SECOND. NEVER SKIP SPEC PHASE.
Violating the letter of the rules is violating the spirit of the rules.
No exceptions: Delete means delete.
See references/common-mistakes.md for:
After spec-mode triggers:
Ask about (3 types only):
WRONG: Mechanical 3-5 questions, asking about minors, asking before scanning RIGHT: Scan → Infer → Ask only if critical → Write specs
After creating all three documents:
Correct format:
✅ 已完成规范文档:
- .specs/<change-id>/spec.md
- .specs/<change-id>/tasks.md
- .specs/<change-id>/checklist.md
[简要总结关键内容]
请审阅。确认后我开始实现。
WRONG: Starting implementation immediately RIGHT: Create specs → Notify → Wait → Implement
Flow: User Request → Scan Context → Ask (if critical) → Create 3 docs → Notify → Wait → Implement
Step-by-step:
See references/workflow-details.md for complete diagram and details.
After creating documents, use this format:
✅ 已完成规范文档:
- .specs/<change-id>/spec.md
- .specs/<change-id>/tasks.md
- .specs/<change-id>/checklist.md
[简要总结关键内容]
请审阅。确认后我开始实现。
Before confirmation, DO NOT: Write code, modify files, or implement.
Note: Scanning code happens BEFORE specs (for context), not after confirmation.
After user confirms:
WRONG: Asking about every small decision RIGHT: Execute → Report when done
Prompts: prompts/standard.md, prompts/workflow.md
Templates: templates/spec-template.md, templates/tasks-template.md, templates/checklist-template.md
Examples: examples/sample-spec.md
Testing: tests/pressure-scenarios.md
See references/cross-platform.md for: