codereview
/octopus:codereview is the agentβs self-review pass on uncommitted
changes. It reads the staged diff, routes it to the right specialist
skills and roles, and aggregates everything into a single
severity-tiered report before a commit ever lands.
What it solves
Ad-hoc review checklists are inconsistent β the items you remember
depend on the day and on how tired you are. codereview fixes that by
treating the diff as a routing signal: billing code automatically
triggers the money audit, auth changes trigger the security role, DTO
changes trigger the contract check. Nothing is skipped because someone
forgot to run it.
It also catches the things no specialist covers β debug statements left in production files, functions that grew past 50 lines, nesting depth that crept past four levels β through a lightweight fallback checklist that runs after every dispatch.
How it works
The command runs five phases:
-
Detect β
git diff --name-only HEADclassifies each changed path against a routing matrix. -
Dispatch β matching skills and roles run concurrently. Each receives the same diff context and emits findings in its own severity format.
Signal in the diff Dispatch Migrations, SQL files, ORM mappings dbaroleAuth, JWT, OAuth, secrets, credential paths securityroleBilling, payment, money-touching code audit-moneyskillMulti-tenant queries, IgnoreQueryFilters()audit-tenantskillBoth api/and frontend stacks in the same diffaudit-contractsskillAny production code change architectrole (always)Data-layer changes require both
dbaandarchitectto clear. Auth/secrets changes require bothsecurityandarchitect. -
Fallback checklist β covers what no specialist skill owns:
TODO/FIXME/HACKintroduced in the diff, debug statements (console.log,print(),debugger) in non-test files, files exceeding 800 lines, functions exceeding 50 lines, nesting depth above four levels. -
Definition of Done β when
docs/definition-of-done.mdexists, the DoD is validated against the diff and its verdict folded into the report as advisory findings. When the file is absent, this step is silently skipped. -
Aggregate β findings from all dispatched skills, roles, and the fallback checklist are merged into one report ordered by severity: BLOCKING / CRITICAL β ADVISORY / HIGH β MEDIUM β LOW / QUESTION.
The commit is blocked if any BLOCKING or CRITICAL finding remains open. Advisory findings surface in the report but do not block β they belong in the PR description as follow-ups.
Usage & parameters
/octopus:codereviewNo flags. The command reads the current working-copy diff automatically.
Pairing
/octopus:pr-reviewβ self-review of a PR the agent already opened, with reviewer assignment. Narrower scope thancodereview; runs every time on every PR./octopus:respond-to-reviewβ processing feedback from human reviewers after the PR is open.