sdlc-framework 1.0.0 → 1.0.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 (49) hide show
  1. package/README.md +89 -46
  2. package/bin/install.js +4 -4
  3. package/package.json +2 -2
  4. package/src/commands/close.md +50 -25
  5. package/src/commands/debug.md +5 -5
  6. package/src/commands/discuss.md +90 -0
  7. package/src/commands/fast.md +49 -13
  8. package/src/commands/fix.md +18 -18
  9. package/src/commands/help.md +26 -21
  10. package/src/commands/impl.md +11 -10
  11. package/src/commands/init.md +23 -7
  12. package/src/commands/spec.md +42 -22
  13. package/src/commands/status.md +57 -91
  14. package/src/commands/verify.md +81 -120
  15. package/src/references/loop-phases.md +24 -30
  16. package/src/references/prompt-detection.md +7 -7
  17. package/src/rules/commands.md +2 -2
  18. package/src/rules/style.md +3 -4
  19. package/src/rules/workflows.md +3 -4
  20. package/src/templates/HANDOFF.md +1 -1
  21. package/src/templates/LAWS.md +2 -2
  22. package/src/templates/PRD.md +89 -0
  23. package/src/templates/ROADMAP.md +2 -3
  24. package/src/templates/STATE.md +15 -5
  25. package/src/templates/SUMMARY.md +2 -2
  26. package/src/workflows/close-phase.md +117 -37
  27. package/src/workflows/debug-flow.md +16 -5
  28. package/src/workflows/discuss-phase.md +395 -0
  29. package/src/workflows/fast-forward.md +103 -15
  30. package/src/workflows/fix-findings.md +42 -19
  31. package/src/workflows/impl-phase.md +130 -17
  32. package/src/workflows/init-project.md +19 -8
  33. package/src/workflows/spec-phase.md +305 -41
  34. package/src/workflows/status-session.md +229 -0
  35. package/src/workflows/verify-phase.md +300 -112
  36. package/src/commands/hotfix.md +0 -99
  37. package/src/commands/milestone.md +0 -136
  38. package/src/commands/pause.md +0 -115
  39. package/src/commands/research.md +0 -136
  40. package/src/commands/resume.md +0 -103
  41. package/src/commands/review.md +0 -195
  42. package/src/templates/REVIEW.md +0 -145
  43. package/src/workflows/hotfix-flow.md +0 -190
  44. package/src/workflows/milestone-management.md +0 -169
  45. package/src/workflows/pause-work.md +0 -153
  46. package/src/workflows/research.md +0 -219
  47. package/src/workflows/resume-project.md +0 -159
  48. package/src/workflows/review-phase.md +0 -337
  49. package/src/workflows/transition-phase.md +0 -203
