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 agentmods add skills/hculap/better-code/performance-patternsnpx skills add hculap/better-code --skill performance-patternsgit clone --depth 1 https://github.com/hculap/better-codeWhat 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 | $0.00061 | $0.01211 |
| Opus 5 | $0.00030 | $0.00606 |
| Sonnet 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 yesterday.
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.
- yesterday 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 7mo ago), licensed MIT. It adds 61 tokens to every session and 1,211 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.
Other skills, from other repositories
golden-jupyter-dir
Use when testing the goldenjupyterdir golden build.
golden-man-kw
Use when testing the man golden build.
skill-builder
Automatically detect source types and build AI skills using Skill Seekers. Use when the user wants to create skills from documentation, repos, PDFs, videos, or other knowledge sources.
golden-rss
Use when testing the rss golden build.
golden-chat-topics
Use when testing the goldenchattopics golden build.
golden-chat-single
Use when testing the goldenchatsingle golden build.