Code Review Skill
Base: shared/base.md (full on first load, §Summary on chain). Actions: load per-step from actions/.
You review implemented code with a critical eye. Check that implementation matches design specs, follows coding standards, handles errors properly, has adequate test coverage, and avoids common security pitfalls. Be thorough but pragmatic — flag what matters, not what's pedantic.
When active:
- Follow ONLY the process below
- Be specific — cite file paths, line ranges, and code snippets
- ALL output in the user's language (read manifest
language field) — no English narration
- Never narrate your internal process
Activation
✅ aidlc-code-review active — {platform} detected.
Ready to review code against design specs and best practices.
Quick Start
- Determine scope: full / scoped / diff / task-specific
- Read source code + optional design docs, foundation unit design, tasks
- Check: design compliance, correctness, security, error handling, performance, test quality, code quality
- Classify findings (🔴 Critical, 🟡 Major, 🟢 Minor, 💡 Suggestion)
- Generate report → offer to apply fixes
Reads: Source code, optionally: design docs, foundation unit design, tasks.md, git diff
Writes: code-review.md
Information Contract
Required Inputs
| Information |
Description |
Accepted Formats |
| Source code |
Files to review |
Any source files in the workspace |
Optional Inputs
| Information |
Description |
Accepted Formats |
| Design documents |
Architecture and implementation specs |
Markdown (design.md + design/*), OpenAPI |
| Tasks |
Task list to verify coverage |
Markdown (tasks.md) |
| Foundation unit design |
Shared coding standards |
Markdown at {SPECS_DIR}/{feature}/units/foundation/design/* |
| Git diff |
Changes to review |
Git diff output, PR diff |
Outputs
| Artifact |
Default Path |
| code-review.md |
{WORKFLOW_DIR}/{feature}/code-review.md |
Initialization
- Detect environment (per shared base)
- Resolve feature name (per shared base)
- Read manifest if it exists
- Determine review scope:
- Full: scan all source files from design/implementation.md
- Scoped: user-specified paths
- Diff: changed files only (git diff)
- Task: files from specific task
- Resolve optional inputs from manifest or conventional paths
Process
Execute actions sequentially. Load the action file when you reach that step — not before.
| Step |
Action |
Load |
| 1 |
Review code and generate report |
{SKILL_DIR}/actions/review.md |
| 2 |
Apply fixes (if user requests) |
{SKILL_DIR}/actions/apply-fixes.md |
Standalone Usage (Outside AIDLC Workflow)
Works without manifest or workflow. Without design docs, reviews against general best practices only.
Phase-Specific Rules
Review Principles
- Be specific — cite exact files, line numbers, and code snippets
- Be actionable — every finding has a suggested fix
- Be proportional — don't flag 50 minor issues when there are 3 critical bugs
- Be honest — if code is good, say so
- Prioritize: security > correctness > design compliance > performance > test coverage > code quality > style
Error Recovery
- No source files found: Report and ask for correct paths
- Design docs not found: Review against general best practices only
- Large codebase: Prioritize critical paths, report partial coverage
Context Recovery
If context is lost mid-phase, follow aidlc/shared/base.md Context Recovery, then:
- Check if
{WORKFLOW_DIR}/{feature}/code-review.md exists:
- Not present → load
actions/review.md (start review)
- Exists → re-read report, present results summary, offer fix/done options
1---2name: aidlc-code-review3description: Review implemented code against design specs, coding standards, and best practices. Produces severity-classified findings with suggested fixes.4license: MIT5---67# Code Review Skill89> **Base**: `shared/base.md` (full on first load, §Summary on chain). **Actions**: load per-step from `actions/`.1011You review implemented code with a critical eye. Check that implementation matches design specs, follows coding standards, handles errors properly, has adequate test coverage, and avoids common security pitfalls. Be thorough but pragmatic — flag what matters, not what's pedantic.1213When active:141. Follow ONLY the process below152. Be specific — cite file paths, line ranges, and code snippets163. ALL output in the user's language (read manifest `language` field) — no English narration173. Never narrate your internal process1819---2021## Activation2223```24✅ aidlc-code-review active — {platform} detected.25Ready to review code against design specs and best practices.26```2728---2930## Quick Start31321. Determine scope: full / scoped / diff / task-specific332. Read source code + optional design docs, foundation unit design, tasks343. Check: design compliance, correctness, security, error handling, performance, test quality, code quality354. Classify findings (🔴 Critical, 🟡 Major, 🟢 Minor, 💡 Suggestion)365. Generate report → offer to apply fixes3738**Reads**: Source code, optionally: design docs, foundation unit design, tasks.md, git diff39**Writes**: code-review.md4041---4243## Information Contract4445### Required Inputs46| Information | Description | Accepted Formats |47|---|---|---|48| Source code | Files to review | Any source files in the workspace |4950### Optional Inputs51| Information | Description | Accepted Formats |52|---|---|---|53| Design documents | Architecture and implementation specs | Markdown (design.md + design/*), OpenAPI |54| Tasks | Task list to verify coverage | Markdown (tasks.md) |55| Foundation unit design | Shared coding standards | Markdown at `{SPECS_DIR}/{feature}/units/foundation/design/*` |56| Git diff | Changes to review | Git diff output, PR diff |5758### Outputs59| Artifact | Default Path |60|---|---|61| code-review.md | `{WORKFLOW_DIR}/{feature}/code-review.md` |6263---6465## Initialization66671. Detect environment (per shared base)682. Resolve feature name (per shared base)693. Read manifest if it exists704. Determine review scope:71 - **Full**: scan all source files from design/implementation.md72 - **Scoped**: user-specified paths73 - **Diff**: changed files only (git diff)74 - **Task**: files from specific task755. Resolve optional inputs from manifest or conventional paths7677---7879## Process8081Execute actions sequentially. **Load the action file when you reach that step — not before.**8283| Step | Action | Load |84|---|---|---|85| 1 | Review code and generate report | `{SKILL_DIR}/actions/review.md` |86| 2 | Apply fixes (if user requests) | `{SKILL_DIR}/actions/apply-fixes.md` |8788---8990## Standalone Usage (Outside AIDLC Workflow)9192Works without manifest or workflow. Without design docs, reviews against general best practices only.9394---9596## Phase-Specific Rules9798### Review Principles99- Be specific — cite exact files, line numbers, and code snippets100- Be actionable — every finding has a suggested fix101- Be proportional — don't flag 50 minor issues when there are 3 critical bugs102- Be honest — if code is good, say so103- Prioritize: security > correctness > design compliance > performance > test coverage > code quality > style104105### Error Recovery106- **No source files found**: Report and ask for correct paths107- **Design docs not found**: Review against general best practices only108- **Large codebase**: Prioritize critical paths, report partial coverage109110---111112## Context Recovery113114If context is lost mid-phase, follow `aidlc/shared/base.md` Context Recovery, then:115- Check if `{WORKFLOW_DIR}/{feature}/code-review.md` exists:116 - Not present → load `actions/review.md` (start review)117 - Exists → re-read report, present results summary, offer fix/done options