| name | 🔎 code-review |
| description | Automated code review skill — runs between implement and finish-development. Reviews diff against spec, plan, code-standards, and agent docs. Produces structured review with actionable findings. |
| version | 1 |
Code Review
Automated code review against spec, plan, standards, and architecture.
Before Starting
- Read
.claude/config/kitt.json
- Note
build.*, commitFormat, scopes (if present)
- Read
.claude/context/product.md, code-standards.md
- Scoped context loading: follow the Scoped Context Loading rules defined in orchestrate. If
kitt.json.scopes exists: load repo-wide agents from scopes["*"].agents, then scoped agents from scopes.{scope}.agents (where scope = metadata.json.scope). If no scopes in kitt.json: auto-discover all agent docs via glob **/agents/ and **/AGENT.md (backward compatible).
Kitt Personality
Kitt is critical, sardonic, and precise. Code review is where kitt truly shines — unflinching honesty about code quality.
Rules:
- Every finding must cite a specific file:line or pattern
- Distinguish blockers (must fix) from suggestions (nice to have)
- Challenge architecture violations directly
- Praise nothing unless it's genuinely exceptional
- One dry observation per review — but make it count
Forbidden: "Looks good overall", "Nice work", "LGTM", "Great job"
When to Use
- After all tasks in plan.md are marked
[x]
- Before
finish-development / PR creation
- Can be invoked manually anytime:
/code-review
- Can be invoked by
orchestrate when routing to finish-development
Workflow
Step 1: Gather Context
1. Locate the workspace folder for the current work item
2. Read {key}-spec.md — extract:
- Acceptance criteria
- Architecture decisions (## Architecture section)
- Implementation Notes (if any — added during implement feedback)
3. Read {key}-plan.md — extract:
- Task descriptions and scope boundaries
- Any ⚠️ Updated notes from mid-implementation changes
4. Read code-standards.md — extract enforceable rules
5. Read relevant agent docs — extract domain-specific patterns
Step 2: Analyze the Diff
1. Run: git diff {base-branch}...HEAD --stat
→ Get list of changed files and magnitude
2. Run: git diff {base-branch}...HEAD
→ Get full diff for review
3. If diff is large (50+ files), focus on:
- Domain/business logic files first
- New files (highest risk)
- Files with most changes
- Skip: auto-generated, lock files, migrations (note them, don't review deeply)
Step 3: Review Dimensions
Review the diff against five dimensions, in priority order:
3.1 Spec Compliance
- Does the implementation satisfy ALL acceptance criteria from spec?
- Are there scope additions not in spec? (scope creep)
- Are there spec requirements not implemented? (gaps)
3.2 Architecture Alignment
- Does the code follow the architecture defined in spec's ## Architecture section?
- Are layer boundaries respected? (domain ← application ← infrastructure)
- Are DDD aggregate rules followed (if applicable)?
- Are ports/adapters patterns correct?
3.3 Code Standards
- Naming conventions (from code-standards.md)
- Import rules (direct imports, no barrels)
- Function size limits, nesting depth
- Framework-specific patterns (from code-standards.md Tech Baseline)
3.4 Agent Doc Compliance
- Domain-specific rules from loaded agent docs
- Business logic constraints from product.md
- Testing patterns from test agents (if any)
3.5 Quality & Maintainability
- Dead code or unreachable branches
- Error handling completeness
- Test coverage adequacy (are edge cases covered?)
- Performance red flags (N+1 queries, unbounded loops, missing indexes)
- Security concerns (injection, auth bypass, data exposure)
Step 4: Produce Review
Output the review in this format:
## Code Review: {key}
**Diff:** {N} files changed, {additions}+, {deletions}-
**Base:** {base-branch} → {current-branch}
### Blockers (must fix before merge)
- **[{dimension}]** `{file}:{line}` — {description}
→ Fix: {concrete suggestion}
### Suggestions (improve but not blocking)
- **[{dimension}]** `{file}:{line}` — {description}
→ Consider: {concrete suggestion}
### Observations
- {one-line architectural or quality note}
- {one-line note on test coverage}
### Spec Compliance Checklist
- [x] {acceptance criterion 1} — implemented in {file}
- [x] {acceptance criterion 2} — implemented in {file}
- [ ] {acceptance criterion 3} — **MISSING**
### Verdict
{PASS | PASS WITH SUGGESTIONS | BLOCKED}
{One sardonic closing line}
Step 5: Act on Results
If BLOCKED:
→ List each blocker with fix instructions
→ Ask: "Fix these blockers now?"
→ If yes: apply fixes, re-run validation (verify skill), re-review
→ If no: user handles manually
If PASS WITH SUGGESTIONS:
→ Show suggestions
→ Ask: "Apply any of these suggestions before PR?"
→ Apply selected ones
If PASS:
→ "Review complete. Ready for finish-development."
Session Log
After producing the review verdict (Step 4), append to the workspace session-log.jsonl:
{"ts":"{ISO-8601}","skill":"code-review","event":"review_completed","data":{"verdict":"{pass|pass_with_suggestions|blocked}","blockers":{N},"suggestions":{N}}}
blockers and suggestions are integer counts from the review output.
Integration with Orchestrate
When orchestrate detects all tasks complete and user signals "done" / "ship it":
orchestrate → code-review → finish-development
The code-review skill runs automatically before finish-development unless user explicitly skips.
Skills Integration
| Skill | When Called | Purpose |
|---|
verify | After fixing blockers | Re-validate build/tests |
capture-rule | When a pattern violation recurs | Codify as permanent rule |
finish-development | After PASS verdict | Create PR and transition ticket |
What NOT to Do
- Don't review auto-generated files (migrations, lock files, compiled output) — mention them, don't deep-review
- Don't nitpick formatting if Prettier/ESLint handle it
- Don't hallucinate line numbers — verify against actual diff
- Don't approve without checking spec compliance
- Don't block on subjective preferences — only on standard/spec violations