sdlc-framework 2.1.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- <purpose>Close the current SPEC-IMPL-VERIFY-REVIEW loop by reconciling planned work against actual outcomes, creating a SUMMARY.md, and advancing the state machine to the next spec or phase transition.</purpose>
1
+ <purpose>Close the current SPEC-IMPL-VERIFY-REVIEW loop by reconciling planned work against actual outcomes, creating a SUMMARY.md, and advancing the state machine to the next spec. When the last plan in a phase completes, execute the phase transition inline — verify completeness, update PROJECT.md, advance the roadmap, and commit the phase boundary.</purpose>
2
2
  <when_to_use>Run after /sdlc:review passes with zero blockers. STATE.md must show loop_position = REVIEW ✓ and next_required_action = /sdlc:close.</when_to_use>
3
- <required_reading>.sdlc/STATE.md, the current SPEC.md, REVIEW.md, VERIFY.md</required_reading>
3
+ <required_reading>.sdlc/STATE.md, .sdlc/ROADMAP.md, .sdlc/PROJECT.md, the current SPEC.md, REVIEW.md, VERIFY.md</required_reading>
4
4
  <loop_context>
5
5
  expected_phase: CLOSE (active)
6
6
  prior_phase: REVIEW ✓
7
- next_phase: SPEC (next loop) or transition-phase (if last plan)
7
+ next_phase: SPEC (next loop) phase transition handled inline when last plan completes
8
8
  </loop_context>
9
9
  <display_rule>
10
10
  MANDATORY: Display the loop closure summary in the chat window. Show:
@@ -135,22 +135,66 @@
135
135
  OPTION A — More plans in this phase:
136
136
  - Check ROADMAP.md: is this the last planned plan for the current phase?
137
137
  - If there are more plans (or the phase is open-ended): set next to /sdlc:spec
138
+ - Update .sdlc/STATE.md:
139
+ - loop_position: CLOSE ✓
140
+ - current_plan: cleared (no active plan)
141
+ - next_required_action: /sdlc:spec
142
+ - Add history entry: "{timestamp} | close | Plan {N} closed. {N} ACs passed. {N} deviations."
143
+ - Update .sdlc/ROADMAP.md:
144
+ - Increment completed plan count for current phase
145
+
146
+ OPTION B — Last plan in phase (execute phase transition inline):
147
+
148
+ B1. Verify phase completeness:
149
+ - List all SPEC and SUMMARY files in .sdlc/phases/{current_phase}/.
150
+ - Every SPEC must have a corresponding SUMMARY. If a SPEC exists without a SUMMARY: STOP. Display: "Phase transition blocked. Plan {N} has a spec but no summary. Complete it first."
151
+ - Every SUMMARY must show all ACs passed. If any AC is FAIL: STOP. Display: "Phase transition blocked. Plan {N} has failing ACs."
152
+ - Display completeness check: plans created, plans completed, hotfixes, all ACs passed.
153
+
154
+ B2. Cross-check STATE.md, PROJECT.md, ROADMAP.md consistency:
155
+ - STATE.md current_milestone must match ROADMAP.md in-progress milestone.
156
+ - STATE.md current_phase must match the phase being completed.
157
+ - Prior phases in this milestone must all be COMPLETE.
158
+ - If inconsistency found: display details, offer to auto-fix, ask for user confirmation before applying.
159
+
160
+ B3. Update PROJECT.md:
161
+ - Read all SUMMARY.md files from the completing phase.
162
+ - For each requirement in PROJECT.md:
163
+ - If addressed in this phase: mark as IMPLEMENTED with reference to plan number.
164
+ - If contradicted or superseded by implementation: mark as SUPERSEDED with explanation.
165
+ - Leave unaddressed requirements as-is (future phase responsibility).
166
+ - Add newly discovered requirements (from decisions and lessons learned) as NOT STARTED.
167
+ - Display proposed changes and ask user to confirm before writing.
168
+
169
+ B4. Update ROADMAP.md with phase completion details:
170
+ - Mark completed phase as COMPLETE with date.
171
+ - Add phase summary note:
172
+ ```
173
+ #### Phase {number} Summary
174
+ - Plans executed: {N}
175
+ - Hotfixes: {N}
176
+ - Key deliverables: {from summaries}
177
+ - Duration: {first spec date} to {completion date}
178
+ ```
138
179
 
