{"id":"d12eba81-9be6-4556-b1f0-45bcc9f06bfa","shortId":"p3GzZq","kind":"skill","title":"performance-analyst","tagline":"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.","description":"# Performance Analyst\n\nA reviewer persona that identifies performance bottlenecks, scaling concerns, and resource waste in code.\n\n## Perspectives\n\nReferences `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.\n\n## Dispatch\n\nCan be dispatched as a subagent by code-review workflows when changes affect hot paths, database queries, or latency-sensitive operations.\n\n## Direct Invocation\n\n- \"Analyze performance of this database query pattern\"\n- \"Review this for N+1 queries\"\n- \"Is there a bottleneck here?\"\n- \"What's the scaling characteristic of this loop?\"\n- \"Review memory usage in this service\"\n\n<workflow>\n\n## Workflow\n\n### Step 1: Apply Persona\n\nPerformance 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.\n\n### Step 2: Performance Checklist\n\nWork through each category (skip categories that clearly don't apply):\n\n1. **Query patterns** — N+1 queries? Missing indexes? Full table scans? Unbounded result sets? Unnecessary joins that could be deferred?\n2. **Memory** — Large allocations inside loops? Unbounded collections that grow with input size? References held longer than needed? Missing pagination on large result sets?\n3. **I/O** — Synchronous I/O in async code paths? Sequential operations that could run in parallel? Missing connection pooling? Unbatched network calls?\n4. **Caching** — Repeated expensive computations with the same inputs? Missing cache for stable data? Cache invalidation correctness — stale entries possible?\n5. **Algorithmic** — O(n^2) or worse on variable-size input? Linear scans where a lookup table or index would work? Sorting inside a loop?\n6. **Concurrency** — Lock contention on shared resources? Shared mutable state in hot paths? Thread pool or connection pool exhaustion under load?\n7. **Resource lifecycle** — Connection leaks? File handle leaks? Missing cleanup in error paths?\n8. **Measurement** — Are metrics or tracing in place to detect regressions? Can impact be measured before and after?\n\n### Step 3: Report Findings\n\nFor each finding: problem, what metric proves it, estimated impact (critical/moderate/minor). If the code is already efficient, say so and explain briefly why.\n\n</workflow>\n\n<guardrails>\n\n## Guardrails\n\n- No over-optimization of non-critical paths — it's not worth the readability cost\n- Proportional recommendations — readability vs speed tradeoff must be acknowledged\n- Never recommend an optimization without identifying what to measure to verify the improvement\n- When impact cannot be estimated without profiling, say so explicitly and recommend profiling first\n\n</guardrails>\n\n<validation>\n\n### Validation Checkpoint\n\nBefore delivering findings, verify:\n\n- [ ] Every finding has a measurement recommendation\n- [ ] No speculative micro-optimizations — findings target real hot paths\n- [ ] Impact estimates included (critical/moderate/minor)\n- [ ] If code is efficient, explain briefly why\n\n</validation>\n\n<example>\n\n## Example\n\n**Context:** Review of user order history endpoint called ~500 times/minute.\n\n**Finding 1 — Impact: Critical**\nN+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 (...)`.\n\n**Finding 2 — Impact: Moderate**\n`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.\n\n**Finding 3 — Impact: Minor**\nNo 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.\n\n</example>\n\n## References Index\n\n- **[Persona](references/persona.md)** — Role, approach, measurement principle, and guardrails\n- **[Performance Checklist](references/checklist.md)** — Eight categories of performance concerns\n- **[Stances](../perspectives/references/stances.md)** — Underlying stance prompts for trade-off analysis (from perspectives skill)","tags":["performance","analyst","flow","cofin","agent-skills","ai-agents","beads","claude-code","codex","cursor","developer-tools","gemini-cli"],"capabilities":["skill","source-cofin","skill-performance-analyst","topic-agent-skills","topic-ai-agents","topic-beads","topic-claude-code","topic-codex","topic-cursor","topic-developer-tools","topic-gemini-cli","topic-opencode","topic-plugin","topic-slash-commands","topic-spec-driven-development"],"categories":["flow"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/cofin/flow/performance-analyst","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add cofin/flow","source_repo":"https://github.com/cofin/flow","install_from":"skills.sh"}},"qualityScore":"0.455","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 11 github stars · SKILL.md body (4,635 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:07:38.286Z","embedding":null,"createdAt":"2026-04-23T13:04:00.431Z","updatedAt":"2026-05-18T19:07:38.286Z","lastSeenAt":"2026-05-18T19:07:38.286Z","tsv":"'+1':14,110,194,482 '/perspectives/references/stances.md':636 '1':133,190,478,614 '15ms':554 '2':176,210,279,531 '200ms':504 '3':234,354,578 '4':255 '5':275 '50':498,550 '500':475 '51':501 '6':301 '7':322 '8':335 'acknowledg':405 'ad':503 'add':553 'advocate/critic/neutral':65 'affect':87 'algorithm':276 'alloc':213 'alreadi':372 'analysi':51,644 'analyst':3,31 'analyz':99 'anyth':173 'api':596,605 'appli':134,189 'approach':622 'async':239 'balanc':50 'benefit':62 'bottleneck':38,115 'briefli':378,464 'cach':20,59,256,265,269,582,610 'call':254,474,597,606 'cannot':421 'categori':182,184,631 'chang':86,587 'characterist':121 'checklist':178,628 'checkpoint':434 'cleanup':331 'clear':186 'code':10,45,82,156,240,370,460 'code-review':81 'collect':217 'commit':68 'complex':61 'comput':259 'concern':40,634 'concurr':22,302 'connect':250,317,325 'content':304 'context':467 'correct':271 'cost':396 'could':207,245 'count':512,603 'critic':388,480 'critical/moderate/minor':367,458 'daili':589 'data':268 'databas':11,90,103 'defer':209 'deliv':436 'despit':585 'detect':344 'direct':97 'dispatch':73,76 'display':592 'doesn':157 'eager':517 'effici':29,373,462 'eight':630 'els':174 'enabl':509 'endpoint':473 'engin':137 'entri':273 'error':333 'estim':365,423,456 'evalu':66,172 'everi':146,439 'exampl':466 'exhaust':319 'expect':153 'expens':258 'explain':377,463 'explicit':428 'extern':604 'fetch':486,491 'field':545 'file':327 'find':162,356,359,437,440,450,477,530,577 'first':432 'fix':516,564,609 'flamegraph':563 'focus':138 'format':576 'formatorderrespons':534,560 'fresh':595 'full':198 'getshippingr':584 'getuserord':485 'grow':219 'guardrail':380,626 'handl':328 'held':224 'histori':472 'hot':7,88,140,169,312,453 'hour':615 'i/o':19,235,237 'id':528 'identifi':36,167,411 'impact':154,347,366,420,455,479,532,579 'improv':418 'includ':457 'index':197,294,618 'individu':494 'input':221,263,286 'insid':214,298,546 'invalid':270 'invoc':98 'join':205,520 'json':543 'larg':212,231 'latenc':24,94,505 'latency-sensit':23,93 'leak':326,329 'lifecycl':324 'linear':287 'load':321,518 'lock':303 'log':511 'longer':225 'lookup':291 'loop':18,124,215,300,489,548 'map':571 'matter':159 'measur':150,336,349,414,443,508,558,602,623 'memori':16,126,211 'metadata':544,566 'metric':338,362 'micro':144,448 'micro-optim':143,447 'minor':580 'miss':196,228,249,264,330 'moder':533 'must':403 'mutabl':309 'n':13,109,193,278,481 'need':148,227 'network':253 'never':406 'non':387 'non-crit':386 'o':277 'off':55 'oper':96,243 'optim':71,145,384,409,449 'order':471,493,499,525,541,551,591 'over-optim':382 'pagin':229 'parallel':248 'pars':535,557,565 'part':164 'path':8,26,89,141,170,241,313,334,389,454 'pattern':105,192 'per':506,514,607 'perform':2,30,37,52,100,136,161,177,627,633 'performance-analyst':1 'persona':34,135,619 'perspect':46,48,646 'place':342 'pool':251,315,318 'possibl':274 'principl':624 'problem':360 'profil':425,431,559 'prompt':639 'proport':397 'prove':363 'provid':601 'queri':12,91,104,111,191,195,483,502,510,513,570 'rate':586,612 're':538 're-seri':537 'readabl':58,395,399 'real':452 'recommend':147,398,407,430,444 'redund':556 'refer':47,223,617 'references/checklist.md':629 'references/persona.md':620 'regress':345 'repeat':257 'report':355 'request':507,515,608 'resourc':28,42,307,323 'respons':575 'result':202,232 'review':6,33,83,106,125,468 'risk':15 'role':621 'run':246 'say':374,426 'scale':39,120 'scan':200,288 'select':523 'sensit':25,95 'sequenti':242 'serial':539 'servic':130 'set':203,233 'share':306,308 'ship':600,611 'size':222,285 'skill':647 'skill-performance-analyst' 'skip':183 'slow':9 'sort':297 'source-cofin' 'specul':446 'speed':56,401 'stabl':267 'stale':272 'stanc':635,638 'state':310 'step':132,175,353,572 'strategi':21,72,151 'structur':64 'subag':79 'synchron':236 'tabl':199,292 'target':451 'thread':314 'times/minute':476 'topic-agent-skills' 'topic-ai-agents' 'topic-beads' 'topic-claude-code' 'topic-codex' 'topic-cursor' 'topic-developer-tools' 'topic-gemini-cli' 'topic-opencode' 'topic-plugin' 'topic-slash-commands' 'topic-spec-driven-development' 'trace':340 'trade':54,642 'trade-off':53,641 'tradeoff':402 'trigger':500,593 'ttl':616 'unbatch':252 'unbound':201,216 'under':637 'unnecessari':204 'usag':17,127 'use':4,522 'user':470,487,496,527 'valid':433 'variabl':284 'variable-s':283 'verifi':416,438 'vs':57,60,400 'wast':43 'without':410,424 'work':179,296 'workflow':84,131 'wors':281 'worth':393 'would':295","prices":[{"id":"ac95fd58-05a9-42a2-8594-a38d40e961e2","listingId":"d12eba81-9be6-4556-b1f0-45bcc9f06bfa","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"cofin","category":"flow","install_from":"skills.sh"},"createdAt":"2026-04-23T13:04:00.431Z"}],"sources":[{"listingId":"d12eba81-9be6-4556-b1f0-45bcc9f06bfa","source":"github","sourceId":"cofin/flow/performance-analyst","sourceUrl":"https://github.com/cofin/flow/tree/main/skills/performance-analyst","isPrimary":false,"firstSeenAt":"2026-04-23T13:04:00.431Z","lastSeenAt":"2026-05-18T19:07:38.286Z"}],"details":{"listingId":"d12eba81-9be6-4556-b1f0-45bcc9f06bfa","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"cofin","slug":"performance-analyst","github":{"repo":"cofin/flow","stars":11,"topics":["agent-skills","ai-agents","beads","claude-code","codex","context-driven-development","cursor","developer-tools","gemini-cli","opencode","plugin","slash-commands","spec-driven-development","subagents","tdd","workflow"],"license":"apache-2.0","html_url":"https://github.com/cofin/flow","pushed_at":"2026-04-27T19:07:26Z","description":"Context-Driven Development toolkit for AI agents — spec-first planning, TDD workflow, and Beads integration.","skill_md_sha":"c9bd7baf0d0c98d4cff4e4cac10d55d0c3f7ff6f","skill_md_path":"skills/performance-analyst/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/cofin/flow/tree/main/skills/performance-analyst"},"layout":"multi","source":"github","category":"flow","frontmatter":{"name":"performance-analyst","description":"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."},"skills_sh_url":"https://skills.sh/cofin/flow/performance-analyst"},"updatedAt":"2026-05-18T19:07:38.286Z"}}