claude-code-workflow 7.2.11 → 7.2.13

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 (30) hide show
  1. package/.claude/agents/workflow-research-agent.md +112 -0
  2. package/.claude/commands/workflow/analyze-with-file.md +185 -60
  3. package/.claude/commands/workflow-tune.md +811 -0
  4. package/.claude/skills/workflow-lite-execute/SKILL.md +106 -14
  5. package/.claude/skills/workflow-lite-plan/SKILL.md +34 -72
  6. package/.claude/skills/workflow-lite-test-review/SKILL.md +39 -26
  7. package/package.json +1 -1
  8. package/.claude/commands/ddd/auto.md +0 -359
  9. package/.claude/commands/ddd/doc-generate.md +0 -222
  10. package/.claude/commands/ddd/doc-refresh.md +0 -218
  11. package/.claude/commands/ddd/execute.md +0 -416
  12. package/.claude/commands/ddd/index-build.md +0 -212
  13. package/.claude/commands/ddd/plan.md +0 -611
  14. package/.claude/commands/ddd/scan.md +0 -365
  15. package/.claude/commands/ddd/sync.md +0 -353
  16. package/.claude/commands/ddd/update.md +0 -160
  17. package/.claude/commands/idaw/add.md +0 -287
  18. package/.claude/commands/idaw/resume.md +0 -442
  19. package/.claude/commands/idaw/run-coordinate.md +0 -648
  20. package/.claude/commands/idaw/run.md +0 -539
  21. package/.claude/commands/idaw/status.md +0 -182
  22. package/.claude/skills/workflow-tune/SKILL.md +0 -487
  23. package/.claude/skills/workflow-tune/phases/01-setup.md +0 -548
  24. package/.claude/skills/workflow-tune/phases/02-step-execute.md +0 -197
  25. package/.claude/skills/workflow-tune/phases/03-step-analyze.md +0 -386
  26. package/.claude/skills/workflow-tune/phases/04-synthesize.md +0 -257
  27. package/.claude/skills/workflow-tune/phases/05-optimize-report.md +0 -246
  28. package/.claude/skills/workflow-tune/specs/workflow-eval-criteria.md +0 -57
  29. package/.claude/skills/workflow-tune/templates/step-analysis-prompt.md +0 -88
  30. package/.claude/skills/workflow-tune/templates/synthesis-prompt.md +0 -90
