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.
npx skills add hculap/better-code --skill performance-patternsgit clone --depth 1 https://github.com/hculap/better-codeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hculap/better-code/performance-patterns)<a href="https://agentmods.dev/skills/hculap/better-code/performance-patterns"><img src="https://agentmods.dev/badge/skills/hculap/better-code/performance-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hculap/better-code/performance-patterns"><img src="https://agentmods.dev/badge/skills/hculap/better-code/performance-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00061 | $0.01211 |
| Opus 5.5 | $0.00024 | $0.00484 |
| Sonnet 5.5 | $0.00012 | $0.00242 |
| Haiku 4.5 | $0.00006 | $0.00121 |
Grade A, and why
performance-patterns 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performance Anti-Patterns Reference
N+1 Query Problem
The N+1 problem occurs when code executes N additional queries to fetch related data for N items from an initial query.
Identification:
- Queries inside loops
- Lazy loading of associations during iteration
- GraphQL resolvers fetching per-item
Fix Strategies:
- Eager Loading: Load related data in initial query
- Batching: Collect IDs, fetch all at once
- DataLoader: For GraphQL, batch and cache per-request
- Denormalization: Store computed/related data together
Severity: HIGH - Scales linearly with data size, causes exponential slowdown
Over-Fetching
Retrieving more data than needed from API or database.
Identification:
- SELECT * queries
- API endpoints returning full objects
- No field selection support
- Loading nested relations by default
Fix Strategies:
- Field Selection: Only query needed columns
- Sparse Fieldsets: Support
?fields=id,nameparameter - GraphQL: Let clients specify exact fields
- DTOs: Map to response-specific objects
Severity: MEDIUM - Increases bandwidth, memory, serialization time
Under-Fetching
Requiring multiple requests to get needed data.
Identification:
- Waterfall requests (request depends on previous)
- Multiple endpoints for related data
- No include/expand support
Fix Strategies:
- Compound Endpoints:
/users?include=orders - GraphQL: Single query for nested data
- BFF Pattern: Backend aggregates for frontend
- Parallel Requests: When dependencies allow
Severity: MEDIUM - Increases latency, connection overhead
Missing Pagination
Returning unbounded result sets.
Identification:
- List endpoints without limit
findAll()without pagination- No cursor for large datasets
Fix Strategies:
- Offset Pagination:
?page=1&limit=20 - Cursor Pagination:
?cursor=abc&limit=20(better for large sets) - Default Limits: Always apply max limit server-side
- Streaming: For very large exports
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.
- 1mo ago First seen · 164 lines · 61 tokens per session scan A e97082d1ee56
performance-patterns is a skill published in the GitHub repository hculap/better-code (2 stars, last pushed 13d ago), licensed MIT. It adds 61 tokens to every session and 1,211 once invoked, about $0.0002 per session on Opus 5.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.
Other skills, from other repositories
audit-dead-code
Read-only hunt for dead and unused code across four labeled lanes (Knip for TS/JS, vulture for Python, gopls for Go, grep for shell and files no lane owns), each candidate adjudicated dead, uncertain or alive. Use when asked to 'find dead code', to find what is unused in a repository (exports, functions, orphaned…
devils-advocate
Stress-test plans and proposals via systematic adversarial review. Assumption extraction, evidence check, failure scenarios, operational gotchas. Before implementation begins. Use when: asked to attack a plan or proposal ('devil's advocate', 'stress test', 'poke holes', 'what could go wrong'), or before implementation…
known-issues
Lookup and tracking of known Claude product issues: GitHub bug search, service health and model quality checks, and a persistent registry of tracked issues. Use when: 'is this broken', 'any workarounds', 'troubleshoot Claude Code', 'feature behaves unexpectedly', 'scan repo for issues', 'file a bug'. Actions: status…
diagnose
Diagnose unexpected behavior from Claude Code's built-in computer-use MCP server (desktop screen control). Use when: 'computer use', 'control my screen', 'screenshot is blurry', 'why is the screenshot low resolution', 'zoom in on the screen', 'screenshot capture failed', 'empty capture', 'clicks are landing in the…
target
Identify and rank optimization targets by evidence quality, so an unmeasured system yields 'instrument this first' instead of a guess. Accepts session pain, a named path, telemetry, or open-ended 'what is slow here'. Use when: 'what should we optimize', 'find the bottleneck', 'this feels slow', 'is X worth…
drive
Launch and operate the project's app, observe it and record evidence, without judging it. Actions: drive a feature, ready (what is reachable), capture one artifact, cleanup. Use when another skill, a scheduled run or a CI job needs the real app run and shown (/verification:confirm, /debugging:debug), or when asked to…