/profile-skills:perf-cifrom Profile Skills
Keep performance from regressing as agents ship changes - adopt perf-policy.toml (benchmarks, noise-calibrated tolerances, budgets for latency, startup, memory, bundle size, query/exec counts and Core Web Vitals) on top of test-skills' R1-R5 rigor tiers, and wire a CI gate that builds base and head on the same runner, compares them interleaved and paired with a confidence-interval rule (perfkit suite + gate), reads its policy from the base branch so a PR can't loosen it, and is proven to fail on an injected regression and pass a clean change; CodSpeed, Bencher, github-action-benchmark, Lighthouse CI and size-limit where they fit. Use this skill whenever the user asks to add performance or benchmark checks to CI, catch perf regressions in PRs, set performance budgets or SLOs, track benchmarks over time, fix flaky perf tests, gate bundle size or Lighthouse scores, or add performance rules for agents to a repo. For one-off measurement use perf-measure; for optimizing use perf-optimize.
Ships in Profile Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Performance regressions arrive one plausible PR at a time, and agents raise the rate. A gate that works:
PK=${CLAUDE_SKILL_DIR}/../perf-measure/scripts/perfkit.py. Templates are in assets/.
Inventory first. Collect:
assertNumQueries;test-policy.toml (rigor tiers, CI tiers);Reuse what's there.
Pick a strategy per metric (references/strategies.md):
| Metric | PR gate |
|---|---|
| CPU-bound wall time (CLI, library hot path) | perfkit suite: same-runner interleaved paired A/B; tolerance ≥ max(5%, 2.5× A/A spread), typically 7–10% on GitHub-hosted runners |
| many micro-benchmarks, tight thresholds | CodSpeed simulation (instruction counts, Linux; excludes I/O) |
| deterministic counts: bytes, queries, execs, allocations | [[metric]] + [[budget]], exact |
| page load / interaction | browser_trace.mjs metrics or LHCI, median of 5, generous budgets |
| trends on main | Bencher / github-action-benchmark / asv, plus change-point detection; not PR-blocking |
Adopt the policy. Copy assets/perf-policy.toml to the repo root.
test-policy.toml (ADR-0004). Give each [[benchmark]] the
paths it protects, so the gate looks up their tier. perf-policy tiers may only raise
rigor. Without test-skills, the default is R3.--engine hyperfine). perfkit's rule decides.min_effect ≥ the largest A/A |change|, and
max_regression ≥ 2× that. Record the A/A numbers as comments in the policy.Vendor perfkit with ${CLAUDE_SKILL_DIR}/scripts/vendor_perfkit.sh tools/perfkit
(stdlib only), so CI doesn't depend on the plugin.
Wire CI from assets/github-actions.yml:
perfkit suite --policy-ref <base sha>, then perfkit gate --policy-ref <base sha>;Also:
shell: bash (pipefail), or a failing gate behind | tee shows green;perf-policy.toml, benchmarks/ and .github/workflows/ with CODEOWNERS. PR
workflows run the PR's own copy of the workflow file, so only review can stop a PR from
switching the gate off.Tiers.
paths the diff touches, within about 10 minutes.Align with test-ci's tiers.
Prove the gate both ways. This is not optional. Show the output of each case:
sleep, a quadratic loop, or an uncompiled regex in the hot
path): FAIL with regressed;perf-policy.toml or shrinks the benchmark: still FAIL,
judged by base's rules;Record the results in the PR description and a lore note.
Agent rules. Add assets/agent-block.md to CLAUDE.md / AGENTS.md.
max_runs) and pairing;perfkit doctor). A CPU change explains
many "regressions" in history.gate.json numbers attached. Calibration and the both-ways proof go in a lore note
linked from the adoption task.test-policy.toml. Perf jobs follow test-ci's
PR/main/nightly tiers and time budgets. Deterministic budgets that belong next to the code
(query counts, memory limits) go through test-plan's admission rules.perf-ci/ and
.perf/ outputs are disposable (.housekeeping.toml [junk] patterns).references/strategies.md: same-runner A/B, instruction counts, Bencher, github-action-benchmark, asv, change points, choosing tolerances.references/web-budgets.md: LHCI, size-limit, lab-vitals budgets, field data.references/policy.md: the perf-policy.toml schema and how suite and gate decide.assets/perf-policy.toml, assets/github-actions.yml, assets/lighthouserc.json, assets/agent-block.md; scripts/vendor_perfkit.sh.assets/agent-block.md (opens in a new tab)assets/github-actions.yml (opens in a new tab)assets/lighthouserc.json (opens in a new tab)assets/perf-policy.toml (opens in a new tab)references/policy.md (opens in a new tab)references/strategies.md (opens in a new tab)references/web-budgets.md (opens in a new tab)scripts/vendor_perfkit.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (opum-ai/profile-skills) — no native marketplace selected
npx claudepluginhub p/opum-ai-profile-skills3 skills in this plugin
/perf-measureGather performance evidence without changing the code - profile to find where time or memory goes (Python, Node, Bun, browser, Bash), benchmark and compare two versions/branches/runtimes with interleaved runs and a confidence-interval verdict, verify someone's claimed speedup by independent re-measurement, or review a diff/PR for performance regressions with measured confirmation. Use this skill whenever the user asks to profile, find a bottleneck or hotspot, "why is this slow", "where is the time going", "what's using the memory", wants a flame graph, asks to benchmark or compare implementations, "is this faster", "did this regress", "is this speedup real", "will this PR be slow", "check this for perf issues", or hands you a .prof, .cpuprofile, speedscope, trace.json or benchmark JSON. To change code to make it faster use perf-optimize; to add CI gates use perf-ci./perf-optimizeMake code measurably faster or leaner without breaking it - the recursive loop of baseline → profile → one hypothesis → one change → re-measure with statistics → keep only if significant AND tests stay green, otherwise revert and record why, repeat until a stop rule fires - for Python, JavaScript/TypeScript on Node and Bun, browser pages and Bash. Pins behaviour first (tests and coverage of the changed path, kill matrix at higher rigor), records every experiment (kept or rejected) in Quest and lore, hands concurrency and algorithm-equivalence questions to proof-skills, and scales evidence with the R1-R5 rigor profiles. Use this skill whenever the user asks to speed something up, optimize, reduce latency/memory/startup/build time/bundle size/page load, says something is "slow", "takes forever", "times out" or "uses too much memory", wants a performance pass, or asks to iteratively/recursively improve performance - even if they never say "profile". For measuring or reviewing without changing code use perf-measure; for CI gates use perf-ci.