--- name: code-review description: Structured code review against implementation plan. --- # Skill: code-review Structured code review against implementation plan. ## Invoked by 🔍 Reviewer mode ## Required Inputs | Input | Source | Example | |-------|--------|---------| | `TICKET_KEY` | Jira issue key | `PROJECT-123` | | `MODULE` | Module/component name | `auth`, `api`, `core` | ## Output Markdown file: `docs///-review.md` ## Steps ### 1. Read the plan document ```bash cat docs///-plan.md ``` Extract: planned changes, affected files, expected patterns, acceptance criteria. ### 2. Read the test plan (if exists) ```bash cat docs///-testplan.md ``` Cross-reference: are all planned test cases implemented? ### 3. Get the diff ```bash cd - git diff origin/main --name-only git diff origin/main --stat git diff origin/main ``` ### 4. Read changed files For each changed file, read the full file to understand context — not just the diff hunks. ### 5. Run the review checklist For each changed file, verify: | # | Check | What to look for | |---|-------|-----------------| | 1 | Plan compliance | All plan items implemented? Nothing missing, nothing extra? | | 2 | Pattern correctness | Correct project patterns used? | | 3 | No generated source changes | Generated sources must never be modified manually | | 4 | Logging | Parameterized messages (`log.debug("x: {}", v)`) — no string concatenation | | 5 | Error handling | Proper error responses checked before parsing? Null-safe patterns? | | 6 | Test coverage | Every new/modified public method has a test? Edge cases covered? | | 7 | Database migrations | Correct naming convention? Dual DB dialect support? | | 8 | No hardcoded values | No hardcoded IDs, instance names, or secrets? | | 9 | Field visibility | Appropriate access modifiers? | | 10 | Annotations | Correct use of framework annotations? | ### 6. Check test quality For each test file: - Meaningful assertions (not just `assertNotNull`)? - Edge cases covered? - Mocking done correctly? - Test naming convention: `test__()`? ### 7. Run tests ```bash cd - mvn test -pl -f pom.xml ``` ### 8. Generate review document ```markdown # Code Review: — **Date:** **Module:** **Reviewer:** Lumen (Reviewer) **Branch:** **Status:** ✅ Approved / âš ī¸ Approved with comments / ❌ Changes requested --- ## Summary <1-2 sentence summary of the review outcome> ## Reviewed Files | File | Change | Assessment | |------|--------|-----------| | `` | New/Modified | ✅ / âš ī¸ / ❌ | ## Checklist | # | Check | Result | Note | |---|-------|--------|------| | 1 | Plan compliance | ✅ | All planned changes implemented | | ... | ... | ... | ... | ## Findings ### âš ī¸ Warnings (non-blocking) 1. **:** — - Recommendation: ### ❌ Blockers (must fix) 1. **:** — - Reason: ## Tests - **Executed:** tests - **Passed:** ✅ - **Failed:** ❌ - **Build:** ✅ Green / ❌ Red ## Recommendation ``` ### 9. Store in BigMind ```python memory_store_fact( category="codebase", fact=f"{TICKET_KEY}: Code review completed — {status}. {findings_count} findings ({blockers} blockers)." ) ``` ## Severity Levels | Level | Symbol | Meaning | Action | |-------|--------|---------|--------| | Blocker | ❌ | Must fix before merge | Changes requested | | Warning | âš ī¸ | Should fix, not blocking | Approved with comments | | Info | â„šī¸ | Suggestion for improvement | Approved | | OK | ✅ | No issues | — |