.claude/skills/profile/SKILL.md
Run CPU and memory profiling with pprof to identify performance hotspots. Use when investigating high resource usage.
npx skillsauth add PeterBooker/veloria profileInstall 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.
Profile Go code to identify CPU hotspots and memory allocators using pprof.
/profile cpu ./internal/index/ - CPU profiling on index package/profile memory ./internal/repo/ - Memory profiling on repo package/profile all ./... - Both CPU and memory on all packagesParse arguments
cpu, memory, or all)./...)Create profile output directory
mkdir -p .profiles
Run profiling benchmarks
For CPU profiling:
go test -cpuprofile=.profiles/cpu.prof -bench=. $PACKAGE 2>&1
For memory profiling:
go test -memprofile=.profiles/mem.prof -bench=. $PACKAGE 2>&1
Analyze CPU profile
go tool pprof -top -cum .profiles/cpu.prof 2>&1 | head -30
Identify:
Analyze memory profile
go tool pprof -top -alloc_space .profiles/mem.prof 2>&1 | head -30
Identify:
Generate flamegraph data (if requested)
go tool pprof -raw .profiles/cpu.prof > .profiles/cpu.raw
Report findings
Structure the report as:
| Function | Self% | Cum% | Observation | |----------|-------|------|-------------|
| Function | Bytes | Allocs | Observation | |----------|-------|--------|-------------|
Watch for issues in:
(*Index).Search - Regex compilation, line reading(*Repository).Load - Index file mapping(*IndexedExtension).Update - Hot-swap operationsProfile files are stored in .profiles/. Add to .gitignore if not already present.
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.