@comfanion/workflow 4.38.4-dev.0 → 4.39.0-dev.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.
Files changed (38) hide show
  1. package/bin/cli.js +52 -529
  2. package/package.json +1 -1
  3. package/src/build-info.json +2 -2
  4. package/src/opencode/skills/acceptance-criteria/SKILL.md +58 -176
  5. package/src/opencode/skills/architecture-design/SKILL.md +86 -576
  6. package/src/opencode/skills/archiving/SKILL.md +60 -140
  7. package/src/opencode/skills/coding-standards/SKILL.md +113 -434
  8. package/src/opencode/skills/coding-standards/what-to-document.md +512 -0
  9. package/src/opencode/skills/database-design/SKILL.md +94 -778
  10. package/src/opencode/skills/database-design/indexing.md +187 -0
  11. package/src/opencode/skills/database-design/migrations.md +239 -0
  12. package/src/opencode/skills/database-design/schema-design.md +319 -0
  13. package/src/opencode/skills/doc-todo/SKILL.md +35 -27
  14. package/src/opencode/skills/epic-writing/SKILL.md +156 -244
  15. package/src/opencode/skills/epic-writing/template.md +11 -1
  16. package/src/opencode/skills/methodologies/SKILL.md +91 -354
  17. package/src/opencode/skills/methodologies/define.md +336 -0
  18. package/src/opencode/skills/methodologies/diagnose.md +374 -0
  19. package/src/opencode/skills/methodologies/empathize.md +253 -0
  20. package/src/opencode/skills/methodologies/ideate.md +458 -0
  21. package/src/opencode/skills/prd-writing/SKILL.md +162 -366
  22. package/src/opencode/skills/prd-writing/template.md +178 -48
  23. package/src/opencode/skills/requirements-gathering/SKILL.md +102 -117
  24. package/src/opencode/skills/requirements-gathering/template.md +97 -17
  25. package/src/opencode/skills/sprint-planning/SKILL.md +76 -225
  26. package/src/opencode/skills/sprint-planning/template.yaml +8 -0
  27. package/src/opencode/skills/story-writing/SKILL.md +76 -210
  28. package/src/opencode/skills/story-writing/template.md +10 -1
  29. package/src/opencode/skills/test-design/SKILL.md +78 -84
  30. package/src/opencode/skills/test-design/test-strategy.md +279 -0
  31. package/src/opencode/skills/test-design/unit-tests-mocking.md +247 -0
  32. package/src/opencode/skills/test-design/unit-tests-patterns.md +181 -0
  33. package/src/opencode/skills/test-design/unit-tests.md +117 -0
  34. package/src/opencode/skills/unit-writing/SKILL.md +119 -377
  35. package/src/opencode/skills/module-documentation/SKILL.md +0 -224
  36. package/src/opencode/skills/module-documentation/template.md +0 -139
  37. /package/src/opencode/skills/test-design/{template-integration.md → templates/template-integration.md} +0 -0
  38. /package/src/opencode/skills/test-design/{template-module.md → templates/template-module.md} +0 -0
@@ -96,83 +96,196 @@ TaskFlow is a B2B platform for managing distributed teams. The system handles ta
96
96
 
97
97
  ---
98
98
 
99
- ## Product Scope
99
+ ## AI-Specific Considerations (Optional)
100
+
101
+ > **Note:** Only for AI/ML/RAG systems. Skip for traditional applications.
102
+
103
+ ### AI Quality Targets
104
+
105
+ | Metric | MVP Target | Growth Target | Measurement |
106
+ |--------|-----------|---------------|-------------|
107
+ | Accuracy | {{percentage}} | {{percentage}} | {{method}} |
108
+ | Hallucination Rate | < {{threshold}}% | < {{threshold}}% | {{method}} |
109
+ | Response Latency | < {{time}}s (p95) | < {{time}}s (p95) | {{tool}} |
110
+ | Context Relevance | {{percentage}} | {{percentage}} | {{method}} |
111
+
112
+ <!-- Example for RAG system:
113
+ | Metric | MVP Target | Growth Target | Measurement |
114
+ |--------|-----------|---------------|-------------|
115
+ | Accuracy | 85% | 95% | Gold dataset (100 Q&A pairs) |
116
+ | Hallucination Rate | < 5% | < 1% | Manual review + TruLens |
117
+ | Response Latency | < 3s (p95) | < 2s (p95) | APM monitoring |
118
+ | Context Relevance | 80% | 90% | RAG Triad metrics |
119
+ -->
100
120
 
