agentleFS
pekralpekral/cursor-rules/skills/benchmark/SKILL.md

benchmark

Skill10 starsChanged 4 months agoMITView on GitHub

Use when measuring performance baselines or detecting regressions before and after a change in a Laravel app — page Core Web Vitals, API latency percentiles, build/test velocity, and DB query timing, stored as git-tracked baselines for team comparison.

51 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-deploy, cso and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 9 projects that use this

  • ayudaySkill

    cso

    Chief Security Officer mode. Performs OWASP Top 10 audit, STRIDE threat modeling, attack surface analysis, auth flow verification, secret detection, dependency CVE scanning, supply chain risk assessment, and data classification review. Use when: "security audit", "threat model", "pentest review", "OWASP", "CSO review".

    Also in 8 projects that use this

  • AICreator-WindSkill

    document-release

    技术作家工具。更新项目文档。

    Also in 9 projects that use this

  • Kit4SomeSkill

    unfreeze

    Also in 9 projects that use this

  • seek888Skill

    design-html

    Design finalization: generates production-quality Pretext-native HTML/CSS. Works with approved mockups from /design-shotgun, CEO plans from /plan-ceo-review, design review context from /plan-design-review, or from scratch with a user description. Text actually reflows, heights are computed, layouts are dynamic. 30KB overhead, zero deps. Smart API routing: picks the right Pretext patterns for each design type. Use when: "finalize this design", "turn this into HTML", "build me a page", "implement this design", or after any planning skill. Proactively suggest when user has approved a design or has a plan ready. (gstack) Voice triggers (speech-to-text aliases): "build the design", "code the mockup", "make it real".

    Also in 5 projects that use this

  • CodeWithBehnamSkill

    setup-browser-cookies

    Import cookies from your real browser (Comet, Chrome, Arc, Brave, Edge) into the headless browse session. Opens an interactive picker UI where you select which cookie domains to import. Use before QA testing authenticated pages.

    Also in 8 projects that use this

  • +2 more from ayuday

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 45 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep secrets and private payloads out of baseline JSON and logs.

    line 23
  2. Very specific:

    Do not use for live design advice (use latency-critical-systems) or for diagnosing one Telescope request (use …

    line 31
  3. Distinctive:

    Run 3–5 times; report median.

    line 45
  4. Very specific:

    Test suite: time php artisan test or vendor/bin/pest (note parallel vs serial).

    line 57
  5. Distinctive:

    Run each at least twice; report cold and warm separately (Composer/PHPStan caches matter).

    line 59
  6. Very specific:

    Run EXPLAIN (or EXPLAIN ANALYZE on MySQL 8) per @rules/sql/optimalize.mdc.

    line 63

“Common” is measured: kept by at least 6 in 10 of the 45 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Benchmark (Laravel)

Measure real performance baselines for a Laravel app and detect regressions by comparing before/after a change. This skill measures — it produces honest numbers and verdicts. For design guidance on hot paths, defer to @skills/latency-critical-systems/SKILL.md; to act on a regression with an optimization loop, hand off to @skills/benchmark-optimization-loop/SKILL.md.

Constraints

  • Apply @rules/sql/optimalize.mdc when reading or interpreting query timing (N+1, index usage, SARGable filters).
  • Apply @rules/code-testing/general.mdc if you add or touch any benchmark test (Pest, no describe()).
  • Measure, never guess — every number must be a real readback from a running system, command, or tool.
  • Control for noise: separate warm vs cold, run repeats (≥5), report median plus p95, fix one variable at a time.
  • Same machine, same dataset, same config for before and after — note the environment so a teammate can reproduce.
  • Keep secrets and private payloads out of baseline JSON and logs.

Use when

  • You need a performance baseline for a page, API route, build step, or query.
  • A change (PR, dependency bump, query rewrite, config change) may have caused a regression and you must prove it either way.
  • You are comparing two implementations or stack options on the same workload.
  • Someone claims "it's faster/slower" without a measured before/after.

Do not use for live design advice (use latency-critical-systems) or for diagnosing one Telescope request (use @skills/laravel-telescope/SKILL.md).

Execution

Pick the modes that match the change. Always record environment first: app URL, commit SHA, APP_ENV, dataset size, cache/opcache state, and whether the run is cold (first hit, caches cleared) or warm (steady state).

Mode A — Page performance (Core Web Vitals)

Measure against the running Laravel app (php artisan serve or the real host).

  • Run Lighthouse: npx lighthouse <url> --output=json --output-path=./lh.json --only-categories=performance --chrome-flags="--headless".
  • Capture: LCP (target < 2.5s), CLS (< 0.1), INP (< 200ms), FCP (< 1.8s), TTFB (< 0.8s).
  • Capture resource weight: total transfer, JS/CSS bytes (post-Vite build), render-blocking resources, request count.
  • Run 3–5 times; report median. Lighthouse is noisy — discard the first (cold) run unless cold is the metric you want.

Mode B — API performance (latency percentiles + load)

Target real Laravel routes/controllers. Authenticate as needed; use a realistic payload.

  • Quick percentiles: wrk -t4 -c50 -d30s --latency https://app.test/api/orders (reports p50/p90/p99).
  • Apache Bench alternative: ab -n 1000 -c 50 https://app.test/api/orders.
  • Scripted scenarios (auth, POST bodies, ramp): use k6 (k6 run script.js).
  • Capture: p50 / p95 / p99 latency, throughput (req/s), error rate, response size. Warm the route first, then measure.

Mode C — Build / dev velocity

  • composer install (cold = no vendor, no cache): time it.
  • Asset build: time npm run build (Vite production) and HMR warm-reload feel.
  • Test suite: time php artisan test or vendor/bin/pest (note parallel vs serial).
  • Static analysis: time vendor/bin/phpstan analyse and time vendor/bin/pint --test.
  • Run each at least twice; report cold and warm separately (Composer/PHPStan caches matter).

Mode D — DB query timing

  • Identify the hot query via @skills/laravel-telescope/SKILL.md or the slow-query log.
  • Run EXPLAIN (or EXPLAIN ANALYZE on MySQL 8) per @rules/sql/optimalize.mdc; record rows examined, key used, and whether a full scan occurs.
  • Time the query itself, not the surrounding PHP, to isolate DB cost; cross-check with the Telescope duration for the same request.

Before / After comparison

  1. On the base state (before the change), run the relevant modes and write the baseline JSON.
  2. Apply the change. Re-run the same modes on the same environment and dataset.
  3. Compute the delta and verdict per metric. Re-run any metric whose delta is within run-to-run noise before declaring a regression or win.

Output

Baseline JSON

Store git-tracked, one file per logical target, under tests/Benchmark/ (or .benchmarks/ if you prefer a non-test location). Commit so the team shares one reference.

{
  "target": "GET /api/orders",
  "mode": "api",
  "captured_at": "2026-06-15T10:00:00Z",
  "commit": "abc1234",
  "environment": { "app_env": "local", "dataset": "10k orders", "state": "warm", "runs": 5, "tool": "wrk" },
  "metrics": {
    "p50_ms": 42,
    "p95_ms": 110,
    "p99_ms": 180,
    "throughput_rps": 940,
    "error_rate": 0.0
  }
}

For page mode use keys lcp_ms, cls, inp_ms, fcp_ms, ttfb_ms, js_bytes, transfer_bytes; for build mode seconds per step (cold/warm); for DB mode query_ms, rows_examined, key_used.

Comparison table

Report one row per metric with the delta and an explicit verdict.

MetricBeforeAfterDeltaVerdict
p95 (ms)11078-29%improved
p99 (ms)180175-3%noise
throughput (rps)9401280+36%improved
error rate0.0%0.4%+0.4ppregressed

Verdict legend: improved / regressed / noise (delta within run-to-run variance) / target-miss (still below the target threshold). State the threshold and the noise band you used.

Done when

  • Environment is recorded (URL, commit, env, dataset, cold/warm, run count, tool) so the run is reproducible.
  • Each in-scope metric has a real measured value from at least the agreed number of repeat runs — never an estimate.
  • A git-tracked baseline JSON exists for every measured target.
  • For a change review, a before/after comparison table with per-metric delta and verdict is produced, and noise-band deltas are not reported as wins or regressions.
  • Any confirmed regression or target-miss is flagged for @skills/benchmark-optimization-loop/SKILL.md or @skills/mysql-problem-solver/SKILL.md as appropriate.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.