optimize-performance
Skill254 starsChanged 18 days agoMITView on GitHub
Improve software performance through falsifiable, one-change-at-a-time experiments with reproducible benchmarks, frequent green commits, independent review, and safe rollback of rejected uncommitted changes. Use when Codex must profile a hot path, design or repair a benchmark, optimize latency/throughput/memory, compare a candidate against a baseline, investigate a performance regression, or run an iterative performance campaign without compromising correctness or unrelated work.
- Deletes or force-pushes
7 other projects use a version of this.
Adopted by
Most recently taken up by
- wollemiahq/skillstheir own version, first seen Nov 1, 2026
- VelimirMueller/ai-development-skillstheir own version, first seen Oct 25, 2026
- textura-agency/next16-claude-startertheir own version, first seen Oct 14, 2026
- VelimirMueller/claude-skillstheir own version, first seen Oct 11, 2026
- emaraschio/cursor-commandstheir own version, first seen Aug 7, 2026
- igmarin/rails-agent-skillstheir own version, first seen Jul 30, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- textura-agency/next16-claude-starter★ 141same name
- igmarin/rails-agent-skills★ 26same name
- emaraschio/cursor-commands★ 9same name
- VelimirMueller/ai-development-skills★ 7same name
- VelimirMueller/claude-skills★ 7same name
- wollemiahq/skills★ 2same name
- gologo13/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 19 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
19
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run performance work as a sequence of controlled experiments.
- Distinctive: line 11
Read references/benchmark-methodology.md when choosing a benchmark harness, setting thresholds, diagnosing noise, or planning a …
- Distinctive: line 16
Read repository instructions and inspect the worktree, benchmark suite, profiler tooling, and recent performance history.
- Distinctive: line 29
If the existing benchmark is unfair or incomplete, fix and rebaseline it in a measurement-only commit before claiming runtime improvement.
- Distinctive: line 34
Start each experiment from a committed, tested checkpoint.
- Distinctive: line 38
If neither is possible, record the complete pre-experiment state before editing: HEAD and index, binary tracked diffs, untracked-path …
- Distinctive: line 46
Never use git reset --hard, git clean, broad git restore, or a checkout that could erase unrelated changes.
- Distinctive: line 51
Run focused correctness tests and the benchmark under stable conditions.
- Distinctive: line 62
Write this card before changing code:
- Distinctive: line 73
Keep speculative refactors, benchmark changes, and runtime changes in separate experiments.
- Distinctive: line 78
Run focused correctness tests first.
- Distinctive: line 79
Run the identical focused benchmark for baseline and candidate.
- Distinctive: line 84
If the result is noisy or the environment changed, classify it as inconclusive, normalize the conditions, and rerun.
- Distinctive: line 86
Run broader benchmarks. Confirm any apparent protected-workload regression with focused paired runs before deciding.
- Distinctive: line 88
Ask independent subagents to review semantics/concurrency and benchmark fairness.
- Distinctive: line 98
Run formatting, linting, typing, tests, coverage, API-signature checks, and platform/runtime variants required by the repository.
- Distinctive: line 103
Start the next hypothesis from that green checkpoint.
- Distinctive: line 115
Run the focused correctness test to prove the checkpoint still behaves as expected.
- Distinctive: line 150
Stop when the goal is met or the predeclared saturation rule fires.
“Common” is measured: kept by at least 6 in 10 of the 7 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.
Files
Optimize Performance
Run performance work as a sequence of controlled experiments. Retain only reproducible, practically useful wins that preserve correctness; leave the branch green after every decision.
Read references/benchmark-methodology.md when choosing a benchmark harness, setting thresholds, diagnosing noise, or planning a decision-grade campaign.
Establish the contract
- Read repository instructions and inspect the worktree, benchmark suite, profiler tooling, and recent performance history.
- State the user-visible goal and protected constraints: correctness, public API, concurrency, memory, startup, cleanup, fairness, and quality gates.
- Define representative target workloads and broader regression workloads. Verify that each benchmark exercises equivalent lifecycle and setup boundaries across candidates.
- Predeclare decision rules. Derive the minimum useful effect and regression tolerance from observed noise and project requirements; do not invent a universal percentage.
- Record the exact baseline commit, executable/runtime, dependency lock fingerprint, machine, power/CPU state, command, dataset, benchmark parameters, and raw artifact location.
- Declare a saturation rule, such as stopping after a fixed number of well-founded hypotheses fail to clear the useful-effect threshold.
If the existing benchmark is unfair or incomplete, fix and rebaseline it in a measurement-only commit before claiming runtime improvement.
Protect the worktree
- Start each experiment from a committed, tested checkpoint.
- Require a clean worktree or create an isolated worktree before editing, committing, or rolling back an experiment. Use sibling worktrees when baseline and candidate must be measured side by side.
- If neither is possible, record the complete pre-experiment state before editing: HEAD and index, binary tracked diffs, untracked-path inventory, and content hashes for pre-existing files the experiment might touch. Treat every pre-existing change as user work.
- In that fallback, capture the exact experiment patch separately, stage only experiment-owned hunks, and compare the complete post-rollback tree with the recorded pre-experiment state.
- Assign one writer. Use subagents for read-only profiling, hypothesis generation, semantic review, and benchmark-methodology review so concurrent edits cannot contaminate an experiment.
- Finish or pause CPU-heavy subagents and unrelated processes before official timing runs.
- Never use
git reset --hard,git clean, broadgit restore, or a checkout that could erase unrelated changes.
Build the baseline
- Run focused correctness tests and the benchmark under stable conditions.
- Pass a unique caller-provided artifact path or directory for every baseline and candidate run. Archive each raw result before the next run; never overwrite prior evidence.
- Repeat across fresh processes when supported. Inspect warmup, distributions, outliers, and environment metadata before summarizing.
- Profile a representative workload to locate the limiter. Do not use profiled timings as the benchmark result.
- Confirm the suspected cost is material enough to optimize.
Write one hypothesis
Write this card before changing code:
Hypothesis: <specific mechanism causing cost>
Change: <one bounded implementation change>
Target: <benchmark and expected direction/practical magnitude>
Risks: <semantics and protected workloads that might regress>
Accept: <correctness, stability, effect, and regression conditions>
Reject: <rollback conditions>Keep speculative refactors, benchmark changes, and runtime changes in separate experiments.
Run the experiment
- Make only the hypothesized change and add tests for any newly specialized path or invariant.
- Run focused correctness tests first. Reject immediately on unexplained semantic or API change.
- Run the identical focused benchmark for baseline and candidate. Alternate or randomize order when drift is plausible, and use sibling worktrees with equivalent path lengths, dependencies, and environment configuration.
- Compare raw distributions and paired results. Require a practical effect larger than the predeclared threshold and observed noise; statistical significance alone is insufficient.
- If the result is noisy or the environment changed, classify it as inconclusive, normalize the conditions, and rerun. Do not discard inconvenient samples selectively.
- Run broader benchmarks. Confirm any apparent protected-workload regression with focused paired runs before deciding.
- Ask independent subagents to review semantics/concurrency and benchmark fairness. Give them the diff and raw artifacts, not the intended verdict.
Decide immediately
Accept only when the target win is reproducible and practically useful, protected workloads remain within their declared tolerance, reviews find no benchmark gaming, and required tests pass.
When accepting:
- Run formatting, linting, typing, tests, coverage, API-signature checks, and platform/runtime variants required by the repository.
- Stage only experiment-owned changes, inspect the complete staged diff, and commit immediately as one logical Conventional Commit. Include the hypothesis, environment, exact commands, focused and broad results, regressions checked, and verification in the body.
- Start the next hypothesis from that green checkpoint.
When rejecting:
- Record the hypothesis, raw evidence, and rejection reason in the project experiment ledger or task report.
- Reverse only the exact experiment patch. Do not restore a whole path that contained pre-existing changes. Remove only exact untracked artifacts created by the experiment and known to be disposable; otherwise preserve them.
- Compare the complete post-rollback tree and index with the recorded pre-experiment state,
including pre-existing content hashes where applicable. Resolve any difference before moving
on;
git status --shortalone is insufficient proof. - Run the focused correctness test to prove the checkpoint still behaves as expected.
Reject or redesign when correctness fails, the target is reproducibly slower, the win does not clear the practical/noise threshold but adds complexity, a protected workload exceeds tolerance, or the optimization depends on benchmark-specific behavior.
Commit evidence template
perf(<area>): <bounded improvement>
Hypothesis:
<mechanism and change>
Benchmark environment:
<runtime, machine, power state, dependencies, lock fingerprint>
Benchmark command:
<exact reproducible command and artifact paths>
Focused result:
<baseline -> candidate, effect, paired wins/stability>
Full-suite result:
<aggregate plus worst protected scenarios and confirmations>
Verification:
<tests, lint/types, coverage/API, platform variants, independent reviews>Finish the campaign
Re-run the canonical baseline and candidate suite from clean states, inspect every protected workload rather than only an aggregate, and document retained and rejected hypotheses. Ensure the final branch contains small independently testable commits and no transient experiment changes. Stop when the goal is met or the predeclared saturation rule fires; do not keep adding complexity for sub-threshold gains.
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
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.