101
- ### MVP — Minimum Viable Product
121
+ ### System Boundaries
122
+
123
+ **What the AI Should Do:**
124
+ - {{capability_1}} — {{description}}
125
+ - {{capability_2}} — {{description}}
126
+ - {{capability_3}} — {{description}}
127
+
128
+ **What the AI Should NOT Do:**
129
+ - {{limitation_1}} — {{reason}}
130
+ - {{limitation_2}} — {{reason}}
131
+ - {{limitation_3}} — {{reason}}
132
+
133
+ <!-- Example for RAG system:
134
+ **What the AI Should Do:**
135
+ - Answer questions about product documentation — Using only official docs as source
136
+ - Provide code examples from docs — With proper attribution and links
137
+ - Cite sources for every answer — Show which doc section was used
138
+ - Admit when information is not available — "I don't have information about that"
139
+
140
+ **What the AI Should NOT Do:**
141
+ - Answer questions outside documentation scope — Redirect to support/community
142
+ - Generate code not present in docs — Risk of hallucinations
143
+ - Provide opinions or recommendations — Stick to factual information only
144
+ - Make assumptions about user's context — Ask clarifying questions
145
+ -->
102
146
 
103
- **{{Domain_1}}:**
104
- - {{capability}}
105
- - {{capability}}
147
+ ### Feedback & Improvement
106
148
 
107
- **{{Domain_2}}:**
108
- - {{capability}}
149
+ **User Feedback Mechanisms:**
150
+ - {{mechanism}} — {{purpose}} — {{how_used}}
151
+ - {{mechanism}} — {{purpose}} — {{how_used}}
109
152
 
110
- ### Growth Features (Post-MVP)
111
- - {{feature}}
153
+ **Model Improvement Process:**
154
+ - {{approach}} — {{frequency}} — {{who_responsible}}
155
+ - {{approach}} — {{frequency}} — {{who_responsible}}
112
156
 
113
- ### Out of Scope
114
- - {{item}}
157
+ <!-- Example:
158
+ **User Feedback Mechanisms:**
159
+ - Thumbs up/down on answers — Track satisfaction, identify problem areas — Weekly review
160
+ - "Report incorrect answer" button — Flag hallucinations — Immediate review queue
161
+ - Copy answer to clipboard — Track which answers are most useful — Monthly analysis
162
+
163
+ **Model Improvement Process:**
164
+ - Weekly review of flagged answers — Update gold dataset — ML team
165
+ - Monthly retraining on updated documentation — Improve accuracy — ML team
166
+ - Quarterly review of system boundaries — Adjust scope — Product team
167
+ -->
115
168
 
116
169
  ---
117
170
 
118
- ## Functional Requirements
171
+ ## Product Scope
119
172
 
120
- > **Traceability:** Each FR tracks Module, Unit, Architecture section, Epic, and Status.
121
- > **Maintained by:** @pm (Epic), @architect (Module/Unit/Arch §), @dev (Status).
173
+ ### MVP Minimum Viable Product
174
+
175
+ **{{Domain_1}}: {{domain_name}}**
176
+
177
+ Core capabilities:
178
+ - {{capability_1}} — {{brief_description}}
179
+ - {{capability_2}} — {{brief_description}}
180
+ - {{capability_3}} — {{brief_description}}
181
+
182
+ Key user flows:
183
+ 1. **{{flow_name}}:** {{user_action}} → {{system_response}} → {{outcome}}
184
+ 2. **{{flow_name}}:** {{user_action}} → {{system_response}} → {{outcome}}
122
185
 
123
- ### {{Domain_1}}
186
+ **{{Domain_2}}: {{domain_name}}**
124
187
 
125
- | ID | Requirement | Priority | Module | Doc Section | Arch § | Epic | Status |
126
- |----|-------------|----------|--------|-------------|--------|------|--------|
127
- | FR-001 | {{requirement}} | P0 | {{module}} | → Unit: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
128
- | FR-002 | {{requirement}} | P0 | {{module}} | → Module: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
129
- | FR-003 | {{requirement}} | P1 | {{module}} | → Service: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
188
+ Core capabilities:
189
+ - {{capability_1}} — {{brief_description}}
190
+ - {{capability_2}} {{brief_description}}
191
+
192
+ Key user flows:
193
+ 1. **{{flow_name}}:** {{user_action}} → {{system_response}} → {{outcome}}
130
194
 
