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
package/README.md CHANGED
@@ -40,7 +40,7 @@ AI-assisted development has a quality problem. Research shows:
40
40
 
41
41
  SDLC fixes all of this with five principles:
42
42
 
43
- 1. **Closed loop** — SPEC → IMPLEMENT → VERIFY → REVIEW → CLOSE. Every step forces the next. No orphan plans. No skipped reviews.
43
+ 1. **Closed loop** — SPEC → IMPLEMENT → VERIFY → CLOSE. Steps auto-advance with a 10-second delay — reply to intervene. No orphan plans. No skipped reviews.
44
44
 
45
45
  2. **Engineering Laws** — SOLID, DRY, YAGNI, Clean Code, Security, and Testing are enforced as blocking gates at review. Not suggestions. Laws.
46
46
 
@@ -76,14 +76,17 @@ Choose global (all projects) or local (current project only). Verify with `/sdlc
76
76
  # 1. Initialize the framework
77
77
  /sdlc:init
78
78
 
79
- # 2. Define what to build (asks clarification questions)
79
+ # 2. (Optional) Brainstorm AI asks questions, produces a PRD
80
+ /sdlc:discuss add user notifications
81
+
82
+ # 3. Define what to build (asks clarification questions)
80
83
  /sdlc:spec
81
84
 
82
- # 3. Build it (spawns parallel sub-agents)
85
+ # 4. Build it (spawns parallel sub-agents)
83
86
  /sdlc:impl
84
87
 
85
- # 4. The framework forces verify review close automatically
86
- # Just follow the NEXT ACTION REQUIRED prompts
88
+ # 5. Steps auto-advance with 10s delay reply to intervene
89
+ # The framework chains verify close automatically
87
90
  ```
88
91
 
89
92
  ### Just Tell It What To Do
@@ -109,71 +112,85 @@ Follows: reproduce → isolate → root-cause → fix → verify.
109
112
  ## The Loop
110
113
 
111
114
  ```
112
- ┌──────────────────────────────────────────────────────────┐
113
- │ SPEC ──→ IMPLEMENT ──→ VERIFY ──→ REVIEW ──→ CLOSE
114
- │ │
115
- └──────────────── next cycle ←─────────────────┘
116
-
117
- │ Define Build (parallel Auto-test Engineering
118
- │ work + sub-agents per (Playwright laws check
119
- │ ask Qs dependency wave) MCP + tests) (SOLID/DRY/..)
120
- └──────────────────────────────────────────────────────────┘
115
+ ┌────────────────────────────────────────────────────────────┐
116
+ │ SPEC ──→ IMPLEMENT ──→ VERIFY ──→ CLOSE
117
+ │ │
118
+ └──────────── next cycle ←──────────┘
119
+
120
+ │ Define Build (parallel Two-phase: Close loop,
121
+ │ work + sub-agents per 1. AC testing reconcile,
122
+ │ ask Qs dependency wave) 2. Laws review advance
123
+ └────────────────────────────────────────────────────────────┘
121
124
  ```
122
125
 
126
+ ### DISCUSS — Explore the idea (optional, pre-loop)
127
+
128
+ - AI-driven brainstorming — you describe an idea, AI asks structured questions
129
+ - 4 rounds max: problem space → scope → research unknowns → approach validation → requirements detail
130
+ - Spawns research subagents when unknowns are detected (codebase patterns, external APIs, library choices)
131
+ - Every question includes a recommendation with concrete trade-offs
132
+ - Produces a PRD document at `.sdlc/discuss/{topic}-PRD.md` with research findings included
133
+ - **User approval gate** — PRD must be approved before routing to `/sdlc:spec`
134
+
123
135
  ### SPEC — Define the work
124
136
 
125
137
  - Asks clarification questions (no guessing)
126
138
  - Presents options with trade-offs and recommendations
127
- - Defines BDD acceptance criteria (Given/When/Then)
139
+ - Defines BDD acceptance criteria (Given/When/Then) with **explicit verification types** — each AC declares whether it's tested via Playwright MCP, curl, Bash, test runner, or DB queries
128
140
  - Decomposes tasks with dependency graph for parallel execution
129
- - **Spec integrity review** — checks completeness, consistency, feasibility
141
+ - **Codebase gap analysis** — reads existing code the spec touches, flags missing error handling, edge cases, validation gaps, and integration risks before implementation starts
142
+ - **Spec integrity review** — checks completeness, consistency, feasibility, verification types, and gap analysis (7 checks)
130
143
  - **User approval gate** — spec must be explicitly approved before implementation starts
