Skip to content

FEA-372: Add post-loop code review and fix skill - #47

Merged
wongk merged 3 commits into
mainfrom
feat/post-loop-code-review
Apr 10, 2026
Merged

wongk merged 3 commits into
mainfrom
feat/post-loop-code-review

Conversation

@wongk

@wongk wongk commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds comprehensive code review as the final step in the run-loop pipeline, replacing the lightweight in-loop code:code-reviewer with the full code-review:start pipeline after implementation completes
  • Creates a new code-review:fix skill that verifies findings, fixes confirmed issues serially, runs build validation, and supports configurable re-review cycles
  • Writes CLOSEDLOOP_START_SHA to config.env so the review can scope its diff to only this run's changes

Implementation plan: PLN-233

Changes

plugins/code/prompts/prompt.md

  • Remove Phase 5 Step 2 (lightweight single-agent code reviewer)
  • Renumber Step 3 → Step 2
  • Rename phase from "Testing and Code Review" to "Testing and Validation"

plugins/code/scripts/run-loop.sh

  • Add run_post_loop_review() function (~130 lines) invoked after both completion-promise and max-iterations exit paths
  • Detects changes via working tree + staged + committed diffs against START_SHA
  • Runs code-review:start --base $START_SHA, reads verdict.json from the session directory
  • If verdict is not approve, invokes code-review:fix with --max-cycles 2
  • Write CLOSEDLOOP_START_SHA to config.env in create_state_file()

plugins/code-review/skills/fix/SKILL.md (new)

  • 6-step pipeline: parse findings → verify with sonnet agents (parallel) → fix serially → build-validator → conditional re-review → summary
  • Only acts on BLOCKING/HIGH severity findings; MEDIUM/LOW are logged
  • Auto-discovers most recent cr-* session directory when not provided
  • Capped at configurable --max-cycles (default 2) to prevent infinite loops

plugins/code-review/commands/fix.md (new)

  • Thin command wrapper for manual /code-review:fix invocation

Version bumps

  • code: 1.6.0 → 1.7.0
  • code-review: 1.4.0 → 1.5.0

Test plan

  • Run run-loop.sh on a project with an intentional bug — verify post-loop review catches it and fix skill addresses it
  • Run on clean code — verify review returns approve and no fix cycle triggers
  • Run /code-review:fix manually on a prior review session directory
  • Verify CLOSEDLOOP_START_SHA is written to config.env
  • Verify Ctrl+C during post-loop review is handled gracefully
  • Verify Phase 5 no longer launches code:code-reviewer

🤖 Generated with Claude Code

Add comprehensive code review as the final step in the run-loop
pipeline, replacing the lightweight in-loop code reviewer with the
full code-review:start pipeline after implementation completes.

- Remove Phase 5 Step 2 (single-agent code reviewer) from prompt.md,
  rename phase to "Testing and Validation"
- Add run_post_loop_review() to run-loop.sh that invokes
  code-review:start after loop completion, reads verdict.json, and
  triggers code-review:fix if issues are found
- Write CLOSEDLOOP_START_SHA to config.env for diff scoping
- Create code-review:fix skill (verify findings with sonnet agents,
  fix serially, run build-validator, re-review up to max-cycles)
- Add thin command wrapper at commands/fix.md for manual invocation
- Bump code plugin to 1.7.0, code-review plugin to 1.5.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code-review/skills/fix/SKILL.md Outdated
Comment thread plugins/code/scripts/run-loop.sh Outdated

@shafty023 shafty023 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finished review

@wongk
wongk requested a review from shafty023 April 10, 2026 14:47
Comment thread plugins/code-review/skills/fix/SKILL.md
Comment thread plugins/code-review/skills/fix/SKILL.md
@wongk
wongk merged commit 391dcff into main Apr 10, 2026
3 checks passed
@wongk
wongk deleted the feat/post-loop-code-review branch April 10, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants