openspec-sdd-guide
Original:🇨🇳 Chinese
Translated
Conversational SDD (Specification-Driven Development) guidance skill based on OpenSpec. It is automatically triggered when a user describes development requirements, and guides the user through the entire SDD process via conversations without any manual command input.
2installs
Sourcelucannan/skills
Added on
NPX Install
npx skill4agent add lucannan/skills openspec-sdd-guideTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Conversational SDD Guidance
This skill makes AI the user's SDD development partner. Users only need to describe requirements in natural language, AI automatically recognizes the intent and guides the entire development cycle according to the OpenSpec SDD process, no need to manually enter any commands.
/opsx:*What is SDD (Specification-Driven Development)
SDD is a specification-driven development methodology, with the core concept of "specification first, coding later":
- Reach consensus first — Humans and AI reach an agreement on "what to do, how to do it, and how to accept" before writing code
- Change equals folder — Each change is packaged as a set of artifacts (proposal/specs/design/tasks)
- Increment first — Describe changes with incremental specifications, adapted to iterations of existing systems
- Traceable — Each change has a complete closed loop of intent → solution → acceptance → archiving
OpenSpec Core Concepts
| Concept | Description |
|---|---|
| Change | A single change, corresponding to the |
| Artifact | Artifact files in the change (proposal.md / specs / design.md / tasks.md) |
| Delta Spec | Describes requirements for addition/modification/removal |
| Schema | Configuration that defines artifact types and dependencies (default |
| Archive | Archive completed changes, merge incremental specifications into the main specification |
OpenSpec Directory Structure
项目根目录/
├── openspec/
│ ├── config.yaml # 项目配置(schema、context、rules)
│ ├── changes/ # 变更工作区
│ │ ├── <change-name>/
│ │ │ ├── proposal.md # 变更意图(为什么做、做什么)
│ │ │ ├── specs/ # 增量需求规格
│ │ │ │ └── <capability>/
│ │ │ │ └── spec.md # 具体能力的需求和场景
│ │ │ ├── design.md # 技术设计(怎么做)
│ │ │ └── tasks.md # 实现任务清单
│ │ └── archive/ # 已归档的变更
│ └── specs/ # 主规格(系统行为真相源)
│ └── <domain>/
│ └── spec.mdArtifact Dependency (spec-driven mode)
proposal
(根节点)
│
┌─────────────┴─────────────┐
│ │
▼ ▼
specs design
(依赖: (依赖:
proposal) proposal)
│ │
└─────────────┬─────────────┘
│
▼
tasks
(依赖:
specs, design)OpenSpec CLI Core Commands
| Command | Function | Output |
|---|---|---|
| Create a new change | |
| Query change status | Artifact status list |
| Get artifact creation guidance | Template + context + rules |
| List all active changes | Change list |
| Archive change | Merge incremental specifications, move to archive |
⛔ Iron Rule: Documentation First, Coding Later
Before all documentation stages of the SDD process (Exploration → Proposal → Specifications → Design → Tasks) are fully completed and confirmed by the user, writing any application code is strictly prohibited.
This is the core principle of the SDD methodology and cannot be violated:
- ❌ Do not start writing code during the proposal stage
- ❌ Do not start writing code during the specification stage
- ❌ Do not start writing code during the design stage
- ❌ Do not start writing code during the task stage
- ❌ Do not skip the documentation stage and implement functions directly
- ✅ Only when proposal.md, specs/, design.md, tasks.md are all created, and the user confirms to enter the implementation stage, you can start writing application code
If the user urges to "write code directly" or "skip documentation", you should patiently explain the value of SDD, and recommend completing at least the minimal process of proposal + specs + tasks. When the user explicitly insists, you can simplify the process, but still need to create the most basic document framework first.
⛔ Iron Rule: All Artifact Documents Must Be Written in Chinese
All openspec artifact documents (proposal.md, spec.md, design.md, tasks.md) must be written in Chinese. No matter what language the template returned by openspec instructions is, the final generated document content must be in Chinese.
- Document titles, body descriptions, requirement descriptions, scenario descriptions, etc. are all in Chinese
- Proprietary technical terms (such as API names, variable names, command lines, etc.) can remain in English as they are
- Document structure tags (such as ,
## 新增需求,### 需求:xxx) use Chinese#### 场景:xxx
Core Principles
- Documentation first, coding later — Complete the specification document first, and code only after reaching a consensus. This is the most important principle, with priority over everything else
- Artifact documents must be in Chinese — All openspec artifact documents must be written in Chinese, no English allowed
- Conversation driven — Users only need to chat, AI actively guides the process, no manual command input required
- Confirmation per stage — Confirm the direction with the user before each SDD stage to ensure consensus
- Flexible progression — Support rollback, skipping, mid-term adjustment, no mandatory linear progression
- Code base based — Research based on the actual code base, no unfounded assumptions
- Deepen as needed — Adjust the process depth according to the complexity of requirements
Trigger and Intent Recognition
When to Activate
When a user expresses development intent in natural language, automatically activate this skill, for example:
- "I want to develop a XX feature"
- "Help me make a XX"
- "Need to add XX capability"
- "Let's do XX"
- "There is a requirement to develop"
- Any expression describing features, fixes, enhancements or new capabilities
Initial Assessment
Before entering the SDD process, perform the following checks:
-
Check if openspec is initializedbash
ls openspec/config.yamlIf not initialized, inform the user and recommend running.openspec init -
Check for active changesbash
openspec list --jsonIf there are active changes, ask the user:- Do you want to continue an existing change?
- Or do you want to start a new change?
-
Assess complexity and determine process depth
Complexity Characteristics Suggested Process Simple Bug fixes, small adjustments, single file Proposal → Tasks → Implementation → Archiving Medium New features, multi-file changes Proposal → Specifications → Design → Tasks → Implementation → Archiving Complex Architectural changes, cross-domain Exploration → Proposal → Specifications → Design → Tasks → Implementation → Verification → Archiving Show the assessment result to the user:"According to your description, this looks like a [simple/medium/complex] change. I recommend proceeding with the following process: [process list]. Do you think this is okay?"Let the user adjust the plan.
Stage Process
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 探索 │───►│ 提案 │───►│ 规格 │───►│ 设计 │
│ Explore │ │ Propose │ │ Specs │ │ Design │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
│
┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ 归档 │◄───│ 验证 │◄───│ 实现 │◄───┌────┘
│ Archive │ │ Verify │ │ Apply │ │
└──────────┘ └──────────┘ └──────────┘ ▼
┌──────────┐
│ 任务 │
│ Tasks │
└──────────┘Each stage follows the following pattern:
- Inform — Inform the user which stage is about to start and its purpose
- Discuss — Discuss key information of this stage with the user
- Confirm — Execute after confirming the direction
- Execute — Call openspec CLI to generate artifacts
- Summarize — Show the artifact summary and guide to the next stage
Stage 1: Exploration
Purpose: Help users sort out ideas, research the problem space, and clarify requirement boundaries
When to include this stage: Complex changes, unclear requirements, or when the user says "I'm not sure..." / "Help me analyze..."
Specific operations:
-
Ask open-ended questions to understand the problem:
- "What is the core problem you are encountering?"
- "What should it look like in an ideal state?"
- "Are there any reference solutions?"
-
Research the code base (if needed):
- Search for relevant code, patterns, existing implementations
- Sort out the current architecture related to the discussion
- Use ASCII charts to visualize findings
-
Explore solutions and trade-offs:
- If there are multiple solutions, list the comparison
- Build a comparison table
- Highlight risks and unknowns
-
Transition: When the idea is clear, summarize the findings and ask:"The requirements are now relatively clear. To summarize: [key points]. We can enter the proposal stage, do you want me to create a change?"
⛔ Important reminder: The exploration stage is only for thinking, no implementation is done. Do not write any application code, only produce discussions, analysis and charts.
Stage 2: Proposal
Purpose: Create a change and write proposal.md, clarify why to do it / what to do / scope
Steps:
-
Derive the change name from the user's description:
- Convert to kebab-case (for example: "用户关系查询" → )
user-relation-query - Confirm with the user: "I suggest the change name is , is that okay?"
<name>
- Convert to kebab-case (for example: "用户关系查询" →
-
Create change:bash
openspec new change "<name>" -
Get proposal guidance:bash
openspec instructions proposal --change "<name>" --json -
Discuss proposal content with the user: Ask about the following aspects:
- Intent: Why do this change? What problem does it solve?
- Scope: What is included? What is not included?
- Method: Preliminary technical ideas?
- Impact: Which modules/users are affected?
-
Create proposal.md based on discussion and guidance template (content must be in Chinese)
-
Show summary and confirm:"The proposal has been created. Core content: [summary]. After confirming there are no problems, shall we enter the requirement specification stage?"
Constraints:
- The and
contextreturned by instructions are constraint information for AI, not file contentrules - Do not copy ,
<context>,<rules>blocks into artifact files<project_context> - ⛔ Do not write any application code in this stage, only produce proposal.md document
Stage 3: Specifications
Purpose: Create incremental specifications, define requirements, scenarios and acceptance criteria
Steps:
-
Check status and get guidance:bash
openspec status --change "<name>" --json openspec instructions specs --change "<name>" --json -
Read proposal.md to get context
-
Discuss specifications with the user:
- Identify capability modules from the proposal
- For each capability, discuss:
- What are the requirements (using RFC 2119 keywords: MUST/SHOULD/MAY)?
- What are the scenarios (preconditions/operations/expected results)?
- What are the boundary cases?
- What are the exception cases?
-
Create incremental specification files under(content must be in Chinese):
specs/<capability>/spec.md- Use to describe new behaviors
## 新增需求 - Use to describe changed behaviors
## 修改需求 - Use to describe deprecated behaviors
## 移除需求
- Use
-
Show summary and confirm:"The requirement specifications have been created, with a total of N capabilities and M scenarios. Do you want me to go through them one by one for confirmation? After confirmation, we will enter the technical design stage."
⛔ Do not write any application code in this stage, only produce specification documents.
Specification format reference:
markdown
# <能力名称> 增量规格
## 新增需求
### 需求:<名称>
系统必须/应当/可以 <行为描述>。
#### 场景:<名称>
- 前置条件:<前置条件>
- 当:<操作>
- 则:<预期结果>
- 且:<补充预期>Stage 4: Design
Purpose: Create design.md, record technical solutions and architectural decisions
Steps:
-
Get design guidance:bash
openspec instructions design --change "<name>" --json -
Read proposal and specifications to get context
-
Research the code base: Search for relevant patterns, dependencies, integration points
-
Discuss technical solutions with the user:
- Architectural decisions and reasons
- Data flow and component interaction
- Files that need to be changed
- Risks and countermeasures
-
Create design.md based on discussion and template (content must be in Chinese)
-
Show summary and confirm:"The technical design is completed. Core solution: [summary]. After confirmation, shall we enter the task splitting stage?"
⛔ Do not write any application code in this stage, only produce design.md document.
Stage 5: Tasks
Purpose: Create tasks.md, split the implementation into an executable task list
Steps:
-
Get task guidance:bash
openspec instructions tasks --change "<name>" --json -
Read all pre-artifacts (proposal, specifications, design) to get context
-
Create tasks.md (content must be in Chinese), including a task list with checkboxes:
- Group by category
- Use hierarchical numbering (1.1, 1.2, etc.)
- Each task has moderate granularity, can be completed in one focused session
- Include verification steps
-
Show task list and confirm with the user:"The tasks have been split into N groups with a total of M tasks. Please confirm the task list: [task summary]. Start implementation after confirmation?"
⛔ Do not write any application code in this stage, only produce tasks.md document. Code implementation is only carried out in the next stage (implementation).
Task format:
markdown
# 任务清单
## 1. <分组名称>
- [ ] 1.1 <任务描述>
- [ ] 1.2 <任务描述>
## 2. <分组名称>
- [ ] 2.1 <任务描述>Stage 6: Implementation (Coding)
Purpose: Code and implement step by step according to the task list
✅ This is the only stage where writing application code is allowed.
Entry check: Before starting coding, you must confirm that all the following conditions are met:
- proposal.md has been created and confirmed by the user
- Requirement specifications under the specs/ directory have been created and confirmed by the user
- design.md has been created and confirmed by the user (unless the user explicitly agrees to skip)
- tasks.md has been created and confirmed by the user
- The user has explicitly agreed to enter the coding implementation stage
If any of the above conditions are not met, you must first go back to the corresponding stage to complete the document instead of starting coding directly.
Steps:
-
Verify entry conditions: Runto confirm that all required artifacts exist
openspec status --change "<name>" --json -
Get implementation guidance:bash
openspec instructions apply --change "<name>" --json -
Read all context files (from the implementation guidance output)
-
Complete pending tasks one by one: a. Inform which task is currently being processed b. Implement code changes c. Mark the task as completed:→
- [ ]d. Brief the user on the completion status e. Ask: "Continue to the next task?" (for important tasks)- [x] -
Pause conditions:
- Unclear task → Ask the user for clarification
- Design problems found during implementation → Suggest updating artifacts, seek user opinions
- Encounter errors or blockages → Report and wait for guidance
-
When all completed:"All N tasks are completed! Next, we can verify to confirm the consistency between the implementation and the specifications. Do you want to start verification?"
Output format during implementation:
## 正在实现: <change-name>
正在处理任务 3/7: <任务描述>
[...实现过程...]
✓ 任务完成
正在处理任务 4/7: <任务描述>
[...实现过程...]
✓ 任务完成Stage 7: Verification
Purpose: Verify the consistency between implementation and artifacts
Steps:
-
Read all artifacts (proposal, specifications, design, tasks)
-
Verify from three dimensions:
Dimension Check content Completeness Are all tasks completed? Are all requirements implemented? Are all scenarios covered? Correctness Does the implementation conform to the intent of the specifications? Are boundary cases handled? Consistency Are design decisions reflected in the code? Are patterns consistent? -
Problem classification:
- Severe: Must be fixed before archiving
- Warning: Should be fixed, but can be archived first
- Suggestion: Improvement and optimization suggestions
-
Show verification report:
## 验证报告: <change-name> 完整性: ✓ 12/12 任务已完成 正确性: ✓ 所有需求已匹配 一致性: ⚠ 1 个警告 严重: 0 | 警告: 1 | 建议: 2 可以归档: 是(有警告) -
If problems are found: Assist in fixing, then re-verify
-
When verification passes:"Verification passed! All implementations are consistent with the specifications. Archiving can be done, do you want to start?"
Stage 8: Archiving
Purpose: Archive changes, merge incremental specifications into the main specification
Steps:
-
Confirm with the user:"About to archive. This will merge the incremental specifications into the main specification and move the change to archive. Confirm archiving?"
<name> -
Show upcoming operations:
- Incremental specifications → Merge to
openspec/specs/ - Change directory → Move to
openspec/changes/archive/<date>-<name>/
- Incremental specifications → Merge to
-
Execute archiving:bash
openspec archive "<name>" -
Final summary:
## 归档完成 **变更名称**: <name> **归档位置**: openspec/changes/archive/<date>-<name>/ **已更新规格**: openspec/specs/<capability>/spec.md 恭喜!这个变更已完整走完 SDD 流程。 如果有新的需求,随时告诉我。
Process Control
Skip Stages
For simple changes, you can suggest skipping:
- Exploration: Can be skipped when requirements are already clear
- Design: Can be skipped when the implementation solution is simple and direct
- Verification: Not recommended to skip, but possible for minimal changes
Always inform the user which stages are skipped and the reasons.
Rollback and Modification
If you find that previous artifacts need to be updated during implementation or subsequent stages:
- Inform: "Found that [design/requirement/solution] needs adjustment"
- Go back to the corresponding stage
- Update artifacts
- Continue from the interruption point
Example:
"Found that the solution in design.md needs adjustment during implementation. Let me update the technical design before continuing the implementation."
Resume Progress
When the user returns to continue a previous change:
- Run to find active changes
openspec list --json - Run to check progress
openspec status --change "<name>" --json - Summarize current status:
"Detected that you have an ongoing change, current progress: [status]. Do you want to continue?"
<name> - Resume from the appropriate stage
Interaction Guide
Stage Transition Template
Before each stage transition, use the following pattern:
---
## [Stage Name] Stage Completed
### Achievements of this stage
- [List key outputs]
### Next step: [Next Stage Name]
[Brief description of what to do in the next stage]
Are you ready? Or is there anything you want to adjust?
---When the user goes off-topic
If the user asks irrelevant questions during an active SDD process:
- Answer the user's question
- Gently remind: "We still have an ongoing change , do you want to continue?"
<name>
When the user wants to give up
If the user wants to stop halfway:
- Confirm: "Are you sure you want to pause ? Progress will be saved, you can continue at any time."
<name> - Do not archive unfinished changes
Security Constraints
- ⛔ Before all document artifacts are completed and confirmed, never write application code — This is the first iron rule of SDD
- ⛔ All artifact documents (proposal.md, spec.md, design.md, tasks.md) must be written in Chinese — No matter what language the instructions template is, the generated document content must be in Chinese
- Before creating artifacts or implementing code each time, you must first obtain user confirmation
- Do not write /
contextfrom instructions into artifact files — Those are just constraint information for AIrules - Always use openspec CLI to query status, get guidance, perform archiving
- Before creating new artifacts, always read their dependent artifacts first
- Keep changes focused — Each change only contains one logical unit of work
- Pause when unsure — Better to ask the user than to guess
- Follow pattern constraints — Act according to the artifact dependency graph in openspec status
- Track progress — Use TodoWrite tool to maintain user-visible progress
- Strictly follow the stage order — Exploration → Proposal → Specifications → Design → Tasks → Implementation → Verification → Archiving. Only the implementation stage allows writing application code