131
144
 
132
145
  ### IMPLEMENT — Build it
133
146
 
147
+ - **Pre-flight plan verification** — validates AC↔task coverage, file existence, boundary compliance, and dependency integrity before spawning agents
134
148
  - Analyzes task dependencies (DAG)
135
149
  - Spawns parallel sub-agents per wave
136
150
  - Each agent gets: task spec, engineering laws, boundaries
137
151
  - Tracks progress via todo list
138
152
 
139
- ### VERIFY — Test it
153
+ ### VERIFY — Test it + review it (two phases in one command)
140
154
 
141
- - Translates acceptance criteria to automated tests
142
- - UI: Playwright MCP (navigate, click, assert)
143
- - API: curl requests with assertions
144
- - Logic: test suite execution
145
- - Reports pass/fail per AC with evidence
155
+ **Phase 1 Acceptance Criteria:**
156
+ - Reads the **declared verification type** from each AC — no keyword guessing
157
+ - **UI_INTERACTION**: Playwright MCP (navigate, click, snapshot, screenshot, fill_form) with pre-check for browser availability
158
+ - **API_ENDPOINT**: curl requests with status code and body assertions
159
+ - **CLI_BEHAVIOR**: Bash command execution with stdout/stderr/exit code capture
160
+ - **BUSINESS_LOGIC**: project test runner (bun test, npm test, vitest, jest, pytest)
161
+ - **DATA_INTEGRITY**: database queries via CLI
162
+ - ACs missing a Type field are marked FAIL — never skipped, never guessed
163
+ - If any AC fails, stops immediately — no engineering review on broken code
146
164
 
147
- ### REVIEWCheck it
148
-
149
- - Reviews all modified files against Engineering Laws
165
+ **Phase 2Engineering Laws Review (only runs after all ACs pass):**
166
+ - Reviews all modified files against LAWS.md
150
167
  - Checks: SOLID, DRY, YAGNI, Clean Code, Security, Testing, Naming, Error Handling
151
168
  - Severity levels: BLOCKER (must fix), WARNING (should fix), INFO (consider)
152
169
  - Blockers prevent loop closure — routes to `/sdlc:fix` for systematic fixing
153
- - `/sdlc:fix` analyzes fix dependencies, applies fixes (parallel where possible), auto re-reviews
170
+ - `/sdlc:fix` analyzes fix dependencies, applies fixes (parallel where possible), auto re-verifies
154
171
 
155
172
  ### CLOSE — Ship it
156
173
 
157
174
  - Reconciles spec vs actual implementation
158
175
  - Records deviations, decisions, lessons
159
176
  - Creates SUMMARY.md for audit trail
160
- - Advances state to next cycle
177
+ - Advances state to next plan or handles phase transition inline
178
+ - Phase transitions: verifies completeness, updates PROJECT.md, creates git commit, advances to next phase
161
179
 
162
180
  ---
163
181
 
164
182
  ## Commands
165
183
 
166
- 15 commands, grouped by purpose. Run `/sdlc:help` for the full reference.
184
+ 11 commands, grouped by purpose. Run `/sdlc:help` for the full reference.
167
185
 
168
186
  ### Core Loop
169
187
 
170
188
  | Command | What it does | Forces next |
171
189
  |---------|-------------|-------------|
172
190
  | `/sdlc:spec` | Define work with acceptance criteria | → `/sdlc:impl` |
173
- | `/sdlc:impl` | Build via parallel sub-agents | → `/sdlc:verify` |
174
- | `/sdlc:verify` | Automated testing (Playwright MCP) | → `/sdlc:review` |
175
- | `/sdlc:review` | Engineering laws compliance check | → `/sdlc:close` |
176
- | `/sdlc:close` | Reconcile and close the loop | → `/sdlc:spec` |
191
+ | `/sdlc:impl` | Build via parallel sub-agents (with pre-flight plan verification) | → `/sdlc:verify` |
192
+ | `/sdlc:verify` | Two-phase: AC testing (Playwright MCP, curl, tests) + engineering laws review | → `/sdlc:close` |
193
+ | `/sdlc:close` | Close the loop. Handles phase transitions and milestone completion inline | → `/sdlc:spec` |
177
194
 
178
195
  ### Quick Entry
179
196
 
@@ -185,32 +202,35 @@ Follows: reproduce → isolate → root-cause → fix → verify.
185
202
 
