@drafthq/draft 3.6.0 → 3.7.1

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 (117) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.cursor-plugin/plugin.json +1 -1
  4. package/README.md +28 -49
  5. package/bin/README.md +47 -1
  6. package/cli/src/installer.js +1 -1
  7. package/cli/src/lib/cursor-registry.js +10 -0
  8. package/core/agents/architect.md +21 -9
  9. package/core/agents/debugger.md +5 -0
  10. package/core/agents/ops.md +7 -2
  11. package/core/agents/planner.md +7 -0
  12. package/core/agents/rca.md +14 -3
  13. package/core/agents/reviewer.md +1 -0
  14. package/core/agents/writer.md +6 -0
  15. package/core/knowledge-base.md +22 -3
  16. package/core/methodology.md +30 -5
  17. package/core/shared/condensation.md +27 -17
  18. package/core/shared/context-verify.md +3 -1
  19. package/core/shared/cross-skill-dispatch.md +7 -3
  20. package/core/shared/draft-context-loading.md +3 -0
  21. package/core/shared/git-report-metadata.md +1 -0
  22. package/core/shared/graph-query.md +0 -2
  23. package/core/shared/graph-usage-report.md +1 -1
  24. package/core/shared/jira-sync.md +10 -6
  25. package/core/shared/okf-retrieval.md +1 -1
  26. package/core/shared/parallel-analysis.md +14 -7
  27. package/core/shared/pattern-learning.md +2 -0
  28. package/core/shared/template-contract.md +1 -1
  29. package/core/shared/vcs-commands.md +5 -2
  30. package/core/templates/ai-context.md +3 -2
  31. package/core/templates/ai-profile.md +7 -0
  32. package/core/templates/architecture.md +6 -2
  33. package/core/templates/discovery.md +1 -1
  34. package/core/templates/guardrails.md +9 -0
  35. package/core/templates/hld.md +5 -4
  36. package/core/templates/intake-questions.md +45 -0
  37. package/core/templates/jira.md +11 -2
  38. package/core/templates/lld.md +8 -5
  39. package/core/templates/okf/concept.md +0 -1
  40. package/core/templates/product.md +11 -2
  41. package/core/templates/rca.md +6 -0
  42. package/core/templates/service-index.md +1 -0
  43. package/core/templates/spec.md +15 -0
  44. package/core/templates/tech-stack.md +12 -0
  45. package/core/templates/workflow.md +20 -0
  46. package/integrations/agents/AGENTS.md +1272 -292
  47. package/integrations/copilot/.github/copilot-instructions.md +1272 -292
  48. package/package.json +1 -1
  49. package/scripts/fetch-memory-engine.sh +24 -6
  50. package/scripts/lib.sh +11 -4
  51. package/scripts/tools/_graph_queries.sh +10 -3
  52. package/scripts/tools/_lib.sh +33 -11
  53. package/scripts/tools/check-repo-size.sh +125 -0
  54. package/scripts/tools/check-skill-line-caps.sh +1 -2
  55. package/scripts/tools/check-template-noop.sh +0 -1
  56. package/scripts/tools/classify-files.sh +2 -2
  57. package/scripts/tools/cycle-detect.sh +16 -8
  58. package/scripts/tools/fix-whitespace.sh +3 -0
  59. package/scripts/tools/git-metadata.sh +6 -0
  60. package/scripts/tools/graph-arch.sh +1 -1
  61. package/scripts/tools/graph-callers.sh +6 -3
  62. package/scripts/tools/graph-impact.sh +4 -2
  63. package/scripts/tools/graph-init.sh +12 -8
  64. package/scripts/tools/graph-preflight.sh +3 -0
  65. package/scripts/tools/graph-query.sh +70 -7
  66. package/scripts/tools/graph-snapshot.sh +29 -5
  67. package/scripts/tools/hotspot-rank.sh +2 -1
  68. package/scripts/tools/install-smoke-test.sh +223 -0
  69. package/scripts/tools/mermaid-from-graph.sh +2 -1
  70. package/scripts/tools/migrate-track-frontmatter.sh +9 -10
  71. package/scripts/tools/okf-coverage-check.sh +4 -3
  72. package/scripts/tools/okf-fix-links.sh +18 -93
  73. package/scripts/tools/okf-plan-concepts.sh +5 -8
  74. package/scripts/tools/okf-render-views.sh +19 -14
  75. package/scripts/tools/okf-validate-quality.sh +13 -2
  76. package/scripts/tools/okf-validate.sh +13 -2
  77. package/scripts/tools/parse-git-log.sh +19 -1
  78. package/scripts/tools/resolve-tools.sh +24 -8
  79. package/scripts/tools/verify-citations.sh +1 -2
  80. package/scripts/tools/verify-doc-anchors.sh +13 -33
  81. package/scripts/tools/verify-graph-binary.sh +13 -3
  82. package/skills/GRAPH.md +21 -10
  83. package/skills/adr/SKILL.md +24 -6
  84. package/skills/assist-review/SKILL.md +2 -1
  85. package/skills/bughunt/SKILL.md +54 -11
  86. package/skills/bughunt/references/regression-tests.md +14 -4
  87. package/skills/change/SKILL.md +19 -9
  88. package/skills/coverage/SKILL.md +26 -10
  89. package/skills/debug/SKILL.md +12 -2
  90. package/skills/decompose/SKILL.md +39 -9
  91. package/skills/deep-review/SKILL.md +17 -4
  92. package/skills/deploy-checklist/SKILL.md +9 -2
  93. package/skills/documentation/SKILL.md +12 -1
  94. package/skills/draft/SKILL.md +40 -29
  95. package/skills/draft/context-files.md +8 -1
  96. package/skills/draft/quality-guide.md +10 -2
  97. package/skills/graph/SKILL.md +1 -1
  98. package/skills/impact/SKILL.md +3 -1
  99. package/skills/implement/SKILL.md +60 -18
  100. package/skills/incident-response/SKILL.md +5 -2
  101. package/skills/init/SKILL.md +102 -23
  102. package/skills/init/references/architecture-spec.md +31 -7
  103. package/skills/init/references/okf-emitter.md +3 -3
  104. package/skills/jira/SKILL.md +33 -13
  105. package/skills/jira/references/review.md +61 -19
  106. package/skills/learn/SKILL.md +29 -6
  107. package/skills/new-track/SKILL.md +73 -18
  108. package/skills/quick-review/SKILL.md +7 -2
  109. package/skills/revert/SKILL.md +11 -5
  110. package/skills/review/SKILL.md +123 -24
  111. package/skills/review/references/zero-setup-mode.md +117 -0
  112. package/skills/standup/SKILL.md +9 -1
  113. package/skills/status/SKILL.md +6 -6
  114. package/skills/tech-debt/SKILL.md +7 -1
  115. package/skills/testing-strategy/SKILL.md +10 -2
  116. package/skills/tour/SKILL.md +2 -1
  117. package/skills/upload/SKILL.md +3 -2
