wogiflow 1.0.21 → 1.0.22

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 (121) hide show
  1. package/.claude/commands/wogi-bug.md +43 -0
  2. package/.claude/commands/wogi-bulk.md +144 -0
  3. package/.claude/commands/wogi-changelog.md +36 -0
  4. package/.claude/commands/wogi-compact.md +99 -0
  5. package/.claude/commands/wogi-config.md +50 -0
  6. package/.claude/commands/wogi-context.md +68 -0
  7. package/.claude/commands/wogi-correction.md +73 -0
  8. package/.claude/commands/wogi-debt.md +128 -0
  9. package/.claude/commands/wogi-deps.md +32 -0
  10. package/.claude/commands/wogi-epics.md +145 -0
  11. package/.claude/commands/wogi-export.md +100 -0
  12. package/.claude/commands/wogi-feature.md +149 -0
  13. package/.claude/commands/wogi-guided-edit.md +83 -0
  14. package/.claude/commands/wogi-health.md +43 -0
  15. package/.claude/commands/wogi-help.md +96 -0
  16. package/.claude/commands/wogi-hybrid-edit.md +36 -0
  17. package/.claude/commands/wogi-hybrid-off.md +24 -0
  18. package/.claude/commands/wogi-hybrid-setup.md +79 -0
  19. package/.claude/commands/wogi-hybrid-status.md +45 -0
  20. package/.claude/commands/wogi-hybrid.md +54 -0
  21. package/.claude/commands/wogi-import.md +44 -0
  22. package/.claude/commands/wogi-init.md +618 -0
  23. package/.claude/commands/wogi-log.md +38 -0
  24. package/.claude/commands/wogi-map-add.md +29 -0
  25. package/.claude/commands/wogi-map-check.md +35 -0
  26. package/.claude/commands/wogi-map-index.md +98 -0
  27. package/.claude/commands/wogi-map-scan.md +38 -0
  28. package/.claude/commands/wogi-map-sync.md +91 -0
  29. package/.claude/commands/wogi-map.md +33 -0
  30. package/.claude/commands/wogi-morning.md +65 -0
  31. package/.claude/commands/wogi-onboard.md +99 -0
  32. package/.claude/commands/wogi-plan.md +173 -0
  33. package/.claude/commands/wogi-ready.md +84 -0
  34. package/.claude/commands/wogi-resume.md +95 -0
  35. package/.claude/commands/wogi-review.md +636 -0
  36. package/.claude/commands/wogi-roadmap.md +241 -0
  37. package/.claude/commands/wogi-rules.md +104 -0
  38. package/.claude/commands/wogi-search.md +33 -0
  39. package/.claude/commands/wogi-session-end.md +49 -0
  40. package/.claude/commands/wogi-setup-stack.md +151 -0
  41. package/.claude/commands/wogi-skill-learn.md +66 -0
  42. package/.claude/commands/wogi-skills.md +87 -0
  43. package/.claude/commands/wogi-standup.md +28 -0
  44. package/.claude/commands/wogi-start.md +465 -0
  45. package/.claude/commands/wogi-status.md +41 -0
  46. package/.claude/commands/wogi-statusline-setup/skill.md +109 -0
  47. package/.claude/commands/wogi-story.md +98 -0
  48. package/.claude/commands/wogi-suspend.md +87 -0
  49. package/.claude/commands/wogi-test-browser.md +43 -0
  50. package/.claude/commands/wogi-trace.md +198 -0
  51. package/.claude/docs/architecture.md +37 -0
  52. package/.claude/docs/commands.md +343 -0
  53. package/.claude/docs/knowledge-base/01-setup-onboarding/README.md +177 -0
  54. package/.claude/docs/knowledge-base/01-setup-onboarding/component-indexing.md +341 -0
  55. package/.claude/docs/knowledge-base/01-setup-onboarding/framework-detection.md +269 -0
  56. package/.claude/docs/knowledge-base/01-setup-onboarding/installation.md +146 -0
  57. package/.claude/docs/knowledge-base/01-setup-onboarding/onboarding-existing.md +317 -0
  58. package/.claude/docs/knowledge-base/01-setup-onboarding/team-setup.md +346 -0
  59. package/.claude/docs/knowledge-base/02-task-execution/01-task-planning.md +259 -0
  60. package/.claude/docs/knowledge-base/02-task-execution/02-execution-loop.md +443 -0
  61. package/.claude/docs/knowledge-base/02-task-execution/03-verification.md +417 -0
  62. package/.claude/docs/knowledge-base/02-task-execution/04-completion.md +374 -0
  63. package/.claude/docs/knowledge-base/02-task-execution/05-session-review.md +170 -0
  64. package/.claude/docs/knowledge-base/02-task-execution/README.md +173 -0
  65. package/.claude/docs/knowledge-base/02-task-execution/external-integrations.md +133 -0
  66. package/.claude/docs/knowledge-base/02-task-execution/model-management.md +202 -0
  67. package/.claude/docs/knowledge-base/02-task-execution/specification-mode.md +292 -0
  68. package/.claude/docs/knowledge-base/02-task-execution/sync-daemon.md +96 -0
  69. package/.claude/docs/knowledge-base/02-task-execution/trade-offs.md +345 -0
  70. package/.claude/docs/knowledge-base/02-task-execution/workflow-steps.md +357 -0
  71. package/.claude/docs/knowledge-base/03-self-improvement/README.md +199 -0
  72. package/.claude/docs/knowledge-base/03-self-improvement/long-input-processing.md +160 -0
  73. package/.claude/docs/knowledge-base/03-self-improvement/model-learning.md +334 -0
  74. package/.claude/docs/knowledge-base/03-self-improvement/project-learning.md +301 -0
  75. package/.claude/docs/knowledge-base/03-self-improvement/skill-learning.md +372 -0
  76. package/.claude/docs/knowledge-base/03-self-improvement/skill-matching.md +304 -0
  77. package/.claude/docs/knowledge-base/03-self-improvement/team-learning.md +342 -0
  78. package/.claude/docs/knowledge-base/04-memory-context/README.md +189 -0
  79. package/.claude/docs/knowledge-base/04-memory-context/context-management.md +308 -0
  80. package/.claude/docs/knowledge-base/04-memory-context/memory-commands.md +176 -0
  81. package/.claude/docs/knowledge-base/04-memory-context/memory-systems.md +359 -0
  82. package/.claude/docs/knowledge-base/04-memory-context/prd-management.md +115 -0
  83. package/.claude/docs/knowledge-base/04-memory-context/session-persistence.md +359 -0
  84. package/.claude/docs/knowledge-base/04-memory-context/team-history.md +317 -0
  85. package/.claude/docs/knowledge-base/05-development-tools/README.md +84 -0
  86. package/.claude/docs/knowledge-base/05-development-tools/code-traces.md +278 -0
  87. package/.claude/docs/knowledge-base/05-development-tools/figma-analyzer.md +253 -0
  88. package/.claude/docs/knowledge-base/05-development-tools/guided-edit.md +173 -0
  89. package/.claude/docs/knowledge-base/05-development-tools/mcp-integrations.md +286 -0
  90. package/.claude/docs/knowledge-base/06-safety-guardrails/README.md +153 -0
  91. package/.claude/docs/knowledge-base/06-safety-guardrails/checkpoint-rollback.md +302 -0
  92. package/.claude/docs/knowledge-base/06-safety-guardrails/commit-gates.md +309 -0
  93. package/.claude/docs/knowledge-base/06-safety-guardrails/damage-control.md +292 -0
  94. package/.claude/docs/knowledge-base/06-safety-guardrails/security-scanning.md +291 -0
  95. package/.claude/docs/knowledge-base/README.md +92 -0
  96. package/.claude/docs/knowledge-base/configuration/README.md +228 -0
  97. package/.claude/docs/knowledge-base/configuration/all-options.md +1632 -0
  98. package/.claude/docs/knowledge-base/future-features.md +277 -0
  99. package/.claude/docs/stack.md +25 -0
  100. package/.claude/docs/testing.md +71 -0
  101. package/.claude/rules/README.md +60 -0
  102. package/.claude/rules/architecture/component-reuse.md +38 -0
  103. package/.claude/rules/architecture/document-structure.md +76 -0
  104. package/.claude/rules/architecture/feature-refactoring-cleanup.md +87 -0
  105. package/.claude/rules/architecture/model-management.md +35 -0
  106. package/.claude/rules/code-style/naming-conventions.md +55 -0
  107. package/.claude/rules/security/security-patterns.md +116 -0
  108. package/.claude/skills/.gitkeep +0 -0
  109. package/.claude/skills/README.md +131 -0
  110. package/.claude/skills/_template/commands/.gitkeep +0 -0
  111. package/.claude/skills/_template/knowledge/anti-patterns.md +49 -0
  112. package/.claude/skills/_template/knowledge/learnings.md +60 -0
  113. package/.claude/skills/_template/knowledge/patterns.md +45 -0
  114. package/.claude/skills/_template/rules/.gitkeep +0 -0
  115. package/.claude/skills/_template/skill.md +99 -0
  116. package/.claude/skills/_template/templates/.gitkeep +0 -0
  117. package/.claude/skills/figma-analyzer/knowledge/anti-patterns.md +216 -0
  118. package/.claude/skills/figma-analyzer/knowledge/patterns.md +144 -0
  119. package/.claude/skills/figma-analyzer/skill.md +236 -0
  120. package/lib/installer.js +59 -19
  121. package/package.json +5 -1