186
203
  | Command | What it does |
187
204
  |---------|-------------|
188
- | `/sdlc:fix` | Fix review blockers systematically, auto re-review |
205
+ | `/sdlc:fix` | Fix code quality blockers systematically, auto re-verify |
189
206
  | `/sdlc:debug <issue>` | Structured debugging: reproduce → isolate → fix → verify |
190
- | `/sdlc:hotfix <issue>` | Emergency fix with minimal ceremony |
191
207
 
192
- ### Session
208
+ ### Session & Status
193
209
 
194
210
  | Command | What it does |
195
211
  |---------|-------------|
196
- | `/sdlc:pause` | Save context for break |
197
- | `/sdlc:resume` | Restore context, ONE next action |
198
- | `/sdlc:status` | Show position + forced next action |
212
+ | `/sdlc:status` | Show loop position, progress, forced next action |
213
+ | `/sdlc:status pause` | Save context for break, create HANDOFF.md |
214
+ | `/sdlc:status resume` | Restore context, ONE next action |
215
+
216
+ ### Planning & Discovery
217
+
218
+ | Command | What it does |
219
+ |---------|-------------|
220
+ | `/sdlc:discuss [idea]` | Brainstorm and research — AI asks questions, spawns research subagents for unknowns, produces a PRD |
199
221
 
200
222
  ### Setup
201
223
 
202
224
  | Command | What it does |
203
225
  |---------|-------------|
204
- | `/sdlc:init` | Initialize framework in project |
205
- | `/sdlc:milestone` | Create or complete milestones |
206
- | `/sdlc:research` | Deploy research sub-agents |
226
+ | `/sdlc:init` | Initialize framework or add milestones |
207
227
  | `/sdlc:help` | Show command reference |
208
228
 
209
229
  ---
210
230
 
211
231
  ## Engineering Laws
212
232
 
213
- Laws are enforced at `/sdlc:review`. Violations at `error` severity block `/sdlc:close`.
233
+ Laws are enforced at `/sdlc:verify` (Phase 2). Violations at `error` severity block `/sdlc:close`.
214
234
 
215
235
  | Law | Default | What it enforces |
216
236
  |-----|---------|-----------------|
@@ -241,9 +261,10 @@ Severity is configurable per project in `.sdlc/LAWS.md`:
241
261
  ├── phases/
242
262
  │ └── 01-phase-name/
243
263
  │ ├── 01-01-SPEC.md
244
- │ ├── 01-01-REVIEW.md
264
+ │ ├── 01-01-VERIFY.md
245
265
  │ └── 01-01-SUMMARY.md
