perf · pwguler — Claude Code skill: what it does, how to install
A Claude Code and Cursor skill that measures code performance and diagnoses slow processes using empirical data rather than guesses.
MIT 899 installs ★ 10 updated 2026-10-16
npx skills add pwguler/skills --skill perf -a claude-codeWhat perf does
The skill enforces a strict measurement-driven workflow for performance tuning, establishing a baseline before any code changes are made. The agent builds repeatable tests, isolates limiting resources with profilers, and applies single modifications while alternating test runs. No code modification for speed is permitted without prior metrics.
Invoke this skill when users report high latency, memory usage, or sluggish execution, or when comparing two implementations. The procedure relies on task lists, target metrics, and profiler traces. Payloads exceeding roughly 2,000 lines are delegated to a subagent to preserve context limits.
Rules prohibit treating crashes or deadlocks as slowness and tuning code without profiler proof. The agent halts after three non-improving changes and reports back. Failed measurements are recorded as failures rather than hidden.
What it helps with
- measure function performance before and after changes
- identify bottlenecks in slow code using profiler data
- compare execution speed of two alternative implementations
- diagnose a slow or stuck process using trace files
Example prompts for the agent
- Measure the performance of this function
- Find the latency bottleneck in this module
- Compare the speed of these two approaches
How to install perf
1Skills CLI (Vercel)
npx skills add pwguler/skills --skill perf -a claude-code2Manually: put the files in place
~/.claude/skills/perf/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/perf/
1Skills CLI (Vercel)
npx skills add pwguler/skills --skill perf -a codex2Manually: put the files in place
.agents/skills/perf/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add pwguler/skills --skill perf -a cursor2Manually: put the files in place
.cursor/skills/perf/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install pwguler/skills skills/perf2Manually: put the files in place
.github/skills/perf/SKILL.md1Skills CLI (Vercel)
npx skills add pwguler/skills --skill perf -a gemini-cli2Platform CLI
gemini skills install https://github.com/pwguler/skills --path skills/perfManually: put the files in place
.devin/skills/perf/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add pwguler/skills --skill perf -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about perf
How to install perf in Claude Code?
Run npx skills add pwguler/skills --skill perf -a claude-code followed by ~/.claude/skills/perf/SKILL.md.
What does perf do?
It guides the AI agent through a rigorous measurement protocol to optimize code speed based on empirical data rather than guesswork.
What is required to run perf?
Standard profiling tools, trace utilities, or counters are needed to detect the limiting resource.
Source text
SKILL.md · MIT
--- name: perf description: Make code faster or find why it is slow, from measurements and not from guesses. Read this skill before you change code to make it faster or use less memory. Use it when the user reports slow code, high latency, or high memory use. Use it also to check a speed claim, or to compare the speed of two options. Use it to diagnose a slow or stuck process, a profile, or a trace file. --- Measure before you change code for speed. A claim about speed without a measurement is only a guess. A change that rests on a guess can make the code slower. Fast path: when the user only asks whether a measured number holds, change no code. Read the `verify` skill, and check the number with [measurement.md](references/measurement.md). When the user asks only why code is slow, or gives a profile or trace file, also change no code. Go to step 4, and report as its reference says. 1. Before you measure anything, create a task list with these steps as its items. If a task list already exists, add the steps to it. When you skip a step, mark it done and add `skip: <reason>` to its text. To go back to an earlier step, add that step and each step after it again as new items. 2. State the target in one sentence: the operation, the input, and the number that counts as success. Take the target from the user or the spec. When nobody gave one, the target is a gain larger than the spread on a realistic input. Say so. 3. Build a measurement that you can run again: a script or a command, and a realistic input. Run each side five times or more. Check the measurement with [measurement.md](references/measurement.md) before you trust it. Step 4 answers its first check. Record the baseline: the number, its unit, the run count, and the spread. 4. Find the limiter, the one resource that stops the number from getting better, by observation. Do not guess it from the source. Use a profiler, a trace, or counters. A profiler slows the work, so never report a number from a profiled run. For a running process, follow [live-process.md](references/live-process.md). For a profile, trace, dump, or log file that already exists, follow [capture-file.md](references/capture-file.md). 5. Change one thing at the limiter, and try the cheapest kind of change first. First remove work whose result nothing uses. Then do the work once, and keep the result. Then do less work. Then do the work later. Then do it at a time when nobody waits. Then run it in parallel. Make the work itself cheaper only as the last option. A change that keeps results, delays work, or runs work in parallel can change behavior. Give it a failing test first, as implement says. 6. Measure again with the same setup, and run the old and new versions in alternating order. Run the tests that exercise the changed path. Keep the change only when they pass and the gain is larger than the spread. Otherwise revert it. When a kept change meets the target, go to step 7. Otherwise go back to step 4. 7. Before you report the gain, read the `verify` skill, and follow it for the tests, the build, and the linter. The measurement script is a demo of the gain, as verify defines a demo. Report the gain as a measured number, not as a verified criterion. 8. Report the result: the number before and after, each with its unit, run count, spread, and limiter. Name the change and the input that you measured. Rules: - Change no code for speed before the baseline exists. - Make one change between two measurements, so that each gain has one cause. - A request for a diagnosis gets a diagnosis, not a fix. Cite the evidence for each finding. - A deadlock, a crash, or a wrong result is a defect, not slowness. Its fix goes to `debug`. - Do not tune code that the measurement does not show as the limiter. - Stop after three changes in a row that give no gain larger than the spread. Report the measurements and the limiter, and let the user decide. - When the work continues after the session, keep the measurement script in the diff, as implement's build-the-lever principle says. - Never invent a number. Report a measurement that failed as failed. - A raw payload that you must read, and that is longer than about 2,000 lines, goes to a subagent. Keep only the reduced finding in the session, as research's guard-the-context-window principle says.
© pwguler · MIT · pwguler/skills
Similar skills
All skills for Agent setup: memory, context, orchestration →perf by other authors comes first.