139
- OPTION B Last plan in phase:
140
- - If this was the last plan: trigger transition-phase workflow
141
- - Set next to /sdlc:transition (which handles phase advancement)
142
-
143
- Update .sdlc/STATE.md:
144
- - loop_position: CLOSE
145
- - current_plan: cleared (no active plan)
146
- - next_required_action: /sdlc:spec OR /sdlc:transition
147
- - Add history entry: "{timestamp} | close | Plan {N} closed. {N} ACs passed. {N} deviations."
148
-
149
- Update .sdlc/ROADMAP.md:
150
- - Increment completed plan count for current phase
151
- - If phase is complete: mark phase status as COMPLETE
152
-
153
- WHY: The state machine must always have a clear next action. Ambiguity in state leads to confusion about what to do next.
180
+ B5. Advance state to next phase:
181
+ - IF next phase exists in ROADMAP.md:
182
+ - Update STATE.md: current_phase to next phase, clear current_plan, set loop_position to SPEC, set next_required_action to /sdlc:spec.
183
+ - Update ROADMAP.md: set next phase status to IN PROGRESS.
184
+ - Add history entry: "{timestamp} | close | Plan {N} closed. Phase {phase} complete. Transitioning to phase {next-phase}."
185
+ - IF no next phase (last phase in milestone):
186
+ - Do not advance to a new phase. The milestone completion logic in the display_result step handles this.
187
+ - Add history entry: "{timestamp} | close | Plan {N} closed. Phase {phase} complete. Last phase in milestone."
188
+
189
+ B6. Create git commit (if in a git repo):
190
+ - Check git status for uncommitted changes.
191
+ - If uncommitted changes exist:
192
+ - Stage .sdlc/ files and source files from the phase.
193
+ - Commit: `feat({phase-name}): complete phase {number}`
194
+ - Display: "Git commit created: {hash}"
195
+ - If no uncommitted changes: Display: "No uncommitted changes to commit."
196
+
197
+ WHY: The state machine must always have a clear next action. Phase transitions are executed inline to keep the close command as the single point of state advancement. No separate transition command needed.
154
198
  </step>
155
199
 
156
200
  <step name="display_result" priority="sixth">
@@ -165,22 +209,52 @@
165
209
  ACs passed: {count}/{count}
166
210
  Deviations: {count}
167
211
 
168
- NEXT ACTION REQUIRED: /sdlc:spec
169
- Run /sdlc:spec to create the next specification.
212
+ NEXT: /sdlc:spec
170
213
  ```
171
214
 
172
- IF phase complete:
215
+ <auto_advance>
216
+ Read .sdlc/STATE.md auto_advance setting.
217
+ IF auto_advance is true:
218
+ Display: "Auto-advancing to /sdlc:spec in {advance_delay_seconds}s — reply to intervene."
219
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
220
+ If no user message received during sleep: automatically execute /sdlc:spec.
221
+ If user sends a message: cancel auto-advance, process user input, then resume.
222
+ IF auto_advance is false:
223
+ Display: "NEXT ACTION REQUIRED: /sdlc:spec"
224
+ Wait for user to manually run the command.
225
+ </auto_advance>
226
+
227
+ IF phase complete (transition executed inline) AND next phase exists:
173
228
  Display:
174
229
  ```
175
230
  Loop closed: Plan {N} complete.
176
- Phase {phase} COMPLETE — all plans finished.
231
+
232
+ Phase transition complete.
233
+ ─────────────────────────
234
+ Completed: Phase {old-number} — {old-name}
235
+ Plans executed: {N}
236
+ Hotfixes: {N}
237
+ Duration: {first spec date} to {completion date}
238
+
239
+ Starting: Phase {new-number} — {new-name}
177
240
 
