Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tmj-90/gaffer --skill performance-profilinggit clone --depth 1 https://github.com/tmj-90/gafferWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tmj-90/gaffer/performance-profiling)<a href="https://agentmods.dev/skills/tmj-90/gaffer/performance-profiling"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/performance-profiling/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tmj-90/gaffer/performance-profiling"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/performance-profiling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.01429 |
| Opus 5.5 | $0.00035 | $0.00572 |
| Sonnet 5.5 | $0.00017 | $0.00286 |
| Haiku 4.5 | $0.00009 | $0.00143 |
Grade A, and why
performance-profiling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Profile before you optimise
Performance work without a measurement is refactoring with a story attached. Reproduce
the slowness, profile it, fix what the profile points at, and show the same measurement
afterwards. Most wins come from doing less work (fewer queries, allocations, bytes), not
cleverer code. Sources: Brendan Gregg (USE method, flame graphs); Gil Tene on coordinated
omission; Google SRE book ch. 6 (percentiles, not averages); the benchstat/hyperfine
documentation on repeated runs and variance.
Steps
- Define the number and the target. Metric, percentile, load and environment:
"p95 of
GET /orders≤ 200 ms at 50 req/s open-model load", "job wall time", "heap after 10k iterations", "gzipped bundle bytes". Averages hide tails; report p50/p95/p99. Write it down before changing code; the acceptance criterion should be this number. Callsearch_lorefor known hot spots and past decisions. - Build a reproducible harness. Use the repo's tooling (
autocannon,k6,wrk2,pytest-benchmark,go test -bench,hyperfine, JMH,criterion): fixed inputs, realistic data volume, warm-up, and enough repetitions to see variance (≥ 10 runs or the tool's statistical mode). For latency under load use an open-model / constant-arrival-rate generator (k6constant-arrival-rate,wrk2 -R): closed-loop tools that wait for each response under-report tail latency (coordinated omission). Record the exact command and machine. Use only tools already installed; never install one (npm/pip installs are hook-blocked;go install,cargo install,uv/pipxand a fetchingnpxare not blocked but are equally forbidden;node_modulesis shared). If a needed tool is missing, say so in the evidence and use what exists. - Find the bottleneck resource first. For each resource (CPU, memory, disk, network, connection pools, locks) check utilisation, saturation and errors (USE). A request waiting on a pool or a lock is not a CPU problem.
- Profile, do not guess. CPU:
node --cpu-prof,py-spy record,go tool pprof,perf+ flame graph,async-profiler. Memory: heap snapshots / allocation profiles taken at two points to see what grows. Database: query log with timings and per-request query count. Frontend: the bundler's analyzer. Fix the widest frame in the flame graph; if the profile disagrees with your hunch, the profile is right. - Fix the top item with the least clever change. Usual order: remove an N+1 (batch
or join), add the index the plan wants (the
sql-query-performanceskill), stop serialising unused data, stream instead of buffering, cache a pure or hot read (thecaching-strategyskill), move work off the request path (thebackground-jobsskill). Algorithmic rewrites and micro-optimisations last. - Keep behaviour identical, including under concurrency. Run the full suite. A
new cache, batch boundary, memoisation or parallelism is a new code path: test it
directly, including concurrent callers (stale reads, lost updates, shared mutable
state; the
concurrency-and-asyncskill). Never drop a validation, authorisation check or lock to win time. - Measure again under identical conditions and compare distributions, not single
runs: same command, data and machine, repeated; use the tool's comparison
(
benchstat old.txt new.txt,hyperfinewith several commands) and report the change with its variance. A difference within noise is not a result. If the target is not met, say so and what the profile shows now. - Guard the win with a deterministic check. Prefer assertions that do not flake on shared CI hardware: query count per request, allocation count, bundle-size budget, algorithmic complexity on a fixed input. Wall-clock assertions only with generous margins or on dedicated runners.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 16d ago Changed · +29 lines 45eea5774602
- 19d ago First seen · 65 lines · 87 tokens per session scan A 7f079e8b5781
performance-profiling is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 87 tokens to every session and 1,429 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.
Other skills, from other repositories
issue-debugging
Systematic methodology for issue debugging including root cause analysis, impact mapping, tiered validation plans, and confidence assessment. Use when analyzing bugs, fixing issues, or validating fixes.
fix-bug
Run the Fix Validation pipeline to investigate, fix, and validate a bug. Ensures deterministic pipeline execution with IssueAnalyzer, FixWriter, TestWriter (conditional), TestAudit (conditional), and FixValidator stages.
pact-bug
Log a bug investigation using PACT's structured bug tracker.
browser-edge-cases
SOP for debugging browser automation failures on complex websites. Use when browser tools fail on specific sites like LinkedIn, Twitter/X, SPAs, or sites with Shadow DOM.
triage-issue
Analyze a GitHub issue, verify claims against the codebase, and close invalid issues with a technical response.
hive.error-recovery
Follow a structured recovery decision tree when tool calls fail instead of blindly retrying or giving up.