Post-execution test review and fix - chain from workflow-lite-execute or standalone. Reviews implementation against plan, runs tests, auto-fixes failures.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Post-execution test review and fix - chain from workflow-lite-execute or standalone. Reviews implementation against plan, runs tests, auto-fixes failures.
Trigger: --in-memory flag or testReviewContext global variable available
Input Source: testReviewContext global variable set by workflow-lite-execute Step 4
Behavior: Skip session discovery, inherit convergenceReviewTool from execution chain, proceed directly to TR-Phase 1.
Note: workflow-lite-execute Step 5 is the chain gate. Mode 1 invocation means execution + code review are complete โ proceed with convergence verification + tests.
Mode 2: Standalone
Trigger: User calls with session path or --last
Behavior: Discover session โ load plan + tasks โ convergenceReviewTool = 'agent' โ proceed to TR-Phase 1.
let sessionPath, plan, taskFiles, convergenceReviewTool
if (testReviewContext) {
// Mode 1: from workflow-lite-execute chain
sessionPath = testReviewContext.session.folder
plan = testReviewContext.planObject
taskFiles = testReviewContext.taskFiles.map(tf =>JSON.parse(Read(tf.path)))
convergenceReviewTool = testReviewContext.convergenceReviewTool || 'agent'
} else {
// Mode 2: standalone โ find last session or use provided path
sessionPath = resolveSessionPath($ARGUMENTS) // Glob('.workflow/.lite-plan/*/plan.json'), take last
plan = JSON.parse(Read(`${sessionPath}/plan.json`))
taskFiles = plan.task_ids.map(id =>JSON.parse(Read(`${sessionPath}/.task/${id}.json`)))
convergenceReviewTool = 'agent'
}
const skipFix = $ARGUMENTS?.includes('--skip-fix') || false
Phase Summary
Phase
Core Action
Output
TR-Phase 1
Detect test framework + gather changes
testConfig, changedFiles
TR-Phase 2
Convergence verification against plan criteria
reviewResults[]
TR-Phase 3
Run tests + generate checklist
test-checklist.json
TR-Phase 4
Auto-fix failures (iterative, max 3 rounds)
Fixed code + updated checklist
TR-Phase 5
Output report + chain to session:sync
test-review.md
TR-Phase 0: Initialize
Set sessionId from sessionPath. Create TodoWrite with 5 phases (Phase 1 = in_progress, rest = pending).
TR-Phase 1: Detect Test Framework & Gather Changes
Test framework detection (check in order, first match wins):
PASS = all convergence.criteria met + no test gaps
PARTIAL = some criteria met OR has test gaps
FAIL = no criteria met
CLI Convergence Review (convergenceReviewTool === 'gemini' or 'codex'):
const reviewId = `${sessionId}-convergence`const taskCriteria = taskFiles.map(t =>`${t.id}: [${(t.convergence?.criteria || []).join(' | ')}]`).join('\n')
Bash(`ccw cli -p "PURPOSE: Convergence verification โ check each task's completion criteria against actual implementation
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)
TASK CRITERIA:
${taskCriteria}
CHANGED FILES: ${changedFiles.join(', ')}
MODE: analysis
CONTEXT: @${sessionPath}/plan.json @${sessionPath}/.task/*.json @**/* | Memory: workflow-lite-execute completed
EXPECTED: Per-task verdict (PASS/PARTIAL/FAIL) with per-criterion evidence + test gap list
CONSTRAINTS: Read-only | Focus strictly on convergence criteria verification, NOT code quality (code review already done in workflow-lite-execute)" --tool ${convergenceReviewTool} --mode analysis --id ${reviewId}`, { run_in_background: true })
// STOP - wait for hook callback, then parse CLI output into reviewResults format