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/pekral/cursor-rules/benchmark-optimization-loopnpx skills add pekral/cursor-rules --skill benchmark-optimization-loopgit clone --depth 1 https://github.com/pekral/cursor-rulesWhat 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.00052 | $0.01579 |
| Opus 5 | $0.00026 | $0.00790 |
| Sonnet 5 | $0.00010 | $0.00316 |
| Haiku 4.5 | $0.00005 | $0.00158 |
Grade A, and why
benchmark-optimization-loop 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 — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Benchmark Optimization Loop (Laravel/PHP)
Turn "make it faster" into a recursive, measured loop. Every promoted change beats a recorded baseline on a real measurement and keeps correctness green. No baseline, no budget, no promotion.
Constraints
- Apply
@rules/sql/optimalize.mdcfor any query change (N+1, eager loading, index usage, batching). - Apply
@rules/code-testing/general.mdc— the correctness gate is the project test suite. - Measure, never guess. Every win is a real readback, not a label or intuition.
- Never trade correctness for speed: a faster variant that changes output is rejected, not promoted.
- Defer all measurement mechanics (how to run, warm-up, repetitions, noise) to
@skills/benchmark/SKILL.md. This skill owns the loop and the gate, not the stopwatch.
Use when
- The goal is unquantified speed: "make it faster", "it's slow", "reduce p95".
- You are eliminating an N+1, tuning a query, choosing a cache strategy, or raising queue throughput.
- Multiple candidate fixes exist and you must pick the one that actually wins.
- A "faster" claim was made without a before/after number.
Do not use for first-time correctness (use @skills/test-driven-development/SKILL.md)
or pure latency architecture without a comparison loop (@skills/latency-critical-systems/SKILL.md).
Required baseline
Before touching any code, write down all five. If any is missing, stop and define it.
- Operation — the exact thing optimized (route, Action, job, query).
- Correctness gate — the tests that must stay green (per
@rules/code-testing/general.mdc). Identical output for identical input. - Metric — pick one primary: wall time, p95 latency, rows/sec, queries/request, cost/run, memory, queue throughput.
- Baseline value — measure the current code via
@skills/benchmark/SKILL.md. Record the number and its variance. - Budget — the stopping line, set up front:
- target (e.g. "p95 < 200 ms" or "≤ 5 queries/request"), AND
- cost cap (time/effort/iterations you will spend), AND
- noise threshold (smallest delta that counts as real, from the baseline variance).
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 · 100 lines · 52 tokens per session scan A f0879660edac
benchmark-optimization-loop is a skill published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 7d ago), licensed MIT. It adds 52 tokens to every session and 1,579 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
vue-pages
Generate Vue frontend pages using catch-table for CatchAdmin module with full component features.
curd
Generates complete CRUD module from database table definition. Orchestrates 9 sub-skills. Use when user says "create CRUD", "generate module from table", or provides a table structure.
model
Generate Eloquent model for CatchAdmin module with full CatchModel features.
parse-table
Parse table definition to extract module name, model name, table name, and field definitions. First step of CRUD generation.
controller
Generate CRUD controller for CatchAdmin module.
migration
Generate database migration file for CatchAdmin module.