131
195
  <!-- Example:
132
- | FR-001 | User can create task with title, description, due date | P0 | Task | → Unit: `Task` | §3.1 | → Epic: `epic-01-task-crud.md` | ✅ |
133
- | FR-002 | User can assign task to team member | P0 | Task | → Unit: `Task` | §3.1 | → Epic: `epic-01-task-crud.md` | ⬜ |
134
- | FR-003 | System sends notification on assignment | P1 | Notification | → Service: `NotificationService` | §3.3 | → Epic: `epic-03-notifications.md` | ⬜ |
196
+ **Task Management:**
197
+
198
+ Core capabilities:
199
+ - Task CRUD — Create, read, update, delete tasks with title, description, due date
200
+ - Task Assignment — Assign tasks to team members, reassign, unassign
201
+ - Status Workflow — Move tasks through todo → in_progress → done states
202
+
203
+ Key user flows:
204
+ 1. **Create Task:** User fills form → System validates → Task created → Assignee notified → Task appears in list
205
+ 2. **Complete Task:** User clicks "Done" → System updates status → Team sees update → Analytics updated
135
206
  -->
136
207
 
137
- **Notes:**
138
- - {{important_business_rule}}
208
+ ### Growth Features (Post-MVP)
209
+
210
+ **Phase 2:**
211
+ - {{feature}} — {{why_important}} — {{business_value}}
212
+ - {{feature}} — {{why_important}} — {{business_value}}
139
213
 
140
- ### {{Domain_2}}
214
+ **Phase 3:**
215
+ - {{feature}} — {{why_important}} — {{business_value}}
141
216
 
142
- | ID | Requirement | Priority | Module | Doc Section | Arch § | Epic | Status |
143
- |----|-------------|----------|--------|-------------|--------|------|--------|
144
- | FR-010 | {{requirement}} | P0 | {{module}} | Unit: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
217
+ <!-- Example:
218
+ **Phase 2:**
219
+ - Task Templates Reduce repetitive task creation Save 30% time for recurring workflows
220
+ - Task Dependencies — Model complex workflows — Enable project management use cases
145
221
 
146
- ---
222
+ **Phase 3:**
223
+ - Recurring Tasks — Automate periodic work — Expand to operations teams
224
+ - Time Tracking — Measure effort — Enable billing use cases
225
+ -->
147
226
 
148
- ## Non-Functional Requirements
227
+ ### Out of Scope
149
228
 
150
- > **Traceability:** NFRs also track Module (if specific), Architecture section, and Status.
229
+ **Never:**
230
+ - {{item}} — {{reason_why_never}}
231
+ - {{item}} — {{reason_why_never}}
151
232
 
152
- | ID | Requirement | Priority | Module | Doc Section | Arch § | Status |
153
- |----|-------------|----------|--------|-------------|--------|--------|
154
- | NFR-001 | {{requirement}} | P0 | | — | §{{N}} | ⬜ |
155
- | NFR-002 | {{requirement}} | P0 | {{module}} | → Unit: `{{name}}` | §{{N}} | ⬜ |
233
+ **Not Now (Future):**
234
+ - {{item}} — {{why_later}}
235
+ - {{item}} — {{why_later}}
156
236
 
157
237
  <!-- Example:
158
- | NFR-001 | API response time < 200ms (p95) | P0 | — | — | §5 Performance | ⬜ |
159
- | NFR-002 | Task data encrypted at rest | P0 | Task | → Unit: `Task` | §4 Security | ⬜ |
238
+ **Never:**
239
+ - Time tracking Use external tools (Toggl, Harvest) - not core competency
240
+ - Gantt charts — Too complex for target users (small teams)
241
+ - Resource management — Out of product vision
242
+
243
+ **Not Now (Future):**
244
+ - Mobile app — Focus on web first, mobile in Phase 3 after PMF
245
+ - Integrations — Wait for user demand, prioritize after MVP
246
+ - Advanced reporting — Basic analytics in MVP, advanced in Phase 2
160
247
  -->
161
248
 
162
249
  ---
163
250
 