@@ -28,17 +28,20 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
28
28
  ## Phase 1: Initial Context
29
29
 
30
30
  ### Question 1.1: Existing Documentation
31
+ >
31
32
  > Start here. Gather any existing context before diving in.
32
33
 
33
34
  **Ask:**
34
35
  > "Do you have existing documentation for this work? (PRD, RFC, design doc, Jira ticket, or any notes)"
35
36
 
36
37
  **If yes:**
38
+
37
39
  - Request the document or key excerpts
38
40
  - Ingest and extract: goals, requirements, constraints, open questions
39
41
  - Summarize: "I've extracted [X, Y, Z]. I notice [gap] isn't covered yet."
40
42
 
41
43
  **If no:**
44
+
42
45
  - Acknowledge: "No problem. Let's build this from scratch together."
43
46
  - Proceed to Phase 2
44
47
 
@@ -49,10 +52,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
49
52
  ## Phase 2: Problem Space
50
53
 
51
54
  ### Question 2.1: Problem Definition
55
+
52
56
  **Ask:**
53
57
  > "What problem are we solving?"
54
58
 
55
59
  **After response, contribute:**
60
+
56
61
  - Pattern recognition: "This sounds similar to [industry pattern]..."
57
62
  - Domain concepts: Reference Jobs-to-be-Done, DDD problem space if relevant
58
63
  - Clarifying probe: "When you say [X], do you mean [A] or [B]?"
@@ -62,10 +67,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
62
67
  ---
63
68
 
64
69
  ### Question 2.2: Urgency & Impact
70
+
65
71
  **Ask:**
