@@ -32,26 +32,32 @@ Identify inconsistencies, duplications, ambiguities, and underspecified items be
3232IF --session parameter provided:
3333 session_id = provided session
3434ELSE:
35- CHECK: find .workflow/active/ -name " WFS-*" -type d
36- IF active_session EXISTS:
37- session_id = get_active_session ()
38- ELSE:
35+ # Auto-detect active session
36+ active_sessions = bash(find .workflow/active/ -name " WFS-*" -type d 2> /dev/null)
37+ IF active_sessions is empty:
3938 ERROR: " No active workflow session found. Use --session <session-id>"
4039 EXIT
40+ ELSE IF active_sessions has multiple entries:
41+ # Use most recently modified session
42+ session_id = bash(ls -td .workflow/active/WFS-* / 2> /dev/null | head -1 | xargs basename)
43+ ELSE:
44+ session_id = basename(active_sessions[0])
4145
4246# Derive absolute paths
4347session_dir = .workflow/active/WFS-{session}
4448brainstorm_dir = session_dir/.brainstorming
4549task_dir = session_dir/.task
4650
4751# Validate required artifacts
48- SYNTHESIS = brainstorm_dir/role analysis documents
52+ # Note: "role analysis documents" refers to [role]/analysis.md files (e.g., product-manager/analysis.md)
53+ SYNTHESIS_DIR = brainstorm_dir # Contains role analysis files: */analysis.md
4954IMPL_PLAN = session_dir/IMPL_PLAN.md
5055TASK_FILES = Glob(task_dir/* .json)
5156
5257# Abort if missing
53- IF NOT EXISTS(SYNTHESIS):
54- ERROR: " role analysis documents not found. Run /workflow:brainstorm:synthesis first"
58+ SYNTHESIS_FILES = Glob(brainstorm_dir/* /analysis.md)
59+ IF SYNTHESIS_FILES.count == 0:
60+ ERROR: " No role analysis documents found in .brainstorming/*/analysis.md. Run /workflow:brainstorm:synthesis first"
5561 EXIT
5662
5763IF NOT EXISTS(IMPL_PLAN):
@@ -135,40 +141,40 @@ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder i
135141- ** Unmapped Tasks** : Tasks with no clear requirement linkage
136142- ** NFR Coverage Gaps** : Non-functional requirements (performance, security, scalability) not reflected in tasks
137143
138- #### B . Consistency Validation
144+ #### C . Consistency Validation
139145
140146- ** Requirement Conflicts** : Tasks contradicting synthesis requirements
141147- ** Architecture Drift** : IMPL_PLAN architecture not matching synthesis ADRs
142148- ** Terminology Drift** : Same concept named differently across IMPL_PLAN and tasks
143149- ** Data Model Inconsistency** : Tasks referencing entities/fields not in synthesis data model
144150
145- #### C . Dependency Integrity
151+ #### D . Dependency Integrity
146152
147153- ** Circular Dependencies** : Task A depends on B, B depends on C, C depends on A
148154- ** Missing Dependencies** : Task requires outputs from another task but no explicit dependency
149155- ** Broken Dependencies** : Task depends on non-existent task ID
150156- ** Logical Ordering Issues** : Implementation tasks before foundational setup without dependency note
151157
152- #### D . Synthesis Alignment
158+ #### E . Synthesis Alignment
153159
154160- ** Priority Conflicts** : High-priority synthesis requirements mapped to low-priority tasks
155161- ** Success Criteria Mismatch** : IMPL_PLAN success criteria not covering synthesis acceptance criteria
156162- ** Risk Mitigation Gaps** : Critical risks in synthesis without corresponding mitigation tasks
157163
158- #### E . Task Specification Quality
164+ #### F . Task Specification Quality
159165
160166- ** Ambiguous Focus Paths** : Tasks with vague or missing focus_paths
161167- ** Underspecified Acceptance** : Tasks without clear acceptance criteria
162168- ** Missing Artifacts References** : Tasks not referencing relevant brainstorming artifacts in context.artifacts
163169- ** Weak Flow Control** : Tasks without clear implementation_approach or pre_analysis steps
164170- ** Missing Target Files** : Tasks without flow_control.target_files specification
165171
166- #### F . Duplication Detection
172+ #### G . Duplication Detection
167173
168174- ** Overlapping Task Scope** : Multiple tasks with nearly identical descriptions
169175- ** Redundant Requirements Coverage** : Same requirement covered by multiple tasks without clear partitioning
170176
171- #### G . Feasibility Assessment
177+ #### H . Feasibility Assessment
172178
173179- ** Complexity Misalignment** : Task marked "simple" but requires multiple file modifications
174180- ** Resource Conflicts** : Parallel tasks requiring same resources/files
@@ -203,7 +209,9 @@ Use this heuristic to prioritize findings:
203209
204210### 6. Produce Compact Analysis Report
205211
206- Output a Markdown report (no file writes) with the following structure:
212+ ** Report Generation** : Generate report content and save to file.
213+
214+ Output a Markdown report with the following structure:
207215
208216``` markdown
209217## Action Plan Verification Report
@@ -217,7 +225,11 @@ Output a Markdown report (no file writes) with the following structure:
217225### Executive Summary
218226
219227- ** Overall Risk Level** : CRITICAL | HIGH | MEDIUM | LOW
220- - ** Recommendation** : BLOCK_EXECUTION | PROCEED_WITH_FIXES | PROCEED_WITH_CAUTION | PROCEED
228+ - ** Recommendation** : (See decision matrix below)
229+ - BLOCK_EXECUTION: Critical issues exist (must fix before proceeding)
230+ - PROCEED_WITH_FIXES: High issues exist, no critical (fix recommended before execution)
231+ - PROCEED_WITH_CAUTION: Medium issues only (proceed with awareness)
232+ - PROCEED: Low issues only or no issues (safe to execute)
221233- ** Critical Issues** : {count}
222234- ** High Issues** : {count}
223235- ** Medium Issues** : {count}
@@ -322,14 +334,27 @@ Output a Markdown report (no file writes) with the following structure:
322334
323335#### Action Recommendations
324336
325- ** If CRITICAL Issues Exist** :
326- - ** BLOCK EXECUTION** - Resolve critical issues before proceeding
327- - Use TodoWrite to track all required fixes
328- - Fix broken dependencies and circular references
337+ ** Recommendation Decision Matrix** :
338+
339+ | Condition | Recommendation | Action |
340+ | -----------| ----------------| --------|
341+ | Critical > 0 | BLOCK_EXECUTION | Must resolve all critical issues before proceeding |
342+ | Critical = 0, High > 0 | PROCEED_WITH_FIXES | Fix high-priority issues before execution |
343+ | Critical = 0, High = 0, Medium > 0 | PROCEED_WITH_CAUTION | Proceed with awareness of medium issues |
344+ | Only Low or None | PROCEED | Safe to execute workflow |
329345
330- ** If Only HIGH/MEDIUM/LOW Issues** :
331- - ** PROCEED WITH CAUTION** - Fix high-priority issues first
332- - Use TodoWrite to systematically track and complete all improvements
346+ ** If CRITICAL Issues Exist** (BLOCK_EXECUTION):
347+ - Resolve all critical issues before proceeding
348+ - Use TodoWrite to track required fixes
349+ - Fix broken dependencies and circular references first
350+
351+ ** If HIGH Issues Exist** (PROCEED_WITH_FIXES):
352+ - Fix high-priority issues before execution
353+ - Use TodoWrite to systematically track and complete improvements
354+
355+ ** If Only MEDIUM/LOW Issues** (PROCEED_WITH_CAUTION / PROCEED):
356+ - Can proceed with execution
357+ - Address issues during or after implementation
333358
334359#### TodoWrite-Based Remediation Workflow
335360
@@ -359,13 +384,18 @@ Priority Order:
359384
360385### 7. Save Report and Execute TodoWrite-Based Remediation
361386
362- ** Save Analysis Report** :
387+ ** Step 7.1: Save Analysis Report** :
363388``` bash
364389report_path = " .workflow/active/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md"
365390Write(report_path, full_report_content)
366391```
367392
368- ** After Report Generation** :
393+ ** Step 7.2: Display Report Summary to User** :
394+ - Show executive summary with counts
395+ - Display recommendation (BLOCK/PROCEED_WITH_FIXES/PROCEED_WITH_CAUTION/PROCEED)
396+ - List critical and high issues if any
397+
398+ ** Step 7.3: After Report Generation** :
369399
3704001 . ** Extract Findings** : Parse all issues by severity
3714012 . ** Create TodoWrite Task List** : Convert findings to actionable todos
0 commit comments