agentleFS
azborgonovoazborgonovo/ai-skills/skills/code-review/code-review-pyramid/SKILL.md

code-review-pyramid

Skill1 starsChanged 2 months agoMITView on GitHub

Knowledge base for the Code Review Pyramid — a framework for structuring code reviews across five layers prioritized by cost-of-change. Use when the user asks how to approach a code review, wants to understand what to focus on in a review, asks about review priorities, or references "the pyramid". Also use when another skill needs a structured review framework (e.g. review-changes loads it to apply consistent layer priorities and questions).

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do newly added dependencies pull their weight?

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Review Pyramid

The Code Review Pyramid provides guidance on aspects to focus on during code reviews, prioritized by the cost of fixing issues later. Layers at the bottom of the pyramid deserve more attention because they are harder and more expensive to change after. Layers at the top are easier to address (often automatable) and warrant proportionally less manual review effort.

Adapted from the Code Review Pyramid by Gunnar Morling, licensed under CC BY-SA 4.0.

The Pyramid

Five layers, numbered from the base up. Manual review attention should be highest at the base and taper toward the apex, where checks should be automated as much as possible:

  1. API Semantics — base: focus here most
  2. Implementation Semantics — focus here
  3. Documentation
  4. Tests — automate where possible
  5. Code Style — apex: automate

Layer 1 — API Semantics

Questions to ask:

  • API as small as possible, as large as needed?
  • Is there one way of doing one thing, not multiple?
  • Is it consistent? Does it follow the principle of least surprise?
  • Clean split of API/internals, without internals leaking in the API?
  • Are there no breaking changes to user-facing parts (API classes, configuration, metrics, log formats, etc.)?
  • Is a new API generally useful and not overly specific?

Layer 2 — Implementation Semantics

Questions to ask:

  • Does it satisfy the original requirements?
  • Is it logically correct?
  • Is there no unnecessary complexity?
  • Is it robust? (no concurrency issues, proper error handling)
  • Is it performant?
  • Is it secure? (e.g. no SQL injection, no sensitive data exposure, etc.)
  • Is it observable? (e.g. metrics, logging, tracing, etc.)
  • Do newly added dependencies pull their weight? Are their licenses acceptable?

Layer 3 — Documentation

Questions to ask:

  • Are new features reasonably documented?
  • Are the relevant kinds of docs covered: README, API docs, user guide, reference docs, etc.?
  • Are docs understandable? Are there no significant typos or grammar mistakes?

Layer 4 — Tests

Questions to ask:

  • Are all tests passing?
  • Are new features reasonably tested?
  • Are corner cases tested?
  • Is it using unit tests where possible, integration tests where necessary?
  • Are there tests for NFRs, e.g. performance?

Layer 5 — Code Style

Questions to ask:

  • Is the project's formatting style applied?
  • Does it adhere to agreed naming conventions?
  • Is it DRY?
  • Is the code sufficiently readable? (method lengths, etc.)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.