Fix Review
Fix weave review findings — validate, add test coverage, fix, and commit each as atomic changes
Fix Review Findings
Process weave code review findings from the conversation context. Validate each finding independently against the actual codebase and project conventions, add test coverage where applicable, apply fixes as separate atomic commits, and ensure all quality gates pass before each commit.
Multi-pass (multipass, x2, etc.) is not applicable to this command — it is already iterative by nature. Trigger words are ignored if present.
Orchestration Plan
Before executing any fixes, enter plan mode to create a fix strategy from the review findings.
Enter your tool's plan mode:
- Claude Code: Call
EnterPlanMode - Cursor: Use
/planor pressShift+Tab - Codex: Use
/planto switch to Plan mode - Gemini: Use
/planor pressShift+Tab - Other tools: Use your tool's planning/read-only mode if available
If plan mode is not available, proceed — the phase structure still guides the analysis before execution.
Create an orchestration plan covering:
- Findings inventory — List each review finding with its consensus level and severity
- Validity pre-assessment — For each finding, note your initial read: likely valid, likely incorrect, needs investigation
- Fix ordering — Propose the sequence: dependencies first, then highest consensus, then by file proximity (minimize context switches)
- Test strategy per finding — For each likely-valid finding: extend existing test, add new case, or no test needed (and why)
- Risk assessment — Flag findings where the fix could break other code or conflict with other findings
- Expected commit sequence — Predict the atomic commits this session will produce
Present the orchestration plan to the user. Wait for approval before proceeding to Phase 1. The user may adjust priorities, skip findings, or reorder the sequence.
After approval, exit plan mode:
- Claude Code: Call
ExitPlanMode - Cursor/Codex/Gemini: Exit plan mode per your tool's method
Then proceed to Phase 1 with the approved plan as your guide.
Phase 1: Parse and Prioritize Findings
Follow the approved orchestration plan for finding order and priority. If no orchestration plan was created (plan mode unavailable), proceed with the default priority ordering below.
Goal: Extract structured findings from the weave review report in the conversation.
Actions:
-
Locate the review report in the conversation context (output from
/weave:reviewor similar) -
Extract each finding into a numbered list with:
- Consensus level: how many reviewers flagged it (3, 2, or 1)
- Severity: Critical / Important / Suggestion (after consensus promotion)
- Reviewers: which models flagged it (Claude, Gemini, GPT)
- File and line: location in the codebase
- Description: what the issue is
- Recommendation: suggested fix
-
Sort by priority (process in this order):
- Consensus Critical (3 reviewers) first
- Consensus Critical (2 reviewers, promoted)
- Consensus Important (2 reviewers, promoted)
- Single-reviewer Important
- Single-reviewer Suggestions
-
Create a todo list tracking each finding
-
Read CLAUDE.md / AGENTS.md for project conventions that apply to the fixes
Phase 2: Validate Each Finding
Goal: Independently assess whether each finding is valid and actionable.
For EACH finding:
-
Read the relevant code — the exact lines referenced in the finding
-
Check project conventions — read CLAUDE.md/AGENTS.md to verify whether the finding aligns with project standards
-
Review the project's own APIs — read the function signatures, return types, and docstrings to understand the intended contract vs what the reviewers flagged
-
Check existing test coverage — search for tests that already cover this code path
-
Assess validity using these criteria:
- Valid: The finding identifies a real issue that aligns with project conventions
- Already addressed: The issue was already fixed in a later commit
- Incorrect: The reviewer misread the code or the suggestion would introduce a bug
- Out of scope: Valid concern but not related to this branch's changes
- Pre-existing: Valid but existed before this branch (not introduced by our changes)
-
Document the verdict for each finding:
- If valid: note the planned fix AND test coverage strategy
- If invalid: note the specific reason (cite code, tests, or conventions)
-
Present the validation results to the user:
- List each finding with its verdict (compare against orchestration plan predictions)
- For findings where validity differs from the plan, highlight the change
- For valid findings, confirm: the fix + the test approach from the plan
- Wait for user confirmation before proceeding to Phase 3
Phase 3: Apply Fixes (One Commit Per Finding)
Goal: Apply each valid finding as a separate, atomic commit with test coverage.
CRITICAL: Process one finding at a time. Complete the full cycle for each before moving to the next.
For EACH valid finding:
Step 1: Search for Existing Test Coverage
Before writing any code, search for existing tests that can be extended:
- Search for the affected function/module name in the test directory
- Read the test file structure — identify existing parameterized fixtures
- Look for fixtures or helpers that can be extended with a new test case
Priority order for test placement:
- Extend existing parameterized test — add a new entry to an existing fixture list
- Add a case to an existing test function — if the test function already covers the component
- Create a new test function in the existing test file — only if no existing test covers this area
- Create a new test file — only as a last resort
Step 2: Write/Extend Tests
Follow the project's test conventions from AGENTS.md/CLAUDE.md strictly. Common conventions to check for:
- Test structure (classes vs functions, parameterized vs individual)
- Fixture patterns (project-specific fixtures, setup/teardown)
- Assertion style (assert statements, matchers, custom assertions)
- Import conventions
- Mock patterns and documentation requirements
Step 3: Apply the Fix
- Make the minimal change that addresses the finding
- Do not bundle unrelated changes
- Follow project conventions from CLAUDE.md/AGENTS.md
Step 4: Run Quality Gates
Run the project's quality gates as defined in AGENTS.md/CLAUDE.md. All gates must pass before committing.
- If any gate fails, fix the issue before proceeding
- If a test fails due to the change, either:
- Adjust the fix to be correct, OR
- Update the test if the finding changes expected behavior
- ALL gates must pass before committing
Step 5: Commit
Stage only the files changed for this specific finding:
git add <specific-files>
Use the project's commit message format from AGENTS.md/CLAUDE.md. Include a reference to the weave review finding.
Step 6: Verify Clean State
After committing, confirm:
git status
Verify no uncommitted changes remain:
git diff
No uncommitted changes should remain before moving to the next finding.
Phase 4: Summary
After processing all valid findings, present a summary:
- Applied fixes: List each committed fix with its commit hash and consensus level
- Tests added/extended: List test coverage improvements per finding
- Skipped findings: List each invalid/out-of-scope finding with the reason
- Final verification: Run the full quality gate one last time
- Report the final pass/fail status
- Show the commit log for the session:
git log --oneline -<N>
Recovery: Quality Gate Failure
If quality gates fail after applying a fix:
- Identify which gate failed and why
- Fix the issue (adjust the change, not bypass the gate)
- Re-run all gates
- If the fix cannot be made to pass all gates after 2 attempts:
- Revert the change:
git checkout -- <files> - Mark the finding as "valid but could not apply cleanly"
- Move to the next finding
- Report the issue in the Phase 4 summary
- Revert the change:
Rules
- Never skip quality gates
- Never bundle multiple findings into one commit
- Never modify code that isn't related to the finding being addressed
- Always wait for user confirmation after Phase 2 validation
- Always use the project's commit message conventions from AGENTS.md/CLAUDE.md
- Always search for existing tests before creating new test functions
- Always prefer extending existing test fixtures over creating new tests
- If a finding requires changes in multiple files, that is still ONE commit (one logical change)
- Process consensus findings before single-reviewer findings
- If a finding is pre-existing (not from this branch), note it but still fix if the user approved it