ai-dev-requirements 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,215 +1,215 @@
1
- ---
2
- name: dev-workflow
3
- description: >
4
- Use when starting any development task - receiving a requirement ticket number, requirement description,
5
- or when user says "start developing", "new feature", "implement XXX". Drives the full workflow from
6
- requirement fetching through user stories, UI resource acquisition, skill matching, implementation
7
- planning, coding, and verification. Supports ONES/GitHub/Jira MCP for requirements, Figma MCP for
8
- design references, and npx skills find for frontend UI skills when no design is provided.
9
- metadata:
10
- author: ai-dev-workflow
11
- version: "0.1.0"
12
- ---
13
-
14
- # Dev Workflow
15
-
16
- ## Setup
17
-
18
- Install this skill:
19
-
20
- ```bash
21
- npx skills add daguanren21/ai-dev-workflow
22
- ```
23
-
24
- Install to a specific agent with `-a`:
25
-
26
- ```bash
27
- npx skills add daguanren21/ai-dev-workflow -a claude-code
28
- npx skills add daguanren21/ai-dev-workflow -a cursor
29
- ```
30
-
31
- **Prerequisites:**
32
-
33
- 1. Install [find-skills](https://github.com/vercel-labs/skills) for community skill discovery:
34
-
35
- ```bash
36
- npx skills add vercel-labs/skills --skill find-skills -a claude-code
37
- ```
38
-
39
- 2. (Optional) Install companion MCP servers based on your requirement source:
40
-
41
- | Source | MCP Server |
42
- |--------|-----------|
43
- | ONES | `ai-dev-requirements` (bundled) |
44
- | GitHub | [github/github-mcp-server](https://github.com/github/github-mcp-server) |
45
- | Jira | [Atlassian Rovo MCP](https://www.atlassian.com/blog/announcements/remote-mcp-server) |
46
- | Figma | [Figma MCP Server](https://developers.figma.com/docs/figma-mcp-server/) |
47
-
48
- ## Overview
49
-
50
- Requirement-driven AI-assisted development workflow. From requirements to user stories, from user stories to implementation plans, from plans to code.
51
-
52
- **Announce at start:** "I'm using the dev-workflow skill to drive the development process."
53
-
54
- **Core principle:** Requirements first, then user stories, then plan, then code. Never skip to code without a confirmed user story and plan.
55
-
56
- ## The Process
57
-
58
- ### Phase 1: Fetch Requirements
59
-
60
- Identify the requirement source and fetch using the corresponding MCP:
61
-
62
- | Source | MCP Server | Tool |
63
- |--------|-----------|------|
64
- | ONES | `requirements` MCP (bundled) | `get_requirement` |
65
- | GitHub | `github` MCP ([github/github-mcp-server](https://github.com/github/github-mcp-server)) | get issue |
66
- | Jira | `atlassian` MCP ([Atlassian Rovo MCP](https://www.atlassian.com/blog/announcements/remote-mcp-server)) | get issue |
67
- | Natural language | No MCP needed | Use user's description directly |
68
-
69
- Save raw requirements to `docs/plans/{feature-name}/requirements.md`.
70
-
71
- ### Phase 2: Write User Stories
72
-
73
- Convert requirements into standard user stories:
74
-
75
- ```markdown
76
- ### US-1: {title}
77
- **As a** {role},
78
- **I want** {goal},
79
- **So that** {value}.
80
-
81
- #### Acceptance Criteria
82
- - [ ] Given {precondition}, When {action}, Then {expected result}
83
-
84
- #### UI Notes
85
- - 🎨 Figma: {link} | 🖼️ Screenshot: {path} | 📝 No UI dependency
86
- ```
87
-
88
- Rules:
89
- 1. Each story must be independently deliverable
90
- 2. Acceptance criteria use Given/When/Then
91
- 3. Stories involving UI: mark and **pause** for developer to provide UI reference
92
- 4. Non-UI stories: mark as "No UI dependency"
93
-
94
- Save to `docs/plans/{feature-name}/user-stories.md`.
95
-
96
- **PAUSE:** Present stories to developer for confirmation. Collect UI references.
97
-
98
- ### Phase 3: Acquire UI Resources
99
-
100
- **Path A — Developer provided UI reference:**
101
- - **Figma copy link** → Use Figma MCP Server to read design details (components, variables, layout)
102
- - **Screenshot/image** → Analyze image directly for UI structure
103
- - **Text description** → Understand UI intent from description
104
-
105
- **Path B — No UI reference provided:**
106
-
107
- Search for frontend UI skills via `npx skills find`:
108
-
109
- ```bash
110
- npx skills find frontend design
111
- npx skills find ui component
112
- npx skills find css styling
113
- ```
114
-
115
- Load matching community skills and apply their best practices to guide UI implementation.
116
-
117
- Also check the 5-level skill lookup (Phase 4) for project-level UI conventions.
118
-
119
- ### Phase 4: Match Skills (5-Level Lookup)
120
-
121
- Extract tech keywords from user stories, find best practices by priority:
122
-
123
- | Priority | Source | Description |
124
- |:---:|------|------|
125
- | L1 | Project `skills/` | Project-specific conventions (highest priority) |
126
- | L2 | Installed global skills | superpowers, giga-ui, vue-best-practices, etc. |
127
- | L3 | `npx skills find {keyword}` | skills.sh community ecosystem |
128
- | L4 | Context7 MCP | Framework/library official docs |
129
- | L5 | WebSearch | Fallback |
130
-
131
- ### Phase 5: Write Implementation Plan
132
-
133
- **REQUIRED SUB-SKILL:** Use `superpowers:writing-plans` to generate the plan.
134
-
135
- Based on user stories + UI resources + matched skills, generate bite-sized plan:
136
- - Each step 2-5 minutes, TDD, exact file paths and code
137
- - DRY, YAGNI, frequent commits
138
-
139
- Save to `docs/plans/{feature-name}/implementation-plan.md`.
140
-
141
- ### Phase 6: Requirement Validation
142
-
143
- Validate that the design and plan fully cover all product requirements before coding. Follow the detailed spec in `references/requirement-validation.md`.
144
-
145
- Core steps:
146
- 1. Build a traceability matrix: requirement → user story → design section → task
147
- 2. Check each requirement for: story coverage, AC completeness, design landing, task breakdown, edge case coverage
148
- 3. Generate `validation-report.md` with coverage stats, uncovered items, and risk items
149
- 4. **PAUSE:** Present the report to the developer for confirmation
150
-
151
- Judgment:
152
- - ✅ Pass: all requirements covered, no high-risk items → proceed to Phase 7
153
- - ⚠️ Conditional pass: coverage ≥ 90%, uncovered items are low priority → confirm with developer, then proceed
154
- - ❌ Fail: core requirements uncovered or high-risk unresolved → go back to Phase 5 and revise
155
-
156
- Save to `docs/plans/{feature-name}/validation-report.md`.
157
-
158
- ### Phase 7: Implement Code
159
-
160
- **REQUIRED SUB-SKILL:** Use `superpowers:subagent-driven-development` or `superpowers:executing-plans`.
161
-
162
- Follow task types and scheduling strategies defined in `references/task-types.md`.
163
- Follow the 10-step workflow defined in `references/workflow.md`.
164
- Use task templates from `references/templates/` for task declarations.
165
-
166
- Key constraints:
167
- - Max 5 parallel tasks
168
- - `code:dev` → isolated (serial within module, parallel across modules)
169
- - `code:refactor` → serial (global lock)
170
- - `doc:write` / `test` → parallel
171
-
172
- ### Phase 8: Verify
173
-
174
- 1. **Quality gate** (in order, all must pass):
175
- ```bash
176
- pnpm lint # Code style
177
- pnpm type # TypeScript type check (tsc --noEmit)
178
- pnpm build # Build verification
179
- ```
180
- 2. **UI verification** (frontend projects only): Playwright MCP
181
- 3. **Code review:** **REQUIRED SUB-SKILL:** Use `superpowers:requesting-code-review`
182
-
183
- ## Quick Reference
184
-
185
- | Phase | Output | Pause? |
186
- |-------|--------|--------|
187
- | 1. Requirements | `requirements.md` | No |
188
- | 2. User Stories | `user-stories.md` | **Yes** — developer confirms |
189
- | 3. UI Resources | figma-notes / screenshots | Only if UI stories exist |
190
- | 4. Skill Matching | matched skills list | No |
191
- | 5. Plan | `implementation-plan.md` | Per writing-plans skill |
192
- | 6. Requirement Validation | `validation-report.md` | **Yes** — developer confirms |
193
- | 7. Code | Source files + tests | Per executing-plans skill |
194
- | 8. Verify | lint + type + build pass | No |
195
-
196
- ## Output Structure
197
-
198
- ```
199
- docs/plans/{feature-name}/
200
- ├── requirements.md
201
- ├── user-stories.md
202
- ├── ui-references/
203
- │ ├── figma-notes.md
204
- │ └── screenshots/
205
- ├── validation-report.md
206
- └── implementation-plan.md
207
- ```
208
-
209
- ## Common Mistakes
210
-
211
- - **Skipping user stories** — jumping straight from requirements to code. Always convert to user stories first.
212
- - **Not pausing for UI** — continuing without UI reference when stories involve UI changes. Always pause and ask.
213
- - **Ignoring skill matching** — not checking for relevant project/community skills before planning. Always run the 5-level lookup.
214
- - **Skipping requirement validation** — going straight from plan to code without verifying coverage. Always run the traceability check and pause for developer confirmation.
215
- - **Wrong parallelism** — running `code:refactor` tasks in parallel. Refactoring is always serial.
1
+ ---
2
+ name: dev-workflow
3
+ description: >
4
+ Use when starting any development task - receiving a requirement ticket number, requirement description,
5
+ or when user says "start developing", "new feature", "implement XXX". Drives the full workflow from
6
+ requirement fetching through user stories, UI resource acquisition, skill matching, implementation
7
+ planning, coding, and verification. Supports ONES/GitHub/Jira MCP for requirements, Figma MCP for
8
+ design references, and npx skills find for frontend UI skills when no design is provided.
9
+ metadata:
10
+ author: ai-dev-workflow
11
+ version: "0.1.0"
12
+ ---
13
+
14
+ # Dev Workflow
15
+
16
+ ## Setup
17
+
18
+ Install this skill:
19
+
20
+ ```bash
21
+ npx skills add daguanren21/ai-dev-workflow
22
+ ```
23
+
24
+ Install to a specific agent with `-a`:
25
+
26
+ ```bash
27
+ npx skills add daguanren21/ai-dev-workflow -a claude-code
28
+ npx skills add daguanren21/ai-dev-workflow -a cursor
29
+ ```
30
+
31
+ **Prerequisites:**
32
+
33
+ 1. Install [find-skills](https://github.com/vercel-labs/skills) for community skill discovery:
34
+
35
+ ```bash
36
+ npx skills add vercel-labs/skills --skill find-skills -a claude-code
37
+ ```
38
+
39
+ 2. (Optional) Install companion MCP servers based on your requirement source:
40
+
41
+ | Source | MCP Server |
42
+ |--------|-----------|
43
+ | ONES | `ai-dev-requirements` (bundled) |
44
+ | GitHub | [github/github-mcp-server](https://github.com/github/github-mcp-server) |
45
+ | Jira | [Atlassian Rovo MCP](https://www.atlassian.com/blog/announcements/remote-mcp-server) |
46
+ | Figma | [Figma MCP Server](https://developers.figma.com/docs/figma-mcp-server/) |
47
+
48
+ ## Overview
49
+
50
+ Requirement-driven AI-assisted development workflow. From requirements to user stories, from user stories to implementation plans, from plans to code.
51
+
52
+ **Announce at start:** "I'm using the dev-workflow skill to drive the development process."
53
+
54
+ **Core principle:** Requirements first, then user stories, then plan, then code. Never skip to code without a confirmed user story and plan.
55
+
56
+ ## The Process
57
+
58
+ ### Phase 1: Fetch Requirements
59
+
60
+ Identify the requirement source and fetch using the corresponding MCP:
61
+
62
+ | Source | MCP Server | Tool |
63
+ |--------|-----------|------|
64
+ | ONES | `requirements` MCP (bundled) | `get_requirement` |
65
+ | GitHub | `github` MCP ([github/github-mcp-server](https://github.com/github/github-mcp-server)) | get issue |
66
+ | Jira | `atlassian` MCP ([Atlassian Rovo MCP](https://www.atlassian.com/blog/announcements/remote-mcp-server)) | get issue |
67
+ | Natural language | No MCP needed | Use user's description directly |
68
+
69
+ Save raw requirements to `docs/plans/{feature-name}/requirements.md`.
70
+
71
+ ### Phase 2: Write User Stories
72
+
73
+ Convert requirements into standard user stories:
74
+
75
+ ```markdown
76
+ ### US-1: {title}
77
+ **As a** {role},
78
+ **I want** {goal},
79
+ **So that** {value}.
80
+
81
+ #### Acceptance Criteria
82
+ - [ ] Given {precondition}, When {action}, Then {expected result}
83
+
84
+ #### UI Notes
85
+ - 🎨 Figma: {link} | 🖼️ Screenshot: {path} | 📝 No UI dependency
86
+ ```
87
+
88
+ Rules:
89
+ 1. Each story must be independently deliverable
90
+ 2. Acceptance criteria use Given/When/Then
91
+ 3. Stories involving UI: mark and **pause** for developer to provide UI reference
92
+ 4. Non-UI stories: mark as "No UI dependency"
93
+
94
+ Save to `docs/plans/{feature-name}/user-stories.md`.
95
+
96
+ **PAUSE:** Present stories to developer for confirmation. Collect UI references.
97
+
98
+ ### Phase 3: Acquire UI Resources
99
+
100
+ **Path A — Developer provided UI reference:**
101
+ - **Figma copy link** → Use Figma MCP Server to read design details (components, variables, layout)
102
+ - **Screenshot/image** → Analyze image directly for UI structure
103
+ - **Text description** → Understand UI intent from description
104
+
105
+ **Path B — No UI reference provided:**
106
+
107
+ Search for frontend UI skills via `npx skills find`:
108
+
109
+ ```bash
110
+ npx skills find frontend design
111
+ npx skills find ui component
112
+ npx skills find css styling
113
+ ```
114
+
115
+ Load matching community skills and apply their best practices to guide UI implementation.
116
+
117
+ Also check the 5-level skill lookup (Phase 4) for project-level UI conventions.
118
+
119
+ ### Phase 4: Match Skills (5-Level Lookup)
120
+
121
+ Extract tech keywords from user stories, find best practices by priority:
122
+
123
+ | Priority | Source | Description |
124
+ |:---:|------|------|
125
+ | L1 | Project `skills/` | Project-specific conventions (highest priority) |
126
+ | L2 | Installed global skills | superpowers, giga-ui, vue-best-practices, etc. |
127
+ | L3 | `npx skills find {keyword}` | skills.sh community ecosystem |
128
+ | L4 | Context7 MCP | Framework/library official docs |
129
+ | L5 | WebSearch | Fallback |
130
+
131
+ ### Phase 5: Write Implementation Plan
132
+
133
+ **REQUIRED SUB-SKILL:** Use `superpowers:writing-plans` to generate the plan.
134
+
135
+ Based on user stories + UI resources + matched skills, generate bite-sized plan:
136
+ - Each step 2-5 minutes, TDD, exact file paths and code
137
+ - DRY, YAGNI, frequent commits
138
+
139
+ Save to `docs/plans/{feature-name}/implementation-plan.md`.
140
+
141
+ ### Phase 6: Requirement Validation
142
+
143
+ Validate that the design and plan fully cover all product requirements before coding. Follow the detailed spec in `references/requirement-validation.md`.
144
+
145
+ Core steps:
146
+ 1. Build a traceability matrix: requirement → user story → design section → task
147
+ 2. Check each requirement for: story coverage, AC completeness, design landing, task breakdown, edge case coverage
148
+ 3. Generate `validation-report.md` with coverage stats, uncovered items, and risk items
149
+ 4. **PAUSE:** Present the report to the developer for confirmation
150
+
151
+ Judgment:
152
+ - ✅ Pass: all requirements covered, no high-risk items → proceed to Phase 7
153
+ - ⚠️ Conditional pass: coverage ≥ 90%, uncovered items are low priority → confirm with developer, then proceed
154
+ - ❌ Fail: core requirements uncovered or high-risk unresolved → go back to Phase 5 and revise
155
+
156
+ Save to `docs/plans/{feature-name}/validation-report.md`.
157
+
158
+ ### Phase 7: Implement Code
159
+
160
+ **REQUIRED SUB-SKILL:** Use `superpowers:subagent-driven-development` or `superpowers:executing-plans`.
161
+
162
+ Follow task types and scheduling strategies defined in `references/task-types.md`.
163
+ Follow the 10-step workflow defined in `references/workflow.md`.
164
+ Use task templates from `references/templates/` for task declarations.
165
+
166
+ Key constraints:
167
+ - Max 5 parallel tasks
168
+ - `code:dev` → isolated (serial within module, parallel across modules)
169
+ - `code:refactor` → serial (global lock)
170
+ - `doc:write` / `test` → parallel
171
+
172
+ ### Phase 8: Verify
173
+
174
+ 1. **Quality gate** (in order, all must pass):
175
+ ```bash
176
+ pnpm lint # Code style
177
+ pnpm type # TypeScript type check (tsc --noEmit)
178
+ pnpm build # Build verification
179
+ ```
180
+ 2. **UI verification** (frontend projects only): Playwright MCP
181
+ 3. **Code review:** **REQUIRED SUB-SKILL:** Use `superpowers:requesting-code-review`
182
+
183
+ ## Quick Reference
184
+
185
+ | Phase | Output | Pause? |
186
+ |-------|--------|--------|
187
+ | 1. Requirements | `requirements.md` | No |
188
+ | 2. User Stories | `user-stories.md` | **Yes** — developer confirms |
189
+ | 3. UI Resources | figma-notes / screenshots | Only if UI stories exist |
190
+ | 4. Skill Matching | matched skills list | No |
191
+ | 5. Plan | `implementation-plan.md` | Per writing-plans skill |
192
+ | 6. Requirement Validation | `validation-report.md` | **Yes** — developer confirms |
193
+ | 7. Code | Source files + tests | Per executing-plans skill |
194
+ | 8. Verify | lint + type + build pass | No |
195
+
196
+ ## Output Structure
197
+
198
+ ```
199
+ docs/plans/{feature-name}/
200
+ ├── requirements.md
201
+ ├── user-stories.md
202
+ ├── ui-references/
203
+ │ ├── figma-notes.md
204
+ │ └── screenshots/
205
+ ├── validation-report.md
206
+ └── implementation-plan.md
207
+ ```
208
+
209
+ ## Common Mistakes
210
+
211
+ - **Skipping user stories** — jumping straight from requirements to code. Always convert to user stories first.
212
+ - **Not pausing for UI** — continuing without UI reference when stories involve UI changes. Always pause and ask.
213
+ - **Ignoring skill matching** — not checking for relevant project/community skills before planning. Always run the 5-level lookup.
214
+ - **Skipping requirement validation** — going straight from plan to code without verifying coverage. Always run the traceability check and pause for developer confirmation.
215
+ - **Wrong parallelism** — running `code:refactor` tasks in parallel. Refactoring is always serial.
@@ -1,114 +1,114 @@
1
- # 需求符合性校验规范
2
-
3
- > 在技术设计完成后、代码实现前,逐条校验设计方案是否完整覆盖产品需求。
4
-
5
- ---
6
-
7
- ## 校验时机
8
-
9
- ```
10
- ③ 技术设计 → ④ 技能匹配 → ⑤ 最佳实践 → 【⑥ 需求符合性校验】 → ⑦ 代码实现
11
- ```
12
-
13
- 校验通过后方可进入代码实现阶段。校验不通过则回退到技术设计阶段修正。
14
-
15
- ## 校验输入
16
-
17
- | 输入 | 来源 |
18
- |------|------|
19
- | 原始需求 | `requirements.md` |
20
- | 用户故事 + 验收标准 | `user-stories.md` |
21
- | 技术设计方案 | `design.md` |
22
- | 任务列表 | `tasks.md` |
23
-
24
- ## 校验流程
25
-
26
- ### Step 1: 构建需求追踪矩阵
27
-
28
- 逐条提取需求点,建立需求 → 用户故事 → 设计 → 任务的映射关系:
29
-
30
- ```markdown
31
- | # | 需求点 | 用户故事 | 设计章节 | 实现任务 | 状态 |
32
- |---|--------|---------|---------|---------|------|
33
- | R1 | 用户可通过手机号登录 | US-1 | 3.1 认证模块 | Task-1, Task-2 | ✅ 覆盖 |
34
- | R2 | 登录失败锁定账户 | US-2 | 3.1 认证模块 | Task-3 | ✅ 覆盖 |
35
- | R3 | 支持第三方 OAuth | — | — | — | ❌ 未覆盖 |
36
- ```
37
-
38
- ### Step 2: 逐项校验
39
-
40
- 对每个需求点检查以下 5 项:
41
-
42
- | 校验项 | 说明 | 判定标准 |
43
- |--------|------|---------|
44
- | **故事覆盖** | 需求点是否有对应的用户故事 | 每个需求点至少映射到 1 个 US |
45
- | **验收标准完整** | 用户故事的 AC 是否可验证 | AC 使用 Given/When/Then,无模糊描述 |
46
- | **设计落地** | 设计方案是否包含该需求的技术实现 | design.md 中有对应章节或说明 |
47
- | **任务分解** | 是否有具体的实现任务 | tasks.md 中有对应的 task 条目 |
48
- | **边界覆盖** | 异常流、边界条件是否考虑 | AC 中包含异常场景或设计中有错误处理说明 |
49
-
50
- ### Step 3: 输出校验报告
51
-
52
- 生成 `validation-report.md`,保存到 `docs/plans/{feature-name}/` 目录:
53
-
54
- ```markdown
55
- # 需求符合性校验报告
56
-
57
- ## 基本信息
58
- - 需求来源: [ONES/Jira/GitHub] #[ID]
59
- - 校验时间: [timestamp]
60
- - 校验结果: ✅ 通过 / ❌ 不通过
61
-
62
- ## 追踪矩阵
63
- | # | 需求点 | US | 设计 | 任务 | 状态 |
64
- |---|--------|----|------|------|------|
65
- | R1 | ... | US-1 | §3.1 | T-1 | ✅ |
66
-
67
- ## 覆盖统计
68
- - 需求总数: N
69
- - 已覆盖: X (X/N)
70
- - 未覆盖: Y
71
- - 部分覆盖: Z
72
-
73
- ## 未覆盖项
74
- | # | 需求点 | 缺失环节 | 建议处理方式 |
75
- |---|--------|---------|------------|
76
- | R3 | 支持第三方 OAuth | 无用户故事、无设计 | 补充 US 和设计,或与产品确认是否本期实现 |
77
-
78
- ## 风险项
79
- | # | 需求点 | 风险描述 | 建议 |
80
- |---|--------|---------|------|
81
- | R2 | 登录失败锁定 | AC 未定义锁定阈值和解锁方式 | 与产品确认具体规则 |
82
-
83
- ## 结论
84
- [通过/不通过,及后续行动]
85
- ```
86
-
87
- ## 校验判定规则
88
-
89
- | 结果 | 条件 | 后续动作 |
90
- |------|------|---------|
91
- | ✅ 通过 | 所有需求点均已覆盖,无高风险项 | 进入 ⑦ 代码实现 |
92
- | ⚠️ 有条件通过 | 覆盖率 ≥ 90%,未覆盖项为低优先级且已标记 | 与开发者确认后进入实现,未覆盖项记入 backlog |
93
- | ❌ 不通过 | 存在未覆盖的核心需求,或高风险项未解决 | 回退到 ③ 技术设计,补充后重新校验 |
94
-
95
- ## 暂停点
96
-
97
- 校验完成后 **必须暂停**,将校验报告呈现给开发者:
98
-
99
- - 如果通过:展示摘要,确认后继续
100
- - 如果不通过:展示未覆盖项和风险项,等待开发者决策(补充设计 / 与产品沟通 / 标记为后续迭代)
101
-
102
- ## 常见遗漏模式
103
-
104
- 以下是容易被忽略的需求类型,校验时需特别关注:
105
-
106
- | 类型 | 示例 |
107
- |------|------|
108
- | 权限控制 | "仅管理员可操作" — 是否有权限校验设计 |
109
- | 数据校验 | "手机号格式校验" — 前后端是否都有校验 |
110
- | 并发/竞态 | "库存扣减" — 是否考虑并发安全 |
111
- | 性能要求 | "列表页 1s 内加载" — 是否有分页/缓存设计 |
112
- | 兼容性 | "支持 IE11" — 是否影响技术选型 |
113
- | 国际化 | "支持中英文" — 是否有 i18n 方案 |
114
- | 无障碍 | "键盘可操作" — 是否有 a11y 设计 |
1
+ # 需求符合性校验规范
2
+
3
+ > 在技术设计完成后、代码实现前,逐条校验设计方案是否完整覆盖产品需求。
4
+
5
+ ---
6
+
7
+ ## 校验时机
8
+
9
+ ```
10
+ ③ 技术设计 → ④ 技能匹配 → ⑤ 最佳实践 → 【⑥ 需求符合性校验】 → ⑦ 代码实现
11
+ ```
12
+
13
+ 校验通过后方可进入代码实现阶段。校验不通过则回退到技术设计阶段修正。
14
+
15
+ ## 校验输入
16
+
17
+ | 输入 | 来源 |
18
+ |------|------|
19
+ | 原始需求 | `requirements.md` |
20
+ | 用户故事 + 验收标准 | `user-stories.md` |
21
+ | 技术设计方案 | `design.md` |
22
+ | 任务列表 | `tasks.md` |
23
+
24
+ ## 校验流程
25
+
26
+ ### Step 1: 构建需求追踪矩阵
27
+
28
+ 逐条提取需求点,建立需求 → 用户故事 → 设计 → 任务的映射关系:
29
+
30
+ ```markdown
31
+ | # | 需求点 | 用户故事 | 设计章节 | 实现任务 | 状态 |
32
+ |---|--------|---------|---------|---------|------|
33
+ | R1 | 用户可通过手机号登录 | US-1 | 3.1 认证模块 | Task-1, Task-2 | ✅ 覆盖 |
34
+ | R2 | 登录失败锁定账户 | US-2 | 3.1 认证模块 | Task-3 | ✅ 覆盖 |
35
+ | R3 | 支持第三方 OAuth | — | — | — | ❌ 未覆盖 |
36
+ ```
37
+
38
+ ### Step 2: 逐项校验
39
+
40
+ 对每个需求点检查以下 5 项:
41
+
42
+ | 校验项 | 说明 | 判定标准 |
43
+ |--------|------|---------|
44
+ | **故事覆盖** | 需求点是否有对应的用户故事 | 每个需求点至少映射到 1 个 US |
45
+ | **验收标准完整** | 用户故事的 AC 是否可验证 | AC 使用 Given/When/Then,无模糊描述 |
46
+ | **设计落地** | 设计方案是否包含该需求的技术实现 | design.md 中有对应章节或说明 |
47
+ | **任务分解** | 是否有具体的实现任务 | tasks.md 中有对应的 task 条目 |
48
+ | **边界覆盖** | 异常流、边界条件是否考虑 | AC 中包含异常场景或设计中有错误处理说明 |
49
+
50
+ ### Step 3: 输出校验报告
51
+
52
+ 生成 `validation-report.md`,保存到 `docs/plans/{feature-name}/` 目录:
53
+
54
+ ```markdown
55
+ # 需求符合性校验报告
56
+
57
+ ## 基本信息
58
+ - 需求来源: [ONES/Jira/GitHub] #[ID]
59
+ - 校验时间: [timestamp]
60
+ - 校验结果: ✅ 通过 / ❌ 不通过
61
+
62
+ ## 追踪矩阵
63
+ | # | 需求点 | US | 设计 | 任务 | 状态 |
64
+ |---|--------|----|------|------|------|
65
+ | R1 | ... | US-1 | §3.1 | T-1 | ✅ |
66
+
67
+ ## 覆盖统计
68
+ - 需求总数: N
69
+ - 已覆盖: X (X/N)
70
+ - 未覆盖: Y
71
+ - 部分覆盖: Z
72
+
73
+ ## 未覆盖项
74
+ | # | 需求点 | 缺失环节 | 建议处理方式 |
75
+ |---|--------|---------|------------|
76
+ | R3 | 支持第三方 OAuth | 无用户故事、无设计 | 补充 US 和设计,或与产品确认是否本期实现 |
77
+
78
+ ## 风险项
79
+ | # | 需求点 | 风险描述 | 建议 |
80
+ |---|--------|---------|------|
81
+ | R2 | 登录失败锁定 | AC 未定义锁定阈值和解锁方式 | 与产品确认具体规则 |
82
+
83
+ ## 结论
84
+ [通过/不通过,及后续行动]
85
+ ```
86
+
87
+ ## 校验判定规则
88
+
89
+ | 结果 | 条件 | 后续动作 |
90
+ |------|------|---------|
91
+ | ✅ 通过 | 所有需求点均已覆盖,无高风险项 | 进入 ⑦ 代码实现 |
92
+ | ⚠️ 有条件通过 | 覆盖率 ≥ 90%,未覆盖项为低优先级且已标记 | 与开发者确认后进入实现,未覆盖项记入 backlog |
93
+ | ❌ 不通过 | 存在未覆盖的核心需求,或高风险项未解决 | 回退到 ③ 技术设计,补充后重新校验 |
94
+
95
+ ## 暂停点
96
+
97
+ 校验完成后 **必须暂停**,将校验报告呈现给开发者:
98
+
99
+ - 如果通过:展示摘要,确认后继续
100
+ - 如果不通过:展示未覆盖项和风险项,等待开发者决策(补充设计 / 与产品沟通 / 标记为后续迭代)
101
+
102
+ ## 常见遗漏模式
103
+
104
+ 以下是容易被忽略的需求类型,校验时需特别关注:
105
+
106
+ | 类型 | 示例 |
107
+ |------|------|
108
+ | 权限控制 | "仅管理员可操作" — 是否有权限校验设计 |
109
+ | 数据校验 | "手机号格式校验" — 前后端是否都有校验 |
110
+ | 并发/竞态 | "库存扣减" — 是否考虑并发安全 |
111
+ | 性能要求 | "列表页 1s 内加载" — 是否有分页/缓存设计 |
112
+ | 兼容性 | "支持 IE11" — 是否影响技术选型 |
113
+ | 国际化 | "支持中英文" — 是否有 i18n 方案 |
114
+ | 无障碍 | "键盘可操作" — 是否有 a11y 设计 |