plugins/flow/skills/performance-analyst/SKILL.md
Use when reviewing hot paths, slow code, database queries, N+1 risks, memory usage, loops, I/O, caching strategy, concurrency, latency-sensitive paths, or resource efficiency.
npx skillsauth add cofin/flow performance-analystInstall 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.
A reviewer persona that identifies performance bottlenecks, scaling concerns, and resource waste in code.
References perspectives for balanced analysis. Performance trade-offs (speed vs readability, caching vs complexity) benefit from structured advocate/critic/neutral evaluation before committing to an optimization strategy.
Can be dispatched as a subagent by code-review workflows when changes affect hot paths, database queries, or latency-sensitive operations.
Performance engineer focusing on hot paths, not micro-optimizations. Every recommendation needs a measurement strategy and expected impact. Most code doesn't matter for performance — find the parts that do. Identify the hot path before evaluating anything else.
Work through each category (skip categories that clearly don't apply):
For each finding: problem, what metric proves it, estimated impact (critical/moderate/minor). If the code is already efficient, say so and explain briefly why.
</workflow> <guardrails>Before delivering findings, verify:
Context: Review of user order history endpoint called ~500 times/minute.
Finding 1 — Impact: Critical
N+1 query in getUserOrders(): fetches user, then loops to fetch each order individually. A user with 50 orders triggers 51 queries, adding ~200ms latency per request. Measure: enable query logging, count queries per request. Fix: eager load with JOIN or use SELECT * FROM orders WHERE user_id IN (...).
Finding 2 — Impact: Moderate
formatOrderResponse() parses and re-serializes each order's JSON metadata field inside the loop. For 50 orders, this adds ~15ms of redundant parsing. Measure: profile formatOrderResponse with a flamegraph. Fix: parse metadata once during the query mapping step, not during response formatting.
Finding 3 — Impact: Minor
No cache on getShippingRates() despite rates changing only daily. Each order display triggers a fresh API call to the shipping provider. Measure: count external API calls per request. Fix: cache shipping rates with 1-hour TTL.
development
Use when tracing execution paths, mapping dependencies, understanding unfamiliar code, following data flow, investigating end-to-end behavior, debugging call chains, or deciding which files to read next.
development
Use when reviewing authentication, authorization, user input, secrets, API keys, database queries, file uploads, session management, external API calls, OWASP risks, or data handling attack surface.
testing
Use when analyzing tradeoffs, comparing approaches, weighing options, assessing risks, stress-testing conclusions, identifying blind spots, or applying multiple viewpoints to a decision.
data-ai
Use when a repository has .agents, when the user asks for Flow lifecycle routing, Beads-backed task memory, spec-first planning, TDD implementation, sync/status, review, finish, archive, or /flow:* help.