@guanlin4924/devflow-pi 0.1.21 → 0.1.23

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 (32) hide show
  1. package/README.md +29 -21
  2. package/package.json +1 -2
  3. package/plugins/devflow-core/extensions/devflow-core.ts +1 -3
  4. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_workflow.rb +1 -1
  5. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +9 -10
  6. package/plugins/devflow-core/skills/workflow-orchestrator/templates/acceptance-remediation.yaml +87 -0
  7. package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +29 -98
  8. package/plugins/devflow-core/skills/workflow-pipeline/SKILL.md +3 -5
  9. package/plugins/devflow-core/skills/workflow-pipeline/references/pipeline-flow.md +9 -22
  10. package/plugins/devflow-core/skills/workflow-pipeline/references/slice-safety-guide.md +1 -1
  11. package/plugins/devflow-implementation/skills/workflow-change-plan/references/output-template.md +2 -2
  12. package/plugins/devflow-implementation/skills/workflow-execute-phase/references/execute-phase.md +52 -1221
  13. package/plugins/devflow-intel/skills/workflow-context-sync/SKILL.md +1 -1
  14. package/plugins/devflow-intel/skills/workflow-update-navigation/SKILL.md +1 -1
  15. package/plugins/devflow-quality/agents/verification-runner.md +1 -1
  16. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +2 -2
  17. package/plugins/devflow-quality/skills/workflow-release-closeout/SKILL.md +48 -0
  18. package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/SKILL.md +2 -2
  19. package/src/constants.ts +1 -1
  20. package/templates/commands/start.md +2 -2
  21. package/templates/omp/config.yml +1 -3
  22. package/docs/OMP-NATIVE-ARCHITECTURE.md +0 -104
  23. package/plugins/devflow-core/skills/workflow-orchestrator/templates/uat-remediation.yaml +0 -176
  24. package/plugins/devflow-quality/skills/workflow-audit-milestone/SKILL.md +0 -31
  25. package/plugins/devflow-quality/skills/workflow-audit-milestone/references/audit-milestone.md +0 -328
  26. package/plugins/devflow-quality/skills/workflow-complete-milestone/SKILL.md +0 -132
  27. package/plugins/devflow-quality/skills/workflow-complete-milestone/assets/milestone-archive.md +0 -123
  28. package/plugins/devflow-quality/skills/workflow-complete-milestone/references/complete-milestone.md +0 -775
  29. package/plugins/devflow-quality/skills/workflow-complete-milestone/references/milestone-archive.md +0 -123
  30. package/plugins/devflow-quality/skills/workflow-verify-work/SKILL.md +0 -112
  31. package/plugins/devflow-quality/skills/workflow-verify-work/assets/UAT.md +0 -265
  32. package/plugins/devflow-quality/skills/workflow-verify-work/references/verify-work.md +0 -759
@@ -1,759 +0,0 @@
1
- <purpose>
2
- Validate built features through conversational testing with persistent state. Creates UAT.md that tracks test progress, survives /clear, and feeds gaps into the fix planning phase.
3
-
4
- User tests, Claude records. One test at a time. Plain text responses.
5
- </purpose>
6
-
7
- <philosophy>
8
- **Show expected, ask if reality matches.**
9
-
10
- Claude presents what SHOULD happen. User confirms or describes what's different.
11
- - "yes" / "y" / "next" / empty → pass
12
- - Anything else → logged as issue, severity inferred
13
-
14
- No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. Does it?"
15
- </philosophy>
16
-
17
- <template>
18
- assets/UAT.md
19
- </template>
20
-
21
- <process>
22
-
23
- <step name="initialize" priority="first">
24
- If $ARGUMENTS contains a phase number, load context:
25
-
26
- ```bash
27
- if [ -n "${PHASE_ARG}" ]; then
28
- PHASE_DIR=$(ls -d .planning/phases/0${PHASE_ARG}-*/ .planning/phases/${PHASE_ARG}-*/ 2>/dev/null | head -1)
29
- if [ -n "$PHASE_DIR" ]; then
30
- PHASE_NUMBER=$(echo "$PHASE_DIR" | grep -oE '[0-9]+(\.[0-9]+)?' | head -1)
31
- PHASE_NAME=$(basename "$PHASE_DIR" | sed 's/^0*[0-9.]*-//')
32
- HAS_VERIFICATION=$(ls "$PHASE_DIR"/*-VERIFICATION.md 2>/dev/null && echo "true" || echo "false")
33
- UAT_PATH="${PHASE_DIR}/${PHASE_NUMBER}-UAT.md"
34
- phase_found=true
35
- fi
36
- fi
37
- PLANNER_MODEL=$(python3 -c "import json; d=json.load(open('.planning/config.json')); print(d.get('models',{}).get('planner',''))" 2>/dev/null || echo "")
38
- CHECKER_MODEL=$(python3 -c "import json; d=json.load(open('.planning/config.json')); print(d.get('models',{}).get('checker',''))" 2>/dev/null || echo "")
39
- COMMIT_DOCS=$(python3 -c "import json; d=json.load(open('.planning/config.json')); print(str(d.get('commit_docs','true')).lower())" 2>/dev/null || echo "true")
40
- ```
41
-
42
- Key values: `planner_model`, `checker_model`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `has_verification`, `uat_path`.
43
- </step>
44
-
45
- <step name="check_active_session">
46
- **First: Check for active UAT sessions**
47
-
48
- ```bash
49
- (find .planning/phases -name "*-UAT.md" -type f 2>/dev/null || true) | head -5
50
- ```
51
-
52
- **If active sessions exist AND no $ARGUMENTS provided:**
53
-
54
- Read each file's frontmatter (status, phase) and Current Test section.
55
-
56
- Display inline:
57
-
58
- ```
59
- ## Active UAT Sessions
60
-
61
- | # | Phase | Status | Current Test | Progress |
62
- |---|-------|--------|--------------|----------|
63
- | 1 | 04-comments | testing | 3. Reply to Comment | 2/6 |
64
- | 2 | 05-auth | testing | 1. Login Form | 0/4 |
65
-
66
- Reply with a number to resume, or provide a phase number to start new.
67
- ```
68
-
69
- Wait for user response.
70
-
71
- - If user replies with number (1, 2) → Load that file, go to `resume_from_file`
72
- - If user replies with phase number → Treat as new session, go to `create_uat_file`
73
-
74
- **If active sessions exist AND $ARGUMENTS provided:**
75
-
76
- Check if session exists for that phase. If yes, offer to resume or restart.
77
- If no, continue to `create_uat_file`.
78
-
79
- **If no active sessions AND no $ARGUMENTS:**
80
-
81
- ```
82
- No active UAT sessions.
83
-
84
- Provide a phase number to start testing (e.g., /workflow-verify-work 4)
85
- ```
86
-
87
- **If no active sessions AND $ARGUMENTS provided:**
88
-
89
- Continue to `create_uat_file`.
90
- </step>
91
-
92
- <step name="automated_ui_verification">
93
- **Automated UI Verification (when Playwright-MCP is available)**
94
-
95
- Before running manual UAT, check whether this phase has a UI component and whether
96
- `mcp__playwright__*` or `mcp__puppeteer__*` tools are available in the current session.
97
-
98
- ```
99
- UI_PHASE_FLAG=$(python3 -c "import json; d=json.load(open('.planning/config.json')); print(str(d.get('workflow',{}).get('ui_phase','false')).lower())" 2>/dev/null || echo "false")
100
- UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
101
- ```
102
-
103
- **If Playwright-MCP tools are available in this session (`mcp__playwright__*` tools
104
- respond to tool calls) AND (`UI_PHASE_FLAG` is `true` OR `UI_SPEC_FILE` is non-empty):**
105
-
106
- For each UI checkpoint listed in the phase's UI-SPEC.md (or inferred from SUMMARY.md):
107
-
108
- 1. Use `mcp__playwright__navigate` (or equivalent) to open the component's URL.
109
- 2. Use `mcp__playwright__screenshot` to capture a screenshot.
110
- 3. Compare the screenshot visually against the spec's stated requirements
111
- (dimensions, color, layout, spacing).
112
- 4. Automatically mark checkpoints as **passed** or **needs review** based on the
113
- visual comparison — no manual question required for items that clearly match.
114
- 5. Flag items that require human judgment (subjective aesthetics, content accuracy)
115
- and present only those as manual UAT questions.
116
-
117
- If automated verification is not available, fall back to the standard manual
118
- checkpoint questions defined in this workflow unchanged. This step is entirely
119
- conditional: if Playwright-MCP is not configured, behavior is unchanged from today.
120
-
121
- **Display summary line before proceeding:**
122
- ```
123
- UI checkpoints: {N} auto-verified, {M} queued for manual review
124
- ```
125
-
126
- </step>
127
-
128
- <step name="mainflow_automation_gate">
129
- **Mainflow Automation Gate**
130
-
131
- Before functional/manual UAT conclusions, check whether the phase has generated mainflow automation artifacts:
132
-
133
- ```bash
134
- MAINFLOW_SUMMARY="${PHASE_DIR}/MAINFLOW-CASES.md"
135
- FEATURE_NAME="${PHASE_NAME}"
136
- MAINCASE_DIR=".planning/generated-cases/${FEATURE_NAME}"
137
- VALIDATION_REPORT="${MAINCASE_DIR}/validation-report.md"
138
- IMPORT_PAYLOAD="${MAINCASE_DIR}/case-import-payloads.json"
139
- ```
140
-
141
- If paths are not resolvable from `PHASE_NAME`, read `.planning/STATE.md` and use `current_feature` / `current_phase`.
142
-
143
- Read when present:
144
-
145
- - `.planning/phases/{phase}/MAINFLOW-CASES.md`
146
- - `.planning/generated-cases/{feature}/validation-report.md`
147
- - `.planning/generated-cases/{feature}/case-import-payloads.json`
148
-
149
- Apply these UAT rules:
150
-
151
- - DSL validation failed -> UAT does not pass.
152
- - Mainflow case execution failed -> UAT does not pass.
153
- - Environment missing and execution cannot run -> mark verification `blocked`.
154
- - Not imported into platform -> complete at least static validation and record import/execution pending.
155
- - Imported into platform -> record `execution_id` and execution result.
156
- - Non-mainflow tags outside `api-mainflow` / `ui-mainflow` -> UAT does not pass.
157
-
158
- Record gate result in UAT/VERIFICATION outputs:
159
-
160
- ```markdown
161
- ## Mainflow Automation Gate
162
-
163
- - Summary: [path or missing]
164
- - Validation report: [path or missing]
165
- - Import payload: [path or missing]
166
- - Static validation: passed/failed/not-run
167
- - Platform import: imported/not-imported/not-applicable
168
- - Execution: passed/failed/blocked/not-run
169
- - execution_id: [id or none]
170
- - Result: passed/failed/blocked
171
- ```
172
-
173
- If generated mainflow artifacts are expected by the workflow config but missing, mark this gate failed and route back to `workflow-generate-mainflow-cases`.
174
- </step>
175
-
176
- <step name="find_summaries">
177
- **Find what to test:**
178
-
179
- Use `phase_dir` from init (or run init if not already done).
180
-
181
- ```bash
182
- ls "$phase_dir"/*-SUMMARY.md 2>/dev/null || true
183
- ```
184
-
185
- Read each SUMMARY.md to extract testable deliverables.
186
- </step>
187
-
188
- <step name="extract_tests">
189
- **Extract testable deliverables from SUMMARY.md:**
190
-
191
- Parse for:
192
- 1. **Accomplishments** - Features/functionality added
193
- 2. **User-facing changes** - UI, workflows, interactions
194
-
195
- Focus on USER-OBSERVABLE outcomes, not implementation details.
196
-
197
- For each deliverable, create a test:
198
- - name: Brief test name
199
- - expected: What the user should see/experience (specific, observable)
200
-
201
- Examples:
202
- - Accomplishment: "Added comment threading with infinite nesting"
203
- → Test: "Reply to a Comment"
204
- → Expected: "Clicking Reply opens inline composer below comment. Submitting shows reply nested under parent with visual indentation."
205
-
206
- Skip internal/non-observable items (refactors, type changes, etc.).
207
-
208
- **Cold-start smoke test injection:**
209
-
210
- After extracting tests from SUMMARYs, scan the SUMMARY files for modified/created file paths. If ANY path matches these patterns:
211
-
212
- `server.ts`, `server.js`, `app.ts`, `app.js`, `index.ts`, `index.js`, `main.ts`, `main.js`, `database/*`, `db/*`, `seed/*`, `seeds/*`, `migrations/*`, `startup*`, `docker-compose*`, `Dockerfile*`
213
-
214
- Then **prepend** this test to the test list:
215
-
216
- - name: "Cold Start Smoke Test"
217
- - expected: "Kill any running server/service. Clear ephemeral state (temp DBs, caches, lock files). Start the application from scratch. Server boots without errors, any seed/migration completes, and a primary query (health check, homepage load, or basic API call) returns live data."
218
-
219
- This catches bugs that only manifest on fresh start — race conditions in startup sequences, silent seed failures, missing environment setup — which pass against warm state but break in production.
220
- </step>
221
-
222
- <step name="create_uat_file">
223
- **Create UAT file with all tests:**
224
-
225
- ```bash
226
- mkdir -p "$PHASE_DIR"
227
- ```
228
-
229
- Build test list from extracted deliverables.
230
-
231
- Create file:
232
-
233
- ```markdown
234
- ---
235
- status: testing
236
- phase: XX-name
237
- source: [list of SUMMARY.md files]
238
- started: [ISO timestamp]
239
- updated: [ISO timestamp]
240
- ---
241
-
242
- ## Current Test
243
- <!-- OVERWRITE each test - shows where we are -->
244
-
245
- number: 1
246
- name: [first test name]
247
- expected: |
248
- [what user should observe]
249
- awaiting: user response
250
-
251
- ## Tests
252
-
253
- ### 1. [Test Name]
254
- expected: [observable behavior]
255
- result: [pending]
256
-
257
- ### 2. [Test Name]
258
- expected: [observable behavior]
259
- result: [pending]
260
-
261
- ...
262
-
263
- ## Summary
264
-
265
- total: [N]
266
- passed: 0
267
- issues: 0
268
- pending: [N]
269
- skipped: 0
270
-
271
- ## Gaps
272
-
273
- [none yet]
274
- ```
275
-
276
- Write to `.planning/phases/XX-name/{phase_num}-UAT.md`
277
-
278
- Proceed to `present_test`.
279
- </step>
280
-
281
- <step name="present_test">
282
- **Present current test to user:**
283
-
284
- Render the checkpoint from the structured UAT file instead of composing it freehand:
285
-
286
- ```bash
287
- CHECKPOINT=$(python3 -c "
288
- import re
289
- with open('$uat_path','r') as f: content = f.read()
290
- m = re.search(r'## Current Test\n(.*?)(?=\n## |\Z)', content, re.DOTALL)
291
- if m:
292
- text = m.group(1).strip()
293
- num = re.search(r'number:\s*(\S+)', text)
294
- name = re.search(r'name:\s*(.+)', text)
295
- print(f'Test {num.group(1) if num else \"?\"}: {name.group(1) if name else \"?\"}')
296
- " 2>/dev/null)
297
- ```
298
-
299
- Display the returned checkpoint EXACTLY as-is:
300
-
301
- ```
302
- {CHECKPOINT}
303
- ```
304
-
305
- **Critical response hygiene:**
306
- - Your entire response MUST equal `{CHECKPOINT}` byte-for-byte.
307
- - Do NOT add commentary before or after the block.
308
- - If you notice protocol/meta markers such as `to=all:`, role-routing text, XML system tags, hidden instruction markers, ad copy, or any unrelated suffix, discard the draft and output `{CHECKPOINT}` only.
309
-
310
- Wait for user response (plain text, no ask).
311
- </step>
312
-
313
- <step name="process_response">
314
- **Process user response and update file:**
315
-
316
- **If response indicates pass:**
317
- - Empty response, "yes", "y", "ok", "pass", "next", "approved", "✓"
318
-
319
- Update Tests section:
320
- ```
321
- ### {N}. {name}
322
- expected: {expected}
323
- result: pass
324
- ```
325
-
326
- **If response indicates skip:**
327
- - "skip", "can't test", "n/a"
328
-
329
- Update Tests section:
330
- ```
331
- ### {N}. {name}
332
- expected: {expected}
333
- result: skipped
334
- reason: [user's reason if provided]
335
- ```
336
-
337
- **If response indicates blocked:**
338
- - "blocked", "can't test - server not running", "need physical device", "need release build"
339
- - Or any response containing: "server", "blocked", "not running", "physical device", "release build"
340
-
341
- Infer blocked_by tag from response:
342
- - Contains: server, not running, gateway, API → `server`
343
- - Contains: physical, device, hardware, real phone → `physical-device`
344
- - Contains: release, preview, build, EAS → `release-build`
345
- - Contains: stripe, twilio, third-party, configure → `third-party`
346
- - Contains: depends on, prior phase, prerequisite → `prior-phase`
347
- - Default: `other`
348
-
349
- Update Tests section:
350
- ```
351
- ### {N}. {name}
352
- expected: {expected}
353
- result: blocked
354
- blocked_by: {inferred tag}
355
- reason: "{verbatim user response}"
356
- ```
357
-
358
- Note: Blocked tests do NOT go into the Gaps section (they aren't code issues — they're prerequisite gates).
359
-
360
- **If response is anything else:**
361
- - Treat as issue description
362
-
363
- Infer severity from description:
364
- - Contains: crash, error, exception, fails, broken, unusable → blocker
365
- - Contains: doesn't work, wrong, missing, can't → major
366
- - Contains: slow, weird, off, minor, small → minor
367
- - Contains: color, font, spacing, alignment, visual → cosmetic
368
- - Default if unclear: major
369
-
370
- Update Tests section:
371
- ```
372
- ### {N}. {name}
373
- expected: {expected}
374
- result: issue
375
- reported: "{verbatim user response}"
376
- severity: {inferred}
377
- ```
378
-
379
- Append to Gaps section (structured YAML for plan-phase --gaps):
380
- ```yaml
381
- - truth: "{expected behavior from test}"
382
- status: failed
383
- reason: "User reported: {verbatim user response}"
384
- severity: {inferred}
385
- test: {N}
386
- artifacts: [] # Filled by diagnosis
387
- missing: [] # Filled by diagnosis
388
- ```
389
-
390
- **After any response:**
391
-
392
- Update Summary counts.
393
- Update frontmatter.updated timestamp.
394
-
395
- If more tests remain → Update Current Test, go to `present_test`
396
- If no more tests → Go to `complete_session`
397
- </step>
398
-
399
- <step name="resume_from_file">
400
- **Resume testing from UAT file:**
401
-
402
- Read the full UAT file.
403
-
404
- Find first test with `result: [pending]`.
405
-
406
- Announce:
407
- ```
408
- Resuming: Phase {phase} UAT
409
- Progress: {passed + issues + skipped}/{total}
410
- Issues found so far: {issues count}
411
-
412
- Continuing from Test {N}...
413
- ```
414
-
415
- Update Current Test section with the pending test.
416
- Proceed to `present_test`.
417
- </step>
418
-
419
- <step name="complete_session">
420
- **Complete testing and commit:**
421
-
422
- **Determine final status:**
423
-
424
- Count results:
425
- - `pending_count`: tests with `result: [pending]`
426
- - `blocked_count`: tests with `result: blocked`
427
- - `skipped_no_reason`: tests with `result: skipped` and no `reason` field
428
-
429
- ```
430
- if pending_count > 0 OR blocked_count > 0 OR skipped_no_reason > 0:
431
- status: partial
432
- # Session ended but not all tests resolved
433
- else:
434
- status: complete
435
- # All tests have a definitive result (pass, issue, or skipped-with-reason)
436
- ```
437
-
438
- Update frontmatter:
439
- - status: {computed status}
440
- - updated: [now]
441
-
442
- Clear Current Test section:
443
- ```
444
- ## Current Test
445
-
446
- [testing complete]
447
- ```
448
-
449
- Commit the UAT file:
450
- ```bash
451
- git add "${PHASE_DIR}/${PHASE_NUMBER}-UAT.md" && git commit -m "test(${PHASE_NUMBER}): complete UAT - ${passed} passed, ${issues} issues"
452
- ```
453
-
454
- Present summary:
455
- ```
456
- ## UAT Complete: Phase {phase}
457
-
458
- | Result | Count |
459
- |--------|-------|
460
- | Passed | {N} |
461
- | Issues | {N} |
462
- | Skipped| {N} |
463
-
464
- [If issues > 0:]
465
- ### Issues Found
466
-
467
- [List from Issues section]
468
- ```
469
-
470
- **If issues > 0:** Proceed to `diagnose_issues`
471
-
472
- **If issues == 0:**
473
-
474
- ```bash
475
- SECURITY_CFG=$(python3 -c "import json; d=json.load(open('.planning/config.json')); print(str(d.get('workflow',{}).get('security_enforcement','true')).lower())" 2>/dev/null || echo "true")
476
- SECURITY_FILE=$(ls "${PHASE_DIR}"/*-SECURITY.md 2>/dev/null | head -1)
477
- ```
478
-
479
- If `SECURITY_CFG` is `true` AND `SECURITY_FILE` is empty:
480
- ```
481
- ⚠ Security enforcement enabled —
482
- Run before advancing to the next phase.
483
-
484
- All tests passed. Ready to continue.
485
-
486
-
487
- - `/workflow-pipeline {next}` — Plan next phase
488
- - `/workflow-execute-phase {next}` — Execute next phase
489
-
490
- ```
491
-
492
- If `SECURITY_CFG` is `true` AND `SECURITY_FILE` exists: check frontmatter `threats_open`. If > 0:
493
- ```
494
- ⚠ Security gate: {threats_open} threats open
495
-
496
- ```
497
-
498
- If `SECURITY_CFG` is `false` OR (`SECURITY_FILE` exists AND `threats_open` is `0`):
499
- ```
500
- All tests passed. Ready to continue.
501
-
502
- - `/workflow-pipeline {next}` — Plan next phase
503
- - `/workflow-execute-phase {next}` — Execute next phase
504
-
505
-
506
- ```
507
- </step>
508
-
509
- <step name="diagnose_issues">
510
- **Diagnose root causes before planning fixes:**
511
-
512
- ```
513
- ---
514
-
515
- {N} issues found. Diagnosing root causes...
516
-
517
- Spawning parallel debug agents to investigate each issue.
518
- ```
519
-
520
- - Load diagnose-issues workflow
521
- - Follow the diagnose-issues pattern
522
- - Spawn parallel debug agents for each issue
523
- - Collect root causes
524
- - Update UAT.md with root causes
525
- - Proceed to `plan_gap_closure`
526
-
527
- Diagnosis runs automatically - no user prompt. Parallel agents investigate simultaneously, so overhead is minimal and fixes are more accurate.
528
- </step>
529
-
530
- <step name="plan_gap_closure">
531
- **Auto-plan fixes from diagnosed gaps:**
532
-
533
- Display:
534
- ```
535
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
536
- WORKFLOW ► PLANNING FIXES
537
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
538
-
539
- ◆ Spawning planner for gap closure...
540
- ```
541
-
542
- Spawn planner in --gaps mode:
543
-
544
- ```
545
- Task(
546
- prompt="""
547
- <planning_context>
548
-
549
- **Phase:** {phase_number}
550
- **Mode:** gap_closure
551
-
552
- <files_to_read>
553
- - {phase_dir}/{phase_num}-UAT.md (UAT with diagnoses)
554
- - .planning/STATE.md (Project State)
555
- - .planning/ROADMAP.md (Roadmap)
556
- </files_to_read>
557
-
558
- ${AGENT_SKILLS_PLANNER}
559
-
560
- </planning_context>
561
-
562
- <downstream_consumer>
563
- Output consumed by /workflow-execute-phase
564
- Plans must be executable prompts.
565
- </downstream_consumer>
566
- """,
567
- # using general-purpose agent,
568
- model="{planner_model}",
569
- description="Plan gap fixes for Phase {phase}"
570
- )
571
- ```
572
-
573
- On return:
574
- - **PLANNING COMPLETE:** Proceed to `verify_gap_plans`
575
- - **PLANNING INCONCLUSIVE:** Report and offer manual intervention
576
- </step>
577
-
578
- <step name="verify_gap_plans">
579
- **Verify fix plans with checker:**
580
-
581
- Display:
582
- ```
583
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
584
- WORKFLOW ► VERIFYING FIX PLANS
585
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
586
-
587
- ◆ Spawning plan checker...
588
- ```
589
-
590
- Initialize: `iteration_count = 1`
591
-
592
- Spawn plan checker:
593
-
594
- ```
595
- Task(
596
- prompt="""
597
- <verification_context>
598
-
599
- **Phase:** {phase_number}
600
- **Phase Goal:** Close diagnosed gaps from UAT
601
-
602
- <files_to_read>
603
- - {phase_dir}/*-PLAN.md (Plans to verify)
604
- </files_to_read>
605
-
606
- ${AGENT_SKILLS_CHECKER}
607
-
608
- </verification_context>
609
-
610
- <expected_output>
611
- Return one of:
612
- - ## VERIFICATION PASSED — all checks pass
613
- - ## ISSUES FOUND — structured issue list
614
- </expected_output>
615
- """,
616
- subagent_type="general-purpose",
617
- model="{checker_model}",
618
- description="Verify Phase {phase} fix plans"
619
- )
620
- ```
621
-
622
- On return:
623
- - **VERIFICATION PASSED:** Proceed to `present_ready`
624
- - **ISSUES FOUND:** Proceed to `revision_loop`
625
- </step>
626
-
627
- <step name="revision_loop">
628
- **Iterate planner ↔ checker until plans pass (max 3):**
629
-
630
- **If iteration_count < 3:**
631
-
632
- Display: `Sending back to planner for revision... (iteration {N}/3)`
633
-
634
- Spawn planner with revision context:
635
-
636
- ```
637
- Task(
638
- prompt="""
639
- <revision_context>
640
-
641
- **Phase:** {phase_number}
642
- **Mode:** revision
643
-
644
- <files_to_read>
645
- - {phase_dir}/*-PLAN.md (Existing plans)
646
- </files_to_read>
647
-
648
- ${AGENT_SKILLS_PLANNER}
649
-
650
- **Checker issues:**
651
- {structured_issues_from_checker}
652
-
653
- </revision_context>
654
-
655
- <instructions>
656
- Read existing PLAN.md files. Make targeted updates to address checker issues.
657
- Do NOT replan from scratch unless issues are fundamental.
658
- </instructions>
659
- """,
660
- # using general-purpose agent,
661
- model="{planner_model}",
662
- description="Revise Phase {phase} plans"
663
- )
664
- ```
665
-
666
- After planner returns → spawn checker again (verify_gap_plans logic)
667
- Increment iteration_count
668
-
669
- **If iteration_count >= 3:**
670
-
671
- Display: `Max iterations reached. {N} issues remain.`
672
-
673
- Offer options:
674
- 1. Force proceed (execute despite issues)
675
- 2. Provide guidance (user gives direction, retry)
676
- 3. Abandon (exit, user runs /workflow-pipeline manually)
677
-
678
- Wait for user response.
679
- </step>
680
-
681
- <step name="present_ready">
682
- **Present completion and next steps:**
683
-
684
- ```
685
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
686
- WORKFLOW ► FIXES READY ✓
687
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
688
-
689
- **Phase {X}: {Name}** — {N} gap(s) diagnosed, {M} fix plan(s) created
690
-
691
- | Gap | Root Cause | Fix Plan |
692
- |-----|------------|----------|
693
- | {truth 1} | {root_cause} | {phase}-04 |
694
- | {truth 2} | {root_cause} | {phase}-04 |
695
-
696
- Plans verified and ready for execution.
697
-
698
- ───────────────────────────────────────────────────────────────
699
-
700
- ## ▶ Next Up
701
-
702
- **Execute fixes** — run fix plans
703
-
704
- `/clear` then `/workflow-execute-phase {phase} --gaps-only`
705
-
706
- ───────────────────────────────────────────────────────────────
707
- ```
708
- </step>
709
-
710
- </process>
711
-
712
- <update_rules>
713
- **Batched writes for efficiency:**
714
-
715
- Keep results in memory. Write to file only when:
716
- 1. **Issue found** — Preserve the problem immediately
717
- 2. **Session complete** — Final write before commit
718
- 3. **Checkpoint** — Every 5 passed tests (safety net)
719
-
720
- | Section | Rule | When Written |
721
- |---------|------|--------------|
722
- | Frontmatter.status | OVERWRITE | Start, complete |
723
- | Frontmatter.updated | OVERWRITE | On any file write |
724
- | Current Test | OVERWRITE | On any file write |
725
- | Tests.{N}.result | OVERWRITE | On any file write |
726
- | Summary | OVERWRITE | On any file write |
727
- | Gaps | APPEND | When issue found |
728
-
729
- On context reset: File shows last checkpoint. Resume from there.
730
- </update_rules>
731
-
732
- <severity_inference>
733
- **Infer severity from user's natural language:**
734
-
735
- | User says | Infer |
736
- |-----------|-------|
737
- | "crashes", "error", "exception", "fails completely" | blocker |
738
- | "doesn't work", "nothing happens", "wrong behavior" | major |
739
- | "works but...", "slow", "weird", "minor issue" | minor |
740
- | "color", "spacing", "alignment", "looks off" | cosmetic |
741
-
742
- Default to **major** if unclear. User can correct if needed.
743
-
744
- **Never ask "how severe is this?"** - just infer and move on.
745
- </severity_inference>
746
-
747
- <success_criteria>
748
- - [ ] UAT file created with all tests from SUMMARY.md
749
- - [ ] Tests presented one at a time with expected behavior
750
- - [ ] User responses processed as pass/issue/skip
751
- - [ ] Severity inferred from description (never asked)
752
- - [ ] Batched writes: on issue, every 5 passes, or completion
753
- - [ ] Committed on completion
754
- - [ ] If issues: parallel debug agents diagnose root causes
755
- - [ ] If issues: planner creates fix plans (gap_closure mode)
756
- - [ ] If issues: plan checker verifies fix plans
757
- - [ ] If issues: revision loop until plans pass (max 3 iterations)
758
- - [ ] Ready for `/workflow-execute-phase --gaps-only` when complete
759
- </success_criteria>