@@ -74,7 +74,7 @@ function selectExecutionOptions() {
74
74
  const autoYes = workflowPreferences?.autoYes ?? false
75
75
 
76
76
  if (autoYes) {
77
- return { execution_method: "Auto", code_review_tool: "Skip" }
77
+ return { execution_method: "Auto", code_review_tool: "Skip", convergence_review_tool: "Skip" }
78
78
  }
79
79
 
80
80
  return AskUserQuestion({
@@ -90,14 +90,25 @@ function selectExecutionOptions() {
90
90
  ]
91
91
  },
92
92
  {
93
- question: "Review tool for test-review phase?",
94
- header: "Review Tool (passed to lite-test-review)",
93
+ question: "Code review after execution? (runs here in lite-execute)",
94
+ header: "Code Review",
95
95
  multiSelect: false,
96
96
  options: [
97
- { label: "Agent Review", description: "Agent review in test-review (default)" },
98
- { label: "Gemini Review", description: "Gemini CLI in test-review" },
99
- { label: "Codex Review", description: "Codex CLI in test-review" },
100
- { label: "Skip", description: "Skip review in test-review" }
97
+ { label: "Gemini Review", description: "Gemini CLI: git diff quality review" },
98
+ { label: "Codex Review", description: "Codex CLI: git-aware code review (--mode review)" },
99
+ { label: "Agent Review", description: "@code-reviewer agent" },
100
+ { label: "Skip", description: "No code review" }
101
+ ]
102
+ },
103
+ {
104
+ question: "Convergence review in test-review phase?",
105
+ header: "Convergence Review",
106
+ multiSelect: false,
107
+ options: [
108
+ { label: "Agent", description: "Agent: verify convergence criteria" },
109
+ { label: "Gemini", description: "Gemini CLI: convergence verification" },
110
+ { label: "Codex", description: "Codex CLI: convergence verification" },
111
+ { label: "Skip", description: "Skip convergence review, run tests only" }
101
112
  ]
102
113
  }
103
114
  ]
@@ -117,7 +128,8 @@ if (executionContext) {
117
128
  console.log(`
118
129
  Execution Strategy (from lite-plan):
119
130
  Method: ${executionContext.executionMethod}
120
- Review: ${executionContext.codeReviewTool}
131
+ Code Review: ${executionContext.codeReviewTool}
132
+ Convergence Review: ${executionContext.convergenceReviewTool}
121
133
  Tasks: ${getTasks(executionContext.planObject).length}
122
134
  Complexity: ${executionContext.planObject.complexity}
123
135
  ${executionContext.executorAssignments ? ` Assignments: ${JSON.stringify(executionContext.executorAssignments)}` : ''}
@@ -367,18 +379,97 @@ ${(t.test?.success_metrics || []).length > 0 ? `**Success metrics**: ${t.test.su
367
379
  }
368
380
  ```
369
381
 
370
- ### Step 4: Chain to Test Review & Post-Completion
382
+ ### Step 4: Code Review
371
383
 
372
- > **Note**: Spec sync (session:sync) is handled by lite-test-review's TR-Phase 5, not here. This avoids duplicate sync and ensures test fix changes are also captured.
384
+ **Skip if**: `codeReviewTool === 'Skip'`
373
385
 
374
- **Map review tool**: Convert lite-execute's `codeReviewTool` to test-review tool name.
386
+ **Resolve review tool**: From `executionContext.codeReviewTool` (Mode 1) or `userSelection.code_review_tool` (Mode 2/3).
375
387
 
376
388
  ```javascript
377
- function mapReviewTool(codeReviewTool) {
389
+ const codeReviewTool = executionContext?.codeReviewTool || userSelection?.code_review_tool || 'Skip'
390
+ const resolvedTool = (() => {
378
391
  if (!codeReviewTool || codeReviewTool === 'Skip') return 'skip'
379
392
  if (/gemini/i.test(codeReviewTool)) return 'gemini'
380
393
  if (/codex/i.test(codeReviewTool)) return 'codex'
381
394
  return 'agent'
395
+ })()
396
+
397
+ if (resolvedTool === 'skip') {
398
+ console.log('[Code Review] Skipped')
399
+ } else {
400
+ // proceed with review
401
+ }
402
+ ```
403
+
404
+ **Agent Code Review** (resolvedTool === 'agent'):
405
+
406
+ ```javascript
407
+ Agent({
408
+ subagent_type: "code-reviewer",
409
+ run_in_background: false,
410
+ description: `Code review: ${planObject.summary}`,
411
+ prompt: `## Code Review — Post-Execution Quality Check
412
+
413
+ **Goal**: ${originalUserInput}
414
+ **Plan Summary**: ${planObject.summary}
415
+
416
+ ### Changed Files
417
+ Run \`git diff --name-only HEAD~${getTasks(planObject).length}..HEAD\` to identify changes.
418
+
419
+ ### Review Focus
420
+ 1. **Code quality**: Readability, naming, structure, dead code
421
+ 2. **Correctness**: Logic errors, off-by-one, null handling, edge cases
422
+ 3. **Patterns**: Consistency with existing codebase conventions
423
+ 4. **Security**: Injection, XSS, auth bypass, secrets exposure
424
+ 5. **Performance**: Unnecessary loops, N+1 queries, missing indexes
425
+
426
+ ### Instructions
427
+ 1. Run git diff to see actual changes
428
+ 2. Read changed files for full context
429
+ 3. For each issue found: severity (Critical/High/Medium/Low) + file:line + description + fix suggestion
430
+ 4. Return structured review: issues[], summary, overall verdict (PASS/WARN/FAIL)`
431
+ })
432
+ ```
433
+
434
+ **CLI Code Review — Codex** (resolvedTool === 'codex'):
435
+
436
+ ```javascript
437
+ const reviewId = `${sessionId}-code-review`
438
+ Bash(`ccw cli -p "Review code changes for quality, correctness, security, and pattern compliance. Focus: ${planObject.summary}" --tool codex --mode review --id ${reviewId}`, { run_in_background: true })
439
+ // STOP - wait for hook callback
440
+ ```
441
+
442
+ **CLI Code Review — Gemini** (resolvedTool === 'gemini'):
443
+
444
+ ```javascript
445
+ const reviewId = `${sessionId}-code-review`
446
+ Bash(`ccw cli -p "PURPOSE: Post-execution code quality review for: ${planObject.summary}
447
+ TASK: • Run git diff to identify all changes • Review each changed file for quality, correctness, security • Check pattern compliance with existing codebase • Identify potential bugs, edge cases, performance issues
448
+ MODE: analysis
449
+ CONTEXT: @**/* | Memory: lite-execute completed, reviewing code quality
450
+ EXPECTED: Per-file review with severity levels (Critical/High/Medium/Low), file:line references, fix suggestions, overall verdict
451
+ CONSTRAINTS: Read-only | Focus on code quality not convergence" --tool gemini --mode analysis --rule analysis-review-code-quality --id ${reviewId}`, { run_in_background: true })
452
+ // STOP - wait for hook callback
453
+ ```
454
+
455
+ **Write review artifact** (if session folder exists):
456
+ ```javascript
457
+ if (executionContext?.session?.folder) {
458
+ Write(`${executionContext.session.folder}/code-review.md`, codeReviewOutput)
459
+ }
460
+ ```
461
+
462
+ ### Step 5: Chain to Test Review & Post-Completion
463
+
464
+ **Resolve convergence review tool**: From `executionContext.convergenceReviewTool` (Mode 1) or `userSelection.convergence_review_tool` (Mode 2/3).
465
+
466
+ ```javascript
467
+ function resolveConvergenceTool(ctx, selection) {
468
+ const raw = ctx?.convergenceReviewTool || selection?.convergence_review_tool || 'skip'
469
+ if (!raw || raw === 'Skip') return 'skip'
470
+ if (/gemini/i.test(raw)) return 'gemini'
471
+ if (/codex/i.test(raw)) return 'codex'
472
+ return 'agent'
382
473
  }
383
474
  ```
384
475
 
@@ -389,7 +480,7 @@ testReviewContext = {
389
480
  planObject: planObject,
390
481
  taskFiles: executionContext?.taskFiles
391
482
  || getTasks(planObject).map(t => ({ id: t.id, path: `${executionContext?.session?.folder}/.task/${t.id}.json` })),
392
- reviewTool: mapReviewTool(executionContext?.codeReviewTool),
483
+ convergenceReviewTool: resolveConvergenceTool(executionContext, userSelection),
393
484
  executionResults: previousExecutionResults,
394
485
  originalUserInput: originalUserInput,
395
486
  session: executionContext?.session || {
@@ -442,7 +533,8 @@ Skill("lite-test-review")
442
533
  explorationManifest: {...} | null,
443
534
  clarificationContext: {...} | null,
444
535
  executionMethod: "Agent" | "Codex" | "Auto",
445
- codeReviewTool: "Skip" | "Gemini Review" | "Agent Review" | string,
536
+ codeReviewTool: "Skip" | "Gemini Review" | "Codex Review" | "Agent Review",
537
+ convergenceReviewTool: "Skip" | "Agent" | "Gemini" | "Codex",
446
538
  originalUserInput: string,
447
539
  executorAssignments: { // per-task override, priority over executionMethod
448
540
  [taskId]: { executor: "gemini" | "codex" | "agent", reason: string }
@@ -40,7 +40,7 @@ Produces exploration results, a structured plan (plan.json), independent task fi
40
40
 
41
41
  **Output Directory**: `.workflow/.lite-plan/{task-slug}-{YYYY-MM-DD}/`
42
42
 
43
- **Agent Usage**: Low Direct Claude planning (no agent) | Medium/High → `cli-lite-planning-agent`
43
+ **Agent Usage**: All complexities → `cli-lite-planning-agent`
44
44
 
45
45
  **Schema Reference**: `~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json`
46
46
 
@@ -51,7 +51,7 @@ Produces exploration results, a structured plan (plan.json), independent task fi
51
51
  | LP-0 | Initialize workflowPreferences | autoYes, forceExplore |
52
52
  | LP-1 | Complexity assessment → parallel cli-explore-agents (1-4) | exploration-*.json + manifest |
53
53
  | LP-2 | Aggregate + dedup clarification_needs → multi-round AskUserQuestion | clarificationContext (in-memory) |
54
- | LP-3 | Low: Direct Claude planning / Medium+High: cli-lite-planning-agent | plan.json + .task/TASK-*.json |
54
+ | LP-3 | cli-lite-planning-agent | plan.json + .task/TASK-*.json |
55
55
  | LP-4 | Display plan → AskUserQuestion (Confirm + Execution + Review) | userSelection |
56
56
  | LP-5 | Build executionContext → Skill("lite-execute") | handoff (Mode 1) |
57
57
 
@@ -85,7 +85,7 @@ bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${
85
85
  TodoWrite({ todos: [
86
86
  { content: `LP-Phase 1: Exploration [${complexity}] ${selectedAngles.length} angles`, status: "in_progress", activeForm: `Exploring: ${selectedAngles.join(', ')}` },
87
87
  { content: "LP-Phase 2: Clarification", status: "pending" },
88
- { content: `LP-Phase 3: Planning [${planningStrategy}]`, status: "pending" },
88
+ { content: "LP-Phase 3: Planning [cli-lite-planning-agent]", status: "pending" },
89
89
  { content: "LP-Phase 4: Confirmation", status: "pending" },
90
90
  { content: "LP-Phase 5: Execution", status: "pending" }
91
91
  ]})
@@ -154,12 +154,7 @@ function selectAngles(taskDescription, count) {
154
154
 
155
155
  const selectedAngles = selectAngles(task_description, complexity === 'High' ? 4 : (complexity === 'Medium' ? 3 : 1))
156
156
 
157
- // Direct Claude planning ONLY for: Low + no prior analysis + single angle
158
- const planningStrategy = (
159
- complexity === 'Low' && !hasPriorAnalysis && selectedAngles.length <= 1
160
- ) ? 'Direct Claude Planning' : 'cli-lite-planning-agent'
161
-
162
- console.log(`Exploration Plan: ${complexity} | ${selectedAngles.join(', ')} | ${planningStrategy}`)
157
+ console.log(`Exploration Plan: ${complexity} | ${selectedAngles.join(', ')} | cli-lite-planning-agent`)
163
158
  ```
164
159
 
165
160
  **Launch Parallel Explorations**:
@@ -328,56 +323,7 @@ taskFiles.forEach(taskPath => {
328
323
  })
329
324
  ```
330
325
 
331
- **Low Complexity** — Direct planning by Claude:
332
- ```javascript
333
- const schema = Bash(`cat ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json`)
334
-
335
- const manifest = file_exists(`${sessionFolder}/explorations-manifest.json`)
336
- ? JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
337
- : { explorations: [] }
338
- manifest.explorations.forEach(exp => {
339
- console.log(`\n### Exploration: ${exp.angle}\n${Read(exp.path)}`)
340
- })
341
-
342
- // When handoffSpec exists, use it as primary planning input
343
- // implementation_scope[].acceptance_criteria -> convergence.criteria
344
- // implementation_scope[].target_files -> files[]
345
- // implementation_scope[].objective -> task title/description
346
- if (handoffSpec) {
347
- console.log(`\n### Handoff Spec from ${handoffSpec.source}`)
348
- console.log(`Scope items: ${handoffSpec.implementation_scope.length}`)
349
- handoffSpec.implementation_scope.forEach((item, i) => {
350
- console.log(` ${i+1}. ${item.objective} [${item.priority}] — Done when: ${item.acceptance_criteria.join('; ')}`)
351
- })
352
- }
353
-
354
- // Generate tasks — MUST incorporate exploration insights OR handoff spec
355
- // When handoffSpec: map implementation_scope[] → tasks[] (1:1 or group by context)
356
- // Field names: convergence.criteria (not acceptance), files[].change (not modification_points), test (not verification)
357
- const tasks = [
358
- {
359
- id: "TASK-001", title: "...", description: "...", depends_on: [],
360
- convergence: { criteria: ["..."] }, // From handoffSpec: item.acceptance_criteria
361
- files: [{ path: "...", change: "..." }], // From handoffSpec: item.target_files + item.change_summary
362
- implementation: ["..."], test: "..."
363
- }
364
- ]
365
-
366
- const taskDir = `${sessionFolder}/.task`
367
- Bash(`mkdir -p "${taskDir}"`)
368
- tasks.forEach(task => Write(`${taskDir}/${task.id}.json`, JSON.stringify(task, null, 2)))
369
-
370
- const plan = {
371
- summary: "...", approach: "...",
372
- task_ids: tasks.map(t => t.id), task_count: tasks.length,
373
- complexity: "Low", estimated_time: "...", recommended_execution: "Agent",
374
- _metadata: { timestamp: getUtc8ISOString(), source: "direct-planning", planning_mode: "direct", plan_type: "feature" }
375
- }
376
- Write(`${sessionFolder}/plan.json`, JSON.stringify(plan, null, 2))
377
- // MUST continue to LP-Phase 4 — DO NOT execute code here
378
- ```
379
-
380
- **Medium/High Complexity** — Invoke cli-lite-planning-agent:
326
+ **Invoke cli-lite-planning-agent**:
381
327
 
382
328
  ```javascript
383
329
  Task(
@@ -492,8 +438,8 @@ ${tasks.map((t, i) => `${i+1}. ${t.title} (${t.scope || t.files?.[0]?.path || ''
492
438
  let userSelection
493
439
 
494
440
  if (workflowPreferences.autoYes) {
495
- console.log(`[Auto] Allow & Execute | Auto | Skip`)
496
- userSelection = { confirmation: "Allow", execution_method: "Auto", code_review_tool: "Skip" }
441
+ console.log(`[Auto] Allow & Execute | Auto | Skip + Skip`)
442
+ userSelection = { confirmation: "Allow", execution_method: "Auto", code_review_tool: "Skip", convergence_review_tool: "Skip" }
497
443
  } else {
498
444
  // "Other" in Execution allows specifying CLI tools from ~/.claude/cli-tools.json
499
445
  userSelection = AskUserQuestion({
@@ -519,14 +465,25 @@ if (workflowPreferences.autoYes) {
519
465
  ]
520
466
  },
521
467
  {
522
- question: "Code review after execution?",
523
- header: "Review",
468
+ question: "Code review after execution? (runs in lite-execute)",
469
+ header: "Code Review",
524
470
  multiSelect: false,
525
471
  options: [
526
- { label: "Gemini Review", description: "Gemini CLI review" },
527
- { label: "Codex Review", description: "Git-aware review (prompt OR --uncommitted)" },
472
+ { label: "Gemini Review", description: "Gemini CLI: git diff quality review" },
473
+ { label: "Codex Review", description: "Codex CLI: git-aware code review (--mode review)" },
528
474
  { label: "Agent Review", description: "@code-reviewer agent" },
529
- { label: "Skip", description: "No review" }
475
+ { label: "Skip", description: "No code review" }
476
+ ]
477
+ },
478
+ {
479
+ question: "Convergence review in test-review phase?",
480
+ header: "Convergence Review",
481
+ multiSelect: false,
482
+ options: [
483
+ { label: "Agent", description: "Agent: verify convergence criteria against implementation" },
484
+ { label: "Gemini", description: "Gemini CLI: convergence verification" },
485
+ { label: "Codex", description: "Codex CLI: convergence verification" },
486
+ { label: "Skip", description: "Skip convergence review, run tests only" }
530
487
  ]
531
488
  }
532
489
  ]
@@ -534,7 +491,7 @@ if (workflowPreferences.autoYes) {
534
491
  }
535
492
  ```
536
493
 
537
- // TodoWrite: Phase 4 → completed `[${userSelection.execution_method} + ${userSelection.code_review_tool}]`, Phase 5 → in_progress
494
+ // TodoWrite: Phase 4 → completed `[${userSelection.execution_method} | CR:${userSelection.code_review_tool} | CVR:${userSelection.convergence_review_tool}]`, Phase 5 → in_progress
538
495
 
539
496
  ## 10. LP-Phase 5: Handoff to Execution
540
497
 
@@ -561,6 +518,7 @@ executionContext = {
561
518
  clarificationContext: clarificationContext || null,
562
519
  executionMethod: userSelection.execution_method,
563
520
  codeReviewTool: userSelection.code_review_tool,
521
+ convergenceReviewTool: userSelection.convergence_review_tool,
564
522
  originalUserInput: task_description,
565
523
  executorAssignments: executorAssignments, // { taskId: { executor, reason } } — overrides executionMethod
566
524
  session: {
@@ -588,7 +546,7 @@ TodoWrite({ todos: [
588
546
  { content: "LP-Phase 1: Exploration", status: "completed" },
589
547
  { content: "LP-Phase 2: Clarification", status: "completed" },
590
548
  { content: "LP-Phase 3: Planning", status: "completed" },
591
- { content: `LP-Phase 4: Confirmed [${userSelection.execution_method}]`, status: "completed" },
549
+ { content: `LP-Phase 4: Confirmed [${userSelection.execution_method} | CR:${userSelection.code_review_tool} | CVR:${userSelection.convergence_review_tool}]`, status: "completed" },
592
550
  { content: `LP-Phase 5: Handoff → lite-execute`, status: "completed" },
593
551
  { content: `LE-Phase 1: Task Loading [${taskCount} tasks]`, status: "in_progress", activeForm: "Loading tasks" }
594
552
  ]})
@@ -605,6 +563,7 @@ Skill("lite-execute")
605
563
  ├── explorations-manifest.json # Exploration index
606
564
  ├── planning-context.md # Evidence paths + understanding
607
565
  ├── plan.json # Plan overview (task_ids[])
566
+ ├── code-review.md # Generated by lite-execute Step 4
608
567
  ├── test-checklist.json # Generated by lite-test-review
609
568
  ├── test-review.md # Generated by lite-test-review
610
569
  └── .task/
@@ -618,9 +577,12 @@ Skill("lite-execute")
618
577
  ```
619
578
  lite-plan (LP-Phase 1-5)
620
579
  └─ Skill("lite-execute") ← executionContext (global)
621
- ├─ Step 1-4: Execute + Review
580
+ ├─ Step 1-3: Task Execution
581
+ ├─ Step 4: Code Review (quality/correctness/security)
622
582
  └─ Step 5: Skill("lite-test-review") ← testReviewContext (global)
623
- ├─ TR-Phase 1-4: Test + Fix
583
+ ├─ TR-Phase 1: Detect test framework
584
+ ├─ TR-Phase 2: Convergence verification (plan criteria)
585
+ ├─ TR-Phase 3-4: Run tests + Auto-fix
624
586
  └─ TR-Phase 5: Report + Sync specs
625
587
  ```
626
588
 
@@ -629,7 +591,7 @@ lite-plan (LP-Phase 1-5)
629
591
  | Error | Resolution |
630
592
  |-------|------------|
631
593
  | Exploration agent failure | Skip exploration, continue with task description only |
632
- | Planning agent failure | Fallback to direct planning by Claude |
594
+ | Planning agent failure | Retry with reduced complexity or suggest breaking task |
633
595
  | Clarification timeout | Use exploration findings as-is |
634
596
  | Confirmation timeout | Save context, display resume instructions |
635
597
  | Modify loop > 3 times | Suggest breaking task or using /workflow-plan |
@@ -649,7 +611,7 @@ Auto mode authorizes the complete plan-and-execute workflow with a single confir
649
611
  - [ ] Parallel exploration agents launched with run_in_background=false
650
612
  - [ ] Explorations manifest built from auto-discovered files
651
613
  - [ ] Clarification needs aggregated, deduped, and presented in batches of 4
652
- - [ ] Plan generated via direct Claude (Low) or cli-lite-planning-agent (Medium/High)
614
+ - [ ] Plan generated via cli-lite-planning-agent
653
615
  - [ ] Plan output as two-layer: plan.json (task_ids[]) + .task/TASK-*.json
654
616
  - [ ] User confirmation collected (or auto-approved in auto mode)
655
617
  - [ ] executionContext fully built with all artifacts and session references
@@ -31,31 +31,31 @@ Test review and fix engine for lite-execute chain or standalone invocation.
31
31
 
32
32
  **Input Source**: `testReviewContext` global variable set by lite-execute Step 4
33
33
 
34
- **Behavior**: Skip session discovery, inherit reviewTool from execution chain, proceed directly to TR-Phase 1.
34
+ **Behavior**: Skip session discovery, inherit convergenceReviewTool from execution chain, proceed directly to TR-Phase 1.
35
35
 
36
- > **Note**: lite-execute Step 4 is the chain gate. Mode 1 invocation means execution is complete — proceed with test review.
36
+ > **Note**: lite-execute Step 5 is the chain gate. Mode 1 invocation means execution + code review are complete — proceed with convergence verification + tests.
37
37
 
38
38
  ### Mode 2: Standalone
39
39
 
40
40
  **Trigger**: User calls with session path or `--last`
41
41
 
42
- **Behavior**: Discover session → load plan + tasks → `reviewTool = 'agent'` → proceed to TR-Phase 1.
42
+ **Behavior**: Discover session → load plan + tasks → `convergenceReviewTool = 'agent'` → proceed to TR-Phase 1.
43
43
 
44
44
  ```javascript
45
- let sessionPath, plan, taskFiles, reviewTool
45
+ let sessionPath, plan, taskFiles, convergenceReviewTool
46
46
 
47
47
  if (testReviewContext) {
48
48
  // Mode 1: from lite-execute chain
49
49
  sessionPath = testReviewContext.session.folder
50
50
  plan = testReviewContext.planObject
51
51
  taskFiles = testReviewContext.taskFiles.map(tf => JSON.parse(Read(tf.path)))
52
- reviewTool = testReviewContext.reviewTool || 'agent'
52
+ convergenceReviewTool = testReviewContext.convergenceReviewTool || 'agent'
53
53
  } else {
54
54
  // Mode 2: standalone — find last session or use provided path
55
55
  sessionPath = resolveSessionPath($ARGUMENTS) // Glob('.workflow/.lite-plan/*/plan.json'), take last
56
56
  plan = JSON.parse(Read(`${sessionPath}/plan.json`))
57
57
  taskFiles = plan.task_ids.map(id => JSON.parse(Read(`${sessionPath}/.task/${id}.json`)))
58
- reviewTool = 'agent'
58
+ convergenceReviewTool = 'agent'
59
59
  }
60
60
 
61
61
  const skipFix = $ARGUMENTS?.includes('--skip-fix') || false
@@ -66,7 +66,7 @@ const skipFix = $ARGUMENTS?.includes('--skip-fix') || false
66
66
  | Phase | Core Action | Output |
67
67
  |-------|-------------|--------|
68
68
  | TR-Phase 1 | Detect test framework + gather changes | testConfig, changedFiles |
69
- | TR-Phase 2 | Review implementation against convergence criteria | reviewResults[] |
69
+ | TR-Phase 2 | Convergence verification against plan criteria | reviewResults[] |
70
70
  | TR-Phase 3 | Run tests + generate checklist | test-checklist.json |
71
71
  | TR-Phase 4 | Auto-fix failures (iterative, max 3 rounds) | Fixed code + updated checklist |
72
72
  | TR-Phase 5 | Output report + chain to session:sync | test-review.md |
@@ -93,32 +93,45 @@ Output: `testConfig = { command, framework, type }` + `changedFiles[]`
93
93
 
94
94
  // TodoWrite: Phase 1 → completed, Phase 2 → in_progress
95
95
 
96
- ## TR-Phase 2: Review Implementation Against Plan
96
+ ## TR-Phase 2: Convergence Verification
97
97
 
98
- **Skip if**: `reviewTool === 'skip'` — set all tasks to PASS, proceed to Phase 3.
98
+ **Skip if**: `convergenceReviewTool === 'skip'` — set all tasks to PASS, proceed to Phase 3.
99
99
 
100
- For each task, verify convergence criteria and identify test gaps.
100
+ Verify each task's convergence criteria are met in the implementation and identify test gaps.
101
101
 
102
- **Agent Review** (reviewTool === 'agent', default):
102
+ **Agent Convergence Review** (convergenceReviewTool === 'agent', default):
103
103
 
104
104
  For each task in taskFiles:
105
- 1. Extract `convergence.criteria[]` and `test` requirements
106
- 2. Find changed files matching `task.files[].path` against `changedFiles`
107
- 3. Read matched files, evaluate each criterion against implementation
108
- 4. Check test coverage: if `task.test.unit` exists but no test files in changedFiles → mark as test gap
109
- 5. Same for `task.test.integration`
110
- 6. Build `reviewResult = { taskId, title, criteria_met[], criteria_unmet[], test_gaps[], files_reviewed[] }`
105
+ 1. Extract `convergence.criteria[]` from the task
106
+ 2. Match `task.files[].path` against `changedFiles` to find actually-changed files
107
+ 3. Read each matched file, verify each convergence criterion with file:line evidence
108
+ 4. Check test coverage gaps:
109
+ - If `task.test.unit` defined but no matching test files in changedFiles → mark as test gap
110
+ - If `task.test.integration` defined but no integration test in changedFiles mark as test gap
111
+ 5. Build `reviewResult = { taskId, title, criteria_met[], criteria_unmet[], test_gaps[], files_reviewed[] }`
111
112
 
112
- **CLI Review** (reviewTool === 'gemini' or 'codex'):
113
+ **Verdict logic**:
114
+ - PASS = all `convergence.criteria` met + no test gaps
115
+ - PARTIAL = some criteria met OR has test gaps
116
+ - FAIL = no criteria met
117
+
118
+ **CLI Convergence Review** (convergenceReviewTool === 'gemini' or 'codex'):
113
119
 
114
120
  ```javascript
115
- const reviewId = `${sessionId}-tr-review`
116
- Bash(`ccw cli -p "PURPOSE: Post-execution test review — verify convergence criteria met and identify test gaps
117
- TASK: Read plan.json and .task/*.json convergence criteria • For each criterion, check implementation in changed files • Identify missing unit/integration tests • List unmet criteria with file:line evidence
121
+ const reviewId = `${sessionId}-convergence`
122
+ const taskCriteria = taskFiles.map(t => `${t.id}: [${(t.convergence?.criteria || []).join(' | ')}]`).join('\n')
123
+ Bash(`ccw cli -p "PURPOSE: Convergence verification check each task's completion criteria against actual implementation
124
+ TASK: • For each task below, verify every convergence criterion is satisfied in the changed files • Mark each criterion as MET (with file:line evidence) or UNMET (with what's missing) • Identify test coverage gaps (planned tests not found in changes)
125
+
126
+ TASK CRITERIA:
127
+ ${taskCriteria}
128
+
129
+ CHANGED FILES: ${changedFiles.join(', ')}
130
+
118
131
  MODE: analysis
119
- CONTEXT: @${sessionPath}/plan.json @${sessionPath}/.task/*.json @**/* | Memory: lite-execute completed, reviewing convergence
120
- EXPECTED: Per-task verdict table (PASS/PARTIAL/FAIL) + unmet criteria list + test gap list
121
- CONSTRAINTS: Read-only | Focus on convergence verification" --tool ${reviewTool} --mode analysis --id ${reviewId}`, { run_in_background: true })
132
+ CONTEXT: @${sessionPath}/plan.json @${sessionPath}/.task/*.json @**/* | Memory: lite-execute completed
133
+ EXPECTED: Per-task verdict (PASS/PARTIAL/FAIL) with per-criterion evidence + test gap list
134
+ CONSTRAINTS: Read-only | Focus strictly on convergence criteria verification, NOT code quality (code review already done in lite-execute)" --tool ${convergenceReviewTool} --mode analysis --id ${reviewId}`, { run_in_background: true })
122
135
  // STOP - wait for hook callback, then parse CLI output into reviewResults format
123
136
  ```
124
137
 
@@ -207,13 +220,13 @@ Skill({ skill: "workflow:session:sync", args: `-y "Test review: ${testChecklist.
207
220
 
208
221
  ## Data Structures
209
222
 
210
- ### testReviewContext (Input - Mode 1, set by lite-execute)
223
+ ### testReviewContext (Input - Mode 1, set by lite-execute Step 5)
211
224
 
212
225
  ```javascript
213
226
  {
214
227
  planObject: { /* same as executionContext.planObject */ },
215
228
  taskFiles: [{ id: string, path: string }],
216
- reviewTool: "skip" | "agent" | "gemini" | "codex",
229
+ convergenceReviewTool: "skip" | "agent" | "gemini" | "codex",
217
230
  executionResults: [...],
218
231
  originalUserInput: string,
219
232
  session: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-workflow",
3
- "version": "7.2.11",
3
+ "version": "7.2.13",
4
4
  "description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
5
5
  "type": "module",
6
6
  "main": "ccw/dist/index.js",