164
- ## Non-Functional Requirements (Details)
251
+ ## Requirements
165
252
 
166
- > Optional: Add detailed notes for complex NFRs here.
253
+ > **Source of Truth:** All detailed Functional and Non-Functional Requirements are maintained in `requirements.md`.
167
254
 
168
- ### Performance
169
- - {{details_if_needed}}
255
+ **Requirements Document:** `docs/requirements/requirements.md`
170
256
 
171
- ### Security
172
- - {{details_if_needed}}
257
+ ### Requirements Summary
173
258
 
174
- ### Scalability
175
- - {{details_if_needed}}
259
+ **Functional Requirements:** {{total_fr_count}} requirements across {{domain_count}} domains
260
+ - {{domain_1}}: {{fr_count}} requirements ({{p0_count}} P0, {{p1_count}} P1)
261
+ - {{domain_2}}: {{fr_count}} requirements ({{p0_count}} P0, {{p1_count}} P1)
262
+
263
+ **Non-Functional Requirements:** {{total_nfr_count}} requirements
264
+ - Performance: {{nfr_count}} requirements
265
+ - Security: {{nfr_count}} requirements
266
+ - Scalability: {{nfr_count}} requirements
267
+
268
+ **Priority Breakdown:**
269
+ - P0 (Must Have - MVP): {{p0_count}} requirements
270
+ - P1 (Should Have - Growth): {{p1_count}} requirements
271
+ - P2 (Nice to Have - Vision): {{p2_count}} requirements
272
+
273
+ <!-- Example:
274
+ **Functional Requirements:** 23 requirements across 3 domains
275
+ - Task Management: 12 requirements (8 P0, 4 P1)
276
+ - User Management: 6 requirements (5 P0, 1 P1)
277
+ - Notifications: 5 requirements (2 P0, 3 P1)
278
+
279
+ **Non-Functional Requirements:** 8 requirements
280
+ - Performance: 3 requirements
281
+ - Security: 3 requirements
282
+ - Scalability: 2 requirements
283
+
284
+ **Priority Breakdown:**
285
+ - P0 (Must Have - MVP): 15 requirements
286
+ - P1 (Should Have - Growth): 8 requirements
287
+ - P2 (Nice to Have - Vision): 0 requirements
288
+ -->
176
289
 
177
290
  ---
178
291
 
@@ -198,5 +311,22 @@ TaskFlow is a B2B platform for managing distributed teams. The system handles ta
198
311
 
199
312
  ## References
200
313
 
201
- Architecture: `{{path}}`
202
- Requirements: `{{path}}`
314
+ **Requirements (Source of Truth for FR/NFR):** `docs/requirements/requirements.md`
315
+ **Architecture:** `docs/architecture.md`
316
+ → **Coding Standards:** `docs/coding-standards/README.md`
317
+
318
+ ---
319
+
320
+ ## Document Changelog
321
+
322
+ | Version | Date | Author | Changes |
323
+ |---------|------|--------|---------|
324
+ | 1.0 | {{date}} | {{author}} | Initial PRD |
325
+
326
+ <!-- Example:
327
+ | Version | Date | Author | Changes |
328
+ |---------|------|--------|---------|
329
+ | 1.0 | 2026-01-15 | @pm | Initial PRD created from requirements |
330
+ | 1.1 | 2026-01-20 | @pm | Added AI-specific considerations |
331
+ | 1.2 | 2026-01-25 | @architect | Updated requirements summary after architecture |
332
+ -->
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: requirements-gathering
3
- description: Use when gathering FR/NFR through stakeholder interviews and elicitation techniques
3
+ description: Gather functional and non-functional requirements through stakeholder interviews, user research, and elicitation techniques. Use when starting a new project, collecting requirements, interviewing stakeholders, or when user mentions "requirements", "FR", "NFR", "stakeholder needs", or "user research".
4
4
  license: MIT
5
5
  compatibility: opencode
6
6
  metadata:
@@ -10,69 +10,85 @@ metadata:
10
10
 
11
11
  # Requirements Gathering Skill
12
12
 