66
72
  > "Why does this problem matter now? What happens if we don't solve it?"
67
73
 
68
74
  **After response, contribute:**
75
+
69
76
  - Validate urgency: Is this symptom or root cause?
70
77
  - Impact analysis: Who's affected? How severely?
71
78
  - Reference: 5 Whys technique if they're describing symptoms
@@ -75,10 +82,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
75
82
  ---
76
83
 
77
84
  ### Question 2.3: Users & Workarounds
85
+
78
86
  **Ask:**
79
87
  > "Who experiences this pain? How do they currently cope?"
80
88
 
81
89
  **After response, contribute:**
90
+
82
91
  - User segmentation: Are there different user types with different needs?
83
92
  - Workaround analysis: Current workarounds often reveal requirements
84
93
  - Prior art: "Similar products handle this by [X]..."
@@ -88,10 +97,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
88
97
  ---
89
98
 
90
99
  ### Question 2.4: Scope Boundary
100
+
91
101
  **Ask:**
92
102
  > "What's the scope boundary? Where does this problem end and adjacent problems begin?"
93
103
 
94
104
  **After response, contribute:**
105
+
95
106
  - Identify adjacent problems that should NOT be solved here
96
107
  - Reference: Bounded Context (DDD)
97
108
  - Flag scope creep risks: "I'd suggest explicitly excluding [X]..."
@@ -104,6 +115,7 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
104
115
 
105
116
  **Summarize:**
106
117
  > "Here's what we've established about the problem:
118
+ >
107
119
  > - Problem: [summary]
108
120
  > - Why now: [summary]
109
121
  > - Users: [summary]
@@ -118,10 +130,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
118
130
  ## Phase 3: Solution Space
119
131
 
120
132
  ### Question 3.1: Simplest Solution
133
+
121
134
  **Ask:**
122
135
  > "What's the simplest version that solves this problem?"
123
136
 
124
137
  **After response, contribute:**
138
+
125
139
  - MVP identification: What's truly essential vs nice-to-have?
126
140
  - Gold-plating risks: "We could simplify by [X]..."
127
141
  - Reference: YAGNI, Walking Skeleton, Tracer Bullet (Pragmatic Programmer)
@@ -131,10 +145,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
131
145
  ---
132
146
 
133
147
  ### Question 3.2: Approach Rationale
148
+
134
149
  **Ask:**
135
150
  > "Why this approach over alternatives?"
136
151
 
137
152
  **After response, contribute:**
153
+
138
154
  - Present 2-3 alternative approaches with trade-offs
139
155
  - Reference: Architecture Decision Records pattern
140
156
  - Probe: "Have you considered [alternative]? Trade-off would be [X]..."
@@ -144,10 +160,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
144
160
  ---
145
161
 
146
162
  ### Question 3.3: Explicit Non-Goals
163
+
147
164
  **Ask:**
148
165
  > "What are we explicitly NOT doing? What should be out of scope?"
149
166
 
150
167
  **After response, contribute:**
168
+
151
169
  - Suggest common scope creep items to exclude
152
170
  - Reference: Anti-goals pattern, MoSCoW prioritization
153
171
  - "I'd recommend also excluding [X] to keep scope tight..."
@@ -157,10 +175,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
157
175
  ---
158
176
 
159
177
  ### Question 3.4: Architecture Fit
178
+
160
179
  **Ask:**
161
180
  > "How does this fit with the current architecture?"
162
181
 
163
182
  **After response, contribute:**
183
+
164
184
  - Cross-reference `draft/.ai-context.md` (or `draft/architecture.md`) for integration points
165
185
  - Identify affected modules/components
166
186
  - Reference: Clean Architecture boundaries, module coupling
@@ -171,10 +191,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
171
191
  ---
172
192
 
173
193
  ### Question 3.5: Reusable Patterns
194
+
174
195
  **Ask:**
175
196
  > "What existing patterns or components can we leverage?"
176
197
 
177
198
  **After response, contribute:**
199
+
178
200
  - Search codebase context for reusable patterns
179
201
  - Suggest tech-stack.md conventions to follow
180
202
  - Reference: DRY, existing abstractions
@@ -188,6 +210,7 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
188
210
 
189
211
  **Summarize:**
190
212
  > "Here's the proposed solution:
213
+ >
191
214
  > - Approach: [summary]
192
215
  > - Why this approach: [rationale]
