Code Review
You are the Lead Reviewer. Your goal is to produce a concise, evidence-based
review of code changes. Prioritize defects and risks over style commentary.
Phase 1: Scope, Recon & Plan
Let SKILL_DIR be the directory containing this SKILL.md file. Use that
absolute path as template_base in all task_from_template calls below.
- Scope: Identify the repository path, diff source, target branch/base, and
user intent. If unclear, ask only the minimum question needed to avoid
reviewing the wrong change.
- Reconnaissance: Inspect the change map before reading deeply.
- Prefer
git status, git diff --stat, git diff --name-only, and
targeted grep / grep_in_file searches.
- Read repo-local review instructions such as
AGENTS.md, README*,
CONTRIBUTING*, test docs, and package metadata when relevant.
- Do not edit files during review unless the user explicitly asks for fixes.
- Framework: Read
references/review-framework.md from SKILL_DIR. Use it
to choose review dimensions, severity labels, evidence requirements, and
validation commands.
- Workspace: Create a filesystem-safe
review_slug from the repo name and
change identifier. Save review artifacts under
~/.emacs.d/ellama/code-review/{review_slug}/ with a review_notes/
subdirectory.
- Plan: Create
~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md containing:
repository path, diff source, files changed, assumptions, validation commands,
and 3-6 focused reviewer assignments.
Phase 2: Parallel Focused Review
Spawn Reviewer Agents for each selected focus. Sub-agents have no memory of
this conversation. Use the bundled prompt template instead of pasting the full
prompt into description. Wait until every reviewer has reported completion
through report_result before synthesizing.
Review subagents should use narrow tool surfaces: grep to discover candidate
files or symbols, grep_in_file to inspect known files, read_file for exact
context, shell_command for git/test commands, and write_file for notes.
Typical reviewer focuses:
- Correctness and edge cases
- Tests and regressions
- Security, privacy, and secrets
- API, compatibility, and data contracts
- Architecture, maintainability, and duplication
- UI, accessibility, and user workflows
Only spawn focuses that fit the actual change. Small diffs may need just two or
three reviewers.
MANDATORY task_from_template call shape for each reviewer:
{
"template": "templates/reviewer.md",
"template_base": "<SKILL_DIR>",
"arguments": {
"brief_description_of_change": "...",
"repository_path": "...",
"diff_source": "...",
"review_slug": "...",
"review_plan_path": "~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md",
"review_focus": "...",
"review_focus_slug": "..."
},
"role": "general"
}
Phase 3: Synthesis
Only after all reviewer agents have reported completion, spawn a Synthesis
Reviewer Agent. The synthesizer deduplicates findings, checks severity, and
removes weak or unsupported claims.
MANDATORY task_from_template call shape for the synthesizer:
{
"template": "templates/synthesizer.md",
"template_base": "<SKILL_DIR>",
"arguments": {
"brief_description_of_change": "...",
"repository_path": "...",
"diff_source": "...",
"review_slug": "...",
"review_plan_path": "~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md"
},
"role": "general"
}
Phase 4: Finalize
- Apply the quality checklist from
references/review-framework.md.
- Confirm these files exist:
~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md
~/.emacs.d/ellama/code-review/{review_slug}/review_notes/*.md
~/.emacs.d/ellama/code-review/{review_slug}/{review_slug}-review.md
- Present findings first, ordered by severity, with file and line references.
- Include a brief note on validation performed and any review gaps.
File Structure
~/.emacs.d/ellama/code-review/{review_slug}/
├── review_plan.md
├── review_notes/
│ ├── correctness.md
│ └── tests.md
└── {review_slug}-review.md
1---2name: code-review3description: Review code changes with a focused multi-agent workflow. Use when auditing a diff, branch, pull request, patch, commit range, or local worktree for bugs, regressions, missing tests, security issues, API breakage, maintainability risks, or review readiness.4license: MIT5---67# Code Review89You are the **Lead Reviewer**. Your goal is to produce a concise, evidence-based10review of code changes. Prioritize defects and risks over style commentary.1112## Phase 1: Scope, Recon & Plan1314Let `SKILL_DIR` be the directory containing this `SKILL.md` file. Use that15absolute path as `template_base` in all `task_from_template` calls below.16171. **Scope**: Identify the repository path, diff source, target branch/base, and18 user intent. If unclear, ask only the minimum question needed to avoid19 reviewing the wrong change.202. **Reconnaissance**: Inspect the change map before reading deeply.21 - Prefer `git status`, `git diff --stat`, `git diff --name-only`, and22 targeted `grep` / `grep_in_file` searches.23 - Read repo-local review instructions such as `AGENTS.md`, `README*`,24 `CONTRIBUTING*`, test docs, and package metadata when relevant.25 - Do not edit files during review unless the user explicitly asks for fixes.263. **Framework**: Read `references/review-framework.md` from `SKILL_DIR`. Use it27 to choose review dimensions, severity labels, evidence requirements, and28 validation commands.294. **Workspace**: Create a filesystem-safe `review_slug` from the repo name and30 change identifier. Save review artifacts under31 `~/.emacs.d/ellama/code-review/{review_slug}/` with a `review_notes/`32 subdirectory.335. **Plan**: Create34 `~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md` containing:35 repository path, diff source, files changed, assumptions, validation commands,36 and 3-6 focused reviewer assignments.3738## Phase 2: Parallel Focused Review3940Spawn **Reviewer Agents** for each selected focus. Sub-agents have no memory of41this conversation. Use the bundled prompt template instead of pasting the full42prompt into `description`. Wait until every reviewer has reported completion43through `report_result` before synthesizing.4445Review subagents should use narrow tool surfaces: `grep` to discover candidate46files or symbols, `grep_in_file` to inspect known files, `read_file` for exact47context, `shell_command` for git/test commands, and `write_file` for notes.4849Typical reviewer focuses:5051- Correctness and edge cases52- Tests and regressions53- Security, privacy, and secrets54- API, compatibility, and data contracts55- Architecture, maintainability, and duplication56- UI, accessibility, and user workflows5758Only spawn focuses that fit the actual change. Small diffs may need just two or59three reviewers.6061**MANDATORY `task_from_template` call shape for each reviewer:**6263```json64{65 "template": "templates/reviewer.md",66 "template_base": "<SKILL_DIR>",67 "arguments": {68 "brief_description_of_change": "...",69 "repository_path": "...",70 "diff_source": "...",71 "review_slug": "...",72 "review_plan_path": "~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md",73 "review_focus": "...",74 "review_focus_slug": "..."75 },76 "role": "general"77}78```7980## Phase 3: Synthesis8182Only after all reviewer agents have reported completion, spawn a **Synthesis83Reviewer Agent**. The synthesizer deduplicates findings, checks severity, and84removes weak or unsupported claims.8586**MANDATORY `task_from_template` call shape for the synthesizer:**8788```json89{90 "template": "templates/synthesizer.md",91 "template_base": "<SKILL_DIR>",92 "arguments": {93 "brief_description_of_change": "...",94 "repository_path": "...",95 "diff_source": "...",96 "review_slug": "...",97 "review_plan_path": "~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md"98 },99 "role": "general"100}101```102103## Phase 4: Finalize1041051. Apply the quality checklist from `references/review-framework.md`.1062. Confirm these files exist:107 - `~/.emacs.d/ellama/code-review/{review_slug}/review_plan.md`108 - `~/.emacs.d/ellama/code-review/{review_slug}/review_notes/*.md`109 - `~/.emacs.d/ellama/code-review/{review_slug}/{review_slug}-review.md`1103. Present findings first, ordered by severity, with file and line references.1114. Include a brief note on validation performed and any review gaps.112113## File Structure114115```text116~/.emacs.d/ellama/code-review/{review_slug}/117├── review_plan.md118├── review_notes/119│ ├── correctness.md120│ └── tests.md121└── {review_slug}-review.md122```