adversarial-reviewer
Review code through three hostile personas - the Saboteur, the New Hire, and the Security Auditor - each required to find at least one issue. Use when a…
Optimize a performance problem by profiling to find the real bottleneck before changing anything, making one targeted change, and verifying both the improvement and that correctness did not degrade. Use when a feature is measurably slow, a page load or API response exceeds a
$ npx -y skills add KhaledSaeed18/dotclaude --skill performance-optimization --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/performance-optimizationContext preview
The summary Claude sees to decide when to auto-load this skill.
Optimize a performance problem by profiling to find the real bottleneck before changing anything, making one targeted change, and verifying both the improvement and that correctness did not degrade. Use when a feature is measurably slow, a page load or API response exceeds a
name: performance-optimization description: Optimize a performance problem by profiling to find the real bottleneck before changing anything, making one targeted change, and verifying both the improvement and that correctness did not degrade. Use when a feature is measurably slow, a page load or API response exceeds a budget, a query is taking too long, or a user reports sluggishness. Do not use to pre-optimize code that has not been measured to be slow.
Profile first. Every performance intuition is wrong until the profiler confirms it. The code that looks slow is rarely the bottleneck; the bottleneck is almost always somewhere the code looks unremarkable. An optimization without a measurement is a guess. A guess that happens to speed things up does not mean you found the right thing.
**No change before you have a baseline measurement and a profiled bottleneck.** If you cannot name the specific file, function, and line where the most time or memory is spent - with numbers - you are still in the investigation phase.
Define what "slow" means in terms the problem must satisfy:
Run the scenario and record the baseline:
# For Node.js / server-side node --prof app.js # then: node --prof-process isolate-*.log # or: clinic flame -- node app.js # For queries EXPLAIN ANALYZE SELECT ... # PostgreSQL # or the equivalent for your database # For browser / frontend # Use the browser devtools Performance panel; record the scenario end-to-end # Look at the flame chart, not just the summary
Save the baseline number. The optimization is only valid if the after-measurement is better than this.
Read the profiler output - do not guess from the source. Identify:
Common bottlenecks that do not look like bottlenecks:
State it exactly: "The bottleneck is X at file:line because Y, which will be fixed by Z."
Be specific enough to be falsifiable. "The code is slow because it does too much" is not a hypothesis. "The `getUser` function issues one SQL query per item in the `results` array at `src/db/users.ts:44`, so a page with 50 results makes 50 database round trips; replacing this with a single `WHERE id IN (...)` query should reduce the query time from ~500ms to ~10ms" is a hypothesis.
Address only the identified bottleneck. Do not:
The change should be the minimum needed to fix the specific bottleneck. Multiple simultaneous changes make the measurement impossible to attribute.
Run the same scenario under the same conditions as the baseline:
If the improvement is less than 20% or does not meet the target, re-profile - you may have fixed a symptom, or the bottleneck may have shifted to a new location now that the first one is gone.
An optimization that breaks behavior is not an optimization - it is a bug. Run the full test suite. If there are no tests covering the modified path, write one before treating the optimization as done.
Check specifically:
Reusable Claude Code extension registry. skills, subagents, slash commands, and hooks for engineering, git, testing, and security workflows. Distributed as a shadcn GitHub registry and as installable plugins.
Repo: KhaledSaeed18/dotclaude
Review code through three hostile personas - the Saboteur, the New Hire, and the Security Auditor - each required to find at least one issue. Use when a…
Review an API contract (REST or GraphQL) before or while it is implemented, checking resource naming, HTTP semantics, status codes, error shape, pagination,…
Process code-review feedback with technical rigour — understand each point, check it against the actual codebase, and respond with reasoning or implementation…
Author a new subagent for this repository end to end by scaffolding it with pnpm new, curating its tool allowlist, setting model, color, and memory in…
Author a new slash command for this repository end to end by scaffolding it with pnpm new, writing the frontmatter and argument handling, drafting the prompt…
Author a new Claude Code hook for this repository end to end by scaffolding it with pnpm new, writing the hook script and its settings.json wiring, documenting…