193
216
  > - Not doing: [non-goals]
@@ -203,10 +226,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
203
226
  ## Phase 4: Risk & Constraints
204
227
 
205
228
  ### Question 4.1: What Could Go Wrong
229
+
206
230
  **Ask:**
207
231
  > "What could go wrong with this approach?"
208
232
 
209
233
  **After response, contribute:**
234
+
210
235
  - Surface risks user may not have considered
211
236
  - Security: Reference OWASP Top 10 if relevant
212
237
  - Performance: Identify potential bottlenecks
@@ -218,10 +243,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
218
243
  ---
219
244
 
220
245
  ### Question 4.2: Dependencies & Blockers
246
+
221
247
  **Ask:**
222
248
  > "What dependencies or blockers exist? (External APIs, other teams, data, infrastructure)"
223
249
 
224
250
  **After response, contribute:**
251
+
225
252
  - Identify external dependencies and their reliability
226
253
  - Team dependencies: Who else needs to be involved?
227
254
  - Data dependencies: What data do we need? Where does it come from?
@@ -232,10 +259,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
232
259
  ---
233
260
 
234
261
  ### Question 4.3: Assumptions
262
+
235
263
  **Ask:**
236
264
  > "What assumptions are we making? Why might this fail?"
237
265
 
238
266
  **After response, contribute:**
267
+
239
268
  - List implicit assumptions explicitly
240
269
  - Fact-check against `draft/tech-stack.md` and `draft/.ai-context.md`
241
270
  - Reference: Pre-mortem technique
@@ -246,10 +275,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
246
275
  ---
247
276
 
248
277
  ### Question 4.4: Constraints
278
+
249
279
  **Ask:**
250
280
  > "What constraints must we operate within? (Timeline, tech limitations, compliance, performance requirements)"
251
281
 
252
282
  **After response, contribute:**
283
+
253
284
  - Identify tech constraints from tech-stack.md
254
285
  - Performance requirements: Latency, throughput, scale
255
286
  - Compliance: GDPR, SOC2, industry-specific
@@ -260,10 +291,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
260
291
  ---
261
292
 
262
293
  ### Question 4.5: Security & Compliance
294
+
263
295
  **Ask:**
264
296
  > "Are there security or compliance considerations?"
265
297
 
266
298
  **After response, contribute:**
299
+
267
300
  - Flag relevant OWASP concerns
268
301
  - Data privacy: PII handling, encryption, access control
269
302
  - Authentication/authorization patterns
@@ -277,6 +310,7 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
277
310
 
278
311
  **Summarize:**
279
312
  > "Key risks and constraints identified:
313
+ >
280
314
  > - Risks: [list]
281
315
  > - Dependencies: [list]
282
316
  > - Assumptions: [list]
@@ -292,10 +326,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
292
326
  ## Phase 5: Success Criteria
293
327
 
294
328
  ### Question 5.1: Definition of Done
329
+
295
330
  **Ask:**
296
331
  > "How do we know this is complete? What must be true when we're done?"
297
332
 
298
333
  **After response, contribute:**
334
+
299
335
  - Suggest measurable acceptance criteria
300
336
  - Convert vague criteria to testable outcomes
301
337
  - Reference: SMART criteria, Given-When-Then format
@@ -306,10 +342,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
306
342
  ---
307
343
 
308
344
  ### Question 5.2: Verification Strategy
345
+
309
346
  **Ask:**
310
347
  > "How will we verify it works correctly?"
311
348
 
312
349
  **After response, contribute:**
350
+
313
351
  - Suggest testing strategies appropriate to feature type
314
352
  - Reference: Test pyramid, TDD practices
315
353
  - Integration testing: What integration points need testing?
@@ -320,10 +358,12 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
320
358
  ---
321
359
 
322
360
  ### Question 5.3: Stakeholder Acceptance
361
+
323
362
  **Ask:**
324
363
  > "What would make stakeholders accept this? What does success look like to them?"
325
364
 
326
365
  **After response, contribute:**
366
+
327
367
  - Align with product.md goals
328
368
  - Suggest demo scenarios
329
369
  - Reference: Stakeholder analysis, acceptance criteria patterns
@@ -337,6 +377,7 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
337
377
 
338
378
  **Summarize:**
339
379
  > "Success criteria defined:
380
+ >
340
381
  > - Done when: [criteria list]
341
382
  > - Verified by: [testing approach]
342
383
  > - Stakeholders accept when: [demo scenarios]
@@ -360,11 +401,13 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
360
401
  > Ready to finalize this spec, or any changes needed?"
361
402
 
362
403
  **If changes needed:**
404
+
363
405
  - Discuss specific sections
364
406
  - Update spec-draft.md
365
407
  - Return to this review step
366
408
 
367
409
  **If confirmed:**
410
+
368
411
  - Promote spec-draft.md → spec.md
369
412
  - Announce: "Spec finalized. Now let's create the implementation plan."
370
413
 
@@ -374,6 +417,7 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
374
417
 
375
418
  **After spec is finalized, propose plan structure:**
376
419
  > "Based on the spec, I propose these phases:
420
+ >
377
421
  > - Phase 1: [name] — [goal]
378
422
  > - Phase 2: [name] — [goal]
379
423
  > - Phase 3: [name] — [goal]
@@ -382,6 +426,7 @@ Structured questions for track creation. **Ask ONE question at a time.** Wait fo
382
426
  > Does this phasing make sense, or should we adjust?"
383
427
 
384
428
  **After confirmation:**
429
+
385
430
  - Build out detailed plan-draft.md with tasks
386
431
  - Present for review
387
432
  - On confirmation: promote plan-draft.md → plan.md
@@ -28,11 +28,12 @@ labels: # Labels to apply to all created issues
28
28
  # Jira Story Template (Minimal)
29
29
 
30
30
  ## Summary
31
+
31
32
  [Brief, descriptive title]
32
33
 
33
34
  ## Description
34
35
 
35
- ```
36
+ ```text
36
37
  h3. Description:
37
38
 
38
39
  Problem Statement:
@@ -68,7 +69,7 @@ Use Cases:
68
69
 
69
70
  ## Acceptance Criteria
70
71
 
71
- ```
72
+ ```text
72
73
  - [ ] [Criterion 1: Specific, testable requirement]
73
74
  - [ ] [Criterion 2: Specific, testable requirement]
74
75
  - [ ] [Criterion 3: Specific, testable requirement]
@@ -77,35 +78,42 @@ Use Cases:
77
78
  ## Required Fields
78
79
 
79
80
  ### Standard Fields
81
+
80
82
  - **Issue Type:** Story
81
83
  - **Priority:** Medium
82
84
  - **Components:** [Component name]
83
85
  - **Fix Version/s:** [Version or master]
84
86
 
85
87
  ### People
88
+
86
89
  - **Assignee:** [Your email]
87
90
  - **Product Owner:** [PO email]
88
91
  - **Tech Lead:** [Tech lead email]
89
92
  - **Scrum Master:** [Scrum master email]
90
93
 
91
94
  ### Team
95
+
92
96
  - **Developers:** [List developer emails]
93
97
  - **Reviewers:** [List reviewer emails]
94
98
 
95
99
  ### Story Details
100
+
96
101
  - **Story Points:** [1/2/3/5/8/13]
97
102
  - **Work Type:** Operational Excellence
98
103
  - **Sub-Team:** [Sub-team name]
99
104
  - **Organization:** R&D
100
105
 
101
106
  ### Development Status
107
+
102
108
  - **Development Status:** Not-Started
103
109
 
104
110
  ### Security
111
+
105
112
  - **Requires Security Review:** Yes/No
106
113
  - **Security Review Status:** Review Needed
107
114
 
108
115
  ### Quality Gates
116
+
109
117
  - [ ] Tasks complete
110
118
  - [ ] Functional Testing complete
111
119
  - [ ] 100% code unit tested or Automated
@@ -113,6 +121,7 @@ Use Cases:
113
121
  - [ ] i18n impact review
114
122
 
115
123
  ### Other
124
+
116
125
  - **Risk Assessment:** Toss Up
117
126
  - **Priority Level:** Normal
118
127
  - **Category:** Uncategorized
@@ -48,7 +48,7 @@ links:
48
48
  <Link to HLD and explain context here>
49
49
 
