.claude/skills/benchmark/SKILL.md
Run Go benchmarks and compare results to detect performance regressions. Use before and after performance-related changes.
npx skillsauth add PeterBooker/veloria benchmarkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run Go benchmarks to measure and compare performance. Flags regressions exceeding 10%.
/benchmark - Run benchmarks on all packages/benchmark ./internal/index/... - Run benchmarks on specific package/benchmark -compare ./... - Compare against saved baselineIdentify benchmark targets
$ARGUMENTS specifies a package, use that*_test.go files containing Benchmark functionsinternal/index/, internal/repo/, internal/api/Run benchmarks
go test -bench=. -benchmem -count=5 $ARGUMENTS 2>&1
-count=5 for statistical reliability-benchmem to track allocationsParse and analyze results For each benchmark, extract:
ns/op - Nanoseconds per operationB/op - Bytes allocated per operationallocs/op - Allocations per operationCheck for baseline comparison
.benchmark-baseline file in project root-compare flag used and baseline exists, compare resultsReport findings Format results as a table:
| Benchmark | ns/op | B/op | allocs/op | Change |
|-----------|-------|------|-----------|--------|
Flag any metric that regressed more than 10% with a warning.
Offer to save baseline If no baseline exists or results improved, offer to save current results:
go test -bench=. -benchmem -count=5 ./... > .benchmark-baseline
Pay special attention to:
internal/index/ - Trigram search (hot path)internal/repo/ - Repository access patternsinternal/api/search/ - Search request handlinginternal/storage/ - S3 result compressionBenchmark Results for ./internal/index/...
| Benchmark | ns/op | B/op | allocs/op |
|---------------------|----------|-------|-----------|
| BenchmarkSearch-8 | 1234567 | 4096 | 12 |
| BenchmarkOpen-8 | 567890 | 8192 | 24 |
No regressions detected (threshold: 10%)
development
Run Go unit tests. Use after code changes to verify correctness.
development
Run gosec and govulncheck to find security vulnerabilities. Use before releases or after dependency changes.
tools
Trigger reindexing of a specific WordPress extension. Use to rebuild the search index for a plugin, theme, or core version.
development
Run Go race detector to find data races in concurrent code. Use after any change to mutexes, goroutines, or channels.