178
241
  Summary: .sdlc/phases/{phase}/{plan}-SUMMARY.md
179
242
 
180
- Transitioning to next phase...
181
- NEXT ACTION REQUIRED: /sdlc:transition
243
+ NEXT: /sdlc:spec
182
244
  ```
183
245
 
246
+ <auto_advance>
247
+ Read .sdlc/STATE.md auto_advance setting.
248
+ IF auto_advance is true:
249
+ Display: "Auto-advancing to /sdlc:spec in {advance_delay_seconds}s — reply to intervene."
250
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
251
+ If no user message received during sleep: automatically execute /sdlc:spec.
252
+ If user sends a message: cancel auto-advance, process user input, then resume.
253
+ IF auto_advance is false:
254
+ Display: "NEXT ACTION REQUIRED: /sdlc:spec"
255
+ Wait for user to manually run the command.
256
+ </auto_advance>
257
+
184
258
  IF milestone complete (last phase, last plan):
185
259
  Display:
186
260
  ```
@@ -292,10 +292,21 @@
292
292
 
293
293
  Debug record: .sdlc/phases/{phase}/DEBUG-{slug}.md
294
294
 
295
- NEXT ACTION REQUIRED: /sdlc:review
296
- Run /sdlc:review to check the fix against engineering laws.
295
+ NEXT: /sdlc:review
297
296
  ```
298
297
 
298
+ <auto_advance>
299
+ Read .sdlc/STATE.md auto_advance setting.
300
+ IF auto_advance is true:
301
+ Display: "Auto-advancing to /sdlc:review in {advance_delay_seconds}s — reply to intervene."
302
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
303
+ If no user message received during sleep: automatically execute /sdlc:review.
304
+ If user sends a message: cancel auto-advance, process user input, then resume.
305
+ IF auto_advance is false:
306
+ Display: "NEXT ACTION REQUIRED: /sdlc:review"
307
+ Wait for user to manually run the command.
308
+ </auto_advance>
309
+
299
310
  WHY: Debug fixes still go through review. A hurried fix might violate engineering laws — empty catch blocks, missing types, function too long. The review catches that.
300
311
  </step>
301
312
 
@@ -1,6 +1,6 @@
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, 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. 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), codebase structure for technical context</required_reading>
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
4
  <loop_context>
5
5
  expected_phase: DISCUSS (pre-loop activity)
6
6
  prior_phase: any (entry point or between loops)
@@ -68,10 +68,188 @@
68
68
  Record all answers in the decisions log.
69
69
  </step>
70
70
 
71
- <step name="validate_approach" priority="fourth">
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">
72
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.
73
247
 
74
- Based on the problem and scope, identify 2-3 viable technical approaches.
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.
75
253
 
76
254
  Present each approach:
77
255
  ```
@@ -80,6 +258,7 @@
80
258
  - Risk: {what could go wrong}
81
259
  - Maintenance: {ongoing burden}
82
260
  - Fits existing patterns: {yes/no — reference specific codebase patterns}
261
+ - Research support: {what research findings support this approach}
83
262
 
84
263
  Approach B: {description}
85
264
  - Effort: {low/medium/high}
@@ -102,7 +281,7 @@
102
281
  Record the chosen approach and rationale in the decisions log.
103
282
  </step>
104
283
 
105
- <step name="detail_requirements" priority="fifth">
284
+ <step name="detail_requirements" priority="sixth">
106
285
  Requirements bridge the gap between "what to build" and "how to spec it." Missing requirements surface as bugs during implementation.
107
286
 
108
287
  Ask 2-4 questions from this category. Include a recommendation with each.
@@ -130,8 +309,8 @@
130
309
  Record all answers in the decisions log.
131
310
  </step>
132
311
 