50
50
  > See [`./hld.md` §Background](./hld.md#background) for the high-level rationale. Use this section only for component-internal context the HLD doesn't cover.
51
-
51
+ >
52
52
  > **Citations.** Use `path/to/file.ext:LINE` (or `LINE-RANGE`); verifier:
53
53
  > `scripts/tools/verify-citations.sh`. Prefer `// DRAFT-CITE: <id>` source
54
54
  > anchors over raw line numbers for code that moves often.
@@ -67,6 +67,7 @@ links:
67
67
  ## Low Level Design
68
68
 
69
69
  > **NOTE:**
70
+ >
70
71
  > - HLD and Detailed Design covers components and interactions across various services that the feature touches
71
72
  > - LLD to be documented here is for each such component and internal implementation
72
73
  > - A single doc here can cover all components, or they can be split up, but the key is to ensure every component in every service the design touches has an LLD
@@ -159,6 +160,7 @@ links:
159
160
  > deploy-checklist fail on bare prose without diagram blocks.
160
161
 
161
162
  Examples:
163
+
162
164
  - List of steps to failover a multi-region database cluster
163
165
  - Analysis phase of a background data indexing service
164
166
  - Transferring session state information between authentication and profile services via a secure messaging protocol
@@ -188,13 +190,14 @@ sequenceDiagram
188
190
 
189
191
  **Pseudocode:**
190
192
 
191
- ```
193
+ ```text
192
194
  1. validate inputs
193
195
  2. ...
194
196
  3. return result
195
197
  ```
196
198
 
197
199
  **Edge cases handled:**
200
+
198
201
  - {case 1 — what happens}
199
202
  - {case 2 — what happens}
200
203
 
@@ -269,9 +272,9 @@ sequenceDiagram
269
272
 
270
273
  List down all metrics that developers and SREs need to look at to identify issues:
271
274
 
272
- -
273
- -
274
- -
275
+ -
276
+ -
277
+ -
275
278
 
276
279
  ### Alerting Thresholds
277
280
 
@@ -60,4 +60,3 @@ okf-validate-quality.sh and therefore does NOT satisfy okf-coverage-check.sh —
60
60
  the bundle will not be promoted. Diagram types (Subsystem/Module/Feature/
61
61
  Entrypoint) require ≥1 valid Mermaid block and ≥2 x-grounded-paths.
62
62
  -->
63
-
@@ -26,10 +26,12 @@ generated_at: "{ISO_TIMESTAMP}"
26
26
  ## Target Users
27
27
 
28
28
  ### Primary Users
29
+
29
30
  - **[User Type 1]**: [What they need, their context]
30
31
  - **[User Type 2]**: [What they need, their context]
31
32
 
32
33
  ### Secondary Users
34
+
33
35
  - **[Admin/Support]**: [Their interaction with the product]
34
36
 
35
37
  ---
@@ -37,15 +39,18 @@ generated_at: "{ISO_TIMESTAMP}"
37
39
  ## Core Features
38
40
 
39
41
  ### Must Have (P0)
42
+
40
43
  1. **[Feature 1]**: [Brief description]
41
44
  2. **[Feature 2]**: [Brief description]
42
45
  3. **[Feature 3]**: [Brief description]
43
46
 
44
47
  ### Should Have (P1)
48
+
45
49
  1. **[Feature 4]**: [Brief description]
46
50
  2. **[Feature 5]**: [Brief description]
47
51
 
48
52
  ### Nice to Have (P2)
53
+
49
54
  1. **[Feature 6]**: [Brief description]
50
55
 
51
56
  ---
@@ -61,16 +66,16 @@ generated_at: "{ISO_TIMESTAMP}"
61
66
  ## Constraints
62
67
 
63
68
  ### Technical
69
+
64
70
  - [Constraint, e.g., "Must support IE11"]
65
71
  - [Constraint, e.g., "API response time < 200ms"]
66
72
 
67
73
  ### Business
74
+
68
75
  - [Constraint, e.g., "Must comply with GDPR"]
69
76
  - [Constraint, e.g., "Budget for external APIs: $X/month"]
70
77
 
71
78
  ### Timeline
72
- - [Milestone 1]: [Date]
73
- - [Milestone 2]: [Date]
74
79
 
75
80
  ---
76
81
 
@@ -93,19 +98,23 @@ Things explicitly out of scope for this product:
93
98
  ## Guidelines (Optional)
94
99
 
95
100
  ### Writing Style
101
+
96
102
  - **Tone:** [professional / casual / technical]
97
103
  - **Voice:** [first person "we" / third person "the system" / second person "you"]
98
104
  - **Terminology:** [domain-specific terms and definitions]
99
105
 
100
106
  ### UX Principles
107
+
101
108
  1. [e.g., "Convention over configuration" — minimize required decisions]
102
109
  2. [e.g., "Accessible by default" — WCAG AA compliance minimum]
103
110
  3. [e.g., "Progressive disclosure" — show complexity only when needed]
104
111
 
105
112
  ### Error Handling
113
+
106
114
  - **Error message tone:** [helpful / technical / minimal]
107
115
  - **User feedback patterns:** [toasts / modals / inline / status bar]
108
116
 
109
117
  ### Content Standards
118
+
110
119
  - **Date format:** [ISO 8601 / localized / relative]
111
120
  - **Internationalization:** [i18n required / English-only / planned]
@@ -64,15 +64,19 @@ generated_at: "{ISO_TIMESTAMP}"
64
64
  ## Prevention Items
65
65
 
66
66
  ### Detection Improvement
67
+
67
68
  - [ ] [monitoring/alerting improvement to catch this sooner]
68
69
 
69
70
  ### Process Improvement
71
+
70
72
  - [ ] [review/testing improvement to prevent this class of bug]
71
73
 
72
74
  ### Code Improvement
75
+
73
76
  - [ ] [guard/validation to add in code]
74
77
 
75
78
  ### Architecture Improvement
79
+
76
80
  - [ ] [structural change if needed to make this class of bug impossible]
77
81
 
78
82
  ## Proposed Fix
@@ -80,8 +84,10 @@ generated_at: "{ISO_TIMESTAMP}"
80
84
  [Brief description of the fix approach — developer reviews before implementation]
81
85
 
82
86
  **Files to modify:**
87
+
83
88
  - `file1:line` — [change description]
84
89
  - `file2:line` — [change description]
85
90
 
86
91
  **Regression test:**
92
+
87
93
  - [Description of regression test to write — pending developer approval]
@@ -43,6 +43,7 @@ The following services have not been initialized with `/draft:init`:
43
43
  - `[path/to/service]/`
44
44
 
45
45
  Initialize each one by running `/draft:init` inside its directory — it links the module's graph up to the root spine:
46
+
46
47
  ```bash
47
48
  cd [path/to/service] && /draft:init
48
49
  ```
@@ -45,6 +45,7 @@ approvers:
45
45
  > is rendered from `metadata.json:status`; never edit it inline.
46
46
 
47
47
  ## Context References
48
+
48
49
  - **Product:** `draft/product.md` — [pending]
49
50
  - **Tech Stack:** `draft/tech-stack.md` — [pending]
50
51
  - **Architecture:** `draft/.ai-context.md` — [pending]
@@ -59,16 +60,21 @@ approvers:
59
60
  > `<!-- VERIFIER:IGNORE END -->` so they don't fail the verifier.
60
61
 
61
62
  ## Problem Statement
63
+
62
64
  [To be developed through intake conversation]
63
65
 
64
66
  ## Background & Why Now
67
+
65
68
  [To be developed through intake conversation]
66
69
 
67
70
  ## Requirements
71
+
68
72
  ### Functional
73
+
69
74
  [To be developed through intake conversation]
70
75
 
71
76
  ### Non-Functional
77
+
72
78
  [To be developed through intake conversation]
73
79
 
74
80
  ## Acceptance Criteria
@@ -82,9 +88,11 @@ approvers:
82
88
  | AC-2 | _TBD_ac_2_description_ | _TBD_ac_2_test_id_ |
83
89
 
84
90
  ## Non-Goals
91
+
85
92
  [To be developed through intake conversation]
86
93
 
87
94
  ## Technical Approach
95
+
88
96
  [To be developed through intake conversation]
89
97
 
90
98
  ## Eligibility / Cap Policy <!-- OPTIONAL -->
@@ -118,6 +126,7 @@ approvers:
118
126
  | QA | _TBD_approver_qa_ | Test plan review | [ ] |
119
127
 
120
128
  ### Approval Gates
129
+
121
130
  - [ ] Spec approved by Product Owner
122
131
  - [ ] Architecture reviewed by Tech Lead
123
132
  - [ ] Security review completed (if touching auth, data, or external APIs)
@@ -138,29 +147,35 @@ approvers:
138
147
  <!-- Define rollout approach for production delivery -->
139
148
 
140
149
  ### Rollout Phases
150
+
141
151
  1. **Canary** (1-5% traffic) — Validate core flows, monitor error rates
142
152
  2. **Limited GA** (25%) — Expand to subset, watch performance metrics
143
153
  3. **Full GA** (100%) — Complete rollout
144
154
 
145
155
  ### Feature Flags
156
+
146
157
  - Flag name: `[feature_flag_name]`
147
158
  - Default: `off`
148
159
  - Kill switch: [yes/no]
149
160
 
150
161
  ### Rollback Plan
162
+
151
163
  - Trigger: [e.g., error rate >1%, latency >500ms p95]
152
164
  - Process: [e.g., disable feature flag, revert deployment]
153
165
  - Data rollback: [e.g., migration revert script, N/A]
154
166
 
155
167
  ### Monitoring
168
+
156
169
  - Dashboard: [link or name]
157
170
  - Alerts: [e.g., PagerDuty rule for error rate spike]
158
171
  - Key metrics: [e.g., error rate, latency, throughput]
159
172
 
160
173
  ## Open Questions
174
+
161
175
  [Tracked during conversation]
162
176
 
163
177
  ## Conversation Log
178
+ >
164
179
  > Key decisions and reasoning captured during intake.
165
180
 
166
181
  [Conversation summary will be added here]
@@ -29,12 +29,14 @@ generated_at: "{ISO_TIMESTAMP}"
29
29
  ## Frameworks & Libraries
30
30
 
31
31
  ### Core
32
+
32
33
  | Name | Version | Purpose |
33
34
  |------|---------|---------|
34
35
  | [Framework] | [Version] | [Purpose] |
35
36
  | [Library] | [Version] | [Purpose] |
36
37
 
37
38
  ### Development
39
+
38
40
  | Name | Version | Purpose |
39
41
  |------|---------|---------|
40
42
  | [Tool] | [Version] | [Purpose] |
@@ -64,14 +66,17 @@ generated_at: "{ISO_TIMESTAMP}"
64
66
  ## Build & Deploy
65
67
 
66
68
  ### Build
69
+
67
70
  - **Tool**: [Webpack/Vite/esbuild/etc]
68
71
  - **Output**: [dist/build/etc]
69
72
 
70
73
  ### CI/CD
74
+
71
75
  - **Platform**: [GitHub Actions/CircleCI/etc]
72
76
  - **Triggers**: [on push, PR, etc]
73
77
 
74
78
  ### Deployment
79
+
75
80
  - **Target**: [Vercel/AWS/GCP/etc]
76
81
  - **Environments**: [dev, staging, prod]
77
82
 
@@ -80,18 +85,22 @@ generated_at: "{ISO_TIMESTAMP}"
80
85
  ## Code Patterns
81
86
 
82
87
  ### Architecture
88
+
83
89
  - **Pattern**: [Clean Architecture/MVC/Hexagonal/etc]
84
90
  - **Rationale**: [Why this pattern]
85
91
 
86
92
  ### State Management
93
+
87
94
  - **Approach**: [Redux/Zustand/Context/etc]
88
95
  - **Rationale**: [Why this approach]
89
96
 
90
97
  ### Error Handling
98
+
91
99
  - **Strategy**: [Centralized/per-module/etc]
92
100
  - **Logging**: [Tool/service]
93
101
 
94
102
  ### API Design
103
+
95
104
  - **Style**: [REST/GraphQL/gRPC]
96
105
  - **Conventions**: [Naming, versioning]
97
106
 
@@ -140,15 +149,18 @@ graph TD
140
149
  ## Code Style
141
150
 
142
151
  ### Linting
152
+
143
153
  - **Tool**: [ESLint/Prettier/etc]
144
154
  - **Config**: [.eslintrc / prettier.config.js]
145
155
 
146
156
  ### Formatting
157
+
147
158
  - **Indentation**: [2 spaces / 4 spaces / tabs]
148
159
  - **Line Length**: [80 / 100 / 120]
149
160
  - **Quotes**: [single / double]
150
161
 
151
162
  ### Naming Conventions
163
+
152
164
  - **Files**: [kebab-case / camelCase / PascalCase]
153
165
  - **Functions**: [camelCase]
154
166
  - **Classes**: [PascalCase]