13
- ## When to Use
14
-
15
- Use this skill when you need to:
16
- - Gather requirements from stakeholders
17
- - Document functional and non-functional requirements
18
- - Create the foundation for PRD
19
-
20
- ## Template
21
-
22
- Use template at: `@.opencode/skills/requirements-gathering/template.md`
23
-
24
- ## Requirements Document Structure (v2)
25
-
26
- ### 1. Header
27
-
28
- ```yaml
29
- id: REQ-001
30
- version: 1.0
31
- status: draft | approved
32
- date: {{date}}
33
- author: {{author}}
13
+ ```xml
14
+ <requirements_gathering>
15
+ <definition>Gather FR/NFR through stakeholder interviews</definition>
16
+
17
+ <output>docs/requirements/requirements.md</output>
18
+
19
+ <structure>
20
+ <header>id, version, status, date, author</header>
21
+ <summary>Problem, users, outcomes</summary>
22
+ <stakeholders>Table: Role | Representative | Interest | Influence</stakeholders>
23
+ <functional_requirements>
24
+ <grouped_by>Domain</grouped_by>
25
+ <table>ID | Requirement | Priority | Source | Module | Doc Section | Arch § | Epic | Status</table>
26
+ <traceability>
27
+ <module>Filled by @architect</module>
28
+ <arch_section>Filled by @architect</arch_section>
29
+ <epic>Filled by @pm</epic>
30
+ <status>Updated by @dev (⬜ → ✅)</status>
31
+ </traceability>
32
+ </functional_requirements>
33
+ <nfr>
34
+ <categories>Performance, Security, Scalability, Usability, Reliability, Maintainability</categories>
35
+ <table>ID | Requirement | Priority | Metric | Arch § | Status</table>
36
+ </nfr>
37
+ <ai_requirements optional="true">For RAG/AI systems</ai_requirements>
38
+ <constraints>Table: Type | Description | Impact</constraints>
39
+ <assumptions>Bullet list</assumptions>
40
+ <dependencies>Table: Item | Owner | Status | Risk</dependencies>
41
+ <open_questions>Checklist</open_questions>
42
+ <glossary>Table: Term | Definition</glossary>
43
+ <references>Links to PRD, Architecture</references>
44
+ </structure>
45
+
46
+ <requirement_rules>
47
+ <atomic>One requirement = one thing</atomic>
48
+ <measurable>Use numbers, not "quickly"</measurable>
49
+ <testable>Can verify with test</testable>
50
+ <unambiguous>Clear, no interpretation needed</unambiguous>
51
+ </requirement_rules>
52
+
53
+ <ids>
54
+ <functional>FR-001, FR-002, ...</functional>
55
+ <nfr>NFR-001, NFR-002, ...</nfr>
56
+ </ids>
57
+
58
+ <priority>
59
+ <P0>Must have (MVP)</P0>
60
+ <P1>Should have (Growth)</P1>
61
+ <P2>Nice to have (Vision)</P2>
62
+ </priority>
63
+
64
+ <interview_questions>
65
+ <functional>
66
+ <q>What do you need to accomplish?</q>
67
+ <q>What information do you need to see?</q>
68
+ <q>What actions do you need to take?</q>
69
+ <q>What happens when X fails?</q>
70
+ </functional>
71
+ <nfr>
72
+ <q>How many users concurrently?</q>
73
+ <q>What response time is acceptable?</q>
74
+ <q>What's the data retention policy?</q>
75
+ <q>What security standards apply?</q>
76
+ </nfr>
77
+ </interview_questions>
78
+
79
+ <reference_format>
80
+ <unit>→ Unit: `Task`</unit>
81
+ <fr>→ FR: `FR-001`</fr>
82
+ <prd>→ PRD: `docs/prd.md`</prd>
83
+ </reference_format>
84
+ </requirements_gathering>
34
85
  ```
35
86
 
36
- ### 2. Summary
37
-
38
- Brief prose explaining:
39
- - What problem is being solved
40
- - Who the primary users are
41
- - Key outcomes expected
42
-
43
- ### 3. Stakeholders
44
-
45
- | Role | Representative | Interest | Influence |
46
- |------|---------------|----------|-----------|
47
- | Product Owner | Name | Feature delivery | High |
48
- | End Users | Segment | Daily usage | High |
49
-
50
- ### 4. Functional Requirements
51
-
52
- **Grouped by domain:**
53
-
54
- ```markdown
55
- ### Task Management
56
-
57
- Core task lifecycle operations.
58
-
59
- | ID | Requirement | Priority | Source |
60
- |----|-------------|----------|--------|
61
- | FR-001 | User can create task | P0 | Team Lead |
62
-
63
- **Business Rules:**
64
- - One task = one assignee
65
-
66
- **Notes:**
67
- - Notifications in separate domain
68
- ```
69
-
70
- ### 5. Non-Functional Requirements
71
-
72
- Separate tables by category:
73
- - Performance (with metrics)
74
- - Security
75
- - Scalability
87
+ **When to include:**
88
+ - System uses LLM/ML models
89
+ - System has probabilistic outputs (not deterministic)
90
+ - Accuracy/hallucination metrics are critical
91
+ - System needs clear boundaries (what it should/shouldn't do)
76
92
 
77
93
  ### 6. Constraints
78
94
 
@@ -112,71 +128,40 @@ Separate tables by category:
112
128
  → Stakeholder Interviews: `docs/interviews/`
113
129
  ```
