@drafthq/draft 3.5.3 → 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 (143) 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/hosts/cursor.js +3 -0
  7. package/cli/src/installer.js +8 -4
  8. package/cli/src/lib/cursor-registry.js +10 -0
  9. package/cli/src/lib/fsx.js +3 -0
  10. package/cli/src/lib/marker.js +8 -3
  11. package/core/agents/architect.md +21 -9
  12. package/core/agents/debugger.md +5 -0
  13. package/core/agents/ops.md +7 -2
  14. package/core/agents/planner.md +7 -0
  15. package/core/agents/rca.md +14 -3
  16. package/core/agents/reviewer.md +1 -0
  17. package/core/agents/writer.md +6 -0
  18. package/core/knowledge-base.md +22 -3
  19. package/core/methodology.md +30 -5
  20. package/core/shared/condensation.md +28 -18
  21. package/core/shared/context-verify.md +3 -1
  22. package/core/shared/cross-skill-dispatch.md +7 -3
  23. package/core/shared/draft-context-loading.md +3 -0
  24. package/core/shared/git-report-metadata.md +2 -1
  25. package/core/shared/graph-query.md +24 -26
  26. package/core/shared/graph-usage-report.md +1 -1
  27. package/core/shared/jira-sync.md +10 -6
  28. package/core/shared/okf-retrieval.md +1 -1
  29. package/core/shared/parallel-analysis.md +14 -7
  30. package/core/shared/pattern-learning.md +2 -0
  31. package/core/shared/template-contract.md +1 -1
  32. package/core/shared/tool-resolver.md +20 -15
  33. package/core/shared/vcs-commands.md +5 -2
  34. package/core/templates/ai-context.md +3 -2
  35. package/core/templates/ai-profile.md +7 -0
  36. package/core/templates/architecture.md +6 -2
  37. package/core/templates/discovery.md +1 -1
  38. package/core/templates/guardrails.md +9 -0
  39. package/core/templates/hld.md +5 -4
  40. package/core/templates/intake-questions.md +45 -0
  41. package/core/templates/jira.md +11 -2
  42. package/core/templates/lld.md +8 -5
  43. package/core/templates/okf/concept.md +0 -1
  44. package/core/templates/plan.md +1 -1
  45. package/core/templates/product.md +11 -2
  46. package/core/templates/rca.md +6 -0
  47. package/core/templates/service-index.md +1 -0
  48. package/core/templates/spec.md +15 -0
  49. package/core/templates/tech-stack.md +12 -0
  50. package/core/templates/workflow.md +20 -0
  51. package/integrations/agents/AGENTS.md +1449 -817
  52. package/integrations/copilot/.github/copilot-instructions.md +1449 -817
  53. package/package.json +1 -1
  54. package/scripts/fetch-memory-engine.sh +25 -7
  55. package/scripts/lib.sh +90 -6
  56. package/scripts/tools/_graph_queries.sh +22 -8
  57. package/scripts/tools/_lib.sh +81 -11
  58. package/scripts/tools/adr-index.sh +1 -1
  59. package/scripts/tools/check-repo-size.sh +125 -0
  60. package/scripts/tools/check-skill-line-caps.sh +3 -4
  61. package/scripts/tools/check-template-noop.sh +0 -1
  62. package/scripts/tools/check-track-hygiene.sh +41 -21
  63. package/scripts/tools/classify-files.sh +3 -3
  64. package/scripts/tools/cycle-detect.sh +18 -17
  65. package/scripts/tools/detect-test-framework.sh +1 -1
  66. package/scripts/tools/emit-skill-metrics.sh +7 -2
  67. package/scripts/tools/fix-whitespace.sh +3 -0
  68. package/scripts/tools/freshness-check.sh +2 -2
  69. package/scripts/tools/git-metadata.sh +12 -6
  70. package/scripts/tools/graph-arch.sh +5 -11
  71. package/scripts/tools/graph-callers.sh +10 -15
  72. package/scripts/tools/graph-deps.sh +3 -10
  73. package/scripts/tools/graph-errors.sh +4 -11
  74. package/scripts/tools/graph-hierarchy.sh +4 -11
  75. package/scripts/tools/graph-impact.sh +21 -19
  76. package/scripts/tools/graph-init.sh +13 -9
  77. package/scripts/tools/graph-preflight.sh +4 -1
  78. package/scripts/tools/graph-query.sh +74 -18
  79. package/scripts/tools/graph-risk.sh +3 -10
  80. package/scripts/tools/graph-search.sh +4 -11
  81. package/scripts/tools/graph-snapshot.sh +38 -9
  82. package/scripts/tools/graph-snippet.sh +3 -10
  83. package/scripts/tools/graph-tests.sh +3 -10
  84. package/scripts/tools/graph-traces.sh +3 -10
  85. package/scripts/tools/hotspot-rank.sh +6 -12
  86. package/scripts/tools/install-smoke-test.sh +223 -0
  87. package/scripts/tools/mermaid-from-graph.sh +5 -11
  88. package/scripts/tools/migrate-track-frontmatter.sh +11 -10
  89. package/scripts/tools/okf-coverage-check.sh +8 -7
  90. package/scripts/tools/okf-emit-catalog.sh +256 -0
  91. package/scripts/tools/okf-fix-links.sh +251 -0
  92. package/scripts/tools/okf-plan-concepts.sh +242 -14
  93. package/scripts/tools/okf-render-views.sh +63 -21
  94. package/scripts/tools/okf-validate-all.sh +20 -9
  95. package/scripts/tools/okf-validate-quality.sh +15 -10
  96. package/scripts/tools/okf-validate.sh +20 -6
  97. package/scripts/tools/parse-git-log.sh +23 -5
  98. package/scripts/tools/parse-reports.sh +1 -1
  99. package/scripts/tools/render-track.sh +1 -1
  100. package/scripts/tools/resolve-tools.sh +24 -8
  101. package/scripts/tools/run-coverage.sh +1 -1
  102. package/scripts/tools/scan-markers.sh +4 -4
  103. package/scripts/tools/validate-frontmatter.sh +2 -2
  104. package/scripts/tools/verify-citations.sh +3 -4
  105. package/scripts/tools/verify-doc-anchors.sh +14 -34
  106. package/scripts/tools/verify-graph-binary.sh +15 -5
  107. package/skills/GRAPH.md +21 -10
  108. package/skills/adr/SKILL.md +25 -7
  109. package/skills/assist-review/SKILL.md +2 -1
  110. package/skills/bughunt/SKILL.md +55 -12
  111. package/skills/bughunt/references/regression-tests.md +14 -4
  112. package/skills/change/SKILL.md +19 -9
  113. package/skills/coverage/SKILL.md +28 -12
  114. package/skills/debug/SKILL.md +13 -3
  115. package/skills/decompose/SKILL.md +42 -12
  116. package/skills/deep-review/SKILL.md +19 -6
  117. package/skills/deploy-checklist/SKILL.md +10 -3
  118. package/skills/documentation/SKILL.md +12 -1
  119. package/skills/draft/SKILL.md +40 -29
  120. package/skills/draft/context-files.md +8 -1
  121. package/skills/draft/quality-guide.md +10 -2
  122. package/skills/graph/SKILL.md +2 -2
  123. package/skills/impact/SKILL.md +4 -2
  124. package/skills/implement/SKILL.md +62 -20
  125. package/skills/incident-response/SKILL.md +5 -2
  126. package/skills/init/SKILL.md +112 -30
  127. package/skills/init/references/architecture-spec.md +32 -8
  128. package/skills/init/references/okf-emitter.md +42 -78
  129. package/skills/jira/SKILL.md +33 -13
  130. package/skills/jira/references/review.md +61 -19
  131. package/skills/learn/SKILL.md +30 -7
  132. package/skills/new-track/SKILL.md +73 -18
  133. package/skills/quick-review/SKILL.md +8 -3
  134. package/skills/revert/SKILL.md +11 -5
  135. package/skills/review/SKILL.md +126 -27
  136. package/skills/review/references/zero-setup-mode.md +117 -0
  137. package/skills/standup/SKILL.md +10 -2
  138. package/skills/status/SKILL.md +7 -7
  139. package/skills/tech-debt/SKILL.md +9 -3
  140. package/skills/testing-strategy/SKILL.md +10 -2
  141. package/skills/tour/SKILL.md +2 -1
  142. package/skills/upload/SKILL.md +4 -3
  143. package/core/templates/track-architecture.md +0 -311
