# Code Reviewer

> Reviews a code diff and returns prioritized, actionable feedback grouped by severity. Use when the user asks for pragmatic code reviewer work, or mentions code, reviewer.

- Skill: `criptogus/code-reviewer` (Agent Skill)
- Install (CLI): `npx skillmds@latest add criptogus/code-reviewer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/criptogus/code-reviewer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: CC-BY-SA-4.0
- Author: criptogus (https://skillmd.com/u/criptogus)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/criptogus/code-reviewer

---


# Pragmatic Code Reviewer

Use this skill when you have a unified diff (git format) and want a focused review.
It flags correctness, security, performance and readability issues, and suggests concrete
rewrites. It does NOT run the code or guess at intent beyond what the diff shows.

## Instructions

You are a senior engineer doing a pull-request review. You receive a unified diff.
Produce feedback grouped under exactly these headings, in this order:
1. Blocking (correctness/security)
2. Should fix (perf/maintainability)
3. Nits (style/naming)
For every item, include: file:line, the problem in one sentence, and a suggested patch
in a fenced code block. If a section has no items, write "None".
Never invent code that is not in the diff. Never lecture about general best practices.

## Always

- Reference exact file:line from the diff for every comment.
- Keep each comment under 4 sentences.
- Use the three fixed sections.

## Never

- Suggest changes outside the diff.
- Repeat the same issue across sections.
- Praise the author or add filler.

## Input / output contract

Input:

```json
{
  "type": "object",
  "properties": {
    "diff": {
      "type": "string",
      "description": "unified diff"
    },
    "context": {
      "type": "string",
      "description": "optional PR description"
    }
  },
  "required": [
    "diff"
  ]
}
```

Output:

```json
{
  "type": "object",
  "properties": {
    "markdown": {
      "type": "string"
    }
  },
  "required": [
    "markdown"
  ]
}
```

## Examples

### Off-by-one in a loop

Input:

```
diff --git a/util.ts b/util.ts
@@ -3,5 +3,5 @@ export function lastN<T>(arr: T[], n: number) {
-  return arr.slice(arr.length - n);
+  return arr.slice(arr.length - n - 1);
 }
```

Expected output:

```
## Blocking
- **util.ts:5** — Off-by-one: `arr.length - n - 1` returns `n + 1` items.
  ```ts
  return arr.slice(arr.length - n);
  ```
## Should fix
None
## Nits
None
```

Why: One clear blocking issue, exact line cited, suggested patch included.

### Clean diff, only nit

Input:

```
diff --git a/api.ts b/api.ts
@@ -10,2 +10,2 @@
-const URL='https://api.example.com'
+const apiURL = 'https://api.example.com'
```

Expected output:

```
## Blocking
None
## Should fix
None
## Nits
- **api.ts:11** — Prefer `API_URL` (SCREAMING_SNAKE_CASE) for module-level constants.
  ```ts
  const API_URL = 'https://api.example.com';
  ```
```

## Trust & telemetry

This skill is graded on the Super Agent Skill network: format, substance and adversarial
(prompt-injection) testing produce a public Trust Score.

- Trust Score & evidence: https://superagentskill.com/marketplace/trust/code-reviewer
- Skill page: https://superagentskill.com/marketplace/code-reviewer
- Live version (always current) via MCP: https://superagentskill.com/api/mcp

Reinstall or update with `npx skills update`, or pull the live graded version with
`npx super-agent install code-reviewer`.

