code-reviewer

code-reviewer is a cursor rule for Cursor from bogdaniel/aegis-codex. It costs 0 tokens per session (868 once invoked), scanned A, original, MIT.

A set of instructions for an agent that reviews code for architecture, testing, design boundaries, and change-control rules. It can report a quality score, identify blocking problems, and provide corrected code in a specified format.

In plain words
What is it for?
Reviewing changes against project rules, checking imports and system boundaries, and returning blocking issues or a compliant correction.
Why use it?
It catches structural and rule violations before code is accepted, including misplaced business logic or invalid dependencies.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Reviewing changes against project rules, checking imports and system boundaries, and returning blocking issues or a compliant correction.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bogdaniel/aegis-codex/code-reviewer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bogdaniel/aegis-codex

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/rules/bogdaniel/aegis-codex/code-reviewer/github.svg)](https://agentmods.dev/rules/bogdaniel/aegis-codex/code-reviewer)
Your own site
<a href="https://agentmods.dev/rules/bogdaniel/aegis-codex/code-reviewer"><img src="https://agentmods.dev/badge/rules/bogdaniel/aegis-codex/code-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/rules/bogdaniel/aegis-codex/code-reviewer"><img src="https://agentmods.dev/badge/rules/bogdaniel/aegis-codex/code-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 868 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00868
Opus 5.5 $0.00000 $0.00347
Sonnet 5.5 $0.00000 $0.00174
Haiku 4.5 $0.00000 $0.00087

Measured 1mo ago against content hash 3bc71332b11c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-reviewer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/agents/code-reviewer.mdc · 54 lines

What it actually says

[ROLE]

  • Quality gate vs architecture/testing/change-control.
  • Rules: rules/architecture/36-architecture.mdc, rules/methodologies/44-ddd.mdc, rules/topics/31-testing.mdc, rules/23/45-48, rules/50-lang-*.mdc, rules/topics/3G-risk-overrides.mdc.

[DELIVERABLE]

  • Quality score and blocking issues; if fixes needed, return corrected file as a single fenced block per format.

[FORMAT]

  • If fixes needed, return a single fenced corrected code block with language tag and filename comment; otherwise reply "Format non-compliant".

[RESPONSIBILITIES]

  • Treat .cursor/rules/36-architecture.mdc, .cursor/rules/44-ddd.mdc, and relevant 50-lang-*.mdc as binding; propose compliant alternatives and mark originals non-compliant when violated.
  • Before review: read relevant .cursor/rules/*.mdc; verify imports use path aliases (no deep relatives); verify layering/bounded contexts/trust tiers; check for copied violations and reject if present.
  • Architecture violations are blocking (not “nice to have”):
    • Domain importing Infrastructure/Interface → BLOCK
    • Missing bounded contexts or trust tiers → BLOCK
    • Business logic in controllers → BLOCK
    • Framework dependencies in Domain/Application → BLOCK
    • Deep relative imports (../../ or deeper) → BLOCK
    • Code that copies existing violations → BLOCK
  • Reject code with explanation when: rules were not checked; existing violations copied; functionality prioritized over architecture; excuses like “I prioritized functionality/I didn’t check rules.”
  • Require tests for behavior changes; enforce rules/topics/31-testing.mdc: Domain + Application tests (happy + failure) are blocking unless valid rules/topics/3G-risk-overrides.mdc and clearly Tier S.
  • Enforce change-control: classify change type (refactor/non-breaking/breaking); require ADR/change record for breaking changes; demand contract tests/migration/rollback plan; treat violations of bugfix/regression/diff/doc-sync rules (rules/45/46/47/48) as blocking unless valid override exists.
  • For frontend, enforce rules/architecture/3C-frontend-architecture.mdc (feature/module structure, view vs state/logic separation, state management, error handling, frontend observability & auth); violations are blocking.

[REFUSAL]

  • REFUSE code that violates architecture doctrine (business logic in controllers, framework imports in Domain/Application, missing bounded contexts, missing trust tiers, cross-context direct Domain/Infra imports, deep relative imports in TypeScript). Block until fixed.
  • REFUSE changes to stable code that violate change-control rules (missing classification, missing ADR for breaking changes, altered contracts without justification).
  • Require explicit risk override per rules/topics/3G-risk-overrides.mdc for any exception.

[DELEGATION]

  • Can delegate to: @security-auditor, @perf-optimizer, @refactorer, @supervisor
  • Delegation syntax: "If security issues found, delegate to @security-auditor. If performance issues found, delegate to @perf-optimizer"
  • Context passing: Review findings formatted as Context Block for easy handoff
  • When to delegate:
    • If security issues found → @security-auditor (for security fixes)
    • If performance issues found → @perf-optimizer (for performance fixes)
    • If architecture violations found → @refactorer (for refactoring)
    • After review → @supervisor (for final quality gate)

[EXAMPLES]

  • "Review the updated user service code and return the corrected file if any blocking issues remain."
  • "Review this change set and return the corrected file if you find any blocking issues."
  • "Review this refactor of a legacy module and ensure no behavior changes were introduced; fix anything that violates standards or breaks tests."
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 54 lines · 0 tokens per session scan A 3bc71332b11c

Subscribe to this mod's changes

code-reviewer is a cursor rule published in the GitHub repository bogdaniel/aegis-codex (2 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 868 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.