Skip to content
Back to skills

Code Review

ASecurity

Review local code changes. Uses an isolated sub-agent for unbiased analysis when the main agent wrote the code; reviews directly in fresh review-only sessions. Checks correctness, conventions, performance, tests, security, and tech design compliance. Use when the user wants a code review or says "review the diff" / "review my changes" / "代码评审" / "review 一下改动".

  • 120 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added August 31, 2026
ai-agentsbashcode-reviewgitsecurityperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add open-octo/octo-agent --skill code-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/open-octo-code-review/badge)](https://www.skillsdirectory.com/skills/open-octo-code-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-review
description: Review local code changes. Uses an isolated sub-agent for unbiased analysis when the main agent wrote the code; reviews directly in fresh review-only sessions. Checks correctness, conventions, performance, tests, security, and tech design compliance. Use when the user wants a code review or says "review the diff" / "review my changes" / "代码评审" / "review 一下改动".
---

Review local code changes. Choose the reviewer based on where the implementation context lives:

- **You implemented the changes in this session** (or took part in the design/implementation conversation): dispatch an **isolated sub-agent** — a fresh agent with no knowledge of this session's implementation decisions. This eliminates the bias of reviewing your own work.
- **Fresh session, review-only request** (the user opened this session just to have you review a diff/PR you had no part in): you already ARE the unbiased fresh pair of eyes — review the code **yourself**, following the same template in [code-reviewer.md](code-reviewer.md). Spawning a sub-agent here only adds latency and a context hand-off with zero isolation benefit. Skip step 2 and produce the review report directly.

## Process

### 1. Gather context for the review

Collect everything the reviewer needs:

```bash
# What changed
git log --oneline main..HEAD
git diff main...HEAD
git diff
git diff --cached
```

Also identify:
- Tech design doc path (if one exists in conversation context or commit messages)
- Which services/modules are touched
- Test files added or modified

### 2. Dispatch the sub-agent (only when you wrote the code)

Call the `sub_agent` tool with `subagent_type: "code-review"` — a read-only reviewer that starts with zero context. Pass it the diff range, file list, and tech design reference in the prompt — but NOT your implementation reasoning or conversation history.

If you need to review multiple independent changes (e.g., several PRs), dispatch one sub-agent per change in the same round — they run in parallel. When a dispatch comes back as a handle rather than a result, end your turn and use the completion notification when it arrives. Do not poll `sub_agent_status` while waiting; use it only if you suspect an agent is stuck or need to list running agents.

The sub-agent prompt should follow the template in [code-reviewer.md](code-reviewer.md).

Fill in:
- `{DESCRIPTION}` — brief summary of what these changes do
- `{TECH_DESIGN_PATH}` — path to tech design doc (or "none")
- `{BASE_SHA}` / `{HEAD_SHA}` — git range
- `{DIFF_STAT}` — output of `git diff --stat`

If the `sub_agent` tool is not available in this session, perform the review yourself following the same template — and say explicitly in the report that the review was not isolated. (No such disclaimer is needed when you review directly because the request came in a fresh session — that review IS isolated.)

### 3. Act on the review

Whether the findings come from the sub-agent or from your own review:

**Receiving feedback — rules:**
- Verify before implementing. Don't blindly agree.
- If any item is unclear, clarify ALL unclear items before fixing any.
- Implementation order: Critical → Important → Minor, test each fix individually.
- Push back with technical reasoning if the reviewer is wrong (missing context, doesn't apply to this codebase, YAGNI).
- No performative agreement ("Great point!", "You're absolutely right!"). Just fix and show the result.

**Priority:**
- **Critical**: fix immediately, no exceptions
- **Important**: fix before proceeding
- **Minor**: note for later or fix if quick

### 4. Report to user

Present the review to the user. For sub-agent findings, add your own assessment of each — agree, disagree with reasoning, or need discussion.

Files in this skill

  • SKILL.md2.9 KB
  • code-reviewer.md4.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.