Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 66 additions & 6 deletions templates/skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: code-review
description: Use after completing a phase or significant implementation — requires reviewing all changed code for critical issues before sign-off
context: fork
---

# Code Review
Expand All @@ -18,6 +19,24 @@ If you have not read every diff introduced in this phase, you CANNOT mark it com
Violating this rule is a violation — not a shortcut.
</HARD-GATE>

## Two-Stage Review Protocol

Code review runs in two mandatory stages, in order:

### Stage 1: Spec Compliance Review
Verify the implementation matches what was planned:
- Does the code implement every task in the plan's `<done>` criteria?
- Are there changes NOT covered by the plan (scope creep)?
- Do the public interfaces match the plan's specifications?
- Are there missing pieces the plan required but implementation skipped?

**Stage 1 must PASS before proceeding to Stage 2.** Spec non-compliance is a blocker — the code does the wrong thing well.

### Stage 2: Code Quality Review
With spec compliance confirmed, review the implementation quality using the gate function steps below (SCOPE → SECURITY → INTERFACES → ERROR HANDLING → TESTS → QUALITY).

**Both stages must pass for sign-off.**

## The Gate Function

Follow these steps IN ORDER before approving any phase or significant implementation.
Expand Down Expand Up @@ -142,10 +161,51 @@ QUALITY: PASS | ISSUES FOUND (list)
VERDICT: APPROVED | BLOCKED (list blocking issues)
```

## In MAXSIM Plan Execution
## Integration with MAXSIM

### Context Loading

When reviewing within a MAXSIM project, load project context:

```bash
node ~/.claude/maxsim/bin/maxsim-tools.cjs skill-context code-review
```
Comment on lines +168 to +172
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The suggested context-loading command node ~/.claude/maxsim/bin/maxsim-tools.cjs skill-context code-review appears to reference a skill-context subcommand that does not exist in maxsim-tools.cjs (no such command is registered in the CLI). Replace this with a real command sequence (e.g., using state-snapshot, find-phase, and/or roadmap commands) or document this as pseudocode if it’s not meant to be executed.

Copilot uses AI. Check for mistakes.

This returns the current phase, plan path, and artifacts. Use this to:
- Load the current plan for Stage 1 spec compliance checking
- Reference the phase's success criteria from ROADMAP.md
- Check for existing review history in SUMMARY.md files

### Stage 1 Integration

For spec compliance review, load the plan:
1. Read `.planning/phases/{current}/PLAN.md` — this is the spec
2. For each task in the plan, check if the implementation satisfies its `<done>` criteria
3. Flag any implementation that goes beyond or falls short of the plan
4. Produce a Stage 1 verdict: COMPLIANT or NON-COMPLIANT (with list of gaps)

### Stage 2 Integration

For code quality review, use the gate function steps (SCOPE through QUALITY) as defined above.

### STATE.md Hooks

Record review verdicts as decisions:
- After Stage 1: record compliance verdict with any gaps found
- After Stage 2: record quality verdict with any blocking issues
- Review metrics feed into performance tracking (pass rate, common issues)

### Artifact References

- Load plan from `.planning/phases/{current}/PLAN.md` for spec compliance
- Review summary included in `.planning/phases/{current}/SUMMARY.md`
- Blocking issues that require architectural decisions get recorded as STATE.md blockers
- Medium issues filed as `.planning/todos/` entries for follow-up
Comment on lines +181 to +203
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The file paths in Stage 1 / Artifact References don’t match the repo’s established planning layout. Phase plans are written as .planning/phases/XX-name/{phase}-{plan}-PLAN.md (or *-PLAN.md), and summaries as {phase}-{plan}-SUMMARY.md, not .planning/phases/{current}/PLAN.md and SUMMARY.md. Update these references so reviewers can locate the correct plan/summary files reliably.

Copilot uses AI. Check for mistakes.

### Push-Back Protocol

Code review applies at phase boundaries:
- After all tasks in a phase are complete, run this review before marking the phase done
- Blocking issues must be resolved before phase completion
- Medium issues should be captured as todos for the next phase
- The review summary should be included in the phase SUMMARY.md
When reviewing code written by another agent:
- If the code has issues, provide specific, actionable feedback with file paths and line numbers
- If the agent pushes back on your finding, re-evaluate — but do NOT accept incorrect rationalizations
- Refer to the "Common Rationalizations" table above for known invalid excuses
- If 3+ back-and-forth cycles on the same issue, escalate to the user as a blocker