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.
- package/README.md +89 -46
- package/bin/install.js +4 -4
- package/package.json +2 -2
- package/src/commands/close.md +50 -25
- package/src/commands/debug.md +5 -5
- package/src/commands/discuss.md +90 -0
- package/src/commands/fast.md +49 -13
- package/src/commands/fix.md +18 -18
- package/src/commands/help.md +26 -21
- package/src/commands/impl.md +11 -10
- package/src/commands/init.md +23 -7
- package/src/commands/spec.md +42 -22
- package/src/commands/status.md +57 -91
- package/src/commands/verify.md +81 -120
- package/src/references/loop-phases.md +24 -30
- package/src/references/prompt-detection.md +7 -7
- package/src/rules/commands.md +2 -2
- package/src/rules/style.md +3 -4
- package/src/rules/workflows.md +3 -4
- package/src/templates/HANDOFF.md +1 -1
- package/src/templates/LAWS.md +2 -2
- package/src/templates/PRD.md +89 -0
- package/src/templates/ROADMAP.md +2 -3
- package/src/templates/STATE.md +15 -5
- package/src/templates/SUMMARY.md +2 -2
- package/src/workflows/close-phase.md +117 -37
- package/src/workflows/debug-flow.md +16 -5
- package/src/workflows/discuss-phase.md +395 -0
- package/src/workflows/fast-forward.md +103 -15
- package/src/workflows/fix-findings.md +42 -19
- package/src/workflows/impl-phase.md +130 -17
- package/src/workflows/init-project.md +19 -8
- package/src/workflows/spec-phase.md +305 -41
- package/src/workflows/status-session.md +229 -0
- package/src/workflows/verify-phase.md +300 -112
- package/src/commands/hotfix.md +0 -99
- package/src/commands/milestone.md +0 -136
- package/src/commands/pause.md +0 -115
- package/src/commands/research.md +0 -136
- package/src/commands/resume.md +0 -103
- package/src/commands/review.md +0 -195
- package/src/templates/REVIEW.md +0 -145
- package/src/workflows/hotfix-flow.md +0 -190
- package/src/workflows/milestone-management.md +0 -169
- package/src/workflows/pause-work.md +0 -153
- package/src/workflows/research.md +0 -219
- package/src/workflows/resume-project.md +0 -159
- package/src/workflows/review-phase.md +0 -337
- package/src/workflows/transition-phase.md +0 -203
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
<purpose>
|
|
1
|
+
<purpose>Two-phase verification: first test every acceptance criterion using automated tools, then check all modified code against engineering laws. Both gates must pass before closing the loop. UI interactions use Playwright MCP, API endpoints use HTTP requests, business logic uses the project test suite. Engineering laws (SOLID, DRY, YAGNI, Clean Code, Security, Testing, Error Handling) are checked against LAWS.md configured severity. This single step replaces the old separate verify + review commands.</purpose>
|
|
2
2
|
<when_to_use>Run after /sdlc:impl completes. STATE.md must show loop_position = IMPL ✓ and next_required_action = /sdlc:verify.</when_to_use>
|
|
3
|
-
<required_reading>.sdlc/STATE.md, the current SPEC.md
|
|
3
|
+
<required_reading>.sdlc/STATE.md, the current SPEC.md, .sdlc/PROJECT.md, .sdlc/LAWS.md, all modified files</required_reading>
|
|
4
4
|
<loop_context>
|
|
5
5
|
expected_phase: VERIFY (active)
|
|
6
6
|
prior_phase: IMPL ✓
|
|
7
|
-
next_phase:
|
|
7
|
+
next_phase: CLOSE
|
|
8
8
|
</loop_context>
|
|
9
|
+
<display_rule>
|
|
10
|
+
MANDATORY: Display results in two sections in the chat window.
|
|
11
|
+
|
|
12
|
+
PHASE 1 — AC Results:
|
|
13
|
+
| AC | Description | Type | Status | Evidence (1 line) |
|
|
14
|
+
|
|
15
|
+
PHASE 2 — Engineering Laws Review:
|
|
16
|
+
| # | File | Line | Law | Severity | Finding |
|
|
17
|
+
Blocker count, warning count, verdict.
|
|
18
|
+
|
|
19
|
+
Keep it compact (~30-50 lines total). Full VERIFY.md is in the file for audit.
|
|
20
|
+
</display_rule>
|
|
9
21
|
<process>
|
|
10
22
|
|
|
11
23
|
<step name="validate_state" priority="first">
|
|
@@ -38,48 +50,73 @@
|
|
|
38
50
|
WHY: Without acceptance criteria, there is nothing to verify. The spec must define what "done" looks like.
|
|
39
51
|
</step>
|
|
40
52
|
|
|
41
|
-
<step name="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
<step name="read_verification_types" priority="third">
|
|
54
|
+
╔══════════════════════════════════════════════════════════════════════╗
|
|
55
|
+
║ DO NOT GUESS OR INFER THE VERIFICATION TYPE. ║
|
|
56
|
+
║ READ the Type field from each AC in the SPEC.md. ║
|
|
57
|
+
║ The spec phase declared the type. The verify phase USES it. ║
|
|
58
|
+
║ If an AC is missing its Type field, mark it FAIL: "No Type field." ║
|
|
59
|
+
╚══════════════════════════════════════════════════════════════════════╝
|
|
60
|
+
|
|
61
|
+
For each AC extracted in the previous step, read its declared Type field.
|
|
62
|
+
|
|
63
|
+
VALID TYPES AND THEIR VERIFICATION TOOLS:
|
|
64
|
+
|
|
65
|
+
| Type | Verification Tool | Action |
|
|
66
|
+
|------|------------------|--------|
|
|
67
|
+
| UI_INTERACTION | Playwright MCP | Use browser_navigate, browser_snapshot, browser_click, browser_fill_form, browser_take_screenshot |
|
|
68
|
+
| API_ENDPOINT | Bash curl | Construct and execute HTTP requests, parse response |
|
|
69
|
+
| CLI_BEHAVIOR | Bash | Run shell commands, capture stdout/stderr/exit code |
|
|
70
|
+
| BUSINESS_LOGIC | Test runner | Run bun test, npm test, vitest, jest, or pytest |
|
|
71
|
+
| DATA_INTEGRITY | DB CLI | Execute database queries via Bash |
|
|
72
|
+
|
|
73
|
+
MISSING TYPE HANDLING:
|
|
74
|
+
If an AC does NOT have a Type field:
|
|
75
|
+
1. Record: "FAIL — AC-{N} is missing its Type field. The spec must declare a verification_type for every AC."
|
|
76
|
+
2. Do NOT attempt to guess the type from keywords.
|
|
77
|
+
3. Include this failure in the verification report.
|
|
78
|
+
|
|
79
|
+
PLAYWRIGHT MCP PRE-CHECK:
|
|
80
|
+
If ANY AC has Type: UI_INTERACTION:
|
|
81
|
+
1. Call mcp__plugin_playwright_playwright__browser_install to ensure a browser is available.
|
|
82
|
+
2. Call mcp__plugin_playwright_playwright__browser_navigate with a test URL (the app's base URL from PROJECT.md or localhost).
|
|
83
|
+
3. If navigation fails: record ALL UI_INTERACTION ACs as FAIL with evidence "Playwright MCP unavailable or app not running at {url}."
|
|
84
|
+
4. If navigation succeeds: call mcp__plugin_playwright_playwright__browser_snapshot to confirm the page loaded.
|
|
85
|
+
|
|
86
|
+
Present the type mapping before executing:
|
|
65
87
|
```
|
|
66
|
-
|
|
67
|
-
AC-1: {description} →
|
|
68
|
-
AC-2: {description} →
|
|
69
|
-
AC-3: {description} → BUSINESS_LOGIC (test suite)
|
|
88
|
+
Verification Plan:
|
|
89
|
+
AC-1: {description} → {Type} (tool: {Playwright MCP | curl | Bash | test runner | DB CLI})
|
|
90
|
+
AC-2: {description} → {Type} (tool: {Playwright MCP | curl | Bash | test runner | DB CLI})
|
|
70
91
|
```
|
|
71
92
|
|
|
72
|
-
WHY:
|
|
93
|
+
WHY: The spec phase explicitly declared how each AC should be verified. Reading the declared type eliminates guessing. The Playwright pre-check catches "MCP not installed" before wasting time on individual AC attempts.
|
|
73
94
|
</step>
|
|
74
95
|
|
|
75
96
|
<step name="verify_ui_interactions" priority="fourth">
|
|
76
97
|
FOR EACH AC classified as UI_INTERACTION:
|
|
77
98
|
|
|
99
|
+
╔══════════════════════════════════════════════════════════════════════╗
|
|
100
|
+
║ YOU MUST CALL THESE EXACT TOOL NAMES. THIS IS NOT OPTIONAL. ║
|
|
101
|
+
║ mcp__plugin_playwright_playwright__browser_navigate ║
|
|
102
|
+
║ mcp__plugin_playwright_playwright__browser_snapshot ║
|
|
103
|
+
║ mcp__plugin_playwright_playwright__browser_click ║
|
|
104
|
+
║ mcp__plugin_playwright_playwright__browser_fill_form ║
|
|
105
|
+
║ mcp__plugin_playwright_playwright__browser_take_screenshot ║
|
|
106
|
+
║ mcp__plugin_playwright_playwright__browser_select_option ║
|
|
107
|
+
║ mcp__plugin_playwright_playwright__browser_press_key ║
|
|
108
|
+
║ mcp__plugin_playwright_playwright__browser_hover ║
|
|
109
|
+
║ mcp__plugin_playwright_playwright__browser_file_upload ║
|
|
110
|
+
║ mcp__plugin_playwright_playwright__browser_console_messages ║
|
|
111
|
+
║ mcp__plugin_playwright_playwright__browser_wait_for ║
|
|
112
|
+
║ DO NOT ask the user to manually test. DO NOT skip UI ACs. ║
|
|
113
|
+
╚══════════════════════════════════════════════════════════════════════╝
|
|
114
|
+
|
|
78
115
|
A. SET UP PRECONDITION (GIVEN):
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
116
|
+
1. Call browser_navigate to go to the relevant page
|
|
117
|
+
2. Call browser_snapshot to capture initial state
|
|
118
|
+
3. Verify the GIVEN condition is met in the snapshot
|
|
119
|
+
4. If GIVEN requires data setup (e.g., "a registered user"), run setup commands first via Bash
|
|
83
120
|
|
|
84
121
|
B. EXECUTE ACTION (WHEN):
|
|
85
122
|
Translate the WHEN clause into Playwright MCP actions:
|
|
@@ -90,33 +127,31 @@
|
|
|
90
127
|
- "hovers over the menu" → browser_hover with the menu selector
|
|
91
128
|
- "uploads a file" → browser_file_upload
|
|
92
129
|
|
|
93
|
-
|
|
130
|
+
Call browser_snapshot BEFORE the action to confirm the element exists.
|
|
94
131
|
If the element is not found in the snapshot, record FAIL: "Element not found: {selector}"
|
|
95
132
|
|
|
96
133
|
C. VERIFY OUTCOME (THEN):
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
134
|
+
1. Call browser_snapshot AFTER the action
|
|
135
|
+
2. Call browser_take_screenshot for visual evidence
|
|
136
|
+
3. Check the snapshot content against the THEN clause:
|
|
100
137
|
- "displays a success message" → search snapshot for the message text
|
|
101
138
|
- "redirects to /dashboard" → check the current URL in snapshot
|
|
102
139
|
- "shows 3 items in the list" → count matching elements in snapshot
|
|
103
140
|
- "hides the modal" → verify modal is absent from snapshot
|
|
141
|
+
4. Call browser_console_messages to check for JavaScript errors
|
|
104
142
|
|
|
105
143
|
D. RECORD RESULT:
|
|
106
|
-
```
|
|
107
144
|
AC-{N}: {description}
|
|
108
145
|
Status: PASS | FAIL
|
|
109
146
|
Evidence: {what was observed}
|
|
110
147
|
Screenshot: {if taken}
|
|
111
|
-
```
|
|
112
148
|
|
|
113
149
|
IF AN ACTION FAILS (element not found, page error, timeout):
|
|
114
150
|
- Record FAIL with the specific error
|
|
115
|
-
- Use browser_console_messages to check for JavaScript errors
|
|
116
151
|
- Include console errors in the evidence
|
|
117
152
|
- Continue to next AC (do not stop on first failure)
|
|
118
153
|
|
|
119
|
-
WHY: Playwright MCP replaces manual UAT. Every UI acceptance criterion gets tested programmatically with screenshot evidence
|
|
154
|
+
WHY: Playwright MCP replaces manual UAT. Every UI acceptance criterion gets tested programmatically with screenshot evidence.
|
|
120
155
|
</step>
|
|
121
156
|
|
|
122
157
|
<step name="verify_api_endpoints" priority="fifth">
|
|
@@ -136,7 +171,6 @@
|
|
|
136
171
|
-d '{request_body}' \
|
|
137
172
|
{base_url}{endpoint}
|
|
138
173
|
```
|
|
139
|
-
|
|
140
174
|
Capture both response body and status code.
|
|
141
175
|
|
|
142
176
|
C. VERIFY RESPONSE (THEN):
|
|
@@ -145,16 +179,10 @@
|
|
|
145
179
|
- "response contains { 'token': ... }" → parse JSON and check field existence
|
|
146
180
|
- "response body is an array of 3 items" → parse JSON and check array length
|
|
147
181
|
- "returns error message 'Not found'" → check response body contains string
|
|
148
|
-
- "sets cookie 'session'" → check response headers
|
|
149
182
|
|
|
150
|
-
D. RECORD RESULT
|
|
151
|
-
```
|
|
152
|
-
AC-{N}: {description}
|
|
153
|
-
Status: PASS | FAIL
|
|
154
|
-
Evidence: HTTP {status}, Body: {truncated response}
|
|
155
|
-
```
|
|
183
|
+
D. RECORD RESULT with HTTP status and response body as evidence.
|
|
156
184
|
|
|
157
|
-
WHY: API tests are fast and deterministic. They verify the contract between frontend and backend
|
|
185
|
+
WHY: API tests are fast and deterministic. They verify the contract between frontend and backend.
|
|
158
186
|
</step>
|
|
159
187
|
|
|
160
188
|
<step name="verify_cli_behavior" priority="sixth">
|
|
@@ -164,13 +192,9 @@
|
|
|
164
192
|
- Create any required files, directories, or environment state
|
|
165
193
|
|
|
166
194
|
B. EXECUTE COMMAND (WHEN):
|
|
167
|
-
Run the command via Bash. Capture
|
|
168
|
-
- stdout
|
|
169
|
-
- stderr
|
|
170
|
-
- exit code
|
|
195
|
+
Run the command via Bash. Capture stdout, stderr, exit code.
|
|
171
196
|
|
|
172
197
|
C. VERIFY OUTPUT (THEN):
|
|
173
|
-
Check each assertion:
|
|
174
198
|
- "outputs 'Success'" → check stdout contains string
|
|
175
199
|
- "exits with code 0" → check exit code
|
|
176
200
|
- "creates file X" → check file exists
|
|
@@ -185,96 +209,260 @@
|
|
|
185
209
|
FOR EACH AC classified as BUSINESS_LOGIC:
|
|
186
210
|
|
|
187
211
|
A. CHECK IF TESTS EXIST:
|
|
188
|
-
Search for test files related to the AC (
|
|
212
|
+
Search for test files related to the AC (*.test.ts, *.spec.ts, *.test.js, etc.)
|
|
189
213
|
|
|
190
214
|
B. IF TESTS EXIST:
|
|
191
|
-
Run the specific test file or test suite
|
|
192
|
-
- npm test -- {test-file} (or bun test, vitest, jest, etc.)
|
|
193
|
-
- Capture output: pass/fail count, error messages
|
|
215
|
+
Run the specific test file or test suite via Bash. Capture output.
|
|
194
216
|
|
|
195
217
|
C. IF TESTS DO NOT EXIST:
|
|
196
|
-
Record FAIL: "No test file found for AC-{N}. Implementation must include tests
|
|
218
|
+
Record FAIL: "No test file found for AC-{N}. Implementation must include tests."
|
|
197
219
|
|
|
198
|
-
D.
|
|
199
|
-
Run coverage report. Check that modified files have adequate coverage.
|
|
220
|
+
D. RECORD RESULT with test runner output as evidence.
|
|
200
221
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
222
|
+
WHY: Business logic tests are the fastest feedback loop. They catch logic errors without a running server.
|
|
223
|
+
</step>
|
|
224
|
+
|
|
225
|
+
<step name="compile_ac_results" priority="eighth">
|
|
226
|
+
Compile all AC results into a table:
|
|
227
|
+
|
|
228
|
+
| AC | Description | Type | Status | Evidence |
|
|
229
|
+
|----|-------------|------|--------|----------|
|
|
230
|
+
| AC-1 | {desc} | UI | PASS | Screenshot shows success message |
|
|
231
|
+
| AC-2 | {desc} | API | FAIL | Expected 200, got 404 |
|
|
232
|
+
|
|
233
|
+
Calculate: Total ACs, Passed, Failed, Pass rate.
|
|
208
234
|
|
|
209
|
-
|
|
235
|
+
Display the table in chat as "PHASE 1 — Acceptance Criteria".
|
|
236
|
+
|
|
237
|
+
WHY: The AC results table gives immediate visibility before proceeding to engineering laws review.
|
|
210
238
|
</step>
|
|
211
239
|
|
|
212
|
-
<step name="
|
|
213
|
-
|
|
240
|
+
<step name="check_ac_gate" priority="ninth">
|
|
241
|
+
IF ANY AC FAILS (pass rate < 100%):
|
|
242
|
+
Do NOT update loop_position. Keep it at "IMPL ✓".
|
|
243
|
+
Set next_required_action to "/sdlc:verify" (stay in verify).
|
|
244
|
+
|
|
245
|
+
Display:
|
|
246
|
+
```
|
|
247
|
+
PHASE 1 FAILED: {passed}/{total} acceptance criteria met.
|
|
248
|
+
|
|
249
|
+
Failed ACs:
|
|
250
|
+
- AC-{N}: {description} — {evidence}
|
|
214
251
|
|
|
215
|
-
|
|
252
|
+
Fix suggestions:
|
|
253
|
+
- AC-{N}: {specific suggestion based on the failure}
|
|
254
|
+
|
|
255
|
+
Fix the failures and re-run /sdlc:verify.
|
|
256
|
+
If the spec is wrong (not the code), run /sdlc:spec to update it.
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Provide SPECIFIC fix suggestions for each failure:
|
|
260
|
+
- HTTP 404 → "Check that the route is registered."
|
|
261
|
+
- Element not found → "Use browser_snapshot to inspect the DOM."
|
|
262
|
+
- Test fails → "The assertion on line {N} expected {X} but got {Y}."
|
|
263
|
+
- No tests → "Create test file at {path}."
|
|
264
|
+
|
|
265
|
+
Do NOT proceed to engineering laws review. Do NOT auto-advance.
|
|
266
|
+
STOP HERE.
|
|
267
|
+
|
|
268
|
+
IF ALL ACs PASS (pass rate = 100%):
|
|
269
|
+
Display: "PHASE 1 PASSED: {N}/{N} acceptance criteria met."
|
|
270
|
+
Proceed to engineering laws review.
|
|
271
|
+
|
|
272
|
+
WHY: Code must work before reviewing its quality. Reviewing broken code is pointless.
|
|
273
|
+
</step>
|
|
274
|
+
|
|
275
|
+
<step name="engineering_laws_review" priority="tenth">
|
|
276
|
+
╔══════════════════════════════════════════════════════════════════════╗
|
|
277
|
+
║ PHASE 2: ENGINEERING LAWS REVIEW ║
|
|
278
|
+
║ All ACs passed. Now check code quality against LAWS.md. ║
|
|
279
|
+
╚══════════════════════════════════════════════════════════════════════╝
|
|
280
|
+
|
|
281
|
+
A. LOAD REVIEW CONTEXT:
|
|
282
|
+
Read .sdlc/LAWS.md. Build a lookup of law → severity (ERROR/WARN/INFO).
|
|
283
|
+
Read the SPEC.md. Extract files_modified, files_created, boundaries, acceptance criteria.
|
|
284
|
+
Combine into a review list. Read every file in the list.
|
|
285
|
+
|
|
286
|
+
IF review list is empty: skip to generate_final_report with zero findings.
|
|
287
|
+
|
|
288
|
+
B. CHECK SOLID PRINCIPLES:
|
|
289
|
+
FOR EACH FILE:
|
|
290
|
+
- SRP: Does each class/module/function have one reason to change? Flag mixed concerns.
|
|
291
|
+
- OCP: Can code be extended without modification? Flag switch/if chains on types.
|
|
292
|
+
- LSP: Do subtypes honor parent contracts? Flag overrides that change semantics.
|
|
293
|
+
- ISP: Are interfaces minimal? Flag interfaces with 5+ methods.
|
|
294
|
+
- DIP: Do high-level modules depend on abstractions? Flag concrete instantiation with `new`.
|
|
295
|
+
Finding format: "{file}:{line} — {principle} violation: {description}"
|
|
296
|
+
|
|
297
|
+
C. CHECK DRY:
|
|
298
|
+
WITHIN MODIFIED FILES:
|
|
299
|
+
- 3+ lines of identical or near-identical logic in multiple places
|
|
300
|
+
- Copy-pasted code with only variable names changed
|
|
301
|
+
ACROSS THE CODEBASE:
|
|
302
|
+
- Use Grep to search for existing functions that do the same thing as new code
|
|
303
|
+
- Search for existing utilities with similar names or signatures
|
|
304
|
+
Finding format: "{file}:{line} — DRY violation: duplicates {other-file}:{line}"
|
|
305
|
+
|
|
306
|
+
D. CHECK YAGNI:
|
|
307
|
+
FOR EACH NEW FUNCTION/METHOD/CLASS:
|
|
308
|
+
- Is it required by at least one AC?
|
|
309
|
+
- Flag: zero-caller functions, single-value params, single-impl abstractions, "TODO: use later"
|
|
310
|
+
Finding format: "{file}:{line} — YAGNI violation: {function} not required by any AC"
|
|
311
|
+
|
|
312
|
+
E. CHECK CLEAN CODE:
|
|
313
|
+
- Function length > 40 lines → BLOCKER
|
|
314
|
+
- Parameter count > 3 → BLOCKER
|
|
315
|
+
- Nesting depth > 3 → BLOCKER
|
|
316
|
+
- Nested ternaries or ternary chains → BLOCKER
|
|
317
|
+
- Single-letter variables (except i, j, k) → WARNING
|
|
318
|
+
- Generic names (data, info, result, temp) → WARNING
|
|
319
|
+
Finding format: "{file}:{line} — Clean Code: {function} is {N} lines (max 40)"
|
|
320
|
+
|
|
321
|
+
F. CHECK SECURITY:
|
|
322
|
+
- Hardcoded secrets: patterns API_KEY, SECRET, PASSWORD, TOKEN + string literal
|
|
323
|
+
- SQL injection: string concatenation in SQL queries
|
|
324
|
+
- XSS: unsanitized user input rendered in HTML
|
|
325
|
+
- Path traversal: file path construction with user input
|
|
326
|
+
- Input validation: system boundary functions must validate all inputs
|
|
327
|
+
Finding format: "{file}:{line} — SECURITY: {vulnerability type}"
|
|
328
|
+
|
|
329
|
+
G. CHECK TESTING:
|
|
330
|
+
FOR EACH NEW BEHAVIOR:
|
|
331
|
+
- Does a corresponding test exist? Search for *.test.*, *.spec.*
|
|
332
|
+
- Are assertions meaningful? (not just .toBeDefined())
|
|
333
|
+
- Are edge cases covered? (empty input, null, boundary values)
|
|
334
|
+
Finding format: "{file}:{line} — TESTING: no test for {function}"
|
|
335
|
+
|
|
336
|
+
H. CHECK ERROR HANDLING:
|
|
337
|
+
- Empty catch blocks → ALWAYS BLOCKER (regardless of severity config)
|
|
338
|
+
- Generic throw new Error() → flag for domain-specific exception
|
|
339
|
+
- Swallowed exceptions (catch without log/rethrow)
|
|
340
|
+
- Missing error handling on async operations
|
|
341
|
+
Finding format: "{file}:{line} — ERROR HANDLING: {violation}"
|
|
342
|
+
|
|
343
|
+
Map severity from LAWS.md: ERROR → BLOCKER, WARN → WARNING, INFO → INFO.
|
|
344
|
+
|
|
345
|
+
WHY: Engineering laws catch structural issues that automated tests miss. A function can pass all ACs and still be a 200-line unmaintainable mess.
|
|
346
|
+
</step>
|
|
347
|
+
|
|
348
|
+
<step name="generate_final_report" priority="eleventh">
|
|
349
|
+
Compile both phases into a single VERIFY.md at .sdlc/phases/{current_phase}/{current_plan}-VERIFY.md:
|
|
350
|
+
|
|
351
|
+
```markdown
|
|
352
|
+
# Verification Report: Plan {plan-number}
|
|
353
|
+
|
|
354
|
+
## Phase 1: Acceptance Criteria
|
|
355
|
+
|
|
356
|
+
### Summary
|
|
216
357
|
- Total ACs: {N}
|
|
217
358
|
- Passed: {N}
|
|
218
359
|
- Failed: {N}
|
|
219
|
-
- Pass rate: {percentage}
|
|
220
360
|
|
|
221
|
-
|
|
222
|
-
```
|
|
361
|
+
### Results
|
|
223
362
|
| AC | Description | Type | Status | Evidence |
|
|
224
363
|
|----|-------------|------|--------|----------|
|
|
225
|
-
| AC-1 | {desc} |
|
|
226
|
-
|
|
227
|
-
|
|
364
|
+
| AC-1 | {desc} | {type} | PASS/FAIL | {evidence} |
|
|
365
|
+
|
|
366
|
+
## Phase 2: Engineering Laws Review
|
|
367
|
+
|
|
368
|
+
### Summary
|
|
369
|
+
- **Blockers**: {count}
|
|
370
|
+
- **Warnings**: {count}
|
|
371
|
+
- **Info**: {count}
|
|
372
|
+
- **Files reviewed**: {count}
|
|
373
|
+
|
|
374
|
+
### Findings by File
|
|
375
|
+
|
|
376
|
+
#### {file-path}
|
|
377
|
+
| # | Law | Severity | Line | Finding |
|
|
378
|
+
|---|-----|----------|------|---------|
|
|
379
|
+
| 1 | DRY | BLOCKER | 42 | Duplicates logic from utils/format.ts:15 |
|
|
380
|
+
|
|
381
|
+
### Blocker Details
|
|
382
|
+
For each blocker:
|
|
383
|
+
- What the violation is
|
|
384
|
+
- Where: file:line
|
|
385
|
+
- How to fix (specific, actionable)
|
|
386
|
+
- Pattern to follow (reference existing code)
|
|
387
|
+
|
|
388
|
+
### Laws Compliance Matrix
|
|
389
|
+
| Law | Status | Findings |
|
|
390
|
+
|-----|--------|----------|
|
|
391
|
+
| SOLID | PASS/FAIL | B-1, W-2 |
|
|
392
|
+
| DRY | PASS/FAIL | ... |
|
|
393
|
+
|
|
394
|
+
### Clean Files
|
|
395
|
+
{Files with zero findings}
|
|
228
396
|
```
|
|
229
397
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
WHY: The report is the evidence trail. During review and close, we can point to specific pass/fail results. Without evidence, "it works" is just an opinion.
|
|
398
|
+
WHY: One artifact captures both verification and review. No cross-referencing needed.
|
|
233
399
|
</step>
|
|
234
400
|
|
|
235
|
-
<step name="handle_results" priority="
|
|
236
|
-
IF
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
- next_required_action: /sdlc:review
|
|
240
|
-
- Add history entry: "{timestamp} | verify | All {N} ACs passed"
|
|
401
|
+
<step name="handle_results" priority="twelfth">
|
|
402
|
+
IF BLOCKERS EXIST (engineering laws violations at BLOCKER severity):
|
|
403
|
+
Do NOT update loop_position. Keep at "IMPL ✓".
|
|
404
|
+
Set next_required_action to "/sdlc:fix".
|
|
241
405
|
|
|
242
406
|
Display:
|
|
243
407
|
```
|
|
244
|
-
|
|
408
|
+
PHASE 1 PASSED: {N}/{N} ACs met.
|
|
409
|
+
PHASE 2 FAILED: {blocker_count} blockers found.
|
|
410
|
+
|
|
411
|
+
Blockers:
|
|
412
|
+
1. {file}:{line} — {finding} — Fix: {how to fix}
|
|
413
|
+
2. {file}:{line} — {finding} — Fix: {how to fix}
|
|
414
|
+
|
|
415
|
+
Warnings: {count} (non-blocking)
|
|
245
416
|
|
|
246
417
|
Report: .sdlc/phases/{phase}/{plan}-VERIFY.md
|
|
247
418
|
|
|
248
|
-
NEXT
|
|
249
|
-
Run /sdlc:review for engineering laws compliance check.
|
|
419
|
+
NEXT: /sdlc:fix
|
|
250
420
|
```
|
|
251
421
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
422
|
+
<auto_advance>
|
|
423
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
424
|
+
IF auto_advance is true:
|
|
425
|
+
Display: "Auto-advancing to /sdlc:fix in {advance_delay_seconds}s — reply to intervene."
|
|
426
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
427
|
+
If no user message received during sleep: automatically execute /sdlc:fix.
|
|
428
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
429
|
+
IF auto_advance is false:
|
|
430
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:fix — Run /sdlc:fix to systematically fix all blockers, then re-verify automatically."
|
|
431
|
+
Wait for user to manually run the command.
|
|
432
|
+
</auto_advance>
|
|
433
|
+
|
|
434
|
+
IF NO BLOCKERS (only warnings and info, or clean):
|
|
435
|
+
Update .sdlc/STATE.md:
|
|
436
|
+
- loop_position: VERIFY ✓
|
|
437
|
+
- next_required_action: /sdlc:close
|
|
438
|
+
- Add history entry: "{timestamp} | verify | All {N} ACs passed. Review: {warn_count} warnings, {info_count} info."
|
|
255
439
|
|
|
256
440
|
Display:
|
|
257
441
|
```
|
|
258
|
-
|
|
442
|
+
PHASE 1 PASSED: {N}/{N} ACs met.
|
|
443
|
+
PHASE 2 PASSED: 0 blockers.
|
|
259
444
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
- AC-{N}: {description} — {evidence}
|
|
445
|
+
Warnings: {count} (consider fixing)
|
|
446
|
+
Files reviewed: {count}
|
|
263
447
|
|
|
264
|
-
|
|
265
|
-
- AC-{N}: {specific suggestion based on the failure}
|
|
448
|
+
Report: .sdlc/phases/{phase}/{plan}-VERIFY.md
|
|
266
449
|
|
|
267
|
-
|
|
268
|
-
If the spec is wrong (not the code), run /sdlc:spec to update it.
|
|
450
|
+
NEXT: /sdlc:close
|
|
269
451
|
```
|
|
270
452
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
453
|
+
<auto_advance>
|
|
454
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
455
|
+
IF auto_advance is true:
|
|
456
|
+
Display: "Auto-advancing to /sdlc:close in {advance_delay_seconds}s — reply to intervene."
|
|
457
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
458
|
+
If no user message received during sleep: automatically execute /sdlc:close.
|
|
459
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
460
|
+
IF auto_advance is false:
|
|
461
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:close"
|
|
462
|
+
Wait for user to manually run the command.
|
|
463
|
+
</auto_advance>
|
|
464
|
+
|
|
465
|
+
WHY: Both gates must pass. ACs ensure the code works. Laws ensure the code is maintainable. Only when both pass does the loop advance to close.
|
|
278
466
|
</step>
|
|
279
467
|
|
|
280
468
|
</process>
|
package/src/commands/hotfix.md
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sdlc:hotfix
|
|
3
|
-
description: "Emergency fix with minimal ceremony, maximum verification"
|
|
4
|
-
argument-hint: "<critical-issue>"
|
|
5
|
-
allowed-tools: [Read, Write, Bash, Glob, Grep, Edit, mcp__plugin_playwright_playwright__browser_navigate, mcp__plugin_playwright_playwright__browser_snapshot, mcp__plugin_playwright_playwright__browser_click, mcp__plugin_playwright_playwright__browser_fill_form, mcp__plugin_playwright_playwright__browser_take_screenshot, mcp__plugin_playwright_playwright__browser_evaluate, mcp__plugin_playwright_playwright__browser_console_messages, mcp__plugin_playwright_playwright__browser_close, AskUserQuestion]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<objective>
|
|
9
|
-
Emergency fix for critical issues. Minimal ceremony getting to the fix. Maximum verification after the fix. No corners cut on quality — only on planning overhead.
|
|
10
|
-
|
|
11
|
-
**When to use:** Production is broken. A critical path is failing. Security vulnerability discovered. Something that cannot wait for a full SPEC cycle.
|
|
12
|
-
|
|
13
|
-
**What it does:**
|
|
14
|
-
1. Skip full spec — create a lightweight inline spec (3 lines).
|
|
15
|
-
2. Fix the issue directly.
|
|
16
|
-
3. Run FULL verification (tests + Playwright).
|
|
17
|
-
4. Run FULL review (engineering laws compliance).
|
|
18
|
-
5. Record as a hotfix with decimal phase numbering (2.1, 2.2, etc.).
|
|
19
|
-
|
|
20
|
-
**What happens next:** /sdlc:verify to run the full verification suite.
|
|
21
|
-
</objective>
|
|
22
|
-
|
|
23
|
-
<execution_context>
|
|
24
|
-
@~/.claude/sdlc-framework/workflows/hotfix.md
|
|
25
|
-
@.sdlc/STATE.md
|
|
26
|
-
@.sdlc/LAWS.md
|
|
27
|
-
</execution_context>
|
|
28
|
-
|
|
29
|
-
<context>
|
|
30
|
-
$ARGUMENTS
|
|
31
|
-
|
|
32
|
-
Read .sdlc/STATE.md to get current milestone and phase.
|
|
33
|
-
Read .sdlc/LAWS.md — hotfixes are NOT exempt from engineering laws.
|
|
34
|
-
</context>
|
|
35
|
-
|
|
36
|
-
<process>
|
|
37
|
-
Follow workflow: @~/.claude/sdlc-framework/workflows/hotfix.md
|
|
38
|
-
|
|
39
|
-
Step-by-step:
|
|
40
|
-
|
|
41
|
-
1. **Pre-flight check**
|
|
42
|
-
- Verify .sdlc/ exists. If not, tell the user to run /sdlc:init first.
|
|
43
|
-
- Read .sdlc/STATE.md to get current phase number (e.g., phase 2).
|
|
44
|
-
- Assign hotfix number: current phase + decimal increment (2.1, 2.2, etc.).
|
|
45
|
-
- Update STATE.md: set loop_position to HOTFIX, record hotfix number.
|
|
46
|
-
|
|
47
|
-
2. **Lightweight inline spec (3 lines)**
|
|
48
|
-
- Line 1: WHAT is broken. (From $ARGUMENTS.)
|
|
49
|
-
- Line 2: WHERE is the likely location. (Quick search with Grep.)
|
|
50
|
-
- Line 3: WHAT the fix should achieve. (Expected behavior.)
|
|
51
|
-
- Record this inline spec in STATE.md under the hotfix entry.
|
|
52
|
-
|
|
53
|
-
3. **Fix the issue**
|
|
54
|
-
- Search for the affected code using Grep and Read.
|
|
55
|
-
- Apply the fix. Follow engineering laws:
|
|
56
|
-
- DRY: use existing patterns.
|
|
57
|
-
- Handle edge cases.
|
|
58
|
-
- Named types for complex objects.
|
|
59
|
-
- No lint suppression. No non-null assertions.
|
|
60
|
-
- Max 40 lines per function.
|
|
61
|
-
- Keep the change surface as small as possible. Fix the issue, nothing more.
|
|
62
|
-
|
|
63
|
-
4. **Full verification**
|
|
64
|
-
- Run the entire test suite. Not just affected tests — ALL tests.
|
|
65
|
-
- For UI-related hotfixes:
|
|
66
|
-
- Use Playwright to navigate to affected pages.
|
|
67
|
-
- Verify the fix visually with screenshots.
|
|
68
|
-
- Check console for errors.
|
|
69
|
-
- Test the happy path AND edge cases.
|
|
70
|
-
- If tests fail: fix the test failures before proceeding. Do not skip.
|
|
71
|
-
|
|
72
|
-
5. **Full review against engineering laws**
|
|
73
|
-
- Read .sdlc/LAWS.md.
|
|
74
|
-
- Check every changed line against every applicable law.
|
|
75
|
-
- Verify: no dead code introduced, no unused imports, no inline complex types.
|
|
76
|
-
- If any law is violated: fix it. Hotfixes are not exempt.
|
|
77
|
-
|
|
78
|
-
6. **Record in STATE.md**
|
|
79
|
-
- Update .sdlc/STATE.md:
|
|
80
|
-
- Record hotfix number (decimal: 2.1, 2.2, etc.).
|
|
81
|
-
- Record: issue description, files changed, tests run, verification status.
|
|
82
|
-
- Set loop_position back to current phase position.
|
|
83
|
-
- Create .sdlc/hotfixes/HOTFIX-{number}-{timestamp}.md with full details.
|
|
84
|
-
|
|
85
|
-
7. **Force next action**
|
|
86
|
-
- Output: "NEXT ACTION REQUIRED: /sdlc:verify — run full verification suite to confirm no regressions."
|
|
87
|
-
</process>
|
|
88
|
-
|
|
89
|
-
<success_criteria>
|
|
90
|
-
- [ ] Inline spec created (3 lines: what, where, expected behavior)
|
|
91
|
-
- [ ] Fix applied following engineering laws — no exceptions for hotfixes
|
|
92
|
-
- [ ] Full test suite runs and passes
|
|
93
|
-
- [ ] Playwright verification completed for UI-related hotfixes
|
|
94
|
-
- [ ] Engineering laws review passed on all changed code
|
|
95
|
-
- [ ] Hotfix recorded in STATE.md with decimal phase numbering
|
|
96
|
-
- [ ] Hotfix detail file created in .sdlc/hotfixes/
|
|
97
|
-
- [ ] Change surface is minimal — only the fix, nothing extra
|
|
98
|
-
- [ ] Output ends with NEXT ACTION REQUIRED: /sdlc:verify
|
|
99
|
-
</success_criteria>
|