114
130
 
115
- ## Reference Format
116
-
117
- Use `→` for all references:
118
- ```markdown
119
- → PRD: `docs/prd.md`
120
- → FR: `FR-001`
121
- ```
122
-
123
- ## Requirement Writing Rules
124
-
125
- ### Good Requirements
126
-
127
- | Rule | Good | Bad |
128
- |------|------|-----|
129
- | Atomic | User can create task | User can create and edit task |
130
- | Measurable | Load in < 2s | Load quickly |
131
- | Testable | Title max 200 chars | Title reasonable length |
132
- | Unambiguous | Required field | Important field |
133
-
134
- ### Requirement IDs
135
-
136
- - Functional: `FR-001`, `FR-002`, ...
137
- - Non-Functional: `NFR-001`, `NFR-002`, ...
131
+ ---
138
132
 
139
- ### Priority
133
+ ## Example: Task Management Requirements
140
134
 
141
- | Level | Meaning | Scope |
142
- |-------|---------|-------|
143
- | P0 | Must have | MVP |
144
- | P1 | Should have | Growth |
145
- | P2 | Nice to have | Vision |
135
+ ```yaml
136
+ id: REQ-001
137
+ version: 1.0
138
+ status: draft
139
+ ```
146
140
 
147
- ## Interview Questions
141
+ # Requirements Document
148
142
 
149
- ### Functional Discovery
143
+ ## Summary
150
144
 
151
- 1. What do you need to accomplish?
152
- 2. What information do you need to see?
153
- 3. What actions do you need to take?
154
- 4. What happens when X fails?
145
+ Team collaboration tool for managing tasks and assignments.
155
146
 
156
- ### NFR Discovery
147
+ ## Functional Requirements
157
148
 
158
- 1. How many users concurrently?
159
- 2. What response time is acceptable?
160
- 3. What's the data retention policy?
161
- 4. What security standards apply?
149
+ ### Task Management
162
150
 
163
- ## Validation Checklist
151
+ | ID | Requirement | Priority | Source | Module | Doc Section | Arch § | Epic | Status |
152
+ |----|-------------|----------|--------|--------|-------------|--------|------|--------|
153
+ | FR-001 | User can create task | P0 | Team Lead | Task | → Unit: `Task` | §3.1 | → Epic: `epic-01-task-crud.md` | ⬜ |
154
+ | FR-002 | User can assign task | P0 | Team Lead | Task | → Unit: `Task` | §3.1 | → Epic: `epic-01-task-crud.md` | ⬜ |
164
155
 
165
- - [ ] All stakeholders identified
166
- - [ ] Requirements grouped by domain
167
- - [ ] Each requirement is atomic and testable
168
- - [ ] NFRs have measurable metrics
169
- - [ ] Constraints documented
170
- - [ ] Assumptions validated
171
- - [ ] Dependencies identified with owners
172
- - [ ] Uses `→` reference format
156
+ **Business Rules:**
157
+ - One task = one assignee
173
158
 
174
- ## Output
159
+ ## Non-Functional Requirements
175
160
 
176
- Save to: `docs/requirements/requirements.md`
161
+ ### Performance
177
162
 
178
- ## Related Skills
163
+ | ID | Requirement | Priority | Metric | Arch § | Status |
164
+ |----|-------------|----------|--------|--------|--------|
165
+ | NFR-001 | Page load < 2s | P0 | 95th percentile | §4.2 | ⬜ |
179
166
 