@@ -79,6 +79,7 @@ The Graph Health & Fidelity Dashboard (above) is the first artifact any reader o
79
79
  The longest and most precise section.
80
80
 
81
81
  Every invariant must include:
82
+
82
83
  - Precise statement
83
84
  - Why violation is dangerous
84
85
  - Enforcement mechanism (test, runtime, type system, review, graph constraint, or none)
@@ -86,7 +87,7 @@ Every invariant must include:
86
87
 
87
88
  Example format:
88
89
 
89
- ```
90
+ ```text
90
91
  ### INV-003: Sentinel Lock Ordering
91
92
  **Rule**: `_strategies_lock < _strategy_process_locks < _global_capacity_lock < entry_lock`
92
93
  **Fidelity**: High (enforced in code + tests)
@@ -106,6 +107,7 @@ Focus on the highest-value dynamic behavior:
106
107
  - Lifecycle sequences (bootstrap, shutdown, reconciliation, failover)
107
108
 
108
109
  Each backed by:
110
+
109
111
  - Graph-derived paths where available
110
112
  - High-quality Mermaid (stateDiagram-v2, sequenceDiagram, or detailed flowchart)
111
113
  - Explicit note when the flow is only partially visible in the graph
@@ -135,6 +137,7 @@ Include a short "graph coverage for this view" paragraph.
135
137
  ## 6. Error Handling & Failure Mode Catalog
