Sets up correct micro-benchmarks across .NET, Java/Kotlin, Python, JS/TS, Go, and Rust. Handles tool selection, harness setup, and result interpretation while avoiding common pitfalls.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write correct micro-benchmarks with the right tool for the stack, and read the results properly - so "which is faster" is answered with data, not vibes.
Works on a file, folder, project, or GitHub URL. Identify the functions/implementations to compare. If the user pasted results, go straight to interpretation.
| Manifest | Default tool | Alternative |
|---|---|---|
*.csproj | BenchmarkDotNet | - |
pom.xml / build.gradle(.kts) | JMH | kotlinx-benchmark (Kotlin Multiplatform) |
pyproject.toml / requirements*.txt | pytest-benchmark (if pytest is used) | pyperf (standalone, more rigorous) |
package.json | Vitest bench (if Vitest is used) | tinybench, mitata |
go.mod | testing.B + benchstat | - |
Cargo.toml | criterion | divan |
If the project already uses a benchmark tool, use that one.
Blackhole, black_box in Rust, a package-level sink in Go).dotnet add package BenchmarkDotNet
[MemoryDiagnoser] // allocations matter as much as time
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
public class StringJoinBenchmarks
{
private string[] _items = default!;
[Params(10, 1000)] public int N;
[GlobalSetup]
public void Setup() => _items = Enumerable.Range(0, N).Select(i => i.ToString()).ToArray();
[Benchmark(Baseline = true)]
public string Concat() { var s = ""; foreach (var i in _items) s += i; return s; }
[Benchmark]
public string Builder() { var sb = new StringBuilder(); foreach (var i in _items) sb.Append(i); return sb.ToString(); }
[Benchmark]
public string Join() => string.Join("", _items);
}
// Program.cs: BenchmarkRunner.Run<StringJoinBenchmarks>();
Run: dotnet run -c Release. Pitfalls: Debug build or no BenchmarkRunner; setup work inside [Benchmark] (use [GlobalSetup]); not returning the result; no [Baseline].
Reading: Mean + Error/StdDev, Ratio vs baseline, Gen0/1/2 + Allocated for GC pressure.
Maven: generate a module from the org.openjdk.jmh:jmh-java-benchmark-archetype archetype. Gradle: the me.champeau.jmh plugin, benchmarks in src/jmh/java.
@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Warmup(iterations = 5) @Measurement(iterations = 5) @Fork(2)
public class JoinBenchmark {
@Param({"10", "1000"}) int n;
List<String> items;
@Setup public void setup() { items = IntStream.range(0, n).mapToObj(Integer::toString).toList(); }
@Benchmark public String join() { return String.join("", items); }
@Benchmark public void builder(Blackhole bh) {
var sb = new StringBuilder(); for (var s : items) sb.append(s); bh.consume(sb.toString());
}
}
Run the benchmarks jar (java -jar target/benchmarks.jar) or ./gradlew jmh. Add -prof gc for allocation rate (gc.alloc.rate.norm = bytes/op). Never run JMH from the IDE's normal test runner; keep @Fork >= 1.
# test_bench.py (pip install pytest-benchmark)
def concat(items): return "".join(items)
def test_join(benchmark):
items = [str(i) for i in range(1000)] # setup outside the measured call
result = benchmark(concat, items)
assert result
Run: pytest --benchmark-only; save and compare runs with --benchmark-autosave and --benchmark-compare.
pyperf for standalone, process-isolated runs: python -m pyperf timeit -s "items=[str(i) for i in range(1000)]" "''.join(items)" -o new.json, then python -m pyperf compare_to old.json new.json. Allocations: tracemalloc or memray. Run with coverage and debuggers off.
// join.bench.ts
import { bench, describe } from 'vitest';
const items = Array.from({ length: 1000 }, (_, i) => String(i));
describe('join', () => {
bench('Array.join', () => { items.join(''); });
bench('concat loop', () => { let s = ''; for (const i of items) s += i; });
});
Run: npx vitest bench. Without Vitest, tinybench (new Bench(), bench.add(...), await bench.run(), console.table(bench.table())) or mitata (bench(...), await run()). Run against the built output or with production settings, no --inspect. V8 aggressively optimizes and inlines - make results observable and avoid constant inputs the optimizer can fold away.
func BenchmarkJoin(b *testing.B) {
items := make([]string, 1000)
for i := range items { items[i] = strconv.Itoa(i) }
b.ReportAllocs()
b.ResetTimer() // exclude setup
for i := 0; i < b.N; i++ {
sink = strings.Join(items, "")
}
}
var sink string // package-level sink defeats elimination
On Go 1.24+ prefer for b.Loop() { ... } (handles timer reset and keeps results alive). Run: go test -bench=Join -benchmem -count=10 > old.txt, change the code, repeat into new.txt, then benchstat old.txt new.txt (golang.org/x/perf/cmd/benchstat). Trust only deltas benchstat reports as significant.
[dev-dependencies]
criterion = "<current version>"
[[bench]]
name = "join"
harness = false
use criterion::{criterion_group, criterion_main, Criterion};
use std::hint::black_box;
fn bench_join(c: &mut Criterion) {
let items: Vec<String> = (0..1000).map(|i| i.to_string()).collect();
c.bench_function("join", |b| b.iter(|| black_box(&items).concat()));
}
criterion_group!(benches, bench_join);
criterion_main!(benches);
Run: cargo bench (optimized profile). Criterion compares against the previous run automatically; use --save-baseline main and --baseline main for explicit comparisons.
## Setup
<stack + tool, install command, benchmark file(s), run command>
## Results / interpretation
<table or summary: baseline vs candidates, time + allocations, noise>
## Verdict
<which to use and why, or "no meaningful difference">
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Python, JavaScript, TypeScript, Go, Rust
/ai-dev-toolkit:benchmark-setupfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./caching-strategy-setupAdd the right caching to an app in any stack - in-process, distributed (Redis/Valkey/Memcached), two-level, or HTTP/output caching - with correct keys, expiration, stampede protection, and invalidation. Covers HybridCache / IMemoryCache / IDistributedCache / output caching in .NET, lru-cache / keyv / cache-manager / ioredis in Node, functools / cachetools / redis-py / Django cache in Python, Spring Cache with Caffeine or Redis in Java/Kotlin, and ristretto / groupcache / singleflight / go-redis in Go. Use this skill whenever the user wants caching, to cache a query/response, Redis caching, @Cacheable, lru_cache, HybridCache, cache-aside, output caching, or asks "how do I cache this / add caching / avoid cache stampede / invalidate this cache". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly./cicd-pipeline-generatorGenerate a CI/CD pipeline for an app in any stack - GitHub Actions (primary), Azure DevOps, or GitLab CI - with per-stack install/build/test/coverage, dependency caching, lint, vulnerability scan, container build and push, and environment-gated deploy. Covers .NET, Node/TypeScript (npm/pnpm/yarn), Python (pip/uv/poetry), Java/Kotlin (Maven/Gradle), Go, and monorepos with several stacks. Use this skill whenever the user wants a CI/CD pipeline, a GitHub Actions workflow, Azure DevOps YAML, .gitlab-ci.yml, build/test automation, a release or deploy pipeline, caching to speed up CI, or asks "how do I set up CI / pipeline for my app / automate build and deploy / why is my CI slow". Always use this skill for CI/CD requests; it generates a complete, sensible pipeline.Other plugins' skills for the same job