From claudekit
Profiles bottlenecks and optimizes code performance: fixes N+1 queries, reduces bundle sizes, eliminates memory leaks, improves algorithms in Python/JS apps.
npx claudepluginhub duthaho/claudekit --plugin claudekitThis skill uses the workspace's default tool permissions.
- Profiling slow code to find bottlenecks
Guides performance profiling workflows: measure baselines, identify bottlenecks like N+1 queries and memory leaks, apply optimizations such as caching and lazy loading, verify improvements using Node.js, Python, and Go tools.
Analyzes code performance, identifies bottlenecks in CPU/memory/I/O/algorithms/DB queries, suggests optimizations. Supports JS/TS, Python, Java, Go, Rust, web apps.
Analyzes performance issues like inefficient algorithms, re-renders in React/Vue, N+1 queries, memory leaks; suggests optimizations with code examples and complexity analysis.
Share bugs, ideas, or general feedback.
cachingdatabasesrefactoring| Topic | Reference | Key content |
|---|---|---|
| Profiling tools | references/profiling.md | Python (cProfile, py-spy, Scalene) and JS/TS (DevTools, Lighthouse, clinic.js) |
| Anti-patterns | references/anti-patterns.md | N+1 queries, unnecessary re-renders, event loop blocking, memory leaks |
# CPU profiling
python -m cProfile -o output.prof script.py
# Visualize: pip install snakeviz && snakeviz output.prof
# Live profiling (attach to running process)
py-spy top --pid 12345
# Line-by-line profiling
kernprof -lv script.py # requires @profile decorator
# Bundle analysis
npx webpack-bundle-analyzer stats.json
# or: ANALYZE=true next build
# Node.js profiling
node --prof app.js
clinic doctor -- node app.js
# Benchmarking
npx vitest bench
| Anti-Pattern | Detection | Fix |
|---|---|---|
| N+1 queries | django-debug-toolbar, prisma.$on('query') | select_related/joinedload/include |
| Unnecessary re-renders | React DevTools Profiler | useMemo, useCallback, React.memo |
| Blocking event loop | clinic doctor, high event loop lag | worker_threads, async variants |
| Memory leaks | Heap snapshots, growing process.memoryUsage() | Remove listeners, clear refs, bound caches |
| Unbounded lists | No pagination, full table scans | Cursor pagination, LIMIT |
| Heavy imports | Bundle analyzer showing large deps | Tree-shaking, import { x }, code splitting |
systematic-debugging — Investigating slow paths with root-cause rigortesting — Benchmarking and perf regression testsdevops — Deploy-time perf checks