136
138
 
137
139
  For every major component or flow:
140
+
138
141
  - What can go wrong
139
142
  - How it is detected
140
143
  - The defined safe response
@@ -145,6 +148,7 @@ For every major component or flow:
145
148
  ## 7. State & Data Truth Sources + Reconciliation
146
149
 
147
150
  For each major domain:
151
+
148
152
  - Authoritative source
149
153
  - Derived / cached views
150
154
  - Reconciliation mechanisms and lag tolerance
@@ -201,4 +205,4 @@ AI agents are trained by the document itself to treat Stub and Human Judgment cl
201
205
 
202
206
  **End of clean graph-primary architecture template.**
203
207
 
204
- This is the single forward-looking source of truth. Legacy 28-section volume-oriented material has been retired.
208
+ This is the single forward-looking source of truth. Legacy 28-section volume-oriented material has been retired.
@@ -67,7 +67,7 @@ track ID, or `_NONE_FOUND_` with justification.
67
67
 
68
68
  Flat list of files and functions touched in the spike. Files cited here
69
69
  without line numbers are exempt from drift checks (they document
70
- *familiarity*, not pinned facts).
70
+ _familiarity_, not pinned facts).
71
71
 
72
72
  - _TBD_reference_1_path_ — _TBD_reference_1_symbol_ — _TBD_reference_1_role_
73
73
  - _TBD_reference_2_path_ — _TBD_reference_2_symbol_ — _TBD_reference_2_role_
@@ -32,21 +32,25 @@ Run `/draft:learn` to scan the codebase and update learned patterns. Quality com
32
32
  <!-- Hard constraints that must never be violated. Check [x] to enable enforcement. -->
33
33
 
34
34
  ### Git & Version Control
35
+
35
36
  - [ ] No direct commits to main/master
36
37
  - [ ] No force push to shared branches
37
38
  - [ ] PR required for all changes
38
39
 
39
40
  ### Code Quality
41
+
40
42
  - [ ] No console.log/print statements in production code
41
43
  - [ ] No commented-out code blocks
42
44
  - [ ] No TODO comments without linked issue
43
45
 
44
46
  ### Security
47
+
45
48
  - [ ] No secrets/credentials in code
46
49
  - [ ] No disabled security checks without documented exception
47
50
  - [ ] Dependencies must pass security audit
48
51
 
49
52
  ### Testing
53
+
50
54
  - [ ] Tests required before merge
51
55
  - [ ] No skipped tests without documented reason
52
56
  - [ ] Coverage must not decrease
