claude-code-workflow 7.2.29 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
  2. package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
  3. package/.claude/agents/action-planning-agent.md +7 -4
  4. package/.claude/agents/cli-explore-agent.md +77 -63
  5. package/.claude/agents/cli-lite-planning-agent.md +11 -10
  6. package/.claude/agents/issue-plan-agent.md +421 -426
  7. package/.claude/commands/workflow/spec/setup.md +1 -1
  8. package/.claude/commands/workflow-skill.md +130 -0
  9. package/.claude/skills/ccw-chain/SKILL.md +92 -0
  10. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +31 -0
  11. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +58 -0
  12. package/.claude/skills/ccw-chain/chains/ccw-issue.json +44 -0
  13. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +71 -0
  14. package/.claude/skills/ccw-chain/chains/ccw-main.json +65 -0
  15. package/.claude/skills/ccw-chain/chains/ccw-standard.json +51 -0
  16. package/.claude/skills/ccw-chain/chains/ccw-team.json +15 -0
  17. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +47 -0
  18. package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
  19. package/.claude/skills/chain-loader/SKILL.md +78 -0
  20. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
  21. package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
  22. package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
  23. package/.claude/skills/chain-loader/specs/chain-schema.md +126 -0
  24. package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
  25. package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
  26. package/.claude/skills/review-cycle/phases/review-module.md +764 -764
  27. package/.claude/skills/review-cycle/phases/review-session.md +775 -775
  28. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
  29. package/.claude/skills/workflow-plan/SKILL.md +1 -0
  30. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
  31. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
  32. package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
  33. package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
  34. package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
  35. package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
  36. package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
  37. package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
  38. package/.codex/skills/analyze-with-file/SKILL.md +383 -134
  39. package/.codex/skills/brainstorm/SKILL.md +3 -3
  40. package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
  41. package/.codex/skills/clean/SKILL.md +1 -1
  42. package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
  43. package/.codex/skills/investigate/orchestrator.md +24 -0
  44. package/.codex/skills/issue-discover/SKILL.md +374 -361
  45. package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
  46. package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
  47. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
  48. package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
  49. package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
  50. package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
  51. package/.codex/skills/review-cycle/SKILL.md +31 -12
  52. package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
  53. package/.codex/skills/security-audit/orchestrator.md +29 -0
  54. package/.codex/skills/session-sync/SKILL.md +1 -1
  55. package/.codex/skills/ship/orchestrator.md +24 -0
  56. package/.codex/skills/spec-add/SKILL.md +5 -5
  57. package/.codex/skills/spec-generator/SKILL.md +33 -2
  58. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
  59. package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
  60. package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
  61. package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
  62. package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
  63. package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
  64. package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
  65. package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
  66. package/.codex/skills/spec-setup/SKILL.md +669 -669
  67. package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
  68. package/.codex/skills/team-brainstorm/SKILL.md +259 -259
  69. package/.codex/skills/team-coordinate/SKILL.md +359 -359
  70. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
  71. package/.codex/skills/team-designer/SKILL.md +27 -1
  72. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
  73. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  74. package/.codex/skills/team-designer/phases/04-validation.md +1 -1
  75. package/.codex/skills/team-executor/SKILL.md +218 -218
  76. package/.codex/skills/team-frontend/SKILL.md +227 -227
  77. package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
  78. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
  79. package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
  80. package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
  81. package/.codex/skills/team-issue/SKILL.md +269 -269
  82. package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
  83. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
  84. package/.codex/skills/team-motion-design/SKILL.md +222 -222
  85. package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
  86. package/.codex/skills/team-perf-opt/SKILL.md +258 -258
  87. package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
  88. package/.codex/skills/team-planex/SKILL.md +216 -216
  89. package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
  90. package/.codex/skills/team-review/SKILL.md +227 -227
  91. package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
  92. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
  93. package/.codex/skills/team-tech-debt/SKILL.md +206 -206
  94. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
  95. package/.codex/skills/team-testing/SKILL.md +237 -237
  96. package/.codex/skills/team-ui-polish/SKILL.md +218 -218
  97. package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
  98. package/.codex/skills/team-uidesign/SKILL.md +219 -219
  99. package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
  100. package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
  101. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
  102. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
  103. package/.codex/skills/team-ux-improve/SKILL.md +227 -227
  104. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
  105. package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
  106. package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
  107. package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
  108. package/.codex/skills/workflow-execute/SKILL.md +5 -5
  109. package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
  110. package/.codex/skills/workflow-plan/SKILL.md +3 -3
  111. package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
  112. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
  113. package/README.md +14 -0
  114. package/ccw/dist/cli.d.ts.map +1 -1
  115. package/ccw/dist/cli.js +16 -0
  116. package/ccw/dist/cli.js.map +1 -1
  117. package/ccw/dist/commands/chain-loader.d.ts +2 -0
  118. package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
  119. package/ccw/dist/commands/chain-loader.js +11 -0
  120. package/ccw/dist/commands/chain-loader.js.map +1 -0
  121. package/ccw/dist/commands/install.d.ts.map +1 -1
  122. package/ccw/dist/commands/install.js +52 -1
  123. package/ccw/dist/commands/install.js.map +1 -1
  124. package/ccw/dist/commands/launcher.d.ts +2 -0
  125. package/ccw/dist/commands/launcher.d.ts.map +1 -0
  126. package/ccw/dist/commands/launcher.js +434 -0
  127. package/ccw/dist/commands/launcher.js.map +1 -0
  128. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  129. package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
  130. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  131. package/ccw/dist/tools/chain-loader.d.ts +10 -0
  132. package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
  133. package/ccw/dist/tools/chain-loader.js +1054 -0
  134. package/ccw/dist/tools/chain-loader.js.map +1 -0
  135. package/ccw/dist/tools/index.d.ts.map +1 -1
  136. package/ccw/dist/tools/index.js +2 -0
  137. package/ccw/dist/tools/index.js.map +1 -1
  138. package/ccw/dist/tools/json-builder.js +20 -0
  139. package/ccw/dist/tools/json-builder.js.map +1 -1
  140. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
  141. package/ccw/dist/tools/skill-context-loader.js +12 -26
  142. package/ccw/dist/tools/skill-context-loader.js.map +1 -1
  143. package/ccw/dist/types/chain-types.d.ts +112 -0
  144. package/ccw/dist/types/chain-types.d.ts.map +1 -0
  145. package/ccw/dist/types/chain-types.js +5 -0
  146. package/ccw/dist/types/chain-types.js.map +1 -0
  147. package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
  148. package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
  149. package/ccw/dist/utils/chain-visualizer.js +164 -0
  150. package/ccw/dist/utils/chain-visualizer.js.map +1 -0
  151. package/ccw/scripts/prepublish-clean.mjs +0 -1
  152. package/package.json +1 -3
  153. package/.claude/commands/cli/cli-init.md +0 -441
  154. package/.claude/commands/cli/codex-review.md +0 -361
  155. package/.claude/commands/flow-create.md +0 -663
  156. package/.claude/skills/team-edict.zip +0 -0
  157. package/ccw-litellm/README.md +0 -180
  158. package/ccw-litellm/pyproject.toml +0 -35
  159. package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
  160. package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
  161. package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
  162. package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
  163. package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
  164. package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
  165. package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
  166. package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
  167. package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
  168. package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
  169. package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
