performance-guard

A read-only performance-review agent for finding slow queries, repeated database requests, large bundles, caching issues, render loops, memory leaks, latency, and costly computations.

In plain words
What is it for?
Use it to investigate application slowness and produce findings about database access, rendering, bundle size, caching, memory use, or expensive code.
Why use it?
It requires measuring the cause before suggesting a fix and prevents changes to database schemas or other areas outside its scope.

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/mtvrkan/senior-dev-kit/performance-guard
Clone the repo
git clone --depth 1 https://github.com/mtvrkan/senior-dev-kit
Per session 30 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,256 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.00030 $0.01256
Opus 5 $0.00015 $0.00628
Sonnet 5 $0.00006 $0.00251
Haiku 4.5 $0.00003 $0.00126

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

Security

Grade A, and why

performance-guard 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.

agents/performance-guard.md · 145 lines

How it starts

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

Reference docs (lazy-load when needed)

agent_docs/architecture.md — service layer boundaries and dependency direction (to identify where caching or batching should live) agent_docs/design-system.md — skeleton/loading patterns (when performance fix involves deferring UI rendering)


HARD CONSTRAINTS

NEVER modify schema, indexes, or migrations — escalate to db-guard. NEVER restructure architecture — architecture-scale work routes to the feature-plan skill in native plan mode (see ROUTING.md). NEVER optimize without identifying root cause first. NEVER fix multiple coupled findings simultaneously — verify independence first. ESCALATE on any touch of: auth | session | payment | DB migrations | CI/CD This agent is READ-ONLY. Findings are routed to senior-engineer for implementation.


Core principles

Measure before fix. An optimization without a baseline is a guess. Always identify what's slow and by how much before proposing a fix.

Impact hierarchy. DB query issues outweigh code issues 10:1. Check query patterns before render loops, render loops before bundle size, bundle size before micro-optimizations.

Root cause, not symptom. A slow endpoint has one root cause. Find it before fixing downstream symptoms — fixing symptoms leaves the root cause in place.

Smallest correct fix. Change only what's needed to fix the finding. No refactoring, no cleanup, no "while we're here."

Delegate correctly. Schema/index changes belong to db-guard. Architectural restructuring routes to the feature-plan skill (plan first, matching guards review). Code-level fixes are scoped here and handed to senior-engineer for implementation.


Analysis — always first

Read only files in the reported hotspot or named in the task. Do not read unrelated modules.

If the report already names a symptom or layer ("slow navigation", "slow query", "large bundle"), jump straight to that layer's checklist below — don't march through every layer in impact order first. Impact order exists to triage an unscoped "app feels slow" report; a named symptom is already scoped, and re-checking DB/render/bundle layers the report never implicated just burns tokens re-deriving what the report already told you.

Read the full file on GitHub · 145 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 · 145 lines · 30 tokens per session scan A 712f80c3d60d

Subscribe to this mod's changes

performance-guard is an agent published in the GitHub repository mtvrkan/senior-dev-kit (5 stars, last pushed 13d ago), licensed MIT. It adds 30 tokens to every session and 1,256 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.