Org Skills

backend-code-review

Review server-side changes and deliver severity-labelled findings with concrete fixes and a merge verdict — correctness under concurrency, transactions and idempotency, authorization and injection, data migrations and rollout order, API and message contracts, resilience, performance, observability, tests and supply chain.

Download .zip Raw Source
When agents use itCovers .NET and Node.js/TypeScript in depth, with stack-neutral rules for Java/Spring, Python and Go. Use this whenever the user asks to review a pull request, diff, endpoint, handler, repository, migration, message consumer, scheduled job or SQL script, asks "is this safe to merge", "what's wrong with this", "any issues here" or "anything I should fix before I open this PR", or pastes server-side code and asks for feedback. This skill owns the review verdict: load the stack's development skill for idioms only. Frontend and UI changes in the same pull request — components, hooks, templates, styling, accessibility — go to `frontend-code-review`.

Install

Copilot (VS Code, Visual Studio, Copilot CLI and github.com) reads skills from the repository — commit them so the whole team gets them.

npx skills add AGCO-Global/org-skills --skill backend-code-review -a github-copilot
# or with the org installer (adds .github/skills/backend-code-review):
npx -y github:AGCO-Global/org-skills add skill backend-code-review

Uses the open skills CLI. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, OpenCode, Windsurf and 60+ others — it asks which agent to install into.

npx skills add AGCO-Global/org-skills --skill backend-code-review
# user-level instead of project-level:
npx skills add AGCO-Global/org-skills --skill backend-code-review -g

Installs the backend-shared-skills plugin, which bundles all Backend / Shared skills and keeps them updated.

/plugin marketplace add AGCO-Global/org-skills
/plugin install backend-shared-skills@org-skills
# or just this skill, in this repository:
npx skills add AGCO-Global/org-skills --skill backend-code-review -a claude-code

Use Download .zip above, then upload it under Customize → Skills → Upload skill. Team and Enterprise admins can sync this repo as a plugin marketplace instead.

Installs into .agents/skills/, which Codex reads.

npx skills add AGCO-Global/org-skills --skill backend-code-review -a codex

Installs into Cursor's skills folder.

npx skills add AGCO-Global/org-skills --skill backend-code-review -a cursor

Installs into Gemini CLI's skills folder.

npx skills add AGCO-Global/org-skills --skill backend-code-review -a gemini-cli

Nothing to install. Press Download .zip above, unzip it, and drop the backend-code-review folder into your tool's skills folder — .claude/skills/, .github/skills/, .cursor/skills/ or .agents/skills/. Step-by-step, per tool: How to use it. For any other tool with rules or custom prompts, Copy SKILL.md and paste it in — it is plain Markdown.

The npx commands need Node.js 20+ and use your normal git sign-in to GitHub, so they work while the repository is private. Without Node.js, see the No Node.js tab — a skill is a folder of Markdown, so copying it in works just as well.

Skill contents

Backend Code Review

Targets: any server-side stack; .NET and Node.js in depth · Verified: 2026-09 against https://www.rfc-editor.org/rfc/rfc9457.html and https://cheatsheetseries.owasp.org/

Back-end bugs corrupt data, leak data or take production down, and they surface under concurrency, partial failure and scale that the tests never exercised. Review every change as if it will run on N instances at once, be retried, see hostile input, and have to be rolled back halfway through a deploy. Cite the line, say why it matters, propose the fix, label the severity.

1. Decide first

Question Default Change when
Is this mine to review? Server-side code: endpoints, services, repositories, migrations, consumers, jobs, SQL, Dockerfiles Components, templates, styling, accessibility → frontend-code-review for those files; name which files you reviewed
Review or debug? A review request gets this skill "Why doesn't this work" with no review intent → the stack's development skill; do not produce a severity table
Stack depth Load the stack's development skill for idioms (dotnet-development, nodejs-development) Do not load a performance skill unless a finding genuinely needs a profile — then say which one
What was I given? A diff A whole file → review it but say you cannot see what changed. A description with no code → ask for the diff; do not invent findings
Diff over ~400 non-generated lines Ask for a split (migration, then code, then cleanup); review the riskiest files meanwhile and say so Over 2,000 lines → review only auth, money, migrations and public contracts, and list the rest as unreviewed
Empty, lockfile-only or generated-only diff Say so in one line and stop A lockfile change adds a dependency → review that dependency, not the lockfile
Verdict Derive it from the labels (§4), never from an overall impression —

2. Severity labels (use verbatim)

Label Meaning Blocks merge?
[blocker] Data loss or corruption, security hole, broken contract for existing clients, unsafe migration, outage risk Yes
[major] Likely bug under realistic load or failure, missing authorization on a secondary path, no timeout, N+1 on a hot path, new behaviour with no test Yes, unless deferred with a ticket
[minor] Readability, naming, small duplication, weak log message No
[nit] Style or formatting a tool should own No
[question] Intent needed before judging —
[praise] Done well, others should copy it —

Every finding gets exactly one label. Include a genuine [praise] when one exists — it calibrates everything else you wrote.

3. What to look at