133
- <step name="compile_prd" priority="sixth">
134
- The PRD is the deliverable — it captures every decision made during discussion. Without it, the discussion is just a conversation that evaporates.
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.
135
314
 
136
315
  Create .sdlc/discuss/ directory if it does not exist.
137
316
 
@@ -141,22 +320,31 @@
141
320
  - Problem Statement: from explore_problem answers
142
321
  - Proposed Solution: from validate_approach chosen approach
143
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
144
328
  - Requirements: from detail_requirements answers
145
329
  - Constraints: from define_scope answers
146
330
  - Edge Cases: from detail_requirements answers
147
331
  - Success Metrics: from detail_requirements answers
148
332
  - Decisions Log: every question asked and answer received, numbered
149
333
 
334
+ IF research was NOT conducted:
335
+ Omit the Research Findings section entirely.
336
+
150
337
  Display a compact summary of the PRD (30-50 lines):
151
338
  - Problem (2 lines)
152
339
  - Solution (2 lines)
340
+ - Research findings (2-3 lines, if applicable)
153
341
  - Requirements (numbered list)
154
342
  - Constraints (list)
155
343
  - Edge cases (list)
156
344
  - Open questions (list)
157
345
  </step>
158
346
 
159
- <step name="approve_and_route" priority="seventh">
347
+ <step name="approve_and_route" priority="eighth">
160
348
  The user must approve the PRD before it feeds into spec. An unapproved PRD is just notes.
161
349
 
162
350
  Ask: "PRD complete. Review the summary above."
@@ -168,7 +356,7 @@
168
356
  IF APPROVE:
169
357
  Set PRD status to APPROVED.
170
358
  Update .sdlc/STATE.md:
171
- - Add history entry: "{timestamp} | discuss | Topic: {topic}. PRD saved."
359
+ - Add history entry: "{timestamp} | discuss | Topic: {topic}. PRD saved. Research: {yes/no}."
172
360
  - Set next_required_action: /sdlc:spec
173
361
  - Add prd_path: .sdlc/discuss/{topic-slug}-PRD.md
174
362
 
@@ -177,14 +365,26 @@
177
365
  PRD approved.
178
366
 
179
367
  Saved: .sdlc/discuss/{topic-slug}-PRD.md
368
+ Research: {.sdlc/research/{topic-slug}.md if applicable, otherwise "none"}
180
369
 
181
370
  The spec phase will use this PRD to create a detailed specification with
182
371
  acceptance criteria and task dependencies.
183
372
 
184
- NEXT ACTION REQUIRED: /sdlc:spec
185
- Run /sdlc:spec to formalize this PRD into an implementation-ready specification.
373
+ NEXT: /sdlc:spec
186
374
  ```
187
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
+
188
388
  IF REVISE:
189
389
  Apply changes. Re-display summary. Re-ask for approval.
190
390
 
@@ -4,7 +4,7 @@
4
4
  <loop_context>
5
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, RESEARCH, DISCUSS, 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
@@ -61,13 +61,39 @@
61
61
  - No → FEATURE (a "fix" that is really a refinement)
62
62
  Display: "Bug detected. Routing to /sdlc:debug for structured debugging."
63
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
+
64
77
  STOP this workflow.
65
78
 
66
- 3. RESEARCHexploration and investigation
67
- Indicators: "explore", "investigate", "research", "compare options", "evaluate", "what are the options", "how does X work", "should we use"
68
- Route: /sdlc:research
69
- 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."
70
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
+
71
97
  STOP this workflow.
72
98
 
73
99
  4. FEATURE — new functionality
@@ -91,7 +117,7 @@
91
117
 
92
118
  Display: "Classified as: {TYPE}. {Brief explanation of why.}"
93
119
 
94
- 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.
95
121
  </step>
96
122
 
97
123
  <step name="estimate_complexity" priority="third">
@@ -175,10 +201,21 @@
175
201
  Your description and the identified files have been saved to STATE.md.
176
202
  /sdlc:spec will pick up this context automatically — no need to repeat yourself.
177
203
 
178
- NEXT ACTION REQUIRED: /sdlc:spec
179
- Run /sdlc:spec to decompose this into parallel tasks with proper dependency ordering.
204
+ NEXT: /sdlc:spec
180
205
  ```
