brainstorming
MUST USE when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no…
MUST USE when investigating or fixing performance issues: slow responses, high memory usage, CPU spikes, throughput degradation, or optimization requests. Enforces measure-first methodology — profile before guessing, baseline before fixing, re-measure after every change.
$ npx -y skills add REPOZY/superpowers-optimized --skill performance-investigation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/performance-investigationContext preview
The summary Claude sees to decide when to auto-load this skill.
MUST USE when investigating or fixing performance issues: slow responses, high memory usage, CPU spikes, throughput degradation, or optimization requests. Enforces measure-first methodology — profile before guessing, baseline before fixing, re-measure after every change.
name: performance-investigation description: > MUST USE when investigating or fixing performance issues: slow responses, high memory usage, CPU spikes, throughput degradation, or optimization requests. Enforces measure-first methodology — profile before guessing, baseline before fixing, re-measure after every change. Distinct from systematic-debugging (which changes behavior to fix bugs) and brainstorming (which designs new features). Triggers on: "slow", "performance", "optimize", "speed up", "latency", "throughput", "memory leak", "high CPU", "profiling", "benchmark", "bottleneck", "takes too long", "response time", "why is this slow", "make it faster", "reduce memory", "loading time". Routed by using-superpowers, or invoke directly via /performance-investigation.
Measure first. Guess never. Fix once.
Performance intuition is wrong more often than it's right. Developers consistently misidentify bottlenecks — optimizing the wrong function, caching the wrong query, parallelizing the wrong loop. This skill enforces a measurement-first approach that ensures you fix what's actually slow, not what feels slow.
Before changing anything, establish a quantitative baseline.
1. **Define the metric.** What specifically is slow? Be precise:
"It's slow" is not a metric. "GET /api/users takes 1200ms p95 with 100 concurrent connections" is.
2. **Measure the current state.** Run the measurement 3+ times to confirm it's stable and reproducible. For long-running measurements (>2 min each), 2 runs within 5% of each other is sufficient. Record:
3. **Set a target** (if the user hasn't). What would "fast enough" look like? This prevents infinite optimization — you stop when the target is met, not when you run out of ideas.
Baseline: GET /api/users → 1200ms p95 (100 concurrent, 10k users in DB) Target: < 300ms p95 Method: wrk -t4 -c100 -d30s http://localhost:3000/api/users
Identify the actual bottleneck — not the guessed one.
1. **Choose the right profiling tool** for the stack. Prefer CLI-based tools that produce text output (Claude can read and analyze these directly). For GUI-only tools, ask the user to run them and share the output.
2. **Profile under realistic conditions.** A profile with 10 items in the database tells you nothing about production with 10 million. Match the data size, concurrency, and environment as closely as possible. If no profiling infrastructure exists, add lightweight instrumentation (`console.time`/`console.timeEnd`, `Date.now()` deltas, or language-equivalent timing) at suspected boundaries — this is often enough to identify the bottleneck without setting up a full profiler.
3. **Read the profile output.** Identify the top 3 time/memory consumers. The bottleneck is the thing that takes the most wall-clock time (or memory, if that's the metric) — not the thing with the most calls, not the thing with the worst Big-O notation, not the thing that "looks inefficient." Distinguish between self time (time in the function itself) and total time (including callees) — the optimization target is usually the function with the highest self time.
4. **State the bottleneck explicitly** before proposing any fix: > "The profile shows 82% of time is spent in `serializeUser()`, specifically the N+1 query loading user.permissions for each user in the list."
Propose a specific fix with a predicted improvement.
1. **State the hypothesis:** "Batch-loading permissions with a single IN query instead of N individual queries should reduce serialization time by ~80%, bringing p95 from 1200ms to ~300ms."
2. **Sanity-check the hypothesis:**
3. **Identify risks:** Could this fix introduce new problems? (Memory spikes from batch loading, cache staleness, increased complexity)
Apply one change, then measure again.
1. **Implement the fix.** One fix at a time — never bundle multiple optimizations. If you change three things and it's faster, you don't know which change helped (or if one made things worse and the other two compensated).
2. **Re-measure using the exact same method** from Phase 1. Same tool, same conditions, same data.
3. **Compare to baseline:**
4. **Record the result:**
The production-grade fork of obra/superpowers — same trusted workflow, dramatically leaner, safer, and more intelligent.
MUST USE when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no…
Creates minimal, high-signal CLAUDE.md and AGENTS.md context files based on empirical best practices. Invoke on /init command,…
Use in long or noisy sessions to persist durable state across session boundaries via state.md. Also generates project-map.md when…
Use BEFORE brainstorming when facing a complex architectural, technology, or design decision where the options are not yet…
MUST USE when updating, migrating, or auditing project dependencies: upgrading packages, fixing security vulnerabilities (CVEs),…
Use when 2+ tasks are independent and can run concurrently without file or state conflicts or sequential dependencies. Triggers…