CataloguePerformance, Scale & Cost
Performance Anti-Pattern Audit
Finds work on the request path that will not survive a busier day: queries in loops, blocking calls, and caches that grow without a limit.
What it examines
- A query or a remote call inside a loop
- Reads with no limit on a table that grows
- Slow work that holds the request open
- Blocking I/O inside an async handler
- Hot reads that are never cached
- Startup work repeated on every request
- In-memory collections that grow for the life of the process
What you get back
A findings file. Each item has the evidence, how serious it is, and a fix.
Dependencies
- An AI coding agent that reads SKILL.md files, such as Claude Code, Codex or Gemini CLI
- Read access to the repository
- Optional: APM traces or span exports. They let the audit rank findings by request latency and query count.
- Python 3 with the jsonschema package, to check findings.json before fixing anything
How it works
The audit is read-only. It searches the code for patterns that cost performance, such as queries inside loops, reads with no limit, slow calls made while a request waits, and blocking work inside async handlers.
It keeps only evidence it opened itself, and reports one finding per place in the code. With traces it ranks them by how much latency they add.
You get findings.json and findings.md. The remediate skill reads findings.json. You approve each change.
Setup
- Unzip the download. Copy the audit and remediate folders into your agent's skills folder (for Claude Code, .claude/skills/) in the repository you want to check.
- If you have APM traces, export them so the audit can use them. Skip this if you do not.
- Open the repository in your agent and ask it to run the c1-performance-anti-pattern-audit skill.
- Check the result with the validator: pip install jsonschema, then python3 schema/validate.py findings.json.
- Ask your agent to run the c1-performance-anti-pattern-remediate skill using findings.json. Fix some findings and leave the rest open if you like.
Run it with your agent
Copy the prompt, fill in the parts in square brackets, and paste it into your agent.
Run the c1-performance-anti-pattern-audit skill on this repository. APM traces or span exports: [path, or none]. Mode: audit only. Do not change any code. Write findings.json and findings.md in the repository root.
Run the c1-performance-anti-pattern-remediate skill using findings.json. Work through the findings I choose, and leave the rest open.