181
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
+
182
219
  STOP this workflow.
183
220
 
184
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.
@@ -215,9 +215,21 @@
215
215
  Trigger the review-phase workflow (re-run the full review).
216
216
 
217
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."
218
+ Display: "Fix introduced {N} new blockers."
219
219
  Set next_required_action to "/sdlc:fix"
220
220
 
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
+
221
233
  IF re-review passes (zero blockers):
222
234
  Display:
223
235
  ```
@@ -225,10 +237,21 @@
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
 
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
+
232
255
  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.
233
256
  </step>
234
257
 
@@ -276,10 +276,21 @@
276
276
  Files created: {list}
277
277
  Smoke tests: PASSED
278
278
 
279
- NEXT ACTION REQUIRED: /sdlc:verify
280
- Run /sdlc:verify to test acceptance criteria.
279
+ NEXT: /sdlc:verify
281
280
  ```
282
281
 
282
+ <auto_advance>
283
+ Read .sdlc/STATE.md auto_advance setting.
284
+ IF auto_advance is true:
285
+ Display: "Auto-advancing to /sdlc:verify in {advance_delay_seconds}s — reply to intervene."
286
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
287
+ If no user message received during sleep: automatically execute /sdlc:verify.
288
+ If user sends a message: cancel auto-advance, process user input, then resume.
289
+ IF auto_advance is false:
290
+ Display: "NEXT ACTION REQUIRED: /sdlc:verify"
291
+ Wait for user to manually run the command.
292
+ </auto_advance>
293
+
283
294
  WHY: Clear reporting lets the user assess what happened before deciding to proceed. The forcing function moves them to verification.
284
295
  </step>
285
296
 
@@ -218,7 +218,7 @@
218
218
  Run: mkdir -p .sdlc/phases/{phase-dir} for each phase
219
219
  Run: mkdir -p .sdlc/research
220
220
 
221
- WHY: Pre-creating directories prevents "directory not found" errors during spec/impl phases. The research/ directory is used by /sdlc:research to store findings.
221
+ WHY: Pre-creating directories prevents "directory not found" errors during spec/impl phases. The research/ directory is used by /sdlc:discuss to store research findings when unknowns are detected.
222
222
  </step>
223
223
 
224
224
  <step name="update_state_and_display" priority="ninth">
@@ -239,11 +239,22 @@
239
239
  .sdlc/phases/ — phase directories
240
240
  .sdlc/research/ — research storage
241
241
 
242
- NEXT ACTION REQUIRED: /sdlc:spec
243
- Run /sdlc:spec to create your first specification.
242
+ NEXT: /sdlc:spec
244
243
  ```
245
244
 
246
- WHY: The explicit "NEXT ACTION REQUIRED" message is the forcing function. The user always knows exactly what to do next. No ambiguity, no guessing.
245
+ <auto_advance>
246
+ Read .sdlc/STATE.md auto_advance setting.
247
+ IF auto_advance is true:
248
+ Display: "Auto-advancing to /sdlc:spec in {advance_delay_seconds}s — reply to intervene."
249
+ Sleep for {advance_delay_seconds} seconds using Bash sleep command.
250
+ If no user message received during sleep: automatically execute /sdlc:spec.
251
+ If user sends a message: cancel auto-advance, process user input, then resume.
252
+ IF auto_advance is false:
253
+ Display: "NEXT ACTION REQUIRED: /sdlc:spec"
254
+ Wait for user to manually run the command.
255
+ </auto_advance>
256
+
257
+ WHY: The auto-advance directive is the forcing function. The framework automatically chains to the next step unless the user intervenes. No ambiguity, no waiting.
247
258
  </step>
248
259
 
249
260
  </process>