Code Review
"Read with intent. Question with purpose. Document with care."
Systematic code analysis with evidence collection. Code review IS an adventure — the codebase is the dungeon, findings are clues.
Review Process
READ → NOTE ISSUES → CLASSIFY → REPORT
Step 1: Setup
- Create REVIEW.yml
- Identify files to review
- Define focus areas
Step 2: Overview
- List all changed files
- Read PR/commit description
- Note initial impressions
Step 3: Deep Review
For each file:
- Read the code
- Check against criteria
- Note findings
- Run relevant checks
Step 4: Verification
- Run tests
- Run linters
- Check regressions
Step 5: Synthesize
- Compile findings
- Prioritize issues
- Generate REVIEW.md
- State recommendation
Finding Severity
| Level |
Symbol |
Meaning |
Action |
| Blocking |
🚫 |
Must fix before merge |
Request changes |
| Important |
⚠️ |
Should fix or explain |
Request changes |
| Minor |
💡 |
Nice to fix |
Comment only |
| Praise |
🎉 |
Good work! |
Celebrate |
Finding Types
- Security — Injection, auth, sensitive data
- Correctness — Logic errors, edge cases
- Performance — N+1 queries, memory leaks
- Maintainability — Clarity, DRY, naming
- Style — Formatting, conventions
Review Checklist
Security
- Input validation
- Output encoding
- Authentication/authorization
- Sensitive data handling
- Injection vulnerabilities
- Timing attacks
Correctness
- Logic errors
- Edge cases handled
- Null/undefined handling
- Error handling
- Race conditions
- Resource cleanup
Maintainability
- Code clarity
- Appropriate comments
- Consistent naming
- DRY (no duplication)
- Single responsibility
- Testability
Performance
- Algorithmic complexity
- Memory usage
- Database queries
- Caching
- Unnecessary operations
Core Files
REVIEW.yml
review:
name: "PR #123: Add user authentication"
status: "in_progress"
findings:
blocking:
- id: "B1"
file: "src/auth/login.ts"
line: 45
type: "security"
summary: "Timing attack vulnerability"
important: []
minor: []
praise: []
verification:
tests: { ran: true, passed: true }
linter: { ran: true, passed: false, issues: 3 }
REVIEW.md
Formatted document with:
- Summary and counts
- Issues by severity
- Verification results
- Recommendation
Verification Commands
tests:
- "npm test"
- "pytest"
- "go test ./..."
linters:
- "npm run lint"
- "flake8"
- "golangci-lint run"
Recommendation Output
| Outcome |
Meaning |
approve |
Good to merge |
request_changes |
Has blocking/important issues |
comment |
Minor feedback only |
See Also
1---2name: code-review3description: Systematic code analysis with evidence collection4allowed-tools:5 - read_file6 - run_terminal_cmd7tier: 28protocol: CODE-REVIEW9tags: [moollm, development, quality, review, security]10related: [adventure, debugging, research-notebook, session-log, rubric, evaluator]11templates:12 - file: REVIEW.yml.tmpl13 purpose: Structured review tracking14 parameters: [review_name, created_date, focus, files]15 - file: REVIEW.md.tmpl16 purpose: Formatted review document17 parameters: [review_name, created_date, files]18---1920# Code Review2122> *"Read with intent. Question with purpose. Document with care."*2324Systematic code analysis with evidence collection. Code review IS an [adventure](../adventure/) — the codebase is the dungeon, findings are clues.2526## Review Process2728```29READ → NOTE ISSUES → CLASSIFY → REPORT30```3132### Step 1: Setup331. Create REVIEW.yml342. Identify files to review353. Define focus areas3637### Step 2: Overview381. List all changed files392. Read PR/commit description403. Note initial impressions4142### Step 3: Deep Review43For each file:441. Read the code452. Check against criteria463. Note findings474. Run relevant checks4849### Step 4: Verification501. Run tests512. Run linters523. Check regressions5354### Step 5: Synthesize551. Compile findings562. Prioritize issues573. Generate REVIEW.md584. State recommendation5960## Finding Severity6162| Level | Symbol | Meaning | Action |63|-------|--------|---------|--------|64| Blocking | 🚫 | Must fix before merge | Request changes |65| Important | ⚠️ | Should fix or explain | Request changes |66| Minor | 💡 | Nice to fix | Comment only |67| Praise | 🎉 | Good work! | Celebrate |6869## Finding Types7071- **Security** — Injection, auth, sensitive data72- **Correctness** — Logic errors, edge cases73- **Performance** — N+1 queries, memory leaks74- **Maintainability** — Clarity, DRY, naming75- **Style** — Formatting, conventions7677## Review Checklist7879### Security80- Input validation81- Output encoding82- Authentication/authorization83- Sensitive data handling84- Injection vulnerabilities85- Timing attacks8687### Correctness88- Logic errors89- Edge cases handled90- Null/undefined handling91- Error handling92- Race conditions93- Resource cleanup9495### Maintainability96- Code clarity97- Appropriate comments98- Consistent naming99- DRY (no duplication)100- Single responsibility101- Testability102103### Performance104- Algorithmic complexity105- Memory usage106- Database queries107- Caching108- Unnecessary operations109110## Core Files111112### REVIEW.yml113114```yaml115review:116 name: "PR #123: Add user authentication"117 status: "in_progress"118 119findings:120 blocking:121 - id: "B1"122 file: "src/auth/login.ts"123 line: 45124 type: "security"125 summary: "Timing attack vulnerability"126 127 important: []128 minor: []129 praise: []130131verification:132 tests: { ran: true, passed: true }133 linter: { ran: true, passed: false, issues: 3 }134```135136### REVIEW.md137138Formatted document with:139- Summary and counts140- Issues by severity141- Verification results142- Recommendation143144## Verification Commands145146```yaml147tests:148 - "npm test"149 - "pytest"150 - "go test ./..."151 152linters:153 - "npm run lint"154 - "flake8"155 - "golangci-lint run"156```157158## Recommendation Output159160| Outcome | Meaning |161|---------|---------|162| `approve` | Good to merge |163| `request_changes` | Has blocking/important issues |164| `comment` | Minor feedback only |165166## See Also167168- [rubric](../rubric/) — **Explicit scoring criteria** for code quality169- [evaluator](../evaluator/) — Independent assessment pattern170- [adversarial-committee](../adversarial-committee/) — Multiple reviewers debating findings