This skill should be used when profiling code, optimizing bottlenecks, benchmarking, or when performance, profiling, optimization, or --perf are mentioned.
Profiles code to identify bottlenecks and guides evidence-based performance optimization workflows.
npx claudepluginhub outfitter-dev/outfitterThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/benchmarking.mdEvidence-based performance optimization → measure → profile → optimize → validate.
<when_to_use>
NOT for: premature optimization, optimization without measurement, guessing at bottlenecks
</when_to_use>
<iron_law>
NO OPTIMIZATION WITHOUT MEASUREMENT
Required workflow:
Optimizing unmeasured code wastes time and introduces bugs.
</iron_law>
<stages>Load the maintain-tasks skill for stage tracking:
Stage 1: Establishing baseline
Stage 2: Profiling bottlenecks
Stage 3: Analyzing root cause
Stage 4: Implementing optimization
Stage 5: Validating improvement
Latency (response time):
Throughput:
Memory:
CPU:
Always measure:
<profiling_tools>
Built-in timing:
console.time("operation");
// ... code to measure
console.timeEnd("operation");
// High precision
const start = Bun.nanoseconds();
// ... code to measure
const elapsed = Bun.nanoseconds() - start;
console.log(`Took ${elapsed / 1_000_000}ms`);
Performance API:
const mark1 = performance.mark("start");
// ... code to measure
const mark2 = performance.mark("end");
performance.measure("operation", "start", "end");
const measure = performance.getEntriesByName("operation")[0];
console.log(`Duration: ${measure.duration}ms`);
Memory profiling:
--inspect flag + Chrome DevToolsprocess.memoryUsage() for RSS/heap trackingCPU profiling:
--prof flag + node --prof-processBenchmarking:
#[cfg(test)]
mod benches {
use criterion::{black_box, criterion_group, criterion_main, Criterion};
fn benchmark_function(c: &mut Criterion) {
c.bench_function("my_function", |b| {
b.iter(|| my_function(black_box(42)))
});
}
criterion_group!(benches, benchmark_function);
criterion_main!(benches);
}
Profiling:
cargo bench — criterion benchmarksperf record + perf report — Linux profilingcargo flamegraph — visual flamegraphscargo bloat — binary size analysisvalgrind --tool=callgrind — detailed profilingheaptrack — memory profilingInstrumentation:
use std::time::Instant;
let start = Instant::now();
// ... code to measure
let duration = start.elapsed();
println!("Took: {:?}", duration);
</profiling_tools>
<optimization_patterns>
Time complexity:
Space-time tradeoffs:
Reduce allocations:
// Bad: creates new array each iteration
for (const item of items) {
const results = [];
results.push(process(item));
}
// Good: reuse array
const results = [];
for (const item of items) {
results.push(process(item));
}
// Bad: allocates String every time
fn format_user(name: &str) -> String {
format!("User: {}", name)
}
// Good: reuses buffer
fn format_user(name: &str, buf: &mut String) {
buf.clear();
buf.push_str("User: ");
buf.push_str(name);
}
Memory pooling:
Lazy evaluation:
Batching:
Caching:
Async I/O:
Query optimization:
Schema design:
Connection management:
</optimization_patterns>
<workflow>Loop: Measure → Profile → Analyze → Optimize → Validate
At each step:
Before declaring optimization complete:
Check gains:
Check regressions:
Check documentation:
ALWAYS:
NEVER:
Methodology:
Related skills:
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.