@@ -0,0 +1,395 @@
1
+ <purpose>Drive AI-led brainstorming to transform a raw idea into a structured PRD. The discuss phase sits upstream of spec — it explores the problem space, researches unknowns inline, validates approaches, and builds requirements through targeted questioning. Without this phase, specs are built on assumptions instead of explored decisions.</purpose>
2
+ <when_to_use>Run when the user has an idea but has not yet defined what to build. Also use when research is needed — external APIs, library choices, codebase patterns, best practices. This is pre-loop discovery — it feeds into /sdlc:spec. Can run at any point: before init, between loops, or when pivoting direction.</when_to_use>
3
+ <required_reading>.sdlc/PROJECT.md (if exists), .sdlc/ROADMAP.md (if exists), .sdlc/research/*.md (prior research), codebase structure for technical context</required_reading>
4
+ <loop_context>
5
+ expected_phase: DISCUSS (pre-loop activity)
6
+ prior_phase: any (entry point or between loops)
7
+ next_phase: SPEC (discuss always leads to spec)
8
+ </loop_context>
9
+ <process>
10
+
11
+ <step name="seed_idea" priority="first">
12
+ The discussion needs a starting point — without one, questions are unfocused.
13
+
14
+ IF $ARGUMENTS provided:
15
+ Restate the idea in one sentence to confirm understanding.
16
+ Ask: "Is this what you want to explore, or should I adjust the framing?"
17
+
18
+ IF $ARGUMENTS empty:
19
+ Ask: "What idea, feature, or problem do you want to explore?"
20
+ Wait for response before proceeding.
21
+
22
+ IF .sdlc/PROJECT.md exists:
23
+ Read it. Note the tech stack, architecture, and constraints.
24
+ These inform all downstream questions — do not ask about things the project context already answers.
25
+
26
+ Record the seed idea for the decisions log.
27
+ </step>
28
+
29
+ <step name="explore_problem" priority="second">
30
+ Understanding the problem prevents building solutions to the wrong thing. Most failed features solve real problems badly because the problem was never properly defined.
31
+
32
+ Ask 2-4 questions from this category. Include a recommendation with each. Use AskUserQuestion.
33
+
34
+ PROBLEM QUESTIONS (pick the most relevant):
35
+ - "What specific problem does this solve? Who encounters it and how often?"
36
+ Recommendation: Frame the problem from the user's perspective, not the system's.
37
+ - "How do users solve this today? What makes current workarounds insufficient?"
38
+ Recommendation: Based on codebase scan, suggest what exists and what gaps you see.
39
+ - "What happens if this is not built? What is the cost of inaction?"
40
+ Recommendation: Assess severity based on what you know about the project.
41
+ - "Is this a new capability, an improvement to something existing, or a fix?"
42
+ Recommendation: Based on codebase, state whether related functionality already exists.
43
+
44
+ DO NOT ask questions whose answers are already in PROJECT.md or the codebase.
45
+ DO NOT ask questions that do not affect the technical solution.
46
+
47
+ Record all answers in the decisions log.
48
+ </step>
49
+
50
+ <step name="define_scope" priority="third">
51
+ Scope prevents building too much or too little. Without explicit scope, features creep and deadlines slip.
52
+
53
+ Ask 2-4 questions from this category. Include a recommendation with each.
54
+
55
+ SCOPE QUESTIONS (pick the most relevant):
56
+ - "What is the smallest version of this that delivers value? What is the full vision?"
57
+ Recommendation: Propose an MVP scope based on the problem definition.
58
+ - "What is explicitly NOT included? What should be deferred to later?"
59
+ Recommendation: Suggest boundaries based on complexity and dependencies.
60
+ - "Are there timeline or resource constraints that affect scope?"
61
+ Recommendation: If constraints exist, suggest what to cut first.
62
+ - "Does this interact with existing features? Which ones?"
63
+ Recommendation: Based on codebase scan, identify integration points.
64
+
65
+ After this round, you should be able to state the scope in one sentence.
66
+ Display: "Scope summary: {one sentence}. Does this match your intent?"
67
+
68
+ Record all answers in the decisions log.
69
+ </step>
70
+
71
+ <step name="research_unknowns" priority="fourth">
72
+ Unknowns discovered during problem and scope rounds must be resolved before choosing an approach. Picking an approach without understanding external APIs, library options, or codebase patterns leads to rework.
73
+
74
+ SKIP CONDITION: If no unknowns were identified in prior rounds — the idea is clear, the tech is familiar, and existing codebase patterns are sufficient — skip research and proceed to validate_approach.
75
+
76
+ A. IDENTIFY UNKNOWNS:
77
+ Review answers from explore_problem and define_scope. Extract unknowns:
78
+ - External APIs or services that need integration
79
+ - Library or tool choices not yet decided
80
+ - Codebase patterns not yet understood (how does X work in our code?)
81
+ - Best practices or security considerations for unfamiliar territory
82
+ - Migration paths or upgrade strategies
83
+
84
+ IF no unknowns identified:
85
+ Display: "No research needed — proceeding to approach validation."
86
+ Skip to validate_approach.
87
+
88
+ B. CLASSIFY RESEARCH TYPE:
89
+ For each unknown, classify:
90
+
91
+ TYPE: CODEBASE_EXPLORATION
92
+ Indicators: "how does X work in our code", "where is Y implemented", "what pattern does Z use", "find all instances of W"
93
+ Method: Codebase search agent (Grep, Glob, Read)
94
+
95
+ TYPE: WEB_RESEARCH
96
+ Indicators: "what is the best library for X", "how does Y technology work", "compare options for Z", "what are best practices for W"
97
+ Method: WebSearch agent
98
+
99
+ TYPE: HYBRID
100
+ Indicators: "how should we implement X" (needs both codebase understanding AND external knowledge)
101
+ Method: Both codebase and web agents
102
+
103
+ Display: "Unknowns identified: {list}. Research type: {type}. Spawning research subagents."
104
+
105
+ C. SPAWN RESEARCH SUBAGENTS:
106
+
107
+ For CODEBASE_EXPLORATION: spawn ONE Agent with run_in_background: true.
108
+ Agent instruction:
109
+ ```
110
+ You are researching the codebase to answer: "{research question}"
111
+
112
+ PROJECT CONTEXT:
113
+ {from PROJECT.md: tech stack, architecture, conventions}
114
+
115
+ YOUR TASK:
116
+ 1. Search for files and code related to: {topic}
117
+ - Use Glob to find files by name pattern
118
+ - Use Grep to search file contents for relevant patterns
119
+ - Read key files to understand implementation details
120
+
121
+ 2. For each relevant finding, record:
122
+ - File path and line numbers
123
+ - What the code does
124
+ - What pattern it follows
125
+ - How it relates to the research question
126
+
127
+ 3. Look for:
128
+ - Existing implementations of similar features
129
+ - Patterns and conventions used in the codebase
130
+ - Utilities, helpers, and shared code that could be reused
131
+ - Test patterns used for similar features
132
+ - Configuration and setup patterns
133
+
134
+ 4. Compile findings into a structured summary:
135
+ - Existing patterns found: {list with file references}
136
+ - Reusable code: {list of utilities/helpers that apply}
137
+ - Conventions: {naming, structure, testing patterns}
138
+ - Gaps: {what does NOT exist yet that would be needed}
139
+ - Recommendation: {how to approach the implementation based on existing patterns}
140
+ ```
141
+
142
+ For WEB_RESEARCH: spawn ONE Agent with run_in_background: true.
143
+ Agent instruction:
144
+ ```
145
+ You are researching an external topic to inform a specification.
146
+
147
+ RESEARCH QUESTION: "{research question}"
148
+
149
+ PROJECT CONTEXT:
150
+ {from PROJECT.md: tech stack — so research is relevant to the stack}
151
+
152
+ YOUR TASK:
153
+ 1. Use WebSearch to find information about: {topic}
154
+ 2. Search for:
155
+ - Official documentation for relevant libraries/tools
156
+ - Best practices and common patterns
157
+ - Comparison articles if evaluating options
158
+ - Known issues, gotchas, and caveats
159
+ - Security considerations
160
+
161
+ 3. For each option/approach found:
162
+ - Name and description
163
+ - Pros: {advantages}
164
+ - Cons: {disadvantages}
165
+ - Maturity: {stable, beta, experimental}
166
+ - Community: {active, declining, abandoned}
167
+ - Compatibility with our stack: {yes/no, details}
168
+
169
+ 4. Compile findings into a structured summary:
170
+ - Options evaluated: {list}
171
+ - Recommended option: {which and why}
172
+ - Key considerations: {trade-offs, risks}
173
+ - Implementation notes: {relevant details for the spec}
174
+ ```
175
+
176
+ For HYBRID: spawn TWO Agents (one codebase, one web) in parallel with run_in_background: true.
177
+
178
+ D. COLLECT AND SYNTHESIZE:
179
+ Wait for all agents to complete.
180
+
181
+ Synthesize findings:
182
+ - Are codebase patterns consistent with external best practices?
183
+ - Do any options conflict with existing conventions?
184
+ - Are there security or performance concerns?
185
+
186
+ E. SAVE FINDINGS:
187
+ Create .sdlc/research/ directory if it does not exist.
188
+ Generate a topic slug: lowercase, hyphens, no special characters, max 40 chars.
189
+
190
+ Write to .sdlc/research/{topic-slug}.md:
191
+ ```markdown
192
+ # Research: {topic}
193
+
194
+ ## Question
195
+ {Original research question}
196
+
197
+ ## Date
198
+ {ISO timestamp}
199
+
200
+ ## Type
201
+ {CODEBASE|WEB|HYBRID}
202
+
203
+ ## Codebase Findings
204
+ {Structured findings from codebase exploration}
205
+ - Pattern: {description} — {file}:{line}
206
+ - Reusable: {utility/helper} — {file}
207
+
208
+ ## External Findings
209
+ {Structured findings from web research}
210
+ - Option: {name} — Pros: {pros}, Cons: {cons}
211
+
212
+ ## Synthesis
213
+ {Combined analysis}
214
+
215
+ ## Recommendation
216
+ {What to do in the spec, and why}
217
+
218
+ ## References
219
+ - {file paths for codebase references}
220
+ - {URLs for web references}
221
+ ```
222
+
223
+ F. PRESENT FINDINGS:
224
+ Display synthesized findings to the user:
225
+ ```
226
+ Research Findings: {topic}
227
+
228
+ Codebase:
229
+ - Found {N} relevant patterns
230
+ - Key pattern: {description} (used in {files})
231
+ - Reusable: {list of utilities/helpers}
232
+ - Gap: {what is missing}
233
+
234
+ External:
235
+ - Recommended approach: {option}
236
+ - Key trade-off: {trade-off}
237
+ - Risk: {risk}
238
+
239
+ Saved: .sdlc/research/{topic-slug}.md
240
+ ```
241
+
242
+ These findings feed directly into the next step — approach validation.
243
+ </step>
244
+
245
+ <step name="validate_approach" priority="fifth">
246
+ Choosing the wrong approach is the most expensive mistake — it compounds through every downstream phase. Presenting options with trade-offs prevents blind commitment to the first idea.
247
+
248
+ Based on the problem, scope, and research findings (if any), identify 2-3 viable technical approaches.
249
+
250
+ IF research was conducted in research_unknowns:
251
+ Use research findings to inform approach options. Reference specific findings — do not ignore the research.
252
+ Approaches that conflict with codebase patterns or external best practices must note the conflict.
253
+
254
+ Present each approach:
255
+ ```
256
+ Approach A (recommended): {description}
257
+ - Effort: {low/medium/high}
258
+ - Risk: {what could go wrong}
259
+ - Maintenance: {ongoing burden}
260
+ - Fits existing patterns: {yes/no — reference specific codebase patterns}
261
+ - Research support: {what research findings support this approach}
262
+
263
+ Approach B: {description}
264
+ - Effort: {low/medium/high}
265
+ - Risk: {what could go wrong}
266
+ - Maintenance: {ongoing burden}
267
+ - Fits existing patterns: {yes/no}
268
+
269
+ Approach C (do nothing / defer): {description}
270
+ - Risk of deferring: {what happens}
271
+ ```
272
+
273
+ Ask: "Which approach do you prefer? I recommend Approach A because {concrete reason}."
274
+
275
+ IF the user picks a non-recommended approach:
276
+ Acknowledge the choice. Do not argue. Record the rationale.
277
+
278
+ IF the user is unsure:
279
+ Ask one targeted follow-up to resolve the uncertainty.
280
+
281
+ Record the chosen approach and rationale in the decisions log.
282
+ </step>
283
+
284
+ <step name="detail_requirements" priority="sixth">
285
+ Requirements bridge the gap between "what to build" and "how to spec it." Missing requirements surface as bugs during implementation.
286
+
287
+ Ask 2-4 questions from this category. Include a recommendation with each.
288
+
289
+ REQUIREMENTS QUESTIONS (pick the most relevant):
290
+ - "Walk me through the primary user flow. What does the user do step by step?"
291
+ Recommendation: Propose a flow based on the chosen approach.
292
+ - "What are the edge cases? What happens when {unlikely but possible scenario}?"
293
+ Recommendation: List 2-3 edge cases you identified and propose handling.
294
+ - "Are there security, performance, or accessibility requirements?"
295
+ Recommendation: Based on project context, suggest relevant NFRs.
296
+ - "How will you know this works? What does success look like?"
297
+ Recommendation: Propose measurable success criteria.
298
+ - "What data does this feature need? New models, fields, or API endpoints?"
299
+ Recommendation: Based on codebase, suggest data model approach.
300
+
301
+ STOP ASKING SIGNAL:
302
+ - You can write functional requirements for the core flow.
303
+ - You can list at least 3 edge cases with expected behavior.
304
+ - You know the primary user flow end to end.
305
+ - Remaining unknowns are implementation details, not requirements.
306
+
307
+ IF clarity is sufficient after round 2 or 3, skip this round and proceed to compile.
308
+
309
+ Record all answers in the decisions log.
310
+ </step>
311
+
312
+ <step name="compile_prd" priority="seventh">
313
+ The PRD is the deliverable — it captures every decision made during discussion and every research finding discovered. Without it, the discussion is just a conversation that evaporates.
314
+
315
+ Create .sdlc/discuss/ directory if it does not exist.
316
+
317
+ Generate a topic slug from the seed idea: lowercase, hyphens, no special characters, max 40 chars.
318
+
319
+ Write .sdlc/discuss/{topic-slug}-PRD.md using the PRD template structure:
320
+ - Problem Statement: from explore_problem answers
321
+ - Proposed Solution: from validate_approach chosen approach
322
+ - Alternatives Considered: from validate_approach rejected approaches
323
+ - Research Findings: from research_unknowns findings (if research was conducted)
324
+ - Codebase patterns discovered
325
+ - External options evaluated
326
+ - Recommendation and rationale
327
+ - Link to full research: .sdlc/research/{topic-slug}.md
328
+ - Requirements: from detail_requirements answers
329
+ - Constraints: from define_scope answers
330
+ - Edge Cases: from detail_requirements answers
331
+ - Success Metrics: from detail_requirements answers
332
+ - Decisions Log: every question asked and answer received, numbered
333
+
334
+ IF research was NOT conducted:
335
+ Omit the Research Findings section entirely.
336
+
337
+ Display a compact summary of the PRD (30-50 lines):
338
+ - Problem (2 lines)
339
+ - Solution (2 lines)
340
+ - Research findings (2-3 lines, if applicable)
341
+ - Requirements (numbered list)
342
+ - Constraints (list)
343
+ - Edge cases (list)
344
+ - Open questions (list)
345
+ </step>
346
+
347
+ <step name="approve_and_route" priority="eighth">
348
+ The user must approve the PRD before it feeds into spec. An unapproved PRD is just notes.
349
+
350
+ Ask: "PRD complete. Review the summary above."
351
+ Present options:
352
+ - APPROVE: Lock the PRD and proceed to /sdlc:spec
353
+ - REVISE: Tell me what to change (re-compile after changes)
354
+ - REJECT: Discard the PRD and stop
355
+
356
+ IF APPROVE:
357
+ Set PRD status to APPROVED.
358
+ Update .sdlc/STATE.md:
359
+ - Add history entry: "{timestamp} | discuss | Topic: {topic}. PRD saved. Research: {yes/no}."
360
+ - Set next_required_action: /sdlc:spec
361
+ - Add prd_path: .sdlc/discuss/{topic-slug}-PRD.md
362
+
363
+ Display:
364
+ ```
365
+ PRD approved.
366
+
367
+ Saved: .sdlc/discuss/{topic-slug}-PRD.md
368
+ Research: {.sdlc/research/{topic-slug}.md if applicable, otherwise "none"}
369
+
370
+ The spec phase will use this PRD to create a detailed specification with
371
+ acceptance criteria and task dependencies.
372
+
373
+ NEXT: /sdlc:spec
374
+ ```
375
+
376
+ <auto_advance>
377
+ Read .sdlc/STATE.md auto_advance setting.
378
+ IF auto_advance is true:
379
+ Display: "Auto-advancing to /sdlc:spec in {advance_delay_seconds}s — reply to intervene."
380
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
381
+ If no user message received during sleep: automatically execute /sdlc:spec.
382
+ If user sends a message: cancel auto-advance, process user input, then resume.
383
+ IF auto_advance is false:
384
+ Display: "NEXT ACTION REQUIRED: /sdlc:spec"
385
+ Wait for user to manually run the command.
386
+ </auto_advance>
387
+
388
+ IF REVISE:
389
+ Apply changes. Re-display summary. Re-ask for approval.
390
+
391
+ IF REJECT:
392
+ Delete the PRD file. Display: "PRD discarded." Stop.
393
+ </step>
394
+
395
+ </process>
@@ -1,10 +1,10 @@
1
- <purpose>The universal entry point workflow. Accept a plain language description, classify the work, estimate complexity, and either execute inline (simple work) or route to the appropriate specialized command (complex work, bugs, research, hotfixes). This is the "just tell me what to do" workflow.</purpose>
1
+ <purpose>The universal entry point workflow. Accept a plain language description, classify the work, estimate complexity, and either execute inline (simple work), handle critical issues as inline hotfixes, or route to the appropriate specialized command. This is the "just tell me what to do" workflow.</purpose>
2
2
  <when_to_use>Use anytime. This is the default way to start work. The user describes what they need, and this workflow figures out the rest. No prior knowledge of SDLC commands required.</when_to_use>
3
3
  <required_reading>.sdlc/STATE.md, .sdlc/PROJECT.md, .sdlc/LAWS.md</required_reading>
4
4
  <loop_context>
5
- expected_phase: FAST (compressed loop or routing)
5
+ expected_phase: FAST (compressed loop, inline hotfix, or routing)
6
6
  prior_phase: any (fast can be used between loops or as the first action)
7
- next_phase: depends on routing — SPEC, DEBUG, HOTFIX, RESEARCH, or self-contained
7
+ next_phase: depends on routing — SPEC, DEBUG, DISCUSS, or self-contained
8
8
  </loop_context>
9
9
  <references>
10
10
  @~/.claude/sdlc-framework/references/prompt-detection.md
@@ -49,10 +49,9 @@
49
49
 
50
50
  1. CRITICAL — urgent production issues
51
51
  Indicators: "urgent", "production", "down", "outage", "critical", "P0", "hotfix", "emergency", "ASAP"
52
- Route: /sdlc:hotfix
53
- Display: "Critical issue detected. Routing to /sdlc:hotfix for emergency handling."
54
- Write to STATE.md: fast_context = {original description}
55
- STOP this workflow.
52
+ Route: inline hotfix (skip to inline_hotfix step)
53
+ Display: "Critical issue detected. Running inline hotfix minimal spec, full verification."
54
+ Do NOT stop proceed to inline_hotfix step.
56
55
 
57
56
  2. BUG — something broken that needs debugging
58
57
  Indicators: "fix bug", "broken", "crash", "error when", "fails to", "wrong output", "regression", "not working", "throws", "exception"
@@ -62,13 +61,39 @@
62
61
  - No → FEATURE (a "fix" that is really a refinement)
63
62
  Display: "Bug detected. Routing to /sdlc:debug for structured debugging."
64
63
  Write to STATE.md: fast_context = {original description}
64
+
65
+ <auto_advance>
66
+ Read .sdlc/STATE.md auto_advance setting.
67
+ IF auto_advance is true:
68
+ Display: "Auto-advancing to /sdlc:debug in {advance_delay_seconds}s — reply to intervene."
69
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
70
+ If no user message received during sleep: automatically execute /sdlc:debug.
71
+ If user sends a message: cancel auto-advance, process user input, then resume.
72
+ IF auto_advance is false:
73
+ Display: "NEXT ACTION REQUIRED: /sdlc:debug"
74
+ Wait for user to manually run the command.
75
+ </auto_advance>
76
+
65
77
  STOP this workflow.
66
78
 
67
- 3. RESEARCHexploration and investigation
68
- Indicators: "explore", "investigate", "research", "compare options", "evaluate", "what are the options", "how does X work", "should we use"
69
- Route: /sdlc:research
70
- Display: "Research task detected. Routing to /sdlc:research."
79
+ 3. DISCUSSbrainstorming, research, and exploration
80
+ Indicators: "brainstorm", "discuss", "idea", "what if", "think about", "concept", "should we", "could we", "explore", "investigate", "research", "compare options", "evaluate", "what are the options", "how does X work", "should we use"
81
+ Route: /sdlc:discuss
82
+ Display: "Brainstorming or research topic detected. Routing to /sdlc:discuss for structured discovery."
71
83
  Write to STATE.md: fast_context = {original description}
84
+
85
+ <auto_advance>
86
+ Read .sdlc/STATE.md auto_advance setting.
87
+ IF auto_advance is true:
88
+ Display: "Auto-advancing to /sdlc:discuss in {advance_delay_seconds}s — reply to intervene."
89
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
90
+ If no user message received during sleep: automatically execute /sdlc:discuss.
91
+ If user sends a message: cancel auto-advance, process user input, then resume.
92
+ IF auto_advance is false:
93
+ Display: "NEXT ACTION REQUIRED: /sdlc:discuss"
94
+ Wait for user to manually run the command.
95
+ </auto_advance>
96
+
72
97
  STOP this workflow.
73
98
 
74
99
  4. FEATURE — new functionality
@@ -92,7 +117,7 @@
92
117
 
93
118
  Display: "Classified as: {TYPE}. {Brief explanation of why.}"
94
119
 
95
- WHY: Classification determines the entire routing strategy. Bugs need root cause analysis (debug), not fast implementation. Critical issues need minimal ceremony (hotfix). Research needs subagents, not code changes. Getting the classification wrong wastes the user's time on the wrong workflow.
120
+ WHY: Classification determines the entire routing strategy. Bugs need root cause analysis (debug), not fast implementation. Critical issues need minimal ceremony (hotfix). Research and brainstorming need structured discovery (discuss). Getting the classification wrong wastes the user's time on the wrong workflow.
96
121
  </step>
97
122
 
98
123
  <step name="estimate_complexity" priority="third">
@@ -176,10 +201,21 @@
176
201
  Your description and the identified files have been saved to STATE.md.
177
202
  /sdlc:spec will pick up this context automatically — no need to repeat yourself.
178
203
 
179
- NEXT ACTION REQUIRED: /sdlc:spec
180
- Run /sdlc:spec to decompose this into parallel tasks with proper dependency ordering.
204
+ NEXT: /sdlc:spec
181
205
  ```
182
206
 
207
+ <auto_advance>
208
+ Read .sdlc/STATE.md auto_advance setting.
209
+ IF auto_advance is true:
210
+ Display: "Auto-advancing to /sdlc:spec in {advance_delay_seconds}s — reply to intervene."
211
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
212
+ If no user message received during sleep: automatically execute /sdlc:spec.
213
+ If user sends a message: cancel auto-advance, process user input, then resume.
214
+ IF auto_advance is false:
215
+ Display: "NEXT ACTION REQUIRED: /sdlc:spec — Run /sdlc:spec to decompose this into parallel tasks with proper dependency ordering."
216
+ Wait for user to manually run the command.
217
+ </auto_advance>
218
+
183
219
  STOP this workflow.
184
220
 
185
221
  WHY: The user should not have to re-describe their work when routing. Pre-filling context makes the handoff seamless. The explanation tells the user WHY the routing happened — building trust in the framework's decisions.
@@ -276,7 +312,7 @@
276
312
  - PASS: expected outcome observed
277
313
  - FAIL: expected outcome not observed, describe what happened instead
278
314
 
279
- IF ALL PASS: proceed to mini-review
315
+ IF ALL PASS: proceed to mini-laws-review
280
316
  IF ANY FAIL:
281
317
  Display: "Verification failed:\n AC-{N}: FAIL — {what happened}\nFix the issue and describe what you changed, or say 'retry' to re-verify."
282
318
  Wait for user response, then re-verify.
@@ -337,4 +373,56 @@
337
373
  WHY: Fast is a side-quest. It records what happened (audit trail) but does not disrupt the main loop state.
338
374
  </step>
339
375
 
376
+ <step name="inline_hotfix" priority="tenth">
377
+ ONLY IF classification = CRITICAL. Emergency fix with minimal ceremony, maximum verification.
378
+
379
+ A. TRIAGE:
380
+ Ask 3 questions:
381
+ - "What is broken? (specific symptom)"
382
+ - "What is the impact? (who is affected)"
383
+ - "When did it start? (recent deploy, config change)"
384
+
385
+ Classify severity:
386
+ - P0: system down, critical path unavailable
387
+ - P1: data corruption, security breach, data loss
388
+ - P2: major feature broken but system is up
389
+
390
+ If not P0/P1: Display "This may not be critical. Consider /sdlc:debug instead." Let user override.
391
+
392
+ Save current STATE.md position — hotfix restores it when done.
393
+
394
+ B. 3-LINE INLINE SPEC:
395
+ - Line 1: WHAT is broken (from triage)
396
+ - Line 2: WHERE is the likely location (quick Grep search)
397
+ - Line 3: WHAT the fix should achieve (expected behavior)
398
+ Display but do NOT wait for approval — speed matters.
399
+ Boundary: fix ONLY the critical issue. No refactoring. No cleanup.
400
+
401
+ C. FIX DIRECTLY:
402
+ - Single-threaded, no sub-agents
403
+ - Read relevant files, apply MINIMAL fix
404
+ - Engineering laws still apply (no empty catch, no hardcoded secrets)
405
+ - Add regression test for the specific failure
406
+ - Mark debt with TODO(hotfix-{date})
407
+
408
+ D. FULL VERIFICATION:
409
+ - Run FULL test suite (all tests, not just affected)
410
+ - For UI: Playwright verification
411
+ - If any fail: fix before proceeding
412
+
413
+ E. FULL REVIEW:
414
+ - Check all modified files against engineering laws
415
+ - Security blockers still block even in emergencies
416
+ - Warnings acceptable for hotfixes
417
+
418
+ F. RECORD:
419
+ - Hotfix number = {phase}.{count+1} (e.g., 02.1, 02.2)
420
+ - Create .sdlc/phases/{phase}/HOTFIX-{number}-SUMMARY.md
421
+ - Update STATE.md: restore prior state, add history entry
422
+ - Update ROADMAP.md: note hotfix under current phase
423
+ - Display completion summary with verification results
424
+
425
+ WHY: Hotfixes trade planning ceremony for speed, but never trade verification. The inline approach avoids command-switching overhead during emergencies while maintaining quality gates.
426
+ </step>
427
+
340
428
  </process>
@@ -1,15 +1,15 @@
1
- <purpose>Systematically fix all blocker findings from code review. Read REVIEW.md, analyze fix dependencies, apply fixes in optimal order (parallel where possible), then re-run review to confirm compliance. Fixes must not introduce new violations.</purpose>
2
- <when_to_use>Run after /sdlc:review reports blockers. STATE.md should show next_required_action = /sdlc:review (still in review loop) with blockers outstanding.</when_to_use>
3
- <required_reading>.sdlc/STATE.md, the current REVIEW.md, .sdlc/LAWS.md, all files referenced in findings</required_reading>
1
+ <purpose>Systematically fix all blocker findings from verification. Read VERIFY.md Phase 2 section, analyze fix dependencies, apply fixes in optimal order (parallel where possible), then re-run verify to confirm compliance. Fixes must not introduce new violations.</purpose>
2
+ <when_to_use>Run after /sdlc:verify reports code quality blockers. STATE.md should show next_required_action = /sdlc:fix with blockers outstanding.</when_to_use>
3
+ <required_reading>.sdlc/STATE.md, the current VERIFY.md, .sdlc/LAWS.md, all files referenced in findings</required_reading>
4
4
  <loop_context>
5
- expected_phase: REVIEW (fix sub-loop)
6
- prior_phase: REVIEW found blockers
7
- next_phase: REVIEW (re-run) → CLOSE (if pass)
5
+ expected_phase: VERIFY (fix sub-loop)
6
+ prior_phase: VERIFY found blockers
7
+ next_phase: VERIFY (re-run) → CLOSE (if pass)
8
8
  </loop_context>
9
9
  <process>
10
10
 
11
11
  <step name="load_findings" priority="first">
12
- Read the REVIEW.md at .sdlc/phases/{current_phase}/{current_plan}-REVIEW.md.
12
+ Read the VERIFY.md at .sdlc/phases/{current_phase}/{current_plan}-VERIFY.md. Parse the Phase 2 (Engineering Laws Review) section.
13
13
 
14
14
  Parse every finding into a structured list:
15
15
  ```
@@ -25,7 +25,7 @@
25
25
  Count totals: {blocker_count} blockers, {warning_count} warnings, {info_count} info.
26
26
 
27
27
  IF blocker_count == 0:
28
- Display: "No blockers to fix. Run /sdlc:review to confirm, then /sdlc:close."
28
+ Display: "No blockers to fix. Run /sdlc:verify to confirm, then /sdlc:close."
29
29
  STOP.
30
30
 
31
31
  WHY: Parsing findings into structured data enables dependency analysis and parallel execution. Without structure, fixes would be ad-hoc and error-prone.
@@ -193,9 +193,9 @@
193
193
  Show which fix likely caused the regression.
194
194
  STOP.
195
195
 
196
- IF all pass: proceed to re-review.
196
+ IF all pass: proceed to re-verify.
197
197
 
198
- WHY: Fixes must not break the project. The build/test check is a safety net before re-running review.
198
+ WHY: Fixes must not break the project. The build/test check is a safety net before re-running verify.
199
199
  </step>
200
200
 
201
201
  <step name="trigger_re_review" priority="eighth">
@@ -209,27 +209,50 @@
209
209
  - Build: ✓
210
210
  - Tests: ✓
211
211
 
212
- Re-running /sdlc:review to confirm compliance...
212
+ Re-running /sdlc:verify to confirm compliance...
213
213
  ```
214
214
 
215
- Trigger the review-phase workflow (re-run the full review).
215
+ Trigger the verify-phase workflow (re-run the full verification including AC tests and engineering laws review).
216
216
 
217
- IF re-review finds NEW blockers (fixes introduced new violations):
218
- Display: "Fix introduced {N} new blockers. Review the new findings and run /sdlc:fix again."
217
+ IF re-verify finds NEW blockers (fixes introduced new violations):
218
+ Display: "Fix introduced {N} new blockers."
219
219
  Set next_required_action to "/sdlc:fix"
220
220
 
221
- IF re-review passes (zero blockers):
221
+ <auto_advance>
222
+ Read .sdlc/STATE.md auto_advance setting.
223
+ IF auto_advance is true:
224
+ Display: "Auto-advancing to /sdlc:fix in {advance_delay_seconds}s — reply to intervene."
225
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
226
+ If no user message received during sleep: automatically execute /sdlc:fix.
227
+ If user sends a message: cancel auto-advance, process user input, then resume.
228
+ IF auto_advance is false:
229
+ Display: "NEXT ACTION REQUIRED: /sdlc:fix — Review the new findings and run /sdlc:fix again."
230
+ Wait for user to manually run the command.
231
+ </auto_advance>
232
+
233
+ IF re-verify passes (zero blockers):
222
234
  Display:
223
235
  ```
224
- Review PASSED after fixes: 0 blockers.
236
+ Verify PASSED after fixes: 0 blockers.
225
237
  Warnings: {count}
226
238
  Info: {count}
227
239
 
228
- NEXT ACTION REQUIRED: /sdlc:close
229
- Run /sdlc:close to close this loop.
240
+ NEXT: /sdlc:close
230
241
  ```
231
242
 
232
- WHY: Re-review confirms the fixes are correct and complete. Without re-review, a fix that introduced a new violation would slip through to close.
243
+ <auto_advance>
244
+ Read .sdlc/STATE.md auto_advance setting.
245
+ IF auto_advance is true:
246
+ Display: "Auto-advancing to /sdlc:close in {advance_delay_seconds}s — reply to intervene."
247
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
248
+ If no user message received during sleep: automatically execute /sdlc:close.
249
+ If user sends a message: cancel auto-advance, process user input, then resume.
250
+ IF auto_advance is false:
251
+ Display: "NEXT ACTION REQUIRED: /sdlc:close"
252
+ Wait for user to manually run the command.
253
+ </auto_advance>
254
+
255
+ WHY: Re-verification confirms the fixes are correct and complete. Without re-verify, a fix that introduced a new violation would slip through to close.
233
256
  </step>
234
257
 
235
258
  </process>