246
- └── research/ # Sub-agent research output
266
+ ├── discuss/ # PRD documents from /sdlc:discuss
267
+ └── research/ # Research findings (generated by /sdlc:discuss when unknowns detected)
247
268
  ```
248
269
 
249
270
  ---
@@ -254,7 +275,7 @@ Severity is configurable per project in `.sdlc/LAWS.md`:
254
275
 
255
276
  | Aspect | PAUL | SDLC |
256
277
  |--------|------|------|
257
- | Commands | 26 (cognitive overload) | 15 (focused) |
278
+ | Commands | 26 (cognitive overload) | 11 (focused) |
258
279
  | Testing | Manual UAT | Automated (Playwright MCP) |
259
280
  | Code review | None | Engineering Laws enforcement |
260
281
  | Implementation | In-session | Sub-agent parallel waves |
@@ -304,7 +325,29 @@ npx sdlc-framework@latest
304
325
  - Check `.sdlc/STATE.md` directly
305
326
 
306
327
  **Resuming after a break?**
307
- - Run `/sdlc:resume` — it reads state and handoffs automatically
328
+ - Run `/sdlc:status resume` — it reads state and handoffs automatically
329
+
330
+ ---
331
+
332
+ ## What's New in v1.0.1
333
+
334
+ **Verify and review merged. Plan verification before implementation. Playwright pre-checks.**
335
+
336
+ - **Verify + Review merged into one command** — `/sdlc:verify` now runs two phases: Phase 1 tests acceptance criteria (Playwright MCP, curl, test runners), Phase 2 reviews code against engineering laws (SOLID, DRY, YAGNI, etc.). One command, one artifact (`VERIFY.md`), one fewer step in the loop. `/sdlc:review` is removed.
337
+ - **Pre-flight plan verification** — `/sdlc:impl` now validates the spec plan before spawning agents: AC↔task coverage, file existence, boundary compliance, dependency integrity. Catches gaps before expensive agent execution.
338
+ - **Playwright MCP pre-check** — Before running UI verifications, the framework calls `browser_install` and tests navigation to confirm Playwright MCP is available and the app is running. Fails fast with clear error instead of silently skipping.
339
+ - **Auto-advance fixed** — Phase transitions now correctly set `loop_position: CLOSE ✓` so auto-advance to the next spec works reliably across all loop states.
340
+ - **11 commands** (down from 12) — Verify absorbs review. Less to learn, same enforcement.
341
+
342
+ ### Previous: v3.1.0
343
+
344
+ - Explicit verification types on every AC (Type field).
345
+ - Codebase gap analysis in spec phase.
346
+ - 7 integrity checks in spec integrity review.
347
+
348
+ ### Previous: v3.0.0
349
+
350
+ - Research merged into Discuss. Transition absorbed into Close. Auto-advance. 12 commands.
308
351
 
309
352
  ---
310
353
 
package/bin/install.js CHANGED
@@ -144,10 +144,10 @@ function install(isGlobal) {
144
144
 
145
145
  ${yellow}Quick start:${reset}
146
146
  ${dim}1.${reset} /sdlc:init ${dim}— Initialize project${reset}
147
- ${dim}2.${reset} /sdlc:spec ${dim}— Define what to build${reset}
148
- ${dim}3.${reset} /sdlc:impl ${dim}— Build it (sub-agent parallel)${reset}
149
- ${dim}4.${reset} /sdlc:verify ${dim}— Playwright auto-test${reset}
150
- ${dim}5.${reset} /sdlc:review ${dim}— Engineering laws check${reset}
147
+ ${dim}2.${reset} /sdlc:discuss ${dim}— Brainstorm idea into PRD (optional)${reset}
148
+ ${dim}3.${reset} /sdlc:spec ${dim}— Define what to build${reset}
149
+ ${dim}4.${reset} /sdlc:impl ${dim}— Build it (sub-agent parallel)${reset}
150
+ ${dim}5.${reset} /sdlc:verify ${dim}— Test ACs + engineering laws review${reset}
151
151
  ${dim}6.${reset} /sdlc:close ${dim}— Close the loop${reset}
152
152
 
153
153
  ${dim}Or for small tasks:${reset} /sdlc:fast "add logout button"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdlc-framework",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Structured Development Lifecycle - A closed-loop AI-assisted development framework for Claude Code",
5
5
  "bin": {
6
6
  "sdlc-framework": "bin/install.js"
@@ -31,7 +31,7 @@
31
31
  "license": "MIT",
32
32
  "repository": {
33
33
  "type": "git",
34
- "url": ""
34
+ "url": "https://github.com/nadyshalaby/sdlc-framework.git"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=16.7.0"
@@ -1,34 +1,37 @@
1
1
  ---
2
2
  name: sdlc:close
3
- description: Reconcile spec vs actual and close the loop
3
+ description: Reconcile spec vs actual, close the loop, handle phase transitions and milestone completion inline
4
4
  argument-hint: "[spec-path]"
5
- allowed-tools: [Read, Write, Bash, Glob, Grep, Edit]
5
+ allowed-tools: [Read, Write, Bash, Glob, Grep, Edit, AskUserQuestion]
6
6
  ---
7
7
 
8
8
  <objective>
9
- Close the current SDLC loop by reconciling what was planned (SPEC.md) against what was built (IMPL.md, VERIFY.md, REVIEW.md). Record deviations, decisions, and lessons learned. Advance the state to the next plan or phase.
9
+ Close the current SDLC loop by reconciling what was planned (SPEC.md) against what was built (IMPL.md, VERIFY.md). Record deviations, decisions, and lessons learned. Advance the state to the next plan or phase. 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.
10
10
 
11
- **When to use:** After /sdlc:review completes with no blockers. This is the CLOSE phase of the SDLC loop.
11
+ **When to use:** After /sdlc:verify completes with no blockers. This is the CLOSE phase of the SDLC loop.
12
12
 
13
13
  **What it does:**
14
- 1. Read all artifacts from the current loop: SPEC, IMPL, VERIFY, REVIEW.
14
+ 1. Read all artifacts from the current loop: SPEC, IMPL, VERIFY (contains both AC results and review findings).
15
15
  2. Compare planned vs actual: tasks completed, ACs met, scope adhered to.
16
16
  3. Record deviations with reasons (scope changes, discovered complexity, design pivots).
17
17
  4. Create SUMMARY.md with deliverables, results, deviations, decisions, and lessons.
18
18
  5. Update STATE.md to advance to the next plan or phase.
19
+ 6. If this was the last plan in a phase: execute the full phase transition inline (completeness check, PROJECT.md update, ROADMAP.md update, git commit).
19
20
 
20
21
  **What happens next:**
21
22
  - More plans in the current phase: Framework directs you to /sdlc:spec for the next plan.
22
- - Phase complete (all plans done): Framework directs you to the next milestone/phase.
23
+ - Phase complete (all plans done): Framework executes the phase transition inline, then directs to /sdlc:spec for the first plan of the new phase.
24
+ - Milestone complete (all phases done): Framework generates milestone summary, creates git tag, and advances to next milestone or marks project complete.
23
25
  - All milestones complete: Project is done.
24
26
 
25
27
  **Critical rule:** No loop closes without reconciliation. Every deviation from the spec is documented with a reason. Lessons learned feed into the next loop.
26
28
  </objective>
27
29
 
28
30
  <execution_context>
29
- @~/.claude/sdlc-framework/workflows/close-loop.md
31
+ @~/.claude/sdlc-framework/workflows/close-phase.md
30
32
  @.sdlc/STATE.md
31
33
  @.sdlc/ROADMAP.md
34
+ @.sdlc/PROJECT.md
32
35
  </execution_context>
33
36
 
34
37
  <context>
@@ -37,23 +40,22 @@ $ARGUMENTS — optional path to SPEC.md. If not provided, read from .sdlc/STATE.
37
40
  Read these files:
38
41
  - .sdlc/STATE.md — current plan, all artifact paths.
39
42
  - .sdlc/ROADMAP.md — milestones, phases, plans to determine next steps.
43
+ - .sdlc/PROJECT.md — requirements to update during phase transitions.
40
44
  - .sdlc/specs/SPEC-<plan-id>.md — what was planned.
41
45
  - .sdlc/impl/IMPL-<plan-id>.md — what was built.
42
46
  - .sdlc/verify/VERIFY-<plan-id>.md — what was verified.
43
- - .sdlc/review/REVIEW-<plan-id>.md — what was reviewed.
44
47
  </context>
45
48
 
46
49
  <process>
47
- Follow workflow: @~/.claude/sdlc-framework/workflows/close-loop.md
50
+ Follow workflow: @~/.claude/sdlc-framework/workflows/close-phase.md
48
51
 
49
52
  Step-by-step:
50
53
 
51
54
  1. **Load all loop artifacts**
52
- - Read .sdlc/STATE.md. Confirm loop_position is REVIEW_COMPLETE. If not, warn: "Review not complete. Run /sdlc:review first."
55
+ - Read .sdlc/STATE.md. Confirm loop_position is VERIFY ✓. If not, warn: "Verification not complete. Run /sdlc:verify first."
53
56
  - Read SPEC-<plan-id>.md — extract: objective, acceptance criteria, tasks, boundaries.
54
57
  - Read IMPL-<plan-id>.md — extract: tasks completed, files modified, build status.
55
- - Read VERIFY-<plan-id>.md — extract: AC results (pass/fail per criterion).
56
- - Read REVIEW-<plan-id>.md — extract: findings summary, warnings count.
58
+ - Read VERIFY-<plan-id>.md — extract: AC results (Phase 1) and review findings (Phase 2).
57
59
 
58
60
  2. **Reconcile: Planned vs Actual**
59
61
 
@@ -91,7 +93,7 @@ Step-by-step:
91
93
  Compile all design decisions made during this loop:
92
94
  - Decisions from /sdlc:spec (architectural choices).
93
95
  - Decisions from /sdlc:impl (implementation choices).
94
- - Decisions from /sdlc:review (remediation approaches).
96
+ - Decisions from /sdlc:verify (remediation approaches).
95
97
  Include the rationale for each decision.
96
98
 
97
99
  5. **Extract lessons learned**
@@ -155,7 +157,7 @@ Step-by-step:
155
157
  ```
156
158
 
157
159
  7. **Update STATE.md**
158
- - Set `loop_position: SPEC` (ready for next loop).
160
+ - Set `loop_position: CLOSE ✓` (ready for next loop).
159
161
  - Archive the current plan: move plan-id to `completed_plans` list.
160
162
  - Determine next action:
161
163
  - Read ROADMAP.md to find the next plan in the current phase.
@@ -171,20 +173,41 @@ Step-by-step:
171
173
  9. **Determine and output next action**
172
174
  - If more plans in the current phase:
173
175
  - Output: "Plan <plan-id> complete. Next plan: <next-plan-id>."
174
- - End with: NEXT ACTION REQUIRED: /sdlc:spec
175
- - If phase is complete but more phases exist:
176
- - Output: "Phase <phase-name> complete. Next phase: <next-phase-name>."
177
- - End with: NEXT ACTION REQUIRED: /sdlc:spec
178
- - If milestone is complete but more milestones exist:
179
- - Output: "Milestone <milestone-name> complete. Next milestone: <next-milestone-name>."
180
- - End with: NEXT ACTION REQUIRED: /sdlc:spec
176
+ - End with auto-advance directive to /sdlc:spec
177
+
178
+ - If phase is complete (last plan done) — execute phase transition inline:
179
+ a. **Verify phase completeness:** List all SPEC and SUMMARY files in .sdlc/phases/{current_phase}/. Every SPEC must have a corresponding SUMMARY. Every SUMMARY must show all ACs passed. If not, block: "Phase transition blocked. Plan {N} has no summary or failing ACs."
180
+ b. **Cross-check consistency:** Verify STATE.md current_milestone matches ROADMAP.md in-progress milestone. Verify prior phases in this milestone are all COMPLETE. If inconsistency found: display details, offer auto-fix, ask for confirmation.
181
+ c. **Update PROJECT.md:** Read all SUMMARY.md files from the completing phase. Mark addressed requirements as IMPLEMENTED. Mark contradicted requirements as SUPERSEDED. Add newly discovered requirements as NOT STARTED. Display proposed changes and ask user to confirm before writing.
182
+ d. **Update ROADMAP.md:** Mark completed phase as COMPLETE with date. Add phase summary note (plans executed, hotfixes, key deliverables, duration from first spec to completion).
183
+ e. **Advance state:** Update STATE.md — set current_phase to next phase, clear current_plan, set loop_position to SPEC, set next_required_action to /sdlc:spec. Update ROADMAP.md — set next phase to IN PROGRESS.
184
+ f. **If no next phase (last phase in milestone):** Do not advance to a new phase. Set next_required_action to milestone completion (step 10 handles this).
185
+ g. **Create git commit** (if in a git repo): Stage .sdlc/ files and source files from the phase. Commit: `feat({phase-name}): complete phase {number}`
186
+ h. Output: "Phase <phase-name> complete. Next phase: <next-phase-name>."
187
+ i. End with auto-advance directive to /sdlc:spec
188
+
189
+ - If milestone is complete: run milestone completion (step 10).
181
190
  - If all milestones are complete:
182
191
  - Output: "All milestones complete. Project roadmap fulfilled."
183
- - End with: "Project complete. Run /sdlc:init to start a new project or update ROADMAP.md with new milestones."
192
+ - End with: "Project complete. Run /sdlc:init milestone <name> to plan the next milestone."
193
+
194
+ 10. **Milestone completion** (when all phases in current milestone are done)
195
+ a. Verify all phases in current milestone are marked complete in ROADMAP.md.
196
+ b. Generate milestone summary by reading all SUMMARY.md files across phases:
197
+ - Total phases, plans executed, hotfixes applied.
198
+ - Consolidated deliverables, key decisions, technical debt.
199
+ c. Create git tag (ask user first):
200
+ - `git tag -a "milestone-{number}-{name}" -m "Milestone {number}: {name} complete"`
201
+ d. Mark milestone as COMPLETE in ROADMAP.md with completion date.
202
+ e. Check for next milestone in ROADMAP.md:
203
+ - If exists: set as current in STATE.md.
204
+ End with auto-advance directive to /sdlc:spec with message: "Milestone complete. Next: {name}."
205
+ - If none: clear current_milestone.
206
+ Output: "Milestone complete. No further milestones. Run /sdlc:init milestone <name> to plan the next."
184
207
  </process>
185
208
 
186
209
  <success_criteria>
187
- - [ ] All loop artifacts read: SPEC, IMPL, VERIFY, REVIEW
210
+ - [ ] All loop artifacts read: SPEC, IMPL, VERIFY (contains AC results + review findings)
188
211
  - [ ] Task reconciliation complete: each task marked completed, skipped, or modified
