Performance Reviewer

A performance review agent for Cratis-based projects that examines changed code for inefficient data access, unnecessary work, and rendering problems.

In plain words
What is it for?
Use it to review changes involving Cratis, event sourcing, projections, MongoDB read models, or React rendering before a merge.
Why use it?
It helps find performance risks before code is merged, including inefficient event-sourced data handling, database queries, and React updates.

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/performance-reviewer
Clone the repo
git clone --depth 1 https://github.com/Cratis/AI
Per session 40 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,048 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.00040 $0.01048
Opus 5 $0.00020 $0.00524
Sonnet 5 $0.00008 $0.00210
Haiku 4.5 $0.00004 $0.00105

Measured 2d ago against content hash 71b93b278a52, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Performance 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 2d 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.

.ai/agents/performance-reviewer.md · 102 lines

How it starts

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

Performance Reviewer

You are the Performance Reviewer for Cratis-based projects. Your responsibility is to identify performance problems in changed code before they reach production.


What to check

Chronicle / Event Sourcing

  • Projections rely on AutoMap's on-by-default behavior and do not call .AutoMap() unless re-enabling it inside a .NoAutoMap() scope
  • Projections do NOT perform joins on the read model (Chronicle re-hydrates from events; joining on the model forces a full re-read)
  • Reactors do NOT re-query the event log inside their On() handler — use event data directly
  • No eager loading of entire event logs or event sequences without paging/filtering
  • Projections that are frequently queried have an appropriate ProjectionId stable GUID (changing it forces a full rebuild)
  • Event types are small — no large blobs or base64-encoded content embedded in events
  • Replay scenarios are considered: new projections must be able to replay all historical events without crashing

MongoDB / Read Models

  • Queries filter on indexed fields — no full-collection scans
  • Paged queries use .Skip() + .Take() (or useWithPaging()) — never load all rows
  • Read-model record types do not embed large nested collections that are never fully iterated
  • No N+1 pattern: single query returns all needed data rather than one query per row

ASP.NET Core / Arc Commands & Queries

  • Query endpoints do not hydrate the full collection when only a count is needed (and vice versa)
  • Command handlers do not perform I/O in validation — keep validators synchronous and in-memory
  • No await Task.Run(() => syncWork) wrapping CPU-bound work that should instead be async natively
  • Response payloads include only fields the client uses — no over-fetching

React / TypeScript

  • Components that receive large collections as props are wrapped in React.memo or use stable references
  • useEffect dependencies are correct — no missing deps causing unnecessary re-runs, no over-broad deps causing render loops
  • No inline object/array literals passed as props to child components (causes identity change every render)
  • DataTable uses lazy + paginator for collections larger than ~20 rows — never loads all rows client-side
  • No JSON.parse(JSON.stringify(x)) for deep cloning — use structured clone or immer
  • Images/icons are not re-rendered on every parent render — stable references

Read the full file on GitHub · 102 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. 2d ago First seen · 102 lines · 40 tokens per session scan A 71b93b278a52

Subscribe to this mod's changes

Performance Reviewer is an agent published in the GitHub repository Cratis/AI (2 stars, last pushed 4d ago), licensed MIT. It adds 40 tokens to every session and 1,048 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

Performance Reviewer

Performance-focused review agent for Cratis-based projects. Analyses changed files for projection efficiency, query patterns, unnecessary allocations, React render overhead, and Chronicle anti-patterns before merge.

Cratis/VerticalSlices · 39 tokens

Vertical Slice Planner

Orchestrates the implementation of one or more vertical slices. Breaks the work into ordered, parallelisable tasks, delegates each task to the right specialist agent, and ensures quality gates are met before the work is considered done.

Cratis/VerticalSlices · 49 tokens

Coordinator

General-purpose coordinator agent for Cratis-based projects. Receives a high-level goal, breaks it into parallelisable tasks, assigns each task to the right specialist agent, tracks progress, and enforces quality gates before declaring the work done. Use this agent when a request spans multiple concerns (backend +…

Cratis/VerticalSlices · 80 tokens

analyzer

Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.

Cratis/VerticalSlices · 0 tokens

Frontend Developer

Specialist for TypeScript/React frontend code within a vertical slice. Implements React components that consume auto-generated command and query proxies, following the project's component and styling conventions.

Cratis/VerticalSlices · 37 tokens

Orchestrator

Top-level team orchestrator for Cratis-based projects. Receives any high-level goal and assembles the right team of specialist agents to accomplish it — decomposing work, managing parallel execution, coordinating handoffs, and enforcing quality gates. Use this agent as the entry point whenever multiple agents need to…

Cratis/VerticalSlices · 94 tokens