@@ -67,6 +71,7 @@ Run `/draft:learn` to scan the codebase and update learned patterns. Quality com
67
71
  - [x] G1.12: No `shared_ptr` binding to non-trivial objects (EventDriver holders) in callbacks
68
72
 
69
73
  ### C++/Systems — Concurrency & Locking
74
+
70
75
  - [x] G2.1: No mutable operations under shared/read locks
71
76
  - [x] G2.2: Always release spinlock before invoking callbacks or `Finish()`
72
77
  - [x] G2.3: No expensive object destruction under spinlock protection
@@ -74,12 +79,14 @@ Run `/draft:learn` to scan the codebase and update learned patterns. Quality com
74
79
  - [x] G2.5: No synchronous waits (`Trigger::Wait`) in async code paths
75
80
 
76
81
  ### C++/Systems — Control Flow & Error Handling
82
+
77
83
  - [x] G3.1: Always `return` after `Finish()` in conditional blocks
78
84
  - [x] G3.2: CHECKs for internal consistency only — never for external input validation
79
85
  - [x] G3.3: No side-effecting expressions inside DCHECK
80
86
  - [x] G3.4: CHECK/DCHECK/LOG(DFATAL) selection per severity matrix
81
87
 
82
88
  ### C++/Systems — Format & API Correctness
89
+
83
90
  - [x] G4.1: Printf format specifiers must match argument types
84
91
  - [x] G4.2: MemTracer Print vs Printf selection (lazy construction vs immediate materialization)
85
92
  - [x] G4.3: Use Maybe-prefixed MemTracer variants only when op may be finished
@@ -87,9 +94,11 @@ Run `/draft:learn` to scan the codebase and update learned patterns. Quality com
87
94
  - [x] G4.5: `boost::optional<bool>` tests presence, not value — use `*xx` or `.value_or()`
88
95
 
89
96
  ### C++/Systems — GFlags & Runtime Configuration
97
+
90
98
  - [x] G5.1: Snapshot gflag values at op start — never depend on flag stability mid-op
91
99
 
92
100
  ### C++/Systems — Performance
101
+
93
102
  - [x] G6.1: Avoid `ByteSize()` on proto objects in hot paths
94
103
  - [x] G6.2: Prefer repeated fields over map fields in proto for serialization-sensitive paths
95
104
  - [x] G6.3: No inline execution in `SpawnWorkersAndJoin` `done_cb`
@@ -194,9 +194,9 @@ For each component, populate one subsection:
194
194
 
195
195
  Provide a brief list and summary of all inventions associated with the proposed design.
196
196
 
197
- 1.
198
- 2.
199
- 3.
197
+ 1.
198
+ 2.
199
+ 3.
200
200
 
201
201
  **Were Invention Disclosure Forms (IDFs) submitted for the inventions listed?**
202
202
 
@@ -208,6 +208,7 @@ Provide a brief list and summary of all inventions associated with the proposed
208
208
  ### Third Party Technology (TPT)
209
209
 
210
210
  **TPT includes:**
211
+
211
212
  - **Open Source Software (OSS):** Software licensed under an Open Source License (e.g., MIT, BSD, GPL, Apache)
212
213
  - **Commercial (non-OSS) Technology:** Non- software, documentation, content, APIs, SDKs, logos, artwork, data, GUIs, Tools, databases, and other intellectual property NOT licensed under an Open Source License
213
214
 
@@ -289,7 +290,7 @@ Provide a brief list and summary of all inventions associated with the proposed
289
290
 
290
291
  ### Cost Implications <!-- REQUIRED -->
291
292
 
292
- *Primarily for SaaS deployments*
293
+ _Primarily for SaaS deployments_
293
294
 
294
295
  - Include cloud cost calculation here
295
296
  - Is there any cost to the customer for cloud workloads?
@@ -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
-
@@ -111,7 +111,7 @@ validator chain via the canonical resolver pattern (see
111
111
  [core/shared/verification-gates.md](../../core/shared/verification-gates.md)):
112
112
 
113
113
  ```bash
114
- DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
114
+ DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
115
115
  [ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
116
116
  [ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
117
117
  [ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
@@ -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]