189
212
  - [ ] Acceptance criteria reconciliation complete: every AC mapped to pass/fail
190
213
  - [ ] Scope reconciliation complete: files planned vs files modified compared
@@ -193,8 +216,10 @@ Step-by-step:
193
216
  - [ ] Key decisions recorded with rationale
194
217
  - [ ] Lessons learned extracted from the loop
195
218
  - [ ] SUMMARY-<plan-id>.md created with full reconciliation
196
- - [ ] STATE.md updated: loop_position reset to SPEC, current plan advanced
219
+ - [ ] STATE.md updated: loop_position set to CLOSE ✓, current plan advanced
197
220
  - [ ] ROADMAP.md updated: completed plan/phase/milestone marked as done
198
221
  - [ ] Correct next action determined based on roadmap position
199
- - [ ] Output ends with NEXT ACTION REQUIRED: /sdlc:spec (or project complete message)
222
+ - [ ] Phase transition (when last plan completes): completeness verified, PROJECT.md updated, ROADMAP.md updated with phase summary, git commit created
223
+ - [ ] Milestone completion: summary generated, git tag created, ROADMAP.md updated (when applicable)
224
+ - [ ] Output ends with auto-advance directive to /sdlc:spec (or project complete message)
200
225
  </success_criteria>
@@ -17,11 +17,11 @@ Structured debugging that follows a disciplined flow: REPRODUCE, ISOLATE, ROOT-C
17
17
  4. Apply a fix that follows engineering laws.
18
18
  5. Verify the fix by re-running the reproduction and regression tests.
19
19
 
20
- **What happens next:** /sdlc:review to validate the fix meets engineering standards.
20
+ **What happens next:** /sdlc:verify to validate the fix meets engineering standards.
21
21
  </objective>
22
22
 
23
23
  <execution_context>
24
- @~/.claude/sdlc-framework/workflows/debug.md
24
+ @~/.claude/sdlc-framework/workflows/debug-flow.md
25
25
  @.sdlc/STATE.md
26
26
  @.sdlc/LAWS.md
27
27
  </execution_context>
@@ -35,7 +35,7 @@ Gather any error messages, stack traces, or reproduction steps from the user's d
35
35
  </context>
36
36
 
37
37
  <process>
38
- Follow workflow: @~/.claude/sdlc-framework/workflows/debug.md
38
+ Follow workflow: @~/.claude/sdlc-framework/workflows/debug-flow.md
39
39
 
40
40
  Step-by-step:
41
41
 
@@ -107,7 +107,7 @@ Step-by-step:
107
107
 
108
108
  8. **Update STATE.md and force next action**
109
109
  - Update .sdlc/STATE.md: record the debug session, files changed.
110
- - Output: "NEXT ACTION REQUIRED: /sdlc:review — validate the fix meets engineering standards."
110
+ - End with auto-advance directive to /sdlc:verify.
111
111
  </process>
112
112
 
113
113
  <success_criteria>
@@ -120,5 +120,5 @@ Step-by-step:
120
120
  - [ ] Similar bugs in other locations identified and fixed
121
121
  - [ ] DEBUG-LOG.md created in .sdlc/debug-logs/
122
122
  - [ ] STATE.md updated