180
- - `prd-writing` - Uses requirements as input
181
- - `requirements-validation` - Validates requirements
182
- - `acceptance-criteria` - For testable AC
167
+ See `template.md` for full format.
@@ -38,15 +38,34 @@ TaskFlow addresses the need for lightweight task management for small remote tea
38
38
 
39
39
  ## Functional Requirements
40
40
 
41
+ > **Traceability:** Each FR tracks Module, Unit, Architecture section, Epic, and Status.
42
+ > **Maintained by:**
43
+ > - @analyst — Gathers requirements from stakeholders (fills ID, Requirement, Priority, Source)
44
+ > - @architect — Fills Module, Doc Section, Arch § after architecture design
45
+ > - @pm — Fills Epic after epic creation
46
+ > - @dev — Updates Status during implementation
47
+
48
+ > **Workflow:**
49
+ > 1. @analyst creates requirements.md with FR/NFR (Module/Arch § empty)
50
+ > 2. @architect designs architecture.md, updates requirements.md (fills Module, Arch §)
51
+ > 3. @pm creates epics, updates requirements.md (fills Epic column)
52
+ > 4. @dev implements stories, updates requirements.md (Status: ⬜ → ✅)
53
+
41
54
  ### {{Domain_1}}: {{domain_name}}
42
55
 
43
56
  {{brief_context_for_this_group_of_requirements}}
44
57
 
45
- | ID | Requirement | Priority | Source |
46
- |----|-------------|----------|--------|
47
- | FR-001 | {{user_can_action}} | P0 | {{stakeholder}} |
48
- | FR-002 | {{user_can_action}} | P0 | {{stakeholder}} |
49
- | FR-003 | {{system_does_action}} | P1 | {{stakeholder}} |
58
+ | ID | Requirement | Priority | Source | Module | Doc Section | Arch § | Epic | Status |
59
+ |----|-------------|----------|--------|--------|-------------|--------|------|--------|
60
+ | FR-001 | {{user_can_action}} | P0 | {{stakeholder}} | {{module}} | → Unit: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
61
+ | FR-002 | {{user_can_action}} | P0 | {{stakeholder}} | {{module}} | → Unit: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
62
+ | FR-003 | {{system_does_action}} | P1 | {{stakeholder}} | {{module}} | → Unit: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
63
+
64
+ <!-- Example:
65
+ | FR-001 | User can create task with title, description, due date | P0 | Team Lead | Task | → Unit: `Task` | §3.1 | → Epic: `epic-01-task-crud.md` | ✅ |
66
+ | FR-002 | User can assign task to team member | P0 | Team Lead | Task | → Unit: `Task` | §3.1 | → Epic: `epic-01-task-crud.md` | ⬜ |
67
+ | FR-003 | System sends notification on assignment | P1 | Team Lead | Notification | → Service: `NotificationService` | §3.3 | → Epic: `epic-03-notifications.md` | ⬜ |
68
+ -->
50
69
 
51
70
  **Business Rules:**
52
71
  - {{rule}}
@@ -77,31 +96,92 @@ Core task lifecycle operations that all users need.
77
96
 
78
97
  {{brief_context}}
79
98
 
80
- | ID | Requirement | Priority | Source |
81
- |----|-------------|----------|--------|
82
- | FR-010 | {{requirement}} | P1 | {{stakeholder}} |
99
+ | ID | Requirement | Priority | Source | Module | Doc Section | Arch § | Epic | Status |
100
+ |----|-------------|----------|--------|--------|-------------|--------|------|--------|
101
+ | FR-010 | {{requirement}} | P1 | {{stakeholder}} | {{module}} | → Unit: `{{name}}` | §{{N}} | → Epic: `{{file}}` | ⬜ |
83
102
 
84
103
  ---
85
104
 
86
105
  ## Non-Functional Requirements
87
106
 
107
+ > **Traceability:** NFRs also track Module (if specific), Architecture section, and Status.
108
+
88
109
  ### Performance
89
110
 