Work these in order and report only what you find. The full checks per area are in references/review-checklist.md; open it rather than reviewing from memory.

  1. Correctness under concurrency — check-then-act across requests (if not exists then insert) needs a unique constraint or a lock; read-modify-write needs a version column or SELECT … FOR UPDATE; shared mutable state in a singleton or static field is a race.
  2. Transactions and idempotency — the boundary wraps the whole invariant; no HTTP call or queue publish inside a database transaction; a state change plus a published event needs an outbox (messaging-patterns); consumers, webhooks, retried jobs and retried POSTs tolerate duplicates.
  3. Authorization — every new endpoint, handler and resolver declares its policy, and every lookup by id is scoped to the caller (WHERE id = @id AND tenant_id = @tenant). Loading by id alone is IDOR, and it is the single most common blocker in this checklist.
  4. Injection and input — parameterised queries only; allow-lists for anything interpolated into SQL, a shell, a path or a URL; unknown fields rejected on sensitive DTOs; SSRF guards on server-side fetches of user-supplied URLs.
  5. Data and migrations — expand/contract order, so the previous version of the code still runs against the new schema; CREATE INDEX CONCURRENTLY or the engine's online DDL on large tables; throttled backfills; lock timeouts (database-migrations).
  6. Contracts — no field removed, renamed, retyped or newly required without a version; errors in the service's standard shape; lists paginated with a server-enforced maximum; message schemas evolve additively (api-design).
  7. Resilience — a timeout on every outbound call; retries only where idempotent, with capped jittered backoff and not stacked at several layers; consumers bounded, with a dead-letter path and a visibility timeout longer than the slowest handler.
  8. Performance — N+1 queries, unbounded result sets, blocking I/O on an async path, a cache with no bound or invalidation. Name the symptom and hand depth to the stack's performance skill; do not run a triage table here.
  9. Observability — structured logs with a correlation id, one log per failure rather than per retry layer, metrics for new behaviour, traceparent propagated across HTTP and messages (service-operability).
  10. Tests, dependencies and rollout — a test that fails without the change; a new dependency that is maintained, licence-compatible and not a duplicate; config validated at start-up; a stated rollback path.

Verify claimed tests exist. When a description says "added tests", open them: assertion-free tests and tests that pass without the change are common in generated code, and "LGTM, tests added" is how they merge.

4. Deliverable format

Each finding:

[label] <path>:<line> — <the problem in one sentence>        (or <path>#<symbol> when there is no line)
Why it matters: <impact in one sentence>
Suggest:
<the fixed code, or a precise description>

Worked example:

[blocker] src/orders/repository.ts:88 — getOrder(id) loads by id only, with no tenant scope.
Why it matters: any authenticated user can read any tenant's order by guessing or enumerating ids
(IDOR); this is cross-tenant data exposure, not a hardening nit.
Suggest:
  return db.order.findFirst({ where: { id, tenantId: ctx.tenantId } });
  // 404 when missing or not owned — do not return 403, which confirms it exists

Always end with:

## Summary
Verdict: Approve | Approve with minor changes | Request changes
Blockers: <n>  Majors: <n>  Minors: <n>
Files reviewed: <n> of <n>  (name anything skipped and why)

Top 3 to address:
1. …
2. …
3. …

Rollout notes: migration order, feature flags, rollback path
What's good: <one or two lines of genuine praise>

Verdict rules: any [blocker] → Request changes. Any [major] without an agreed follow-up ticket → Request changes. Otherwise Approve, "with minor changes" if any [minor] remain.

Self-review mode (the author asks before opening the pull request): run the same pass, then add a suggested description — intent, approach, migration and rollout plan, testing done, risks — and the reviewer questions to pre-empt.

Checklist

  • The intent of the change is known, from the description, the ticket, or by asking.
  • The stack's development skill was consulted for idioms before judging style.
  • Every finding has one label, a path:line, an impact sentence and a concrete fix.
  • Authorization, concurrency, transactions and migrations were each actively checked.
  • Every new outbound call was checked for a timeout, and every retry for idempotency.
  • Claimed tests were opened and actually assert the new behaviour.
  • Generated, vendored and lockfile-only changes were identified and not line-reviewed.
  • Frontend files, if any, were handed to frontend-code-review and named in the summary.
  • At least one [praise] where the code deserves it.
  • The summary block is present and the verdict follows the rules, not a feeling.

Anti-patterns

  • Nitpicking naming while missing the race, the IDOR or the unsafe migration → work the areas in order; style is last and mostly a tool's job.
  • "Consider using X" with no reason → state the failure mode it prevents, or drop the comment.
  • Approving a schema change without checking deploy order → can the running version still work against the new schema? If not, it is a [blocker].
  • Accepting "it's internal" for missing authorization, validation or timeouts → internal callers are compromised too, and internal services hang.
  • Asking for retries without idempotency, or caching without invalidation → you have requested a different bug.
  • Line-reviewing a 2,000-line diff → ask for a split; triage by risk and say what you left unread.
  • Inventing findings from a description with no code → ask for the diff.
  • "LGTM" on new behaviour with no tests, metrics or rollback plan → that is a [major] by the table above.
  • Restating the stack skills in full → one line plus a pointer; the duplicate ages badly and buries your findings.
  • Reviewing the UI files because they were in the same pull request → frontend-code-review, and say so in the summary.

Go deeper

  • references/review-checklist.md — the full per-area checks, including data migrations, supply chain, secret rotation, personal-data retention and deletion paths, container and probe hygiene, and serverless-specific concerns.
  • references/stack-quick-checks.md — the idiom rows that catch most bugs per stack (.NET, Node.js, Java/Spring, Python, Go), plus GraphQL resolver and queue-consumer checks.
  • Sibling skills: dotnet-development and nodejs-development for idioms, api-design for contracts, database-migrations for schema change safety, messaging-patterns for outbox and consumer rules, service-operability for telemetry, frontend-code-review for client-side files.

References

Deeper material the agent loads only when needed.