@@ -1,395 +1,395 @@
1
- # Phase 5: Plan Verification
2
-
3
- Perform READ-ONLY verification analysis between IMPL_PLAN.md, task JSONs, and brainstorming artifacts. Generates structured report with quality gate recommendation. Does NOT modify any source files.
4
-
5
- ## Objective
6
-
7
- - Generate comprehensive verification report identifying inconsistencies, duplications, ambiguities
8
- - Produce quality gate recommendation (BLOCK_EXECUTION / PROCEED_WITH_FIXES / PROCEED_WITH_CAUTION / PROCEED)
9
- - Route to next action based on quality gate result
10
-
11
- ## Entry Points
12
-
13
- - **From Plan Mode**: After Phase 4 completes, user selects "Verify Plan Quality"
14
- - **From Verify Mode**: Directly triggered via `workflow-plan` skill (plan-verify phase)
15
-
16
- ## User Input
17
-
18
- ```text
19
- $ARGUMENTS
20
- ```
21
-
22
- You **MUST** consider the user input before proceeding (if not empty).
23
-
24
- ## Operating Constraints
25
-
26
- **STRICTLY READ-ONLY FOR SOURCE ARTIFACTS**:
27
- - **MUST NOT** modify `IMPL_PLAN.md`, any `task.json` files, or brainstorming artifacts
28
- - **MUST NOT** create or delete task files
29
- - **MUST ONLY** write the verification report to `.process/PLAN_VERIFICATION.md`
30
-
31
- **Synthesis Authority**: The `role analysis documents` are **authoritative** for requirements and design decisions. Any conflicts between IMPL_PLAN/tasks and synthesis are automatically CRITICAL and require adjustment of the plan/tasks—not reinterpretation of requirements.
32
-
33
- **Quality Gate Authority**: The verification report provides a binding recommendation based on objective severity criteria. User MUST review critical/high issues before proceeding with implementation.
34
-
35
- ## Execution
36
-
37
- ### Step 5.0: Load Validation Context
38
-
39
- Run `ccw spec load --category validation` for verification rules and acceptance criteria.
40
-
41
- ### Step 5.1: Initialize Analysis Context
42
-
43
- ```bash
44
- # Detect active workflow session
45
- IF --session parameter provided:
46
- session_id = provided session
47
- ELSE:
48
- # Auto-detect active session
49
- active_sessions = bash(find .workflow/active/ -name "WFS-*" -type d 2>/dev/null)
50
- IF active_sessions is empty:
51
- ERROR: "No active workflow session found. Use --session <session-id>"
52
- EXIT
53
- ELSE IF active_sessions has multiple entries:
54
- # Use most recently modified session
55
- session_id = bash(ls -td .workflow/active/WFS-*/ 2>/dev/null | head -1 | xargs basename)
56
- ELSE:
57
- session_id = basename(active_sessions[0])
58
-
59
- # Derive absolute paths
60
- session_dir = .workflow/active/WFS-{session}
61
- brainstorm_dir = session_dir/.brainstorming
62
- task_dir = session_dir/.task
63
- process_dir = session_dir/.process
64
- session_file = session_dir/workflow-session.json
65
-
66
- # Create .process directory if not exists (report output location)
67
- IF NOT EXISTS(process_dir):
68
- bash(mkdir -p "{process_dir}")
69
-
70
- # Validate required artifacts
71
- # Note: "role analysis documents" refers to [role]/analysis.md files (e.g., product-manager/analysis.md)
72
- SYNTHESIS_DIR = brainstorm_dir # Contains role analysis files: */analysis.md
73
- IMPL_PLAN = session_dir/IMPL_PLAN.md
74
- TASK_FILES = Glob(task_dir/*.json)
75
- PLANNING_NOTES = session_dir/planning-notes.md # N+1 context and constraints
76
-
77
- # Abort if missing - in order of dependency
78
- SESSION_FILE_EXISTS = EXISTS(session_file)
79
- IF NOT SESSION_FILE_EXISTS:
80
- WARNING: "workflow-session.json not found. User intent alignment verification will be skipped."
81
- # Continue execution - this is optional context, not blocking
82
-
83
- PLANNING_NOTES_EXISTS = EXISTS(PLANNING_NOTES)
84
- IF NOT PLANNING_NOTES_EXISTS:
85
- WARNING: "planning-notes.md not found. Constraints/N+1 context verification will be skipped."
86
- # Continue execution - optional context
87
-
88
- SYNTHESIS_FILES = Glob(brainstorm_dir/*/analysis.md)
89
- IF SYNTHESIS_FILES.count == 0:
90
- WARNING: "No role analysis documents found in .brainstorming/*/analysis.md. Synthesis-based dimensions (E, G) will use reduced coverage."
91
- SYNTHESIS_AVAILABLE = false
92
- # Continue execution - brainstorm artifacts are optional for direct planning workflows
93
- ELSE:
94
- SYNTHESIS_AVAILABLE = true
95
-
96
- IF NOT EXISTS(IMPL_PLAN):
97
- ERROR: "IMPL_PLAN.md not found. Run /workflow-plan first"
98
- EXIT
99
-
100
- IF TASK_FILES.count == 0:
101
- ERROR: "No task JSON files found. Run /workflow-plan first"
102
- EXIT
103
- ```
104
-
105
- ### Step 5.2: Load Artifacts (Progressive Disclosure)
106
-
107
- Load only minimal necessary context from each artifact:
108
-
109
- **From workflow-session.json** (OPTIONAL - Primary Reference for User Intent):
110
- - **ONLY IF EXISTS**: Load user intent context
111
- - Original user prompt/intent (project or description field)
112
- - User's stated goals and objectives
113
- - User's scope definition
114
- - **IF MISSING**: Set user_intent_analysis = "SKIPPED: workflow-session.json not found"
115
-
116
- **From planning-notes.md** (OPTIONAL - Constraints & N+1 Context):
117
- - **ONLY IF EXISTS**: Load planning context
118
- - Consolidated Constraints (numbered list from Phase 1-3)
119
- - N+1 Context: Decisions table (Decision | Rationale | Revisit?)
120
- - N+1 Context: Deferred items list
121
- - **IF MISSING**: Set planning_notes_analysis = "SKIPPED: planning-notes.md not found"
122
-
123
- **From role analysis documents** (AUTHORITATIVE SOURCE):
124
- - Functional Requirements (IDs, descriptions, acceptance criteria)
125
- - Non-Functional Requirements (IDs, targets)
126
- - Business Requirements (IDs, success metrics)
127
- - Key Architecture Decisions
128
- - Risk factors and mitigation strategies
129
- - Implementation Roadmap (high-level phases)
130
-
131
- **From IMPL_PLAN.md**:
132
- - Summary and objectives
133
- - Context Analysis
134
- - Implementation Strategy
135
- - Task Breakdown Summary
136
- - Success Criteria
137
- - Brainstorming Artifacts References (if present)
138
-
139
- **From task.json files**:
140
- - Task IDs
141
- - Titles and descriptions
142
- - Status
143
- - Dependencies (depends_on, blocks)
144
- - Context (requirements, focus_paths, acceptance, artifacts)
145
- - Flow control (pre_analysis, implementation_approach)
146
- - Meta (complexity, priority)
147
-
148
- ### Step 5.3: Build Semantic Models
149
-
150
- Create internal representations (do not include raw artifacts in output):
151
-
152
- **Requirements inventory**:
153
- - Each functional/non-functional/business requirement with stable ID
154
- - Requirement text, acceptance criteria, priority
155
-
156
- **Architecture decisions inventory**:
157
- - ADRs from synthesis
158
- - Technology choices
159
- - Data model references
160
-
161
- **Task coverage mapping**:
162
- - Map each task to one or more requirements (by ID reference or keyword inference)
163
- - Map each requirement to covering tasks
164
-
165
- **Dependency graph**:
166
- - Task-to-task dependencies (depends_on, blocks)
167
- - Requirement-level dependencies (from synthesis)
168
-
169
- ### Step 5.4: Detection Passes (Agent-Driven Multi-Dimensional Analysis)
170
-
171
- **Execution Strategy**:
172
- - Single `cli-explore-agent` invocation
173
- - Agent executes multiple CLI analyses internally (different dimensions: A-J)
174
- - Token Budget: 50 findings maximum (aggregate remainder in overflow summary)
175
- - Priority Allocation: CRITICAL (unlimited) → HIGH (15) → MEDIUM (20) → LOW (15)
176
- - Early Exit: If CRITICAL findings > 0 in User Intent/Requirements Coverage, skip LOW/MEDIUM checks
177
-
178
- **Execution Order** (Agent orchestrates internally):
179
-
180
- 1. **Tier 1 (CRITICAL Path)**: A, B, C, I - User intent, coverage, consistency, constraints compliance (full analysis)
181
- 2. **Tier 2 (HIGH Priority)**: D, E, J - Dependencies, synthesis alignment, N+1 context validation (limit 15 findings)
182
- 3. **Tier 3 (MEDIUM Priority)**: F - Specification quality (limit 20 findings)
183
- 4. **Tier 4 (LOW Priority)**: G, H - Duplication, feasibility (limit 15 findings)
184
-
185
- ---
186
-
187
- #### Step 5.4.1: Launch Unified Verification Agent
188
-
189
- ```javascript
190
- Task(
191
- subagent_type="cli-explore-agent",
192
- run_in_background=false,
193
- description="Multi-dimensional plan verification",
194
- prompt=`
195
- ## Plan Verification Task
196
-
197
- ### MANDATORY FIRST STEPS
198
- 1. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"plan-verify"}' (dimensions & rules)
199
- 2. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"verify"}' (output schema)
200
- 3. Read: ${session_file} (user intent)
201
- 4. Read: ${PLANNING_NOTES} (constraints & N+1 context)
202
- 5. Read: ${IMPL_PLAN} (implementation plan)
203
- 6. Glob: ${task_dir}/*.json (task files)
204
- 7. Glob: ${SYNTHESIS_DIR}/*/analysis.md (role analyses)
205
-
206
- ### Execution Flow
207
-
208
- **Load schema → Execute tiered CLI analysis → Aggregate findings → Write JSON**
209
-
210
- FOR each tier in [1, 2, 3, 4]:
211
- - Load tier config from plan-verify-agent-schema.json
212
- - Execute: ccw cli -p "PURPOSE: Verify dimensions {tier.dimensions}
213
- TASK: {tier.checks from schema}
214
- CONTEXT: @${session_dir}/**/*
215
- EXPECTED: Findings JSON with dimension, severity, location, summary, recommendation
216
- CONSTRAINTS: Limit {tier.limit} findings
217
- " --tool gemini --mode analysis --rule {tier.rule}
218
- - Parse findings, check early exit condition
219
- - IF tier == 1 AND critical_count > 0: skip tier 3-4
220
-
221
- ### Output
222
- Write: ${process_dir}/verification-findings.json (follow verify-json-schema.json)
223
- Return: Quality gate decision + 2-3 sentence summary
224
- `
225
- )
226
- ```
227
-
228
- ---
229
-
230
- #### Step 5.4.2: Load and Organize Findings
231
-
232
- ```javascript
233
- // Load findings (single parse for all subsequent use)
234
- const data = JSON.parse(Read(`${process_dir}/verification-findings.json`))
235
- const { session_id, timestamp, verification_tiers_completed, findings, summary } = data
236
- const { critical_count, high_count, medium_count, low_count, total_findings, coverage_percentage, recommendation } = summary
237
-
238
- // Group by severity and dimension
239
- const bySeverity = Object.groupBy(findings, f => f.severity)
240
- const byDimension = Object.groupBy(findings, f => f.dimension)
241
-
242
- // Dimension metadata (from schema)
243
- const DIMS = {
244
- A: "User Intent Alignment", B: "Requirements Coverage", C: "Consistency Validation",
245
- D: "Dependency Integrity", E: "Synthesis Alignment", F: "Task Specification Quality",
246
- G: "Duplication Detection", H: "Feasibility Assessment",
247
- I: "Constraints Compliance", J: "N+1 Context Validation"
248
- }
249
- ```
250
-
251
- ### Step 5.5: Generate Report
252
-
253
- ```javascript
254
- // Helper: render dimension section
255
- const renderDimension = (dim) => {
256
- const items = byDimension[dim] || []
257
- return items.length > 0
258
- ? items.map(f => `### ${f.id}: ${f.summary}\n- **Severity**: ${f.severity}\n- **Location**: ${f.location.join(', ')}\n- **Recommendation**: ${f.recommendation}`).join('\n\n')
259
- : `> No ${DIMS[dim]} issues detected.`
260
- }
261
-
262
- // Helper: render severity section
263
- const renderSeverity = (severity, impact) => {
264
- const items = bySeverity[severity] || []
265
- return items.length > 0
266
- ? items.map(f => `#### ${f.id}: ${f.summary}\n- **Dimension**: ${f.dimension_name}\n- **Location**: ${f.location.join(', ')}\n- **Impact**: ${impact}\n- **Recommendation**: ${f.recommendation}`).join('\n\n')
267
- : `> No ${severity.toLowerCase()}-severity issues detected.`
268
- }
269
-
270
- // Build Markdown report
271
- const fullReport = `
272
- # Plan Verification Report
273
-
274
- **Session**: WFS-${session_id} | **Generated**: ${timestamp}
275
- **Tiers Completed**: ${verification_tiers_completed.join(', ')}
276
-
277
- ---
278
-
279
- ## Executive Summary
280
-
281
- | Metric | Value | Status |
282
- |--------|-------|--------|
283
- | Risk Level | ${critical_count > 0 ? 'CRITICAL' : high_count > 0 ? 'HIGH' : medium_count > 0 ? 'MEDIUM' : 'LOW'} | ${critical_count > 0 ? 'RED' : high_count > 0 ? 'ORANGE' : medium_count > 0 ? 'YELLOW' : 'GREEN'} |
284
- | Critical/High/Medium/Low | ${critical_count}/${high_count}/${medium_count}/${low_count} | |
285
- | Coverage | ${coverage_percentage}% | ${coverage_percentage >= 90 ? 'GREEN' : coverage_percentage >= 75 ? 'YELLOW' : 'RED'} |
286
-
287
- **Recommendation**: **${recommendation}**
288
-
289
- ---
290
-
291
- ## Findings Summary
292
-
293
- | ID | Dimension | Severity | Location | Summary |
294
- |----|-----------|----------|----------|---------|
295
- ${findings.map(f => `| ${f.id} | ${f.dimension_name} | ${f.severity} | ${f.location.join(', ')} | ${f.summary} |`).join('\n')}
296
-
297
- ---
298
-
299
- ## Analysis by Dimension
300
-
301
- ${['A','B','C','D','E','F','G','H','I','J'].map(d => `### ${d}. ${DIMS[d]}\n\n${renderDimension(d)}`).join('\n\n---\n\n')}
302
-
303
- ---
304
-
305
- ## Findings by Severity
306
-
307
- ### CRITICAL (${critical_count})
308
- ${renderSeverity('CRITICAL', 'Blocks execution')}
309
-
310
- ### HIGH (${high_count})
311
- ${renderSeverity('HIGH', 'Fix before execution recommended')}
312
-
313
- ### MEDIUM (${medium_count})
314
- ${renderSeverity('MEDIUM', 'Address during/after implementation')}
315
-
316
- ### LOW (${low_count})
317
- ${renderSeverity('LOW', 'Optional improvement')}
318
-
319
- ---
320
-
321
- ## Next Steps
322
-
323
- ${recommendation === 'BLOCK_EXECUTION' ? 'BLOCK: Fix critical issues then re-verify' :
324
- recommendation === 'PROCEED_WITH_FIXES' ? 'FIX RECOMMENDED: Address high issues then re-verify or execute' :
325
- 'READY: Proceed to Skill(skill="workflow-execute")'}
326
-
327
- Re-verify: \`/workflow-plan-verify --session ${session_id}\`
328
- Execute: \`Skill(skill="workflow-execute", args="--resume-session=${session_id}")\`
329
- `
330
-
331
- // Write report
332
- Write(`${process_dir}/PLAN_VERIFICATION.md`, fullReport)
333
- console.log(`Report: ${process_dir}/PLAN_VERIFICATION.md\n${recommendation} | C:${critical_count} H:${high_count} M:${medium_count} L:${low_count} | Coverage:${coverage_percentage}%`)
334
- ```
335
-
336
- ### Step 5.6: Next Step Selection
337
-
338
- ```javascript
339
- // Reference workflowPreferences (set by SKILL.md via AskUserQuestion)
340
- const autoYes = workflowPreferences.autoYes
341
- const canExecute = recommendation !== 'BLOCK_EXECUTION'
342
-
343
- // Auto mode
344
- if (autoYes) {
345
- if (canExecute) {
346
- Skill(skill="workflow-execute", args="--resume-session=\"${session_id}\"")
347
- } else {
348
- console.log(`[Auto] BLOCK_EXECUTION - Fix ${critical_count} critical issues first.`)
349
- }
350
- return
351
- }
352
-
353
- // Interactive mode - build options based on quality gate
354
- const options = canExecute
355
- ? [
356
- { label: canExecute && recommendation === 'PROCEED_WITH_FIXES' ? "Execute Anyway" : "Execute (Recommended)",
357
- description: "Proceed to Skill(skill=\"workflow-execute\")" },
358
- { label: "Review Report", description: "Review findings before deciding" },
359
- { label: "Re-verify", description: "Re-run after manual fixes" }
360
- ]
361
- : [
362
- { label: "Review Report", description: "Review critical issues" },
363
- { label: "Re-verify", description: "Re-run after fixing issues" }
364
- ]
365
-
366
- const selection = AskUserQuestion({
367
- questions: [{
368
- question: `Quality gate: ${recommendation}. Next step?`,
369
- header: "Action",
370
- multiSelect: false,
371
- options
372
- }]
373
- })
374
-
375
- // Handle selection
376
- if (selection.includes("Execute")) {
377
- Skill(skill="workflow-execute", args="--resume-session=\"${session_id}\"")
378
- } else if (selection === "Re-verify") {
379
- // Direct phase re-execution: re-read and execute this phase
380
- Read("phases/05-plan-verify.md")
381
- // Re-execute with current session context
382
- }
383
- ```
384
-
385
- ## Output
386
-
387
- - **File**: `PLAN_VERIFICATION.md` (verification report with quality gate)
388
- - **File**: `verification-findings.json` (structured findings data)
389
-
390
- ## Completion
391
-
392
- Phase 5 is a terminal phase. Based on quality gate result, user routes to:
393
- - Execute → Skill(skill="workflow-execute")
394
- - Re-verify → Re-run Phase 5
395
- - Review → Manual inspection
1
+ # Phase 5: Plan Verification
2
+
3
+ Perform READ-ONLY verification analysis between IMPL_PLAN.md, task JSONs, and brainstorming artifacts. Generates structured report with quality gate recommendation. Does NOT modify any source files.
4
+
5
+ ## Objective
6
+
7
+ - Generate comprehensive verification report identifying inconsistencies, duplications, ambiguities
8
+ - Produce quality gate recommendation (BLOCK_EXECUTION / PROCEED_WITH_FIXES / PROCEED_WITH_CAUTION / PROCEED)
9
+ - Route to next action based on quality gate result
10
+
11
+ ## Entry Points
12
+
13
+ - **From Plan Mode**: After Phase 4 completes, user selects "Verify Plan Quality"
14
+ - **From Verify Mode**: Directly triggered via `workflow-plan` skill (plan-verify phase)
15
+
16
+ ## User Input
17
+
18
+ ```text
19
+ $ARGUMENTS
20
+ ```
21
+
22
+ You **MUST** consider the user input before proceeding (if not empty).
23
+
24
+ ## Operating Constraints
25
+
26
+ **STRICTLY READ-ONLY FOR SOURCE ARTIFACTS**:
27
+ - **MUST NOT** modify `IMPL_PLAN.md`, any `task.json` files, or brainstorming artifacts
28
+ - **MUST NOT** create or delete task files
29
+ - **MUST ONLY** write the verification report to `.process/PLAN_VERIFICATION.md`
30
+
31
+ **Synthesis Authority**: The `role analysis documents` are **authoritative** for requirements and design decisions. Any conflicts between IMPL_PLAN/tasks and synthesis are automatically CRITICAL and require adjustment of the plan/tasks—not reinterpretation of requirements.
32
+
33
+ **Quality Gate Authority**: The verification report provides a binding recommendation based on objective severity criteria. User MUST review critical/high issues before proceeding with implementation.
34
+
35
+ ## Execution
36
+
37
+ ### Step 5.0: Load Validation Context
38
+
39
+ Run `ccw spec load --category validation` for verification rules and acceptance criteria.
40
+
41
+ ### Step 5.1: Initialize Analysis Context
42
+
43
+ ```bash
44
+ # Detect active workflow session
45
+ IF --session parameter provided:
46
+ session_id = provided session
47
+ ELSE:
48
+ # Auto-detect active session
49
+ active_sessions = bash(find .workflow/active/ -name "WFS-*" -type d 2>/dev/null)
50
+ IF active_sessions is empty:
51
+ ERROR: "No active workflow session found. Use --session <session-id>"
52
+ EXIT
53
+ ELSE IF active_sessions has multiple entries:
54
+ # Use most recently modified session
55
+ session_id = bash(ls -td .workflow/active/WFS-*/ 2>/dev/null | head -1 | xargs basename)
56
+ ELSE:
57
+ session_id = basename(active_sessions[0])
58
+
59
+ # Derive absolute paths
60
+ session_dir = .workflow/active/WFS-{session}
61
+ brainstorm_dir = session_dir/.brainstorming
62
+ task_dir = session_dir/.task
63
+ process_dir = session_dir/.process
64
+ session_file = session_dir/workflow-session.json
65
+
66
+ # Create .process directory if not exists (report output location)
67
+ IF NOT EXISTS(process_dir):
68
+ bash(mkdir -p "{process_dir}")
69
+
70
+ # Validate required artifacts
71
+ # Note: "role analysis documents" refers to [role]/analysis.md files (e.g., product-manager/analysis.md)
72
+ SYNTHESIS_DIR = brainstorm_dir # Contains role analysis files: */analysis.md
73
+ IMPL_PLAN = session_dir/IMPL_PLAN.md
74
+ TASK_FILES = Glob(task_dir/*.json)
75
+ PLANNING_NOTES = session_dir/planning-notes.md # N+1 context and constraints
76
+
77
+ # Abort if missing - in order of dependency
78
+ SESSION_FILE_EXISTS = EXISTS(session_file)
79
+ IF NOT SESSION_FILE_EXISTS:
80
+ WARNING: "workflow-session.json not found. User intent alignment verification will be skipped."
81
+ # Continue execution - this is optional context, not blocking
82
+
83
+ PLANNING_NOTES_EXISTS = EXISTS(PLANNING_NOTES)
84
+ IF NOT PLANNING_NOTES_EXISTS:
85
+ WARNING: "planning-notes.md not found. Constraints/N+1 context verification will be skipped."
86
+ # Continue execution - optional context
87
+
88
+ SYNTHESIS_FILES = Glob(brainstorm_dir/*/analysis.md)
89
+ IF SYNTHESIS_FILES.count == 0:
90
+ WARNING: "No role analysis documents found in .brainstorming/*/analysis.md. Synthesis-based dimensions (E, G) will use reduced coverage."
91
+ SYNTHESIS_AVAILABLE = false
92
+ # Continue execution - brainstorm artifacts are optional for direct planning workflows
93
+ ELSE:
94
+ SYNTHESIS_AVAILABLE = true
95
+
96
+ IF NOT EXISTS(IMPL_PLAN):
97
+ ERROR: "IMPL_PLAN.md not found. Run /workflow-plan first"
98
+ EXIT
99
+
100
+ IF TASK_FILES.count == 0:
101
+ ERROR: "No task JSON files found. Run /workflow-plan first"
102
+ EXIT
103
+ ```
104
+
105
+ ### Step 5.2: Load Artifacts (Progressive Disclosure)
106
+
107
+ Load only minimal necessary context from each artifact:
108
+
109
+ **From workflow-session.json** (OPTIONAL - Primary Reference for User Intent):
110
+ - **ONLY IF EXISTS**: Load user intent context
111
+ - Original user prompt/intent (project or description field)
112
+ - User's stated goals and objectives
113
+ - User's scope definition
114
+ - **IF MISSING**: Set user_intent_analysis = "SKIPPED: workflow-session.json not found"
115
+
116
+ **From planning-notes.md** (OPTIONAL - Constraints & N+1 Context):
117
+ - **ONLY IF EXISTS**: Load planning context
118
+ - Consolidated Constraints (numbered list from Phase 1-3)
119
+ - N+1 Context: Decisions table (Decision | Rationale | Revisit?)
120
+ - N+1 Context: Deferred items list
121
+ - **IF MISSING**: Set planning_notes_analysis = "SKIPPED: planning-notes.md not found"
122
+
123
+ **From role analysis documents** (AUTHORITATIVE SOURCE):
124
+ - Functional Requirements (IDs, descriptions, acceptance criteria)
125
+ - Non-Functional Requirements (IDs, targets)
126
+ - Business Requirements (IDs, success metrics)
127
+ - Key Architecture Decisions
128
+ - Risk factors and mitigation strategies
129
+ - Implementation Roadmap (high-level phases)
130
+
131
+ **From IMPL_PLAN.md**:
132
+ - Summary and objectives
133
+ - Context Analysis
134
+ - Implementation Strategy
135
+ - Task Breakdown Summary
136
+ - Success Criteria
137
+ - Brainstorming Artifacts References (if present)
138
+
139
+ **From task.json files**:
140
+ - Task IDs
141
+ - Titles and descriptions
142
+ - Status
143
+ - Dependencies (depends_on, blocks)
144
+ - Context (requirements, focus_paths, acceptance, artifacts)
145
+ - Flow control (pre_analysis, implementation_approach)
146
+ - Meta (complexity, priority)
147
+
148
+ ### Step 5.3: Build Semantic Models
149
+
150
+ Create internal representations (do not include raw artifacts in output):
151
+
152
+ **Requirements inventory**:
153
+ - Each functional/non-functional/business requirement with stable ID
154
+ - Requirement text, acceptance criteria, priority
155
+
156
+ **Architecture decisions inventory**:
157
+ - ADRs from synthesis
158
+ - Technology choices
159
+ - Data model references
160
+
161
+ **Task coverage mapping**:
162
+ - Map each task to one or more requirements (by ID reference or keyword inference)
163
+ - Map each requirement to covering tasks
164
+
165
+ **Dependency graph**:
166
+ - Task-to-task dependencies (depends_on, blocks)
167
+ - Requirement-level dependencies (from synthesis)
168
+
169
+ ### Step 5.4: Detection Passes (Agent-Driven Multi-Dimensional Analysis)
170
+
171
+ **Execution Strategy**:
172
+ - Single `cli-explore-agent` invocation
173
+ - Agent executes multiple CLI analyses internally (different dimensions: A-J)
174
+ - Token Budget: 50 findings maximum (aggregate remainder in overflow summary)
175
+ - Priority Allocation: CRITICAL (unlimited) → HIGH (15) → MEDIUM (20) → LOW (15)
176
+ - Early Exit: If CRITICAL findings > 0 in User Intent/Requirements Coverage, skip LOW/MEDIUM checks
177
+
178
+ **Execution Order** (Agent orchestrates internally):
179
+
180
+ 1. **Tier 1 (CRITICAL Path)**: A, B, C, I - User intent, coverage, consistency, constraints compliance (full analysis)
181
+ 2. **Tier 2 (HIGH Priority)**: D, E, J - Dependencies, synthesis alignment, N+1 context validation (limit 15 findings)
182
+ 3. **Tier 3 (MEDIUM Priority)**: F - Specification quality (limit 20 findings)
183
+ 4. **Tier 4 (LOW Priority)**: G, H - Duplication, feasibility (limit 15 findings)
184
+
185
+ ---
186
+
187
+ #### Step 5.4.1: Launch Unified Verification Agent
188
+
189
+ ```javascript
190
+ Task(
191
+ subagent_type="cli-explore-agent",
192
+ run_in_background=false,
193
+ description="Multi-dimensional plan verification",
194
+ prompt=`
195
+ ## Plan Verification Task
196
+
197
+ ### MANDATORY FIRST STEPS
198
+ 1. Read: ~/.ccw/workflows/cli-templates/schemas/plan-verify-agent-schema.json (dimensions & rules)
199
+ 2. Read: ~/.ccw/workflows/cli-templates/schemas/verify-json-schema.json (output schema)
200
+ 3. Read: ${session_file} (user intent)
201
+ 4. Read: ${PLANNING_NOTES} (constraints & N+1 context)
202
+ 5. Read: ${IMPL_PLAN} (implementation plan)
203
+ 6. Glob: ${task_dir}/*.json (task files)
204
+ 7. Glob: ${SYNTHESIS_DIR}/*/analysis.md (role analyses)
205
+
206
+ ### Execution Flow
207
+
208
+ **Load schema → Execute tiered CLI analysis → Aggregate findings → Write JSON**
209
+
210
+ FOR each tier in [1, 2, 3, 4]:
211
+ - Load tier config from plan-verify-agent-schema.json
212
+ - Execute: ccw cli -p "PURPOSE: Verify dimensions {tier.dimensions}
213
+ TASK: {tier.checks from schema}
214
+ CONTEXT: @${session_dir}/**/*
215
+ EXPECTED: Findings JSON with dimension, severity, location, summary, recommendation
216
+ CONSTRAINTS: Limit {tier.limit} findings
217
+ " --tool gemini --mode analysis --rule {tier.rule}
218
+ - Parse findings, check early exit condition
219
+ - IF tier == 1 AND critical_count > 0: skip tier 3-4
220
+
221
+ ### Output
222
+ Write: ${process_dir}/verification-findings.json (follow verify-json-schema.json)
223
+ Return: Quality gate decision + 2-3 sentence summary
224
+ `
225
+ )
226
+ ```
227
+
228
+ ---
229
+
230
+ #### Step 5.4.2: Load and Organize Findings
231
+
232
+ ```javascript
233
+ // Load findings (single parse for all subsequent use)
234
+ const data = JSON.parse(Read(`${process_dir}/verification-findings.json`))
235
+ const { session_id, timestamp, verification_tiers_completed, findings, summary } = data
236
+ const { critical_count, high_count, medium_count, low_count, total_findings, coverage_percentage, recommendation } = summary
237
+
238
+ // Group by severity and dimension
239
+ const bySeverity = Object.groupBy(findings, f => f.severity)
240
+ const byDimension = Object.groupBy(findings, f => f.dimension)
241
+
242
+ // Dimension metadata (from schema)
243
+ const DIMS = {
244
+ A: "User Intent Alignment", B: "Requirements Coverage", C: "Consistency Validation",
245
+ D: "Dependency Integrity", E: "Synthesis Alignment", F: "Task Specification Quality",
246
+ G: "Duplication Detection", H: "Feasibility Assessment",
247
+ I: "Constraints Compliance", J: "N+1 Context Validation"
248
+ }
249
+ ```
250
+
251
+ ### Step 5.5: Generate Report
252
+
253
+ ```javascript
254
+ // Helper: render dimension section
255
+ const renderDimension = (dim) => {
256
+ const items = byDimension[dim] || []
257
+ return items.length > 0
258
+ ? items.map(f => `### ${f.id}: ${f.summary}\n- **Severity**: ${f.severity}\n- **Location**: ${f.location.join(', ')}\n- **Recommendation**: ${f.recommendation}`).join('\n\n')
259
+ : `> No ${DIMS[dim]} issues detected.`
260
+ }
261
+
262
+ // Helper: render severity section
263
+ const renderSeverity = (severity, impact) => {
264
+ const items = bySeverity[severity] || []
265
+ return items.length > 0
266
+ ? items.map(f => `#### ${f.id}: ${f.summary}\n- **Dimension**: ${f.dimension_name}\n- **Location**: ${f.location.join(', ')}\n- **Impact**: ${impact}\n- **Recommendation**: ${f.recommendation}`).join('\n\n')
267
+ : `> No ${severity.toLowerCase()}-severity issues detected.`
268
+ }
269
+
270
+ // Build Markdown report
271
+ const fullReport = `
272
+ # Plan Verification Report
273
+
274
+ **Session**: WFS-${session_id} | **Generated**: ${timestamp}
275
+ **Tiers Completed**: ${verification_tiers_completed.join(', ')}
276
+
277
+ ---
278
+
279
+ ## Executive Summary
280
+
281
+ | Metric | Value | Status |
282
+ |--------|-------|--------|
283
+ | Risk Level | ${critical_count > 0 ? 'CRITICAL' : high_count > 0 ? 'HIGH' : medium_count > 0 ? 'MEDIUM' : 'LOW'} | ${critical_count > 0 ? 'RED' : high_count > 0 ? 'ORANGE' : medium_count > 0 ? 'YELLOW' : 'GREEN'} |
284
+ | Critical/High/Medium/Low | ${critical_count}/${high_count}/${medium_count}/${low_count} | |
285
+ | Coverage | ${coverage_percentage}% | ${coverage_percentage >= 90 ? 'GREEN' : coverage_percentage >= 75 ? 'YELLOW' : 'RED'} |
286
+
287
+ **Recommendation**: **${recommendation}**
288
+
289
+ ---
290
+
291
+ ## Findings Summary
292
+
293
+ | ID | Dimension | Severity | Location | Summary |
294
+ |----|-----------|----------|----------|---------|
295
+ ${findings.map(f => `| ${f.id} | ${f.dimension_name} | ${f.severity} | ${f.location.join(', ')} | ${f.summary} |`).join('\n')}
296
+
297
+ ---
298
+
299
+ ## Analysis by Dimension
300
+
301
+ ${['A','B','C','D','E','F','G','H','I','J'].map(d => `### ${d}. ${DIMS[d]}\n\n${renderDimension(d)}`).join('\n\n---\n\n')}
302
+
303
+ ---
304
+
305
+ ## Findings by Severity
306
+
307
+ ### CRITICAL (${critical_count})
308
+ ${renderSeverity('CRITICAL', 'Blocks execution')}
309
+
310
+ ### HIGH (${high_count})
311
+ ${renderSeverity('HIGH', 'Fix before execution recommended')}
312
+
313
+ ### MEDIUM (${medium_count})
314
+ ${renderSeverity('MEDIUM', 'Address during/after implementation')}
315
+
316
+ ### LOW (${low_count})
317
+ ${renderSeverity('LOW', 'Optional improvement')}
318
+
319
+ ---
320
+
321
+ ## Next Steps
322
+
323
+ ${recommendation === 'BLOCK_EXECUTION' ? 'BLOCK: Fix critical issues then re-verify' :
324
+ recommendation === 'PROCEED_WITH_FIXES' ? 'FIX RECOMMENDED: Address high issues then re-verify or execute' :
325
+ 'READY: Proceed to Skill(skill="workflow-execute")'}
326
+
327
+ Re-verify: \`/workflow-plan-verify --session ${session_id}\`
328
+ Execute: \`Skill(skill="workflow-execute", args="--resume-session=${session_id}")\`
329
+ `
330
+
331
+ // Write report
332
+ Write(`${process_dir}/PLAN_VERIFICATION.md`, fullReport)
333
+ console.log(`Report: ${process_dir}/PLAN_VERIFICATION.md\n${recommendation} | C:${critical_count} H:${high_count} M:${medium_count} L:${low_count} | Coverage:${coverage_percentage}%`)
334
+ ```
335
+
336
+ ### Step 5.6: Next Step Selection
337
+
338
+ ```javascript
339
+ // Reference workflowPreferences (set by SKILL.md via AskUserQuestion)
340
+ const autoYes = workflowPreferences.autoYes
341
+ const canExecute = recommendation !== 'BLOCK_EXECUTION'
342
+
343
+ // Auto mode
344
+ if (autoYes) {
345
+ if (canExecute) {
346
+ Skill(skill="workflow-execute", args="--resume-session=\"${session_id}\"")
347
+ } else {
348
+ console.log(`[Auto] BLOCK_EXECUTION - Fix ${critical_count} critical issues first.`)
349
+ }
350
+ return
351
+ }
352
+
353
+ // Interactive mode - build options based on quality gate
354
+ const options = canExecute
355
+ ? [
356
+ { label: canExecute && recommendation === 'PROCEED_WITH_FIXES' ? "Execute Anyway" : "Execute (Recommended)",
357
+ description: "Proceed to Skill(skill=\"workflow-execute\")" },
358
+ { label: "Review Report", description: "Review findings before deciding" },
359
+ { label: "Re-verify", description: "Re-run after manual fixes" }
360
+ ]
361
+ : [
362
+ { label: "Review Report", description: "Review critical issues" },
363
+ { label: "Re-verify", description: "Re-run after fixing issues" }
364
+ ]
365
+
366
+ const selection = AskUserQuestion({
367
+ questions: [{
368
+ question: `Quality gate: ${recommendation}. Next step?`,
369
+ header: "Action",
370
+ multiSelect: false,
371
+ options
372
+ }]
373
+ })
374
+
375
+ // Handle selection
376
+ if (selection.includes("Execute")) {
377
+ Skill(skill="workflow-execute", args="--resume-session=\"${session_id}\"")
378
+ } else if (selection === "Re-verify") {
379
+ // Direct phase re-execution: re-read and execute this phase
380
+ Read("phases/05-plan-verify.md")
381
+ // Re-execute with current session context
382
+ }
383
+ ```
384
+
385
+ ## Output
386
+
387
+ - **File**: `PLAN_VERIFICATION.md` (verification report with quality gate)
388
+ - **File**: `verification-findings.json` (structured findings data)
389
+
390
+ ## Completion
391
+
392
+ Phase 5 is a terminal phase. Based on quality gate result, user routes to:
393
+ - Execute → Skill(skill="workflow-execute")
394
+ - Re-verify → Re-run Phase 5
395
+ - Review → Manual inspection