ai-workflow-init 6.4.2 → 6.6.0
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.
- package/.claude/agents/requirement-ba.md +203 -0
- package/.claude/agents/requirement-researcher.md +270 -0
- package/.claude/agents/requirement-sa.md +259 -0
- package/.claude/agents/requirement-uiux.md +349 -0
- package/.claude/commands/beads-breakdown.md +278 -0
- package/.claude/commands/beads-create-epic-plan.md +205 -0
- package/.claude/commands/beads-done.md +248 -0
- package/.claude/commands/beads-next.md +260 -0
- package/.claude/commands/beads-status.md +247 -0
- package/.claude/commands/clarify-requirements.md +445 -192
- package/.claude/commands/create-plan.md +79 -2
- package/.claude/commands/execute-plan.md +48 -2
- package/.claude/settings.json +3 -3
- package/.claude/skills/skill-creator/SKILL.md +355 -0
- package/.claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/README.md +97 -3
- package/cli.js +21 -1
- package/docs/ai/planning/epic-template.md +155 -0
- package/docs/ai/planning/feature-template.md +19 -0
- package/docs/ai/requirements/req-template.md +164 -58
- package/docs/ai/requirements/templates/ba-template.md +151 -0
- package/docs/ai/requirements/templates/research-template.md +190 -0
- package/docs/ai/requirements/templates/sa-template.md +184 -0
- package/docs/ai/requirements/templates/uiux-template.md +325 -0
- package/package.json +1 -1
|
@@ -1,287 +1,540 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clarify-requirements
|
|
3
|
-
description:
|
|
3
|
+
description: Requirement Orchestrator - Coordinates BA, SA, Researcher, and UI/UX agents to produce comprehensive requirements.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Goal
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Orchestrate requirement gathering through specialized agents to produce a comprehensive requirement document at `docs/ai/requirements/req-{name}.md`.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This command coordinates:
|
|
11
|
+
- **BA Agent**: Business analysis, user stories, functional requirements
|
|
12
|
+
- **SA Agent**: Technical feasibility, architecture recommendations
|
|
13
|
+
- **Researcher Agent**: Domain terminology, external research (conditional)
|
|
14
|
+
- **UI/UX Agent**: Wireframes, screen flows (conditional)
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
- Business logic is unclear or needs detailed specification
|
|
14
|
-
- Design decisions need to be documented before planning
|
|
15
|
-
- Stakeholder input needs to be captured and organized
|
|
16
|
+
---
|
|
16
17
|
|
|
17
18
|
## Workflow Alignment
|
|
18
19
|
|
|
19
20
|
- Provide brief status updates (1–3 sentences) before/after important actions.
|
|
20
21
|
- For medium/large tasks, create todos (≤14 words, verb-led). Keep only one `in_progress` item.
|
|
21
22
|
- Update todos immediately after progress; mark completed upon finish.
|
|
23
|
+
- Run agents in parallel where possible to optimize performance.
|
|
22
24
|
|
|
23
25
|
---
|
|
24
26
|
|
|
25
|
-
## Step
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
- Mode: "new" | "update" | "review"
|
|
27
|
+
## Step 0: Pre-flight Check
|
|
28
|
+
|
|
29
|
+
### Check for Existing Requirement
|
|
30
|
+
|
|
31
|
+
**If user mentions existing requirement doc:**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Read(file_path="docs/ai/requirements/req-{name}.md")
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Ask user:**
|
|
38
|
+
```
|
|
39
|
+
AskUserQuestion(questions=[{
|
|
40
|
+
question: "Found existing requirement doc. What would you like to do?",
|
|
41
|
+
header: "Mode",
|
|
42
|
+
options: [
|
|
43
|
+
{ label: "Update existing", description: "Enhance with new agents, fill gaps" },
|
|
44
|
+
{ label: "Start fresh", description: "Archive current, create new" },
|
|
45
|
+
{ label: "Review only", description: "Show current state, identify gaps" }
|
|
46
|
+
],
|
|
47
|
+
multiSelect: false
|
|
48
|
+
}])
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- **Update**: Load existing, identify what's missing, run relevant agents
|
|
52
|
+
- **Fresh**: Backup to `archive/`, start from scratch
|
|
53
|
+
- **Review**: Display summary, suggest next steps
|
|
53
54
|
|
|
54
55
|
---
|
|
55
56
|
|
|
56
|
-
## Step
|
|
57
|
+
## Step 1: Analyze User Prompt
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
### Parse Request
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
Analyze user prompt to determine:
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
| Aspect | Detection Method | Output |
|
|
64
|
+
|--------|------------------|--------|
|
|
65
|
+
| **Feature Type** | Keywords: UI, API, page, endpoint, database | `UI` / `API` / `Data` / `Full-stack` |
|
|
66
|
+
| **Complexity** | Scope indicators, number of features | `Simple` / `Medium` / `Complex` |
|
|
67
|
+
| **Domain Terms** | Industry jargon, unfamiliar terms | List of terms needing research |
|
|
68
|
+
| **UI Components** | Mentions of screens, forms, flows | Boolean: needs UI/UX |
|
|
69
|
+
| **Clarity Level** | How specific is the request | `Clear` / `Vague` / `Very Vague` |
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
- **Feature type** from Step 1
|
|
66
|
-
- **Previous answers** collected
|
|
71
|
+
### Determine Agent Strategy
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
| Feature Type | Skip Rounds |
|
|
70
|
-
|--------------|-------------|
|
|
71
|
-
| Backend-only / API | Round 2 (User Flows) if no UI |
|
|
72
|
-
| Data processing | Round 4 (Edge Cases) → ask minimal |
|
|
73
|
-
| Simple CRUD | Round 3 (Business Rules) if straightforward |
|
|
74
|
-
| UI-only | Round 5 (Performance/Security) → ask minimal |
|
|
73
|
+
Based on analysis:
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
| Scenario | Agents to Run | Execution |
|
|
76
|
+
|----------|---------------|-----------|
|
|
77
|
+
| Simple API feature | BA → SA | Sequential |
|
|
78
|
+
| Complex API feature | BA → SA | Sequential |
|
|
79
|
+
| Simple UI feature | BA + SA (parallel) → UI/UX | Mixed |
|
|
80
|
+
| Complex full-stack | BA → SA → UI/UX | Sequential |
|
|
81
|
+
| Domain-specific | BA + Researcher (parallel) → SA → UI/UX | Mixed |
|
|
82
|
+
| Very vague request | BA only first | Single, then reassess |
|
|
78
83
|
|
|
79
|
-
|
|
84
|
+
### Decision Output
|
|
80
85
|
|
|
81
|
-
|
|
86
|
+
```markdown
|
|
87
|
+
## Prompt Analysis
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
**Feature**: {derived name}
|
|
90
|
+
**Type**: {UI / API / Full-stack / Data}
|
|
91
|
+
**Complexity**: {Simple / Medium / Complex}
|
|
92
|
+
**Clarity**: {Clear / Vague / Very Vague}
|
|
84
93
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
**Agents Required**:
|
|
95
|
+
- [x] BA Agent (always)
|
|
96
|
+
- [x] SA Agent (always)
|
|
97
|
+
- [ ] Researcher Agent (domain terms detected: {list})
|
|
98
|
+
- [ ] UI/UX Agent (UI components needed)
|
|
89
99
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
**Execution Plan**:
|
|
101
|
+
1. {Step 1}
|
|
102
|
+
2. {Step 2}
|
|
103
|
+
...
|
|
104
|
+
```
|
|
94
105
|
|
|
95
|
-
|
|
96
|
-
7. **Business Rules**: What rules govern the behavior?
|
|
97
|
-
8. **Calculations/Logic**: Any specific formulas or logic?
|
|
98
|
-
9. **Validations**: What validations are needed?
|
|
106
|
+
---
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
10. **Edge Cases**: What happens in unusual situations?
|
|
102
|
-
11. **Error Handling**: How should errors be handled?
|
|
103
|
-
12. **Constraints**: Technical, business, or time limitations?
|
|
108
|
+
## Step 2: Execute BA Agent
|
|
104
109
|
|
|
105
|
-
|
|
106
|
-
13. **Performance**: Any performance requirements? *(Skip if UI-only)*
|
|
107
|
-
14. **Security**: Authentication, authorization, data protection?
|
|
108
|
-
15. **Out of Scope**: What is explicitly NOT included?
|
|
110
|
+
**Always runs first (or parallel with Researcher if domain terms detected)**
|
|
109
111
|
|
|
112
|
+
### Invoke BA Agent
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
Task(
|
|
116
|
+
subagent_type='general-purpose',
|
|
117
|
+
description='BA requirement analysis',
|
|
118
|
+
prompt="Read agent definition: .claude/agents/requirement-ba.md
|
|
119
|
+
|
|
120
|
+
Execute the BA Agent workflow for feature: {feature-name}
|
|
121
|
+
|
|
122
|
+
User's original request:
|
|
123
|
+
---
|
|
124
|
+
{user prompt}
|
|
110
125
|
---
|
|
111
126
|
|
|
112
|
-
|
|
113
|
-
- Use AskUserQuestion with 2-4 options per question
|
|
114
|
-
- Include "I need to think about this" option for complex questions
|
|
115
|
-
- Allow multi-select where appropriate
|
|
127
|
+
Output to: docs/ai/requirements/agents/ba-{name}.md
|
|
116
128
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
Follow all steps in the agent definition. Use AskUserQuestion for Q&A rounds."
|
|
130
|
+
)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### BA Completion Check
|
|
134
|
+
|
|
135
|
+
After BA completes, verify output exists:
|
|
136
|
+
- `docs/ai/requirements/agents/ba-{name}.md`
|
|
137
|
+
|
|
138
|
+
Extract key info for next agents:
|
|
139
|
+
- Feature type confirmed
|
|
140
|
+
- User stories
|
|
141
|
+
- Functional requirements
|
|
142
|
+
- Domain terms (if any discovered)
|
|
122
143
|
|
|
123
144
|
---
|
|
124
145
|
|
|
125
|
-
## Step 3:
|
|
146
|
+
## Step 3: Execute Parallel Agents (Conditional)
|
|
147
|
+
|
|
148
|
+
Based on Step 1 analysis, run applicable agents in parallel.
|
|
149
|
+
|
|
150
|
+
### 3a: Researcher Agent (if domain terms detected)
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
Task(
|
|
154
|
+
subagent_type='general-purpose',
|
|
155
|
+
description='Domain research',
|
|
156
|
+
prompt="Read agent definition: .claude/agents/requirement-researcher.md
|
|
157
|
+
|
|
158
|
+
Research the following terms/concepts for feature: {feature-name}
|
|
159
|
+
|
|
160
|
+
Terms to research:
|
|
161
|
+
- {term 1}
|
|
162
|
+
- {term 2}
|
|
163
|
+
- {term 3}
|
|
164
|
+
|
|
165
|
+
Context from BA document: docs/ai/requirements/agents/ba-{name}.md
|
|
166
|
+
|
|
167
|
+
Output to: docs/ai/requirements/agents/research-{name}.md
|
|
168
|
+
|
|
169
|
+
Follow all steps in the agent definition.",
|
|
170
|
+
run_in_background: true
|
|
171
|
+
)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 3b: SA Agent (always)
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
Task(
|
|
178
|
+
subagent_type='general-purpose',
|
|
179
|
+
description='Solution architecture',
|
|
180
|
+
prompt="Read agent definition: .claude/agents/requirement-sa.md
|
|
181
|
+
|
|
182
|
+
Perform technical feasibility assessment for feature: {feature-name}
|
|
183
|
+
|
|
184
|
+
BA document: docs/ai/requirements/agents/ba-{name}.md
|
|
126
185
|
|
|
127
|
-
|
|
186
|
+
Read project standards:
|
|
187
|
+
- docs/ai/project/CODE_CONVENTIONS.md
|
|
188
|
+
- docs/ai/project/PROJECT_STRUCTURE.md
|
|
189
|
+
|
|
190
|
+
Output to: docs/ai/requirements/agents/sa-{name}.md
|
|
191
|
+
|
|
192
|
+
Follow all steps in the agent definition.",
|
|
193
|
+
run_in_background: true
|
|
194
|
+
)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Wait for Parallel Agents
|
|
198
|
+
|
|
199
|
+
If running in background, use TaskOutput to collect results:
|
|
128
200
|
|
|
129
201
|
```
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|---|----------|--------|----------|
|
|
133
|
-
| 1 | {question} | {answer} | {FR/BR/NFR/Edge} |
|
|
202
|
+
TaskOutput(task_id={researcher_task_id}, block=true)
|
|
203
|
+
TaskOutput(task_id={sa_task_id}, block=true)
|
|
134
204
|
```
|
|
135
205
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Step 4: Execute UI/UX Agent (Conditional)
|
|
209
|
+
|
|
210
|
+
**Only if UI components are needed (detected in Step 1)**
|
|
211
|
+
|
|
212
|
+
### Check if Needed
|
|
213
|
+
|
|
214
|
+
UI/UX Agent is needed if:
|
|
215
|
+
- Feature type is `UI` or `Full-stack`
|
|
216
|
+
- BA document mentions screens, forms, pages, dashboards
|
|
217
|
+
- User explicitly mentioned UI/UX in request
|
|
143
218
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
219
|
+
### Invoke UI/UX Agent
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
Task(
|
|
223
|
+
subagent_type='general-purpose',
|
|
224
|
+
description='UI/UX design',
|
|
225
|
+
prompt="Read agent definition: .claude/agents/requirement-uiux.md
|
|
226
|
+
|
|
227
|
+
Design UI/UX for feature: {feature-name}
|
|
228
|
+
|
|
229
|
+
BA document: docs/ai/requirements/agents/ba-{name}.md
|
|
230
|
+
SA document: docs/ai/requirements/agents/sa-{name}.md (for constraints)
|
|
231
|
+
|
|
232
|
+
Output to: docs/ai/requirements/agents/uiux-{name}.md
|
|
233
|
+
|
|
234
|
+
Follow all steps in the agent definition."
|
|
235
|
+
)
|
|
236
|
+
```
|
|
147
237
|
|
|
148
238
|
---
|
|
149
239
|
|
|
150
|
-
## Step
|
|
240
|
+
## Step 5: Resolve Conflicts (If Any)
|
|
151
241
|
|
|
152
|
-
|
|
242
|
+
### Check for Conflicts
|
|
153
243
|
|
|
154
|
-
|
|
244
|
+
Compare agent outputs for inconsistencies:
|
|
155
245
|
|
|
156
|
-
|
|
246
|
+
| Conflict Type | Detection | Resolution |
|
|
247
|
+
|---------------|-----------|------------|
|
|
248
|
+
| **Feasibility** | SA says not feasible, BA has as must-have | Ask user to adjust priority or scope |
|
|
249
|
+
| **Technical** | SA recommends X, research shows Y is standard | Present both, let user decide |
|
|
250
|
+
| **Scope** | Agents produced different scope understanding | Clarify with user |
|
|
157
251
|
|
|
158
|
-
|
|
159
|
-
1. Read the template file to understand the required structure and format
|
|
160
|
-
2. Use the template as the baseline - follow its section order and formatting exactly
|
|
161
|
-
3. Fill in sections with data collected from Q&A rounds
|
|
162
|
-
4. For optional sections with no data collected → remove the section entirely (don't leave placeholders)
|
|
163
|
-
5. Keep required sections even if minimal data (Problem Statement, Functional Requirements, Acceptance Criteria)
|
|
252
|
+
### Conflict Resolution
|
|
164
253
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
| 10. References | User-provided links |
|
|
178
|
-
| 11. Glossary | Domain terms collected (TERM category) |
|
|
254
|
+
```
|
|
255
|
+
AskUserQuestion(questions=[{
|
|
256
|
+
question: "Conflict detected: {describe conflict}. How should we proceed?",
|
|
257
|
+
header: "Resolve",
|
|
258
|
+
options: [
|
|
259
|
+
{ label: "{Option A}", description: "{Explanation}" },
|
|
260
|
+
{ label: "{Option B}", description: "{Explanation}" },
|
|
261
|
+
{ label: "Discuss further", description: "Need more context" }
|
|
262
|
+
],
|
|
263
|
+
multiSelect: false
|
|
264
|
+
}])
|
|
265
|
+
```
|
|
179
266
|
|
|
180
|
-
|
|
267
|
+
---
|
|
181
268
|
|
|
182
|
-
|
|
183
|
-
- Derive `req-{name}` from feature description (kebab-case, concise)
|
|
184
|
-
- Example: "User Authentication Flow" → `req-user-authentication`
|
|
269
|
+
## Step 6: Consolidate Final Requirement
|
|
185
270
|
|
|
186
|
-
|
|
187
|
-
1. **Backup existing file** to archive folder:
|
|
188
|
-
```
|
|
189
|
-
docs/ai/requirements/archive/req-{name}_{timestamp}.md
|
|
190
|
-
```
|
|
191
|
-
- Timestamp format: `YYYYMMDD-HHMMSS`
|
|
192
|
-
- Example: `archive/req-user-authentication_20250115-143022.md`
|
|
271
|
+
### Read Template
|
|
193
272
|
|
|
194
|
-
|
|
273
|
+
```
|
|
274
|
+
Read(file_path="docs/ai/requirements/req-template.md")
|
|
275
|
+
```
|
|
195
276
|
|
|
196
|
-
|
|
197
|
-
> "Previous version backed up to `archive/req-{name}_{timestamp}.md`"
|
|
277
|
+
### Gather All Agent Outputs
|
|
198
278
|
|
|
199
|
-
**Create archive folder if not exists:**
|
|
200
|
-
```bash
|
|
201
|
-
mkdir -p docs/ai/requirements/archive
|
|
202
279
|
```
|
|
280
|
+
Read(file_path="docs/ai/requirements/agents/ba-{name}.md")
|
|
281
|
+
Read(file_path="docs/ai/requirements/agents/sa-{name}.md")
|
|
282
|
+
Read(file_path="docs/ai/requirements/agents/research-{name}.md") # if exists
|
|
283
|
+
Read(file_path="docs/ai/requirements/agents/uiux-{name}.md") # if exists
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Generate Consolidated Document
|
|
287
|
+
|
|
288
|
+
Create `docs/ai/requirements/req-{name}.md` with:
|
|
289
|
+
|
|
290
|
+
```markdown
|
|
291
|
+
# Requirement: {Feature Name}
|
|
292
|
+
|
|
293
|
+
> Generated: {YYYY-MM-DD}
|
|
294
|
+
> Status: Draft | Review | Approved
|
|
295
|
+
> Complexity: {Low / Medium / High}
|
|
296
|
+
|
|
297
|
+
## Quick Links
|
|
298
|
+
|
|
299
|
+
| Document | Status |
|
|
300
|
+
|----------|--------|
|
|
301
|
+
| [BA Analysis](agents/ba-{name}.md) | ✅ Complete |
|
|
302
|
+
| [SA Assessment](agents/sa-{name}.md) | ✅ Complete |
|
|
303
|
+
| [Domain Research](agents/research-{name}.md) | {✅ Complete / ⏭️ Skipped} |
|
|
304
|
+
| [UI/UX Design](agents/uiux-{name}.md) | {✅ Complete / ⏭️ Skipped} |
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## 1. Executive Summary
|
|
309
|
+
|
|
310
|
+
{Synthesized from all agents - 3-5 sentences covering what, why, how}
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 2. Problem Statement
|
|
315
|
+
|
|
316
|
+
{From BA document}
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 3. Users & User Stories
|
|
321
|
+
|
|
322
|
+
{From BA document - consolidated user stories table}
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## 4. Functional Requirements
|
|
327
|
+
|
|
328
|
+
{From BA document - FR table}
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## 5. Business Rules
|
|
333
|
+
|
|
334
|
+
{From BA document - BR table}
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 6. Technical Assessment
|
|
339
|
+
|
|
340
|
+
### Feasibility
|
|
341
|
+
{From SA document - feasibility summary}
|
|
342
|
+
|
|
343
|
+
### Recommended Architecture
|
|
344
|
+
{From SA document - key architecture decisions}
|
|
345
|
+
|
|
346
|
+
### Technology Stack
|
|
347
|
+
{From SA document - stack table}
|
|
348
|
+
|
|
349
|
+
### Risks
|
|
350
|
+
{From SA document - risk table}
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## 7. UI/UX Design (if applicable)
|
|
355
|
+
|
|
356
|
+
### Screen Inventory
|
|
357
|
+
{From UI/UX document}
|
|
358
|
+
|
|
359
|
+
### Key Wireframes
|
|
360
|
+
{From UI/UX document - main screens only}
|
|
361
|
+
|
|
362
|
+
### User Flows
|
|
363
|
+
{From UI/UX document - flow diagrams}
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## 8. Domain Context (if applicable)
|
|
368
|
+
|
|
369
|
+
### Glossary
|
|
370
|
+
{From Research document - key terms}
|
|
371
|
+
|
|
372
|
+
### Compliance & Standards
|
|
373
|
+
{From Research document - relevant standards}
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## 9. Implementation Guidance
|
|
378
|
+
|
|
379
|
+
### Suggested Phases
|
|
380
|
+
{From SA document}
|
|
381
|
+
|
|
382
|
+
### Dependencies
|
|
383
|
+
{From BA + SA documents}
|
|
203
384
|
|
|
204
385
|
---
|
|
205
386
|
|
|
206
|
-
|
|
387
|
+
## 10. Out of Scope
|
|
388
|
+
|
|
389
|
+
{From BA document}
|
|
207
390
|
|
|
208
|
-
|
|
209
|
-
2. **User Stories**: Derived from users + functionality
|
|
210
|
-
3. **Business Rules**: From Round 3
|
|
211
|
-
4. **Functional Requirements**: From Rounds 2-3, prioritized
|
|
212
|
-
5. **Non-Functional Requirements**: From Round 5
|
|
213
|
-
6. **Edge Cases & Constraints**: From Round 4
|
|
214
|
-
7. **Clarifications Log**: Complete Q&A history
|
|
215
|
-
8. **Out of Scope**: Explicit exclusions
|
|
216
|
-
9. **Acceptance Criteria**: Derived from requirements (Given/When/Then)
|
|
217
|
-
10. **References**: Links to related docs
|
|
218
|
-
11. **Glossary**: Domain-specific terms *(only if terms were collected)*
|
|
391
|
+
---
|
|
219
392
|
|
|
220
|
-
|
|
221
|
-
|
|
393
|
+
## 11. Open Questions
|
|
394
|
+
|
|
395
|
+
{Consolidated from all agents}
|
|
222
396
|
|
|
223
397
|
---
|
|
224
398
|
|
|
225
|
-
##
|
|
399
|
+
## 12. Acceptance Criteria
|
|
400
|
+
|
|
401
|
+
{Derived from FRs - Given/When/Then format}
|
|
226
402
|
|
|
227
|
-
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Next Steps
|
|
228
406
|
|
|
407
|
+
1. Review this requirement document
|
|
408
|
+
2. Run `/create-plan req-{name}` to generate implementation plan
|
|
409
|
+
3. Address open questions before implementation
|
|
229
410
|
```
|
|
411
|
+
|
|
412
|
+
### File Naming & Versioning
|
|
413
|
+
|
|
414
|
+
**Auto-name requirement:**
|
|
415
|
+
- Derive `req-{name}` from feature (kebab-case, concise)
|
|
416
|
+
- Example: "User Authentication Flow" → `req-user-authentication`
|
|
417
|
+
|
|
418
|
+
**If file already exists:**
|
|
419
|
+
1. Backup to `docs/ai/requirements/archive/req-{name}_{timestamp}.md`
|
|
420
|
+
2. Overwrite main file
|
|
421
|
+
3. Notify user of backup
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## Step 7: Summary & Next Steps
|
|
426
|
+
|
|
427
|
+
### Present Summary
|
|
428
|
+
|
|
429
|
+
```markdown
|
|
230
430
|
## Requirement Document Created
|
|
231
431
|
|
|
232
|
-
**File
|
|
233
|
-
{If backup created: **Previous version:** archive/req-{name}_{timestamp}.md}
|
|
432
|
+
**File**: docs/ai/requirements/req-{name}.md
|
|
234
433
|
|
|
235
|
-
###
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
|
|
434
|
+
### Agents Executed
|
|
435
|
+
| Agent | Output | Status |
|
|
436
|
+
|-------|--------|--------|
|
|
437
|
+
| BA | ba-{name}.md | ✅ Complete |
|
|
438
|
+
| SA | sa-{name}.md | ✅ Complete |
|
|
439
|
+
| Researcher | research-{name}.md | {✅ / ⏭️ Skipped} |
|
|
440
|
+
| UI/UX | uiux-{name}.md | {✅ / ⏭️ Skipped} |
|
|
242
441
|
|
|
243
|
-
### Key
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
442
|
+
### Key Findings
|
|
443
|
+
- **Feasibility**: {Feasible / Feasible with changes / Issues}
|
|
444
|
+
- **Complexity**: {Low / Medium / High}
|
|
445
|
+
- **Open Questions**: {count}
|
|
247
446
|
|
|
248
447
|
### Next Steps
|
|
249
|
-
1. Review
|
|
250
|
-
2.
|
|
448
|
+
1. Review requirement: `docs/ai/requirements/req-{name}.md`
|
|
449
|
+
2. Address open questions (if any)
|
|
450
|
+
3. Create plan: `/create-plan` (will auto-link to this requirement)
|
|
251
451
|
```
|
|
252
452
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
453
|
+
### Offer Options
|
|
454
|
+
|
|
455
|
+
```
|
|
456
|
+
AskUserQuestion(questions=[{
|
|
457
|
+
question: "What would you like to do next?",
|
|
458
|
+
header: "Next",
|
|
459
|
+
options: [
|
|
460
|
+
{ label: "View full document", description: "Display the consolidated requirement" },
|
|
461
|
+
{ label: "Create plan", description: "Run /create-plan for this requirement" },
|
|
462
|
+
{ label: "Continue refining", description: "Run more Q&A or agent passes" }
|
|
463
|
+
],
|
|
464
|
+
multiSelect: false
|
|
465
|
+
}])
|
|
466
|
+
```
|
|
257
467
|
|
|
258
468
|
---
|
|
259
469
|
|
|
260
|
-
##
|
|
470
|
+
## Decision Trees
|
|
471
|
+
|
|
472
|
+
### When to Skip Agents
|
|
261
473
|
|
|
262
|
-
|
|
474
|
+
```
|
|
475
|
+
Researcher Agent:
|
|
476
|
+
├── Domain terms detected? ─── Yes ──▶ Run
|
|
477
|
+
└── No ──▶ Skip
|
|
478
|
+
|
|
479
|
+
UI/UX Agent:
|
|
480
|
+
├── Feature type UI or Full-stack? ─── Yes ──▶ Run
|
|
481
|
+
├── BA mentions screens/forms/pages? ─── Yes ──▶ Run
|
|
482
|
+
└── No ──▶ Skip
|
|
483
|
+
```
|
|
263
484
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
485
|
+
### Complexity Escalation
|
|
486
|
+
|
|
487
|
+
```
|
|
488
|
+
Simple (1-2 Q&A rounds):
|
|
489
|
+
└── Consider: "This seems straightforward. Proceed with full agent workflow or quick mode?"
|
|
490
|
+
|
|
491
|
+
Complex (many unknowns):
|
|
492
|
+
└── Recommend: "This is complex. Suggest breaking down into smaller requirements."
|
|
493
|
+
```
|
|
267
494
|
|
|
268
495
|
---
|
|
269
496
|
|
|
270
|
-
##
|
|
497
|
+
## Error Handling
|
|
271
498
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
7. **Capture terminology**: Domain terms prevent miscommunication later
|
|
499
|
+
| Error | Action |
|
|
500
|
+
|-------|--------|
|
|
501
|
+
| Agent fails | Retry once, then proceed without that agent's output |
|
|
502
|
+
| Template not found | Use fallback minimal structure |
|
|
503
|
+
| Conflict unresolved | Document as open question, proceed |
|
|
504
|
+
| User abandons Q&A | Save progress, allow resume |
|
|
279
505
|
|
|
280
506
|
---
|
|
281
507
|
|
|
282
508
|
## Notes
|
|
283
509
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
-
|
|
510
|
+
### Agent Output Files
|
|
511
|
+
|
|
512
|
+
All agent outputs are saved in `docs/ai/requirements/agents/`:
|
|
513
|
+
- `ba-{name}.md` - Business Analysis
|
|
514
|
+
- `sa-{name}.md` - Solution Architecture
|
|
515
|
+
- `research-{name}.md` - Domain Research
|
|
516
|
+
- `uiux-{name}.md` - UI/UX Design
|
|
517
|
+
|
|
518
|
+
These provide detailed backup and audit trail for the consolidated `req-{name}.md`.
|
|
519
|
+
|
|
520
|
+
### Integration with Planning
|
|
521
|
+
|
|
522
|
+
The consolidated requirement document is designed to be consumed by `/create-plan`:
|
|
523
|
+
- Section mappings are compatible with planning template
|
|
524
|
+
- Technical assessment informs architecture decisions
|
|
525
|
+
- UI/UX wireframes inform implementation phases
|
|
526
|
+
|
|
527
|
+
### Parallel Execution
|
|
528
|
+
|
|
529
|
+
Maximize parallelism where possible:
|
|
530
|
+
- BA + Researcher can run in parallel (if both needed)
|
|
531
|
+
- SA can start after BA completes (needs BA output)
|
|
532
|
+
- UI/UX can start after SA completes (needs both outputs)
|
|
533
|
+
|
|
534
|
+
Optimal parallel execution for full workflow:
|
|
535
|
+
```
|
|
536
|
+
BA ──────────────┐
|
|
537
|
+
├──▶ SA ──────────┐
|
|
538
|
+
Researcher ──────┘ ├──▶ UI/UX ──▶ Consolidate
|
|
539
|
+
│
|
|
540
|
+
```
|