90
- | ID | Requirement | Metric | Priority |
91
- |----|-------------|--------|----------|
92
- | NFR-001 | {{what}} | {{measurable_target}} | P0 |
111
+ | ID | Requirement | Metric | Priority | Module | Arch § | Status |
112
+ |----|-------------|--------|----------|--------|--------|--------|
113
+ | NFR-001 | {{what}} | {{measurable_target}} | P0 | {{module}} | §{{N}} | ⬜ |
114
+
115
+ <!-- Example:
116
+ | NFR-001 | API response time < 200ms (p95) | p95 < 200ms | P0 | — | §5 Performance | ⬜ |
117
+ | NFR-002 | Task data encrypted at rest | AES-256 | P0 | Task | §4 Security | ⬜ |
118
+ -->
93
119
 
94
120
  ### Security
95
121
 
96
- | ID | Requirement | Standard/Approach | Priority |
97
- |----|-------------|-------------------|----------|
98
- | NFR-010 | {{what}} | {{how}} | P0 |
122
+ | ID | Requirement | Standard/Approach | Priority | Module | Arch § | Status |
123
+ |----|-------------|-------------------|----------|--------|--------|--------|
124
+ | NFR-010 | {{what}} | {{how}} | P0 | {{module}} | §{{N}} | ⬜ |
99
125
 
100
126
  ### Scalability
101
127
 
102
- | ID | Requirement | Target | Priority |
103
- |----|-------------|--------|----------|
104
- | NFR-020 | {{what}} | {{number}} | P1 |
128
+ | ID | Requirement | Target | Priority | Module | Arch § | Status |
129
+ |----|-------------|--------|----------|--------|--------|--------|
130
+ | NFR-020 | {{what}} | {{number}} | P1 | {{module}} | §{{N}} | ⬜ |
131
+
132
+ ---
133
+
134
+ ## AI-Specific Requirements (Optional)
135
+
136
+ > **Note:** Only for AI/ML/RAG systems. Skip for traditional applications.
137
+
138
+ ### AI Quality Metrics
139
+
140
+ | ID | Metric | Target | Measurement Method | Priority | Arch § | Status |
141
+ |----|--------|--------|-------------------|----------|--------|--------|
142
+ | AI-001 | Accuracy | {{target_percentage}} | {{how_to_measure}} | P0 | §{{N}} | ⬜ |
143
+ | AI-002 | Hallucination Rate | < {{threshold}}% | {{validation_method}} | P0 | §{{N}} | ⬜ |
144
+ | AI-003 | Response Latency | < {{time}}s (p95) | {{monitoring_tool}} | P1 | §{{N}} | ⬜ |
145
+
146
+ <!-- Example for RAG system:
147
+ | AI-001 | Accuracy | 85% on gold dataset | 100 Q&A pairs validated by experts | P0 | §6 AI Quality | ⬜ |
148
+ | AI-002 | Hallucination Rate | < 5% | Manual review + TruLens framework | P0 | §6 AI Quality | ⬜ |
149
+ | AI-003 | Response Latency | < 3s (p95) | APM monitoring (Datadog) | P1 | §5 Performance | ⬜ |
150
+ -->
151
+
152
+ ### System Boundaries
153
+
154
+ **In Scope:**
155
+ - {{what_system_should_answer}}
156
+ - {{capability_2}}
157
+
158
+ **Out of Scope:**
159
+ - {{what_system_should_NOT_answer}} — {{reason}}
160
+ - {{limitation_2}} — {{reason}}
161
+
162
+ <!-- Example:
163
+ **In Scope:**
164
+ - Answer questions about product documentation
165
+ - Provide code examples from official docs
166
+ - Cite sources for every answer
167
+
168
+ **Out of Scope:**
169
+ - Answer questions outside documentation scope — "I don't have information about that"
170
+ - Generate code not present in docs — "I can only show examples from our docs"
171
+ - Provide opinions or recommendations — Stick to factual information
172
+ -->
173
+
174
+ ### Feedback Mechanisms
175
+
176
+ | ID | Mechanism | Purpose | Priority | Status |
177
+ |----|-----------|---------|----------|--------|
178
+ | FB-001 | {{feedback_type}} | {{why_needed}} | P0 | ⬜ |
179
+
180
+ <!-- Example:
181
+ | FB-001 | Thumbs up/down on answers | Track satisfaction, identify problem areas | P0 | ⬜ |
182
+ | FB-002 | "Report incorrect answer" button | Flag hallucinations for manual review | P0 | ⬜ |
183
+ | FB-003 | Copy answer to clipboard | Track which answers are most useful | P2 | ⬜ |
184
+ -->
105
185
 
106
186
  ---
107
187