Skip to content
Agent Orchestration
Skill

/performance-tuning

Use when something is reported slow, sluggish, memory-hungry or too large, when a performance budget, Core Web Vitals threshold or latency target is breached, when asked to optimise or make code faster, or when tempted to add a cache, index, async rewrite or micro-optimisation.

From plugin
godmode
12333 skills1 agent2 hooks

Claude Code

$ npx -y skills add NoobyGains/godmode --skill performance-tuning --agent claude-code

SKILL.md

performance-tuning.SKILL.md
name: performance-tuning
description: "Use when something is reported slow, sluggish, memory-hungry or too large, when a performance budget, Core Web Vitals threshold or latency target is breached, when asked to optimise or make code faster, or when tempted to add a cache, index, async rewrite or micro-optimisation."

Performance Tuning

Intuition about where time goes is wrong more often than it is right. You measure the problem, profile to find where the time or memory actually goes, change one thing, and measure again with the same method. **No measurement, no optimisation: every change is justified by a number before and proven by a number after.**

The Prime Directive

NO OPTIMISATION WITHOUT A MEASUREMENT PROVING THE PROBLEM

No exceptions. No workarounds. No shortcuts.

When to Use

**Required:**

  • A user, test or monitor reports slowness, timeouts, high memory, large bundles or high cost.
  • A performance budget or target is breached (latency percentile, Core Web Vitals, bundle size, query time, cold start).
  • Someone asks to "optimise", "speed up" or "make it scale".
  • You are about to add a cache, an index, concurrency, a rewrite in another language or a micro-optimisation.

**Skip:**

  • The code does not work correctly yet. Correctness comes first; invoke `godmode:fault-diagnosis` or `godmode:test-first`.
  • There is no target and no complaint. "It might be slow some day" is not a problem; record it and move on.
  • Choosing a sensible algorithm or data structure while first writing code. That is ordinary design, not tuning, as long as it does not cost clarity.

The Protocol

digraph perf {
    rankdir=TB;
    target [label="1. Target\n(number + percentile)", shape=box];
    baseline [label="2. Baseline\n(repeatable measurement)", shape=box];
    met [label="Target met?", shape=diamond];
    profile [label="3. Profile\n(where does it go?)", shape=box];
    hypo [label="4. One hypothesis", shape=box];
    change [label="5. Change one thing", shape=box];
    remeasure [label="6. Re-measure\n(same method)", shape=box];
    better [label="Significant\nimprovement?", shape=diamond];
    revert [label="Revert", shape=box];
    done [label="7. Record + guard", shape=box];

    target -> baseline -> met;
    met -> done [label="yes"];
    met -> profile [label="no"];
    profile -> hypo -> change -> remeasure -> better;
    better -> met [label="yes, keep"];
    better -> revert [label="no"];
    revert -> hypo;
}

1. **Set the target.** A number, a percentile and a context: "p95 under 300 ms for `GET /orders` at 50 requests per second", "LCP 2.5 s or less at the 75th percentile on mobile", "bundle under 200 KB gzipped". Without a target there is no end condition; ask the user for one or propose one.

2. **Take a baseline that you can repeat.** Same input data, same environment (production-like, not a debug build), warm-up runs discarded, several runs, and the spread reported, not one number. Save the exact command and its output. Tools are in the table below.

3. **Profile before you guess.** Use a profiler, query plan, trace or bundle analyser to find where the time, memory or bytes go. The evidence is a profile artefact (flame graph, `EXPLAIN ANALYZE` output, trace) that names the hot spot. Usual suspects, in rough order: database queries (N+1, missing index, full scans), network round trips made in sequence, serialisation of oversized payloads, algorithmic complexity, synchronous I/O, and memory churn.

4. **State one hypothesis** that links the hot spot to a change: "The order list makes one query per item (N+1); a single joined query should cut p95 from 920 ms to under 300 ms."

5. **Change one thing.** One change per measurement, behind passing tests, so the effect is attributable. Keep the change on its own commit.

6. **Re-measure with the identical method** and compare against the baseline, including the spread. If the improvement is within the noise or misses the expectation, revert it, even if it "should" help. If it helps, go back to step 2 with the new baseline until the target is met.

7. **Record and guard.** Write the before and after numbers, the method and the commit in the PR description. Add a guard so the regression cannot return silently: a benchmark in CI, a budget check (`godmode:quality-gates`), or a test that asserts the query count.

Measurement Tools

<!-- Commands checked 2026-10-25 against: https://github.com/sharkdp/hyperfine ; https://github.com/benfred/py-spy ; https://nodejs.org/api/cli.html ; https://pkg.go.dev/cmd/go ; https://www.postgresql.org/docs/current/sql-explain.html ; https://github.com/GoogleChrome/lighthouse -->

| What | Measure | Profile | |---|---|---| | A command or script end to end | `hyperfine --warmup 3 'cmd'` (compare two: `hyperfine 'old' 'new'`) | the language profiler below | | Python | `pytest-benchmark`, `timeit` | `py-spy record -o profile.svg -- python app.py`, `py-spy top --pid <pid>` | | Node.js | `hyperfine`, a benchmark library | `node --cpu-prof app.js` (CPU), `node --heap-prof app.js` (memory); open the files in browser DevTools | | Go | `go test -bench . -benchmem` | `go test -bench . -cpuprofile cpu.out`, then `go tool pprof cpu.out` | | Rust | a benchmark harness such as Criterion | `perf` or a flame-graph tool on Linux | | PostgreSQL query | `EXPLAIN (ANALYZE, BUFFERS) <query>` | the same plan: look for sequential scans, row-estimate errors, loops | | HTTP service under load | a load generator at a fixed request rate, reporting percentiles | APM traces or the language profiler on the server | | Web page | `lighthouse <url>` (lab), field data from real users for Core Web Vitals | browser DevTools Performance panel | | Bundle size | the bundler's analyser or a size-limit check | the same analyser, per module |

`EXPLAIN ANALYZE` executes the statement. For `INSERT`, `UPDATE` or `DELETE`, run it inside a transaction and roll back.

Budgets

<!-- Core Web Vitals thresholds from

Read more
@noobygains
Ships withgodmode

Engineering discipline for AI coding agents: question the request, verify against current docs, plan, build test-first on the cheapest capable model, review with a second model family, prove it before saying done. One repo for Claude Code, Codex, Antigravity, Cursor, Gemini CLI and OpenCode.

12333 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
123
Star history of NoobyGains/godmode on GitHub, a chart by star-history.com

Other skills on godmode.

agent-briefing

agent-briefing

Use when writing a prompt for a subagent or teammate, deciding how much context another agent needs, writing or reading a handoff…

@noobygains@noobygainsInstall Skill
code-review

code-review

Use when a task, feature or bug fix is implemented and before it is committed, merged or handed back to the user, and when the…

@noobygains@noobygainsInstall Skill
codebase-conventions

codebase-conventions

Use when about to add or change code in an existing codebase: a new file, module, route, component, service, test, migration,…

@noobygains@noobygainsInstall Skill
completion-gate

completion-gate

Use when about to say that work is done, fixed, passing, working, deployed or ready, before committing, opening or merging a pull…

@noobygains@noobygainsInstall Skill
cross-model-review

cross-model-review

Use when a reviewed change is about to land on a shared branch, be released or be deployed, and when the user asks for a second…

@noobygains@noobygainsInstall Skill
delegated-execution

delegated-execution

Use when a written implementation plan is ready to execute in the current session and its tasks are mostly independent, so each…

@noobygains@noobygainsInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca1d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip2d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about performance-tuning.

Which coding agents can use performance-tuning?
performance-tuning installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.