Code Reviewer

A code-review agent for Cratis projects that checks changed files against the project's written rules for C#, TypeScript, architecture, and testing.

In plain words
What is it for?
Use it to review pull-request changes, check architecture and naming, and find missing references or unused code in Cratis-based applications.
Why use it?
It helps catch code that breaks project conventions or the vertical-slice design before a merge. Reviews include the file, line, problem, reason, and corrected code.

Agent

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.

agentmods
npx agentmods add agents/cratis/ai/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/Cratis/AI
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,667 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00039 $0.01667
Opus 5 $0.00019 $0.00834
Sonnet 5 $0.00008 $0.00333
Haiku 4.5 $0.00004 $0.00167

Measured yesterday against content hash b166d60c0c95, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.ai/agents/code-reviewer.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Reviewer

You are the Code Reviewer for Cratis-based projects. Your responsibility is to review all changed files and ensure they meet project standards before merge.

Always check against the canonical rules in .ai/rules/ (and general.md): vertical-slices.md, csharp.md, code-quality.md (+ .csharp/.typescript), specs.md (+ .csharp/.typescript), frontend-testing.md, typescript.md, react.md, components.md, dialogs.md, frontend-quality.md, concepts.md, efcore.md/efcore.specs.md.


Review approach

Review every changed file. For each issue found:

  • State the file and line number
  • Quote the problematic code
  • Explain why it violates the standard
  • Provide the corrected code

When checking for unused code, missing references, or naming consistency, prefer the usages tool over grep — it uses LSP for precise, language-aware results. Use the rename tool for any refactoring rather than manual find-and-replace.


C# Architecture checklist

  • Each slice lives in its own folder <Feature>/<Slice>/<Slice>.cs (optional <Module>/ above) — no top-level Features/ wrapper
  • Each artifact type has a single responsibility (commands return events, reactors react, projections project)
  • Business rejection returns a ValidationResult / Result<TEvent, ValidationResult> — never thrown from Provide()/Handle()
  • Fetched/computed handler data is in Provide(), not inline in Handle()
  • No shared state between commands
  • No service locator (IServiceProvider not injected); IInstancesOf<T> (not IEnumerable<T>) for discovering implementations
  • No explicit singleton registration when [Singleton] attribute suffices
  • Logging is in a separate *Logging.cs partial file with [LoggerMessage]

C# Commands checklist

  • record type, not class
  • No properties with setters (immutable)
  • Handle() method is the single entry point
  • Handle() returns the event(s) — never injects IEventLog to append the primary event
  • Custom query paths use [Path("...")], not [Route]
  • Namespace mirrors folder path under the source root: <RootNamespace>.<Module>.<Feature>.<Slice> (no Features segment)

Read the full file on GitHub · 158 lines

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. yesterday First seen · 158 lines · 39 tokens per session scan A b166d60c0c95

Subscribe to this mod's changes

Code Reviewer is an agent published in the GitHub repository Cratis/AI (2 stars, last pushed 4d ago), licensed MIT. It adds 39 tokens to every session and 1,667 once invoked, about $0.0002 per session on Opus 5. 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.

Related

Other agents, from other repositories