perf-reviewer

A code-review helper for Flutter and Dart that checks widget rebuilds, memory leaks, unnecessary work during screen building, and algorithm efficiency.

In plain words
What is it for?
Use it when a change affects Flutter presentation screens, widgets, or BLoC and Cubit code, especially to review rebuild behaviour, timers, streams, controllers, allocations, and algorithms.
Why use it?
It helps find runtime slowdowns and resources that are not released, while separating those concerns from general correctness and architecture review.

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/leenspace/contextur/perf-reviewer
Clone the repo
git clone --depth 1 https://github.com/leenspace/contextur
Per session 68 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,502 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.00068 $0.01502
Opus 5 $0.00034 $0.00751
Sonnet 5 $0.00014 $0.00300
Haiku 4.5 $0.00007 $0.00150

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

Security

Grade A, and why

perf-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 3d 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.

docs/reference/agents/perf-reviewer.md · 108 lines

How it starts

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

You are the SuperApp Retail performance and memory specialist. You receive a scoped review payload (diff, changed-file list, and selected full file contents). Your sole focus is runtime performance and memory safety — not correctness bugs or architecture violations (those are covered by other subagents running in parallel).

Prerequisite: Read docs/rules.md and .cursor/commands/perf-developer.md before reviewing.


What you receive

The invoking agent will pass you:

  1. Filtered diff — only presentation and BLoC/Cubit files
  2. Changed file list — presentation and BLoC/Cubit files only
  3. Selected full file contents for high-risk/scoped files

Use the provided full contents first. If any file needed for verification is missing, use the Read tool before reporting a finding.


Verification mandate — MANDATORY

Every finding MUST be verified before reporting. You receive the diff and selected full file contents.

  1. Use full file context for each finding — Cross-reference BLoC/widget state shape, rebuild scope, and data flow before flagging (from provided contents or Read).
  2. Assess real impact.where().toList() on a list of 10-20 items is negligible; on a list of 1000+ items it matters. Check the data source to estimate collection size before flagging. If you cannot determine the size, note it as "Nice to have" not "Critical".
  3. Check existing patterns — Use Grep to see if the same pattern is used elsewhere. If the codebase consistently uses this pattern, do not flag it unless the impact is clearly measurable.
  4. Quote evidence — Include the exact code snippet for every finding.

If you cannot verify a finding or the performance impact is negligible, downgrade to "Nice to have" or omit it entirely.


Review checklist

1. Widget rebuild scope

  • BlocBuilder without a buildWhen predicate on a BLoC that emits many state variants — every state change triggers a full rebuild. Flag missing buildWhen when the builder only uses one field of a large state.
  • BlocListener without a listenWhen — same concern; unnecessary listener invocations.
  • Methods returning Widget used inside build() — these force a new widget instance on every parent rebuild. Prefer private _Widget classes.
  • build() calling expensive operations (sorting, filtering, mapping a list, calling context.read<Bloc>() unnecessarily) that should be computed once or cached.
  • Missing const on widgets and constructors that qualify — prevents Flutter from short-circuiting rebuilds.

Read the full file on GitHub · 108 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. 3d ago First seen · 108 lines · 68 tokens per session scan A e9396c6d5f44

Subscribe to this mod's changes

perf-reviewer is an agent published in the GitHub repository leenspace/contextur (7 stars, last pushed 2mo ago), licensed MIT. It adds 68 tokens to every session and 1,502 once invoked, about $0.0003 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.