123
- - [ ] Output ends with NEXT ACTION REQUIRED: /sdlc:review
123
+ - [ ] Output ends with auto-advance directive to /sdlc:verify
124
124
  </success_criteria>
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: sdlc:discuss
3
+ description: Brainstorm an idea into a PRD. Spawns research subagents when unknowns are detected.
4
+ argument-hint: "[idea or topic]"
5
+ allowed-tools: [Read, Write, Glob, Grep, Agent, WebSearch, WebFetch, AskUserQuestion]
6
+ ---
7
+
8
+ <objective>
9
+ Drive a structured brainstorming session to help the user explore, clarify, and validate an idea. Spawn research subagents inline when unknowns surface. Produce a complete PRD document through targeted AI-driven questions across problem, scope, research, approach, and requirements.
10
+
11
+ **When to use:** Before /sdlc:spec when the idea is raw, vague, or needs exploration. Also use when research is needed — external APIs, library choices, codebase patterns. This is the DISCOVERY phase — upstream of the SDLC loop.
12
+
13
+ **What it does:**
14
+ 1. Accept a raw idea or topic from the user.
15
+ 2. Ask structured questions in rounds: problem, scope, approach, requirements.
16
+ 3. Between scope and approach, detect unknowns and spawn research subagents inline (codebase exploration, web research, or both).
17
+ 4. Feed research findings directly into approach validation.
18
+ 5. Validate ideas and offer recommendations with concrete trade-offs.
19
+ 6. Compile all decisions and research findings into a PRD document.
20
+ 7. Boot up the SDLC loop by routing to /sdlc:spec with the PRD as input.
21
+
22
+ **What happens next:** After user approves the PRD, framework directs to /sdlc:spec to formalize it into a specification.
23
+
24
+ **Critical rule:** AI drives the conversation. Ask questions — do not assume answers. Every question includes a recommendation. Maximum 4 rounds of 2-4 questions each. Research spawns inline when unknowns exist — skip research when the idea is clear enough.
25
+ </objective>
26
+
27
+ <execution_context>
28
+ @~/.claude/sdlc-framework/workflows/discuss-phase.md
29
+ @~/.claude/sdlc-framework/templates/PRD.md
30
+ @~/.claude/sdlc-framework/references/clarification-strategy.md
31
+ @.sdlc/STATE.md
32
+ @.sdlc/PROJECT.md
33
+ </execution_context>
34
+
35
+ <context>
36
+ $ARGUMENTS — optional idea description or topic to explore.
37
+
38
+ Read these files if they exist:
39
+ - .sdlc/STATE.md — current loop position (discuss can run at any point).
40
+ - .sdlc/PROJECT.md — project context, tech stack, existing architecture.
41
+ - .sdlc/ROADMAP.md — milestones and phases for context.
42
+ - .sdlc/research/*.md — prior research findings for reuse.
43
+
44
+ Scan the codebase to understand existing patterns and constraints.
45
+ </context>
46
+
47
+ <process>
48
+ Follow workflow: @~/.claude/sdlc-framework/workflows/discuss-phase.md
49
+
50
+ Step-by-step:
51
+
52
+ 1. **Seed the idea**
53
+ - If $ARGUMENTS provided, acknowledge the idea and restate it.
54
+ - If no arguments, ask: "What idea or problem do you want to explore?"
55
+
56
+ 2. **Run question rounds** (max 4 rounds, 2-4 questions per round)
57
+ - Round 1: Problem space — who, what, why, current workarounds.
58
+ - Round 2: Scope and constraints — in/out, MVP, timeline, tech.
59
+ - Round 2.5: Research unknowns — if unknowns exist (external APIs, library choices, codebase patterns, best practices), spawn research subagents inline. Classify research type (codebase, web, hybrid). Save findings to .sdlc/research/{topic-slug}.md. Skip if no unknowns identified.
60
+ - Round 3: Approach validation — present options with trade-offs informed by research findings, ask user to choose.
61
+ - Round 4: Requirements detail — user flows, edge cases, integrations.
62
+ - Each question includes a recommendation. Stop early if clarity is sufficient.
63
+
64
+ 3. **Compile PRD**
65
+ - Assemble all answers into .sdlc/discuss/{topic}-PRD.md using @templates/PRD.md.
66
+ - Include decisions log with every question asked and answer received.
67
+ - Include "Research Findings" section if research was conducted.
68
+
69
+ 4. **Present and approve**
70
+ - Display PRD summary. User options: APPROVE, REVISE, REJECT.
71
+ - If APPROVE: route to /sdlc:spec.
72
+
73
+ 5. **Update STATE.md and output**
74
+ - Record discussion reference. Set next_required_action: /sdlc:spec.
75
+ - End with auto-advance directive to /sdlc:spec
76
+ </process>
77
+
78
+ <success_criteria>
79
+ - [ ] Idea explored through at least 2 rounds of structured questions
80
+ - [ ] Every question included a recommendation with trade-offs
81
+ - [ ] Research subagents spawned when unknowns detected (external APIs, library choices, codebase patterns)
82
+ - [ ] Research skipped cleanly when idea is clear and no unknowns exist
83
+ - [ ] Research findings saved to .sdlc/research/{topic-slug}.md when applicable
84
+ - [ ] PRD created at .sdlc/discuss/{topic}-PRD.md with all required sections
85
+ - [ ] PRD includes Research Findings section when research was conducted
86
+ - [ ] PRD includes decisions log mapping questions to answers
87
+ - [ ] User explicitly approved the PRD (APPROVE response received)
88
+ - [ ] STATE.md updated with discussion reference
89
+ - [ ] Output ends with auto-advance directive to /sdlc:spec
90
+ </success_criteria>