@@ -0,0 +1,636 @@
1
+ Comprehensive code review with verification gates and AI analysis. Auto-detects when to use multi-pass (4 sequential passes) vs parallel (3 agents) based on file count and security patterns.
2
+
3
+ **Triggers**: `/wogi-review`, `/wogi-session-review`, "please review", "review what we did", "code review"
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ /wogi-review # Full review (auto-detects if multipass needed)
9
+ /wogi-review --commits 3 # Include last 3 commits
10
+ /wogi-review --staged # Only staged changes
11
+ /wogi-review --skip-verify # Skip verification gates (AI only)
12
+ /wogi-review --verify-only # Only run verification gates
13
+ /wogi-review --multipass # Force multi-pass review mode
14
+ /wogi-review --no-multipass # Disable auto multi-pass detection
15
+ ```
16
+
17
+ ## Review Modes
18
+
19
+ ### Parallel Mode
20
+ Runs 3 AI agents simultaneously for faster results. Used for simple reviews.
21
+
22
+ ### Multi-Pass Mode (Auto-Enabled)
23
+ Runs 4 sequential passes with context isolation. **Auto-enabled when:**
24
+ - 5+ files changed
25
+ - Security-sensitive files detected (auth, credential, .env)
26
+ - Security patterns in content (password, token, secret, etc.)
27
+ - API/service files detected
28
+
29
+ Best for thorough reviews:
30
+
31
+ ```
32
+ Pass 1: Structure (Haiku) → File organization, naming, anti-patterns
33
+ Pass 2: Logic (Sonnet) → Business logic, edge cases
34
+ Pass 3: Security (Sonnet)* → OWASP, injection, credentials
35
+ Pass 4: Integration (Sonnet)* → Breaking changes, contracts
36
+
37
+ * = Conditional - only runs if patterns detected
38
+ ```
39
+
40
+ Multi-pass advantages:
41
+ - Each pass starts with fresh context (no bias from previous findings)
42
+ - Later passes can focus on files flagged by earlier passes
43
+ - Early exit on critical issues saves resources
44
+ - Better for large codebases or security-sensitive changes
45
+
46
+ ## How It Works
47
+
48
+ ```
49
+ ┌─────────────────────────────────────────────────────────────┐
50
+ │ /wogi-review │
51
+ ├─────────────────────────────────────────────────────────────┤
52
+ │ 1. Identify changed files (git diff) │
53
+ │ 2. VERIFY: Run verification gates │
54
+ │ → Spec verification (all deliverables exist?) │
55
+ │ → Lint, typecheck, test checks │
56
+ │ 3. CHECK: Should multi-pass be enabled? │
57
+ │ → 5+ files? Security files? API files? → YES = multi-pass│
58
+ │ → Otherwise → NO = parallel mode │
59
+ │ 4. REVIEW: │
60
+ │ IF multi-pass: Run 4 sequential passes │
61
+ │ Pass 1: Structure (Haiku) → Pass 2: Logic (Sonnet) │
62
+ │ Pass 3: Security (Sonnet) → Pass 4: Integration │
63
+ │ ELSE: Launch 3 parallel AI agents │
64
+ │ 5. Consolidate results into single report │
65
+ └─────────────────────────────────────────────────────────────┘
66
+ ```
67
+
68
+ ## Phase 1: Verification Gates
69
+
70
+ Run automated tools first to catch obvious issues quickly:
71
+
72
+ ### Spec Verification (if task has spec)
73
+
74
+ If reviewing a task with a spec file, run spec verification FIRST:
75
+
76
+ ```bash
77
+ node scripts/flow-spec-verifier.js verify wf-XXXXXXXX
78
+ ```
79
+
80
+ This ensures all files promised in the spec actually exist before reviewing code quality.
81
+
82
+ ### Standard Verification Gates
83
+
84
+ ```bash
85
+ # Run configured verification commands
86
+ npm run lint 2>&1 | head -50
87
+ npm run typecheck 2>&1 | head -50
88
+ npm run test 2>&1 | head -50 # If tests exist
89
+ ```
90
+
91
+ **Output:**
92
+ ```
93
+ ═══════════════════════════════════════
94
+ VERIFICATION GATES
95
+ ═══════════════════════════════════════
96
+ ✓ Spec: 5/5 deliverables exist
97
+ ✓ Lint: passed
98
+ ✗ TypeCheck: 2 errors
99
+ → src/utils.ts:45 - Property 'x' does not exist
100
+ → src/api.ts:12 - Type 'string' not assignable to 'number'
101
+ ✓ Tests: 15/15 passed
102
+
103
+ Gate Summary: 1 failed (typecheck)
104
+ ```
105
+
106
+ If spec verification or critical gate failures exist, report them immediately before AI review.
107
+
108
+ ## Phase 2: AI Review (3 Parallel Agents)
109
+
110
+ ### Agent 1: Code & Logic Review
111
+ Launch a Task agent with subagent_type=Explore focusing on:
112
+ - **Code Quality**: Naming conventions, readability, structure
113
+ - **Logic Correctness**: Algorithm correctness, edge case handling
114
+ - **DRY Violations**: Duplicated logic that should be extracted
115
+ - **Error Handling**: Are errors caught and handled appropriately?
116
+ - **Code Smells**: Long methods, deep nesting, magic numbers
117
+
118
+ Prompt template:
119
+ ```
120
+ Review the following files for code quality and logic issues:
121
+ [FILE_LIST]
122
+
123
+ Check for:
124
+ 1. Naming conventions - are names clear and consistent?
125
+ 2. Logic correctness - any bugs or edge cases missed?
126
+ 3. DRY violations - any duplicated code?
127
+ 4. Error handling - are errors handled appropriately?
128
+ 5. Code smells - long methods, deep nesting, magic numbers?
129
+
130
+ For each issue found, report:
131
+ - File and line number
132
+ - Issue type (quality/logic/dry/error/smell)
133
+ - Severity (critical/high/medium/low)
134
+ - Description and recommendation
135
+ ```
136
+
137
+ ### Agent 2: Security Review
138
+ Launch a Task agent with subagent_type=Explore focusing on:
139
+ - **Input Validation**: User inputs sanitized?
140
+ - **Authentication/Authorization**: Proper access controls?
141
+ - **Injection Risks**: SQL, XSS, command injection?
142
+ - **Sensitive Data**: Passwords, tokens, PII exposed?
143
+ - **Error Messages**: Do errors leak sensitive info?
144
+
145
+ Refer to `agents/security.md` for OWASP Top 10 checklist.
146
+
147
+ Prompt template:
148
+ ```
149
+ Security review of the following files:
150
+ [FILE_LIST]
151
+
152
+ Check for OWASP Top 10 vulnerabilities:
153
+ 1. Injection (SQL, XSS, command injection)
154
+ 2. Broken authentication
155
+ 3. Sensitive data exposure
156
+ 4. Security misconfiguration
157
+ 5. Insufficient input validation
158
+
159
+ For each issue found, report:
160
+ - File and line number
161
+ - Vulnerability type
162
+ - Severity (critical/high/medium/low)
163
+ - Description and remediation
164
+ ```
165
+
166
+ ### Agent 3: Architecture & Conflicts
167
+ Launch a Task agent with subagent_type=Explore focusing on:
168
+ - **Component Reuse**: Check `app-map.md` for existing components
169
+ - **Pattern Consistency**: Check `decisions.md` for coding patterns
170
+ - **Redundancies**: Similar implementations that could be consolidated
171
+ - **Conflicts**: Code that contradicts existing implementations
172
+ - **Dead Code**: Unused imports, variables, unreachable code
173
+
174
+ Prompt template:
175
+ ```
176
+ Architecture review of the following files:
177
+ [FILE_LIST]
178
+
179
+ Check:
180
+ 1. Read app-map.md - are there existing components that should be reused?
181
+ 2. Read decisions.md - do changes follow established patterns?
182
+ 3. Look for redundant implementations across the codebase
183
+ 4. Look for conflicting code (different approaches to same problem)
184
+ 5. Find dead code (unused imports, variables, unreachable code)
185
+
186
+ For each issue found, report:
187
+ - File and line number
188
+ - Issue type (reuse/pattern/redundancy/conflict/dead-code)
189
+ - Severity (critical/high/medium/low)
190
+ - Description and recommendation
191
+ ```
192
+
193
+ ## Execution Steps
194
+
195
+ When `/wogi-review` is invoked:
196
+
197
+ 1. **Get changed files**:
198
+ ```bash
199
+ git diff --name-only HEAD # Unstaged
200
+ git diff --name-only --staged # Staged
201
+ git diff --name-only HEAD~N HEAD # If --commits N specified
202
+ ```
203
+
204
+ 2. **Run verification gates** (unless --skip-verify):
205
+ - **Spec verification** (if task has spec file) - verify all deliverables exist
206
+ - Lint check
207
+ - TypeScript type check
208
+ - Test run (if configured)
209
+ - Report any failures immediately (spec failures are blockers)
210
+
211
+ 3. **Check if multi-pass should be auto-enabled** (unless --no-multipass):
212
+
213
+ Auto-enable multi-pass if ANY of these conditions are met:
214
+ - `--multipass` flag is provided
215
+ - 5+ files changed
216
+ - Any security-sensitive files (auth, credential, .env, security)
217
+ - Security patterns detected in content (password, token, secret, api_key)
218
+ - API/service files detected (*.api.ts, *.service.ts, /api/, /routes/)
219
+
220
+ **If multi-pass is triggered**: Skip to "Multi-Pass Mode Execution" section below.
221
+
222
+ **If parallel mode**: Continue with step 4.
223
+
224
+ 4. **Launch 3 agents in parallel** (single message with 3 Task tool calls):
225
+ - Agent 1: Code & Logic (subagent_type=Explore)
226
+ - Agent 2: Security (subagent_type=Explore)
227
+ - Agent 3: Architecture (subagent_type=Explore)
228
+
229
+ 5. **Wait for all agents to complete**
230
+
231
+ 6. **Consolidate and display results**:
232
+
233
+ ```
234
+ ╔══════════════════════════════════════════════════════════╗
235
+ ║ Code Review ║
236
+ ╚══════════════════════════════════════════════════════════╝
237
+
238
+ Files Reviewed: N
239
+ • path/to/file1.ts
240
+ • path/to/file2.ts
241
+ ...
242
+
243
+ ═══════════════════════════════════════════════════════════
244
+ VERIFICATION GATES
245
+ ═══════════════════════════════════════════════════════════
246
+ ✓ Spec: 5/5 deliverables exist
247
+ ✓ Lint: passed
248
+ ✓ TypeCheck: passed
249
+ ✓ Tests: 15/15 passed
250
+
251
+ ═══════════════════════════════════════════════════════════
252
+ CODE & LOGIC REVIEW
253
+ ═══════════════════════════════════════════════════════════
254
+ [Results from Agent 1]
255
+ ✓ Good: [what's good]
256
+ ⚠ Issue: [description] (file:line)
257
+
258
+ ═══════════════════════════════════════════════════════════
259
+ SECURITY REVIEW
260
+ ═══════════════════════════════════════════════════════════
261
+ [Results from Agent 2]
262
+ ✓ Good: [what's secure]
263
+ ⚠ Issue: [description] (file:line)
264
+
265
+ ═══════════════════════════════════════════════════════════
266
+ ARCHITECTURE & CONFLICTS
267
+ ═══════════════════════════════════════════════════════════
268
+ [Results from Agent 3]
269
+ ✓ Good: [what follows patterns]
270
+ ⚠ Issue: [description] (file:line)
271
+
272
+ ═══════════════════════════════════════════════════════════
273
+ SUMMARY
274
+ ═══════════════════════════════════════════════════════════
275
+ Verification: 4/4 gates passed (spec, lint, typecheck, tests)
276
+ AI Review: N issues (X critical, Y high, Z medium, W low)
277
+
278
+ Top Recommendations:
279
+ 1. [Most important fix]
280
+ 2. [Second most important]
281
+ 3. [Third most important]
282
+ ```
283
+
284
+ ## Multi-Pass Mode Execution
285
+
286
+ When multi-pass is triggered (auto-detected or via `--multipass`), execute **4 sequential passes** using Task agents. Each pass has fresh context and builds on previous findings.
287
+
288
+ **IMPORTANT**: Run passes SEQUENTIALLY, not in parallel. Each pass informs the next.
289
+
290
+ ### Multi-Pass Execution Steps
291
+
292
+ 1. **Get changed files** (same as parallel mode)
293
+
294
+ 2. **Run verification gates** (same as parallel mode)
295
+
296
+ 3. **Execute Pass 1: Structure** using Task agent (model=haiku for speed):
297
+
298
+ Launch a Task agent with subagent_type=Explore, model=haiku:
299
+ ```
300
+ Analyze file structure and naming conventions for:
301
+ [FILE_LIST]
302
+
303
+ Check for:
304
+ 1. File naming conventions (kebab-case for files)
305
+ 2. Folder organization (components in components/, etc.)
306
+ 3. Anti-patterns from decisions.md
307
+ 4. Unused imports or dead code at top of files
308
+
309
+ Return: List of files needing deeper review, structural issues found.
310
+ ```
311
+
312
+ 4. **Execute Pass 2: Logic** using Task agent (model=sonnet):
313
+
314
+ Launch a Task agent with subagent_type=Explore focusing on files flagged by Pass 1:
315
+ ```
316
+ Deep logic review of:
317
+ [FILES_FROM_PASS_1 or ALL_FILES if none flagged]
318
+
319
+ Check for:
320
+ 1. Business logic correctness
321
+ 2. Edge cases and null checks
322
+ 3. Error handling patterns
323
+ 4. Async/await issues (missing await, unhandled promises)
324
+ 5. Race conditions
325
+
326
+ Return: Logic issues with file:line, severity, and fix recommendation.
327
+ ```
328
+
329
+ 5. **Execute Pass 3: Security** (CONDITIONAL - only if security triggers detected):
330
+
331
+ Skip if: No security-sensitive files AND no security patterns in content.
332
+
333
+ Launch a Task agent with subagent_type=Explore:
334
+ ```
335
+ Security review of:
336
+ [FILE_LIST]
337
+
338
+ Check for OWASP Top 10:
339
+ 1. Injection (SQL, XSS, command injection)
340
+ 2. Broken authentication
341
+ 3. Sensitive data exposure (hardcoded secrets, tokens)
342
+ 4. Security misconfiguration
343
+ 5. Insufficient input validation
344
+
345
+ Return: Vulnerabilities with severity, file:line, and remediation steps.
346
+ ```
347
+
348
+ 6. **Execute Pass 4: Integration** (CONDITIONAL - only if 5+ files OR API changes):
349
+
350
+ Skip if: < 5 files AND no API/contract changes detected.
351
+
352
+ Launch a Task agent with subagent_type=Explore:
353
+ ```
354
+ Integration review of:
355
+ [FILE_LIST]
356
+
357
+ Check for:
358
+ 1. Breaking API changes (function signatures, exports)
359
+ 2. Import/export mismatches
360
+ 3. Circular dependencies
361
+ 4. Type contract changes
362
+ 5. Cross-module state issues
363
+
364
+ Return: Breaking changes, conflicts, and integration issues.
365
+ ```
366
+
367
+ 7. **Consolidate all pass results** into the multi-pass output format below.
368
+
369
+ ### Legacy: CLI Module (Optional)
370
+
371
+ The pass modules in `scripts/flow-review-passes/` can also be used programmatically:
372
+
373
+ ```javascript
374
+ const { runMultiPassReview } = require('./scripts/flow-review-passes');
375
+
376
+ const results = await runMultiPassReview({
377
+ files: [{ path: 'src/api.ts', content: '...' }],
378
+ config: {
379
+ passes: ['structure', 'logic', 'security', 'integration'],
380
+ earlyExitOnCritical: true,
381
+ passForward: true
382
+ }
383
+ });
384
+ ```
385
+
386
+ ### Multi-Pass Output Format
387
+
388
+ ```
389
+ ╔══════════════════════════════════════════════════════════╗
390
+ ║ Multi-Pass Code Review ║
391
+ ╚══════════════════════════════════════════════════════════╝
392
+
393
+ Files Reviewed: N
394
+
395
+ ═══════════════════════════════════════════════════════════
396
+ PASS 1: STRUCTURE [Haiku] ✓
397
+ ═══════════════════════════════════════════════════════════
398
+ Duration: 2.3s | Files flagged: 3
399
+ • Naming issue: useGetData.ts should be use-get-data.ts
400
+ • Anti-pattern: console.log in production code (api.ts:45)
401
+
402
+ ═══════════════════════════════════════════════════════════
403
+ PASS 2: LOGIC [Sonnet] ✓
404
+ ═══════════════════════════════════════════════════════════
405
+ Duration: 5.1s | Issues: 2
406
+ • Missing null check: user.profile accessed without guard (user.ts:23)
407
+ • Async issue: Promise not awaited (api.ts:67)
408
+
409
+ ═══════════════════════════════════════════════════════════
410
+ PASS 3: SECURITY [Sonnet] ✓
411
+ ═══════════════════════════════════════════════════════════
412
+ Duration: 4.2s | Triggered by: API file detected
413
+ • No critical vulnerabilities found
414
+
415
+ ═══════════════════════════════════════════════════════════
416
+ PASS 4: INTEGRATION [Sonnet] ⊘ SKIPPED
417
+ ═══════════════════════════════════════════════════════════
418
+ Reason: < 5 files, no API contract changes
419
+
420
+ ═══════════════════════════════════════════════════════════
421
+ SUMMARY
422
+ ═══════════════════════════════════════════════════════════
423
+ Passes: 3/4 executed (1 skipped)
424
+ Total Issues: 4 (0 critical, 1 high, 2 medium, 1 low)
425
+ ```
426
+
427
+ ### Pass Module API
428
+
429
+ The pass modules in `scripts/flow-review-passes/` can be used programmatically:
430
+
431
+ ```javascript
432
+ const { runMultiPassReview } = require('./scripts/flow-review-passes');
433
+
434
+ const results = await runMultiPassReview({
435
+ files: [{ path: 'src/api.ts', content: '...' }],
436
+ config: {
437
+ passes: ['structure', 'logic', 'security', 'integration'],
438
+ earlyExitOnCritical: true,
439
+ passForward: true // Pass results to subsequent passes
440
+ }
441
+ });
442
+ ```
443
+
444
+ ## Options
445
+
446
+ | Flag | Description |
447
+ |------|-------------|
448
+ | `--commits N` | Include last N commits in review scope |
449
+ | `--staged` | Only review staged changes |
450
+ | `--skip-verify` | Skip verification gates, AI review only |
451
+ | `--verify-only` | Only run verification gates, no AI review |
452
+ | `--security-only` | Only run security agent |
453
+ | `--quick` | Faster review with reduced thoroughness |
454
+ | `--multipass` | Use sequential multi-pass mode instead of parallel |
455
+ | `--no-early-exit` | Don't stop on critical issues (multi-pass only) |
456
+ | `--passes=<list>` | Specific passes to run (e.g., `structure,logic`) |
457
+
458
+ ## When No Changes Found
459
+
460
+ If no changes are detected:
461
+ ```
462
+ No changes found to review.
463
+
464
+ To review recent commits: /wogi-review --commits 3
465
+ To review specific files: Please stage them first with git add
466
+ ```
467
+
468
+ ## Phase 3: Post-Review Workflow
469
+
470
+ After AI review completes, execute the fix-and-verify loop:
471
+
472
+ ```
473
+ ┌─────────────────────────────────────────────────────────────┐
474
+ │ POST-REVIEW WORKFLOW │
475
+ ├─────────────────────────────────────────────────────────────┤
476
+ │ 1. TRACK: Convert issues to TodoWrite items │
477
+ │ → Critical/High: Individual todos │
478
+ │ → Medium/Low: Grouped by category │
479
+ │ 2. FIX LOOP: For each issue: │
480
+ │ → Mark todo in_progress │
481
+ │ → Apply fix │
482
+ │ → Run targeted verification (lint/typecheck on file) │
483
+ │ → Mark todo completed │
484
+ │ 3. RE-VERIFY: Run full verification gates again │
485
+ │ → All gates must pass │
486
+ │ → If new issues found, add to todo list │
487
+ │ 4. ARCHIVE: Save review report to .workflow/reviews/ │
488
+ │ 5. SIGN-OFF: User approves review complete │
489
+ └─────────────────────────────────────────────────────────────┘
490
+ ```
491
+
492
+ ### Step 1: Issue Tracking
493
+
494
+ After consolidating review results, convert to TodoWrite items:
495
+
496
+ ```javascript
497
+ // Critical/High issues get individual todos
498
+ { content: "Fix unbounded recursion in cascadeCompletion()", status: "pending" }
499
+ { content: "Fix progress value inconsistency (0-1 vs 0-100)", status: "pending" }
500
+
501
+ // Medium/Low can be grouped
502
+ { content: "Fix 3 DRY violations in file parsing", status: "pending" }
503
+ { content: "Remove 2 unused imports", status: "pending" }
504
+ ```
505
+
506
+ **Priority order for fixes:**
507
+ 1. Critical (blocks functionality or security risk)
508
+ 2. High (significant bugs or vulnerabilities)
509
+ 3. Medium (code quality, maintainability)
510
+ 4. Low (style, minor improvements)
511
+
512
+ ### Step 2: Fix Loop
513
+
514
+ For each issue, follow this cycle:
515
+
516
+ ```
517
+ ┌──────────────────────────────────────┐
518
+ │ Mark todo: in_progress │
519
+ │ ↓ │
520
+ │ Read relevant file(s) │
521
+ │ ↓ │
522
+ │ Apply fix │
523
+ │ ↓ │
524
+ │ Run targeted verification: │
525
+ │ node --check <file> (syntax) │
526
+ │ npx eslint <file> (lint) │
527
+ │ npx tsc --noEmit (types) │
528
+ │ ↓ │
529
+ │ If PASS → Mark todo: completed │
530
+ │ If FAIL → Fix and retry │
531
+ └──────────────────────────────────────┘
532
+ ```
533
+
534
+ **Important**: Don't batch fixes. Complete and verify each fix before moving to the next.
535
+
536
+ ### Step 3: Re-Verification
537
+
538
+ After all issues are fixed, run full verification again:
539
+
540
+ ```bash
541
+ # Run all verification gates
542
+ npm run lint 2>&1 | head -50
543
+ npm run typecheck 2>&1 | head -50
544
+ npm run test 2>&1 | head -50
545
+
546
+ # Syntax check all modified files
547
+ node --check scripts/flow-*.js
548
+ ```
549
+
550
+ If new issues are discovered during re-verification:
551
+ 1. Add them to the todo list
552
+ 2. Continue the fix loop
553
+ 3. Re-verify again
554
+
555
+ ### Step 4: Archive Review Report
556
+
557
+ Save the review report to `.workflow/reviews/`:
558
+
559
+ ```
560
+ .workflow/reviews/
561
+ └── YYYY-MM-DD-HHMMSS-review.md
562
+ ```
563
+
564
+ Report format:
565
+ ```markdown
566
+ # Code Review Report
567
+
568
+ **Date**: YYYY-MM-DD HH:MM
569
+ **Files Reviewed**: N
570
+ **Review Mode**: parallel | multi-pass
571
+
572
+ ## Verification Gates
573
+ - Lint: ✓/✗
574
+ - TypeCheck: ✓/✗
575
+ - Tests: ✓/✗
576
+
577
+ ## Issues Found
578
+ | # | Severity | Issue | File:Line | Status |
579
+ |---|----------|-------|-----------|--------|
580
+ | 1 | Critical | ... | ... | Fixed |
581
+ | 2 | High | ... | ... | Fixed |
582
+
583
+ ## Summary
584
+ - Issues found: N
585
+ - Issues fixed: N
586
+ - Gates passing: Y/Y
587
+ ```
588
+
589
+ ### Step 5: Sign-Off Gate
590
+
591
+ Before completing the review, ask for user approval:
592
+
593
+ ```
594
+ ═══════════════════════════════════════
595
+ REVIEW COMPLETE
596
+ ═══════════════════════════════════════
597
+ Issues Found: 15
598
+ Issues Fixed: 15
599
+ Verification: All gates passing
600
+
601
+ Review report saved to: .workflow/reviews/2026-01-18-143022-review.md
602
+
603
+ Ready to proceed? (User approval required)
604
+ ```
605
+
606
+ The review is not complete until the user confirms. This ensures:
607
+ - User is aware of all changes made
608
+ - User can request additional fixes
609
+ - User can reject fixes that change behavior unexpectedly
610
+
611
+ ## Auto-Fix Suggestions
612
+
613
+ For certain issue types, offer automated fixes:
614
+
615
+ | Issue Type | Auto-Fix Available |
616
+ |------------|-------------------|
617
+ | Unused imports | Yes - remove automatically |
618
+ | Missing try-catch | Yes - wrap in try-catch |
619
+ | Console.log in prod | Yes - remove or convert to logger |
620
+ | Missing null check | Suggest - show options |
621
+ | Logic bugs | No - require manual review |
622
+
623
+ When auto-fix is available:
624
+ ```
625
+ ⚠ Issue: Unused import 'color' in flow-plan.js:21
626
+
627
+ Auto-fix available: Remove unused import
628
+ Apply fix? [Y/n]
629
+ ```
630
+
631
+ ## Integration with Other Commands
632
+
633
+ - After `/wogi-done` - Optionally suggest review
634
+ - After major refactors - Recommend security review
635
+ - Before commits - Can be run as pre-commit check
636
+ - Replaces both `/wogi-session-review` and `/wogi-verify`