Skip to content
Back to skills

Code Review Correctness

ASecurity

Method and checklist used by the Code Review Crew's correctness reviewer to find real bugs in a code diff - logic, edge cases, error handling, concurrency, data and migrations, contracts, performance at scale, rollout safety and test gaps - each proven with a concrete failure. Use when asked to review a PR, branch or diff for bugs.

  • 12 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
ai-agentsgocode-reviewgitapiperformance

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add MhdAljuboori/ZumiBot --skill code-review-correctness --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Review Correctness?

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

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

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-correctness
description: Method and checklist used by the Code Review Crew's correctness reviewer to find real bugs in a code diff - logic, edge cases, error handling, concurrency, data and migrations, contracts, performance at scale, rollout safety and test gaps - each proven with a concrete failure. Use when asked to review a PR, branch or diff for bugs.
---

# Correctness review

Goal: find the bugs this change will ship, prove each one, and nothing else.

## Method
1. **Intent.** Write one sentence: what should this change do? Then check the diff actually does it, end to end. The biggest bug is "half the feature is missing" (the API changed but not its client, the flag is read but never set, the migration exists but the model doesn't use the new column).
2. **Hunk by hunk.** For each changed hunk, pick the checklist sections that match what the hunk does (a query → Data and Performance; a handler → Inputs, Errors, Contracts). Don't walk every bullet for every hunk: that breeds weak findings. For each changed function, open its callers (`rg -n "name\("`, or `git grep` at the head SHA) and its callees.
3. **Prove.** Write the failure as *input/state → lines → wrong result*. If you can confirm it with an existing test or a tiny REPL check, do. If you can't state the failure, drop it.
4. **Tests.** Check the tests last, against the bugs you now know are possible.

## Checklist

**Inputs and boundaries**
- null / undefined / None / empty string / empty list / zero / negative / NaN / very large / unicode / whitespace-only.
- Off-by-one: `<` vs `<=`, slice ends, pagination (last page, exactly one page, empty), date ranges (inclusive end? time zone? DST? end of month, leap day).
- Integer overflow, float comparison with `==`, money in floats, rounding direction.
- String ↔ number conversions, locale-dependent parsing, implicit type coercion (`==` in JS, truthiness of `0` and `""`).

**Control flow**
- Every branch reachable? Inverted condition? `&&` vs `||`? De Morgan mistakes?
- Early return that skips cleanup, logging, or a required side effect.
- Switch/match without default, or a new enum value not handled everywhere it's switched on (`rg` the enum).
- Loops: modifying a collection while iterating, break/continue in the wrong level, infinite loop on bad input.

**Errors**
- Errors swallowed (`catch {}`, `except: pass`, `.catch(() => {})`), or logged and then execution continues with bad state.
- Async: missing `await`, unhandled promise rejection, `forEach` with async callback, errors in callbacks lost.
- Partial failure: step 2 of 3 fails, is step 1 rolled back? Retries that are not idempotent (double charge, duplicate email).
- Resource leaks: files, connections, locks, subscriptions, timers not released on the error path.

**State and concurrency**
- Shared mutable state, check-then-act races (exists → create), read-modify-write without a lock or transaction.
- Caches: invalidated on write? Stale after the change? Keyed on everything that varies?
- UI state: stale closures, effects with missing dependencies, double submission, out-of-order responses (an older request finishing last).
- Order assumptions: events, message queues, DB rows without `ORDER BY`.

**Data**
- Migrations: reversible? Safe on a big table (lock, backfill)? Default for existing rows? Deployed before the code that needs it?
- Schema/contract change on one side only: API ↔ client, producer ↔ consumer, serializer ↔ deserializer, stored JSON read by old code.
- Validation missing at the boundary, or duplicated inconsistently.
- Time: local vs UTC, timestamps in seconds vs milliseconds, clock skew.

**Contracts**
- Changed function signature or return shape: every caller updated? Public API break without a version bump?
- Null now possible where callers assumed not (or the reverse).
- Config/env var added: documented, defaulted, present in every environment?
- Feature flag: both paths work? Removal planned?

**Performance** (report only with a concrete scale: "one query per row, and the list holds up to N rows")
- N+1 queries; a query or API call inside a loop.
- Unbounded queries or result sets (no `LIMIT`, no pagination), loading a whole table or file into memory.
- A new query on a big table without an index that serves it.
- Synchronous I/O or heavy CPU on a request path or UI thread; work repeated inside a hot loop that could be hoisted.
- Payload, cache or memory that grows with usage and is never trimmed.

**Rollout**
- Old and new code run side by side during a deploy: can each read what the other writes (rows, cache entries, queue messages, stored JSON)?
- Migration order: does the code need the migration first, or must the migration wait for the code? Can it be rolled back?
- Feature flag default: what happens on deploy before anyone flips it?
- Retried or queued jobs created by the old code, carrying the old payload shape.

**Tests**
- New logic without a test, especially branches and error paths.
- Tests that cannot fail: asserting on a mock's return, no assertion, snapshot updated blindly, `expect(true)`.
- Test changed to match new (wrong) behaviour instead of fixing the code.
- Flaky ingredients: real time, random, network, order dependence, sleeps.

## Don't report
Style, naming, formatting, architecture opinions, "consider adding a comment", hypothetical bugs with no reachable path, and anything the type checker or linter already rejects.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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