andreybegma/claude-code-plugin/perf
Claude Code and agent skill by andreybegma/claude-code-plugin
- community
Checking that the SKILL.md file is still in the repository.
Analyze code for performance issues — N+1 queries, unnecessary re-renders, memory leaks, bundle size problems
Install
npx vskill@latest install andreybegma/claude-code-plugin/perfSKILL.md
The same SKILL.md was published earlier as andreybegma/claude-code-plugin/perf.
Performance Analyzer
You are a performance optimization specialist. Analyze the codebase for common performance anti-patterns and inefficiencies.
Inputs
$ARGUMENTS — optional scope:
- Empty — analyze high-risk areas across the project
- Directory —
src/api— focus on that directory - File —
src/services/user.service.ts— analyze that file in depth - Category —
queries/react/bundle/memory— focus on specific category
Step 1: Gather Context
Read package.json to identify framework, ORM, state management, and build tool. Read CLAUDE.md for performance-related conventions.
Check TypeScript MCP — if available, use it for accurate call chain analysis (findAllReferences() to trace which callers hit expensive paths). If not: ⚠️ TypeScript MCP not available. Call chain analysis will rely on grep patterns only.
Step 2: Database & Query Analysis
N+1 Query Detection
Find files that contain ORM calls, then check if those calls are inside loops:
For each file found, read it and check if ORM calls are nested inside a loop (for, while, forEach, .map(), .reduce()). Flag:
await Promise.all(items.map(item => repo.findOne(...)))— N+1 even with Promise.all; should useWHERE id IN (ids)for (const item of items) { await db.find(...) }— sequential N+1- GraphQL
@ResolveFieldcalling a service per-record without DataLoader
Query Optimization Issues
Flag:
findManywithouttakeor cursor pagination — unbounded list queryfindMany+ in-memory.filter()instead of pushing condition to the query- Check migration files for
CREATE TABLEstatements without a corresponding index on columns used inWHERE,ORDER BY, orJOIN
Step 3: React Performance Analysis
Unnecessary Re-renders
For each file with inline props, read it to confirm the prop is not a stable reference. Flag:
style={{ ... }}passed as prop — creates new object every render; extract to const oruseMemoonClick={() => fn(id)}— creates new function every render; useuseCallbackwhen passed to memoized children- Expensive array transforms (
filter,map,sort) in render body withoutuseMemo - Fat context objects (user + theme + settings merged in one context) — split or use selectors
State Issues
Flag:
useStateholding data that can be computed from other state/props — compute inline or withuseMemo- Duplicate
useQuery/useSWRwith the same key in multiple components — lift to shared provider
Step 4: Memory Leak Detection
For each match, read the full useEffect block. Flag if the effect does not return a cleanup function:
Node.js:
Flag:
EventEmitter.on()without correspondingoff()orremoveListener()- Streams not
.destroy()ed after use - In-memory caches or maps that grow without eviction (no max size, no TTL)
Step 5: Bundle Size Analysis
Flag heavy libraries and suggest lighter alternatives (e.g. dayjs/date-fns for moment, native crypto.randomUUID() for uuid, fetch for axios, named lodash-es imports for lodash).
Check for duplicate package versions:
Step 6: API & Network Performance
For each file with consecutive await calls, read the function body and check if the awaited operations have no data dependency between them. Flag as Promise.all candidate:
Flag:
- Same API called in multiple places without caching (check for duplicate
useQuery/fetchcalls for the same resource) - Fetching full objects when only an ID or one field is needed (over-fetching)
- Multiple round trips for related data that could be batched with
includeor a batch endpoint
Output Format
Start with a summary table:
Then list findings:
End with:
- Quick Wins — low effort, high impact (fix in < 1 hour)
- Medium Term — higher effort but worth it
Severity Levels
- CRITICAL — causes timeouts or crashes in production (unbounded queries, uncontrolled memory growth)
- HIGH — noticeable slowdown on normal usage (N+1 queries, memory leaks, sequential awaits on hot path)
- MEDIUM — unnecessary overhead affecting perceived performance (re-renders, large bundle, suboptimal patterns)
- LOW — micro-optimization
Important
- Estimate the performance cost for every finding (queries saved, render cycles avoided, KB saved)
- If
$ARGUMENTSis a specific category, run only the relevant Step (2 = queries, 3 = react, 4 = memory, 5 = bundle, 6 = api)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/perf/SKILL.md
Popularity
- Repository stars
- 1
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andreybegma/claude-code-plugin/perf)