Review code for performance: complexity, database/query efficiency, I/O and network cost, memory and allocation behavior, concurrency contention, caching, and latency/throughput regressions. Cognitive-only atomic skill; output is a findings list.
Review code for performance issues only. Do not define scope (diff vs codebase) or analyze security/architecture/language-framework conventions; other atomic skills handle those. Emit a findings list in the standard format for aggregation. Focus on algorithmic complexity, query efficiency, I/O and network cost, memory behavior, contention and concurrency bottlenecks, caching strategy, and measurable regression risk.
Core Objective
Primary goal: produce a performance-centered findings list covering complexity hotspots, query efficiency, I/O cost, memory behavior, concurrency contention, caching, and regression risk for the given code scope.
Success criteria (all must hold):
✅ Performance scope only: reviews performance dimensions only; performs no scope selection, security, architecture, or language/framework style review
✅ All eight categories assessed: complexity, database/query efficiency, I/O and network cost, memory/allocation, concurrency/contention, caching/reuse, load-facing behavior, and observability are assessed where relevant
✅ Findings format compliant: each finding carries location, category (cognitive-performance), severity, title, description, and an optional suggestion
✅ Severity assigned accurately: production-impacting issues are marked "critical"; scalability risk is marked "major"; localized optimizations are marked "minor"/"suggestion"
✅ Actionable output: every finding carries a concrete location reference and a specific fix or improvement suggestion, and claims no benchmark numbers unless measurement evidence is supplied
Acceptance test: does the output contain a performance findings list covering all relevant dimensions, with evidence-based severity ratings and actionable, location-referenced suggestions?
Observability for performance (missing metrics/traces around hot paths)
This skill does not own:
Scope selection (deciding which files/paths to analyze) — the scope is supplied by the caller
Security review — use review-security
Architecture review — use review-architecture
Language/framework-specific conventions - use review-dotnet, review-java, review-go and so on.
Comprehensive SQL performance analysis — use review-sql
Full orchestrated review — use orchestrate-code-review
Handoff point: once all performance findings are emitted, hand them to the orchestrate-code-review orchestrator for aggregation, or deliver them straight to the user for a performance-centered review session.
Use Cases
Orchestrated review: serves as the cognitive step when orchestrate-code-review runs scope -> language -> framework -> library -> cognitive.
Performance-centered review: when the user wants the performance dimensions alone checked before a merge or a release.
Regression prevention: verify that a change introduces no visible latency, throughput, or memory regression.
When to use: when the task includes a performance review. The scope and code range are set by the caller or the user.
Behavior
What this skill covers
Analyze: performance dimensions inside the given code scope (files or a diff supplied by the caller). Does not decide scope; takes the code scope as input.
Do not: perform scope selection, security review, architecture review, or language/framework style review. Stay on performance.
Review checklist (performance dimensions only)
Complexity hotspots: detect unnecessary O(n^2)+ behavior, repeated scans, nested loops over large collections, and avoidable recomputation.
Database and query efficiency: N+1 access patterns, missing pagination, wide selects, inefficient joins/filters, and query frequency amplification.
I/O and network cost: chatty remote calls, missing batching, blocking calls on the critical path, unbounded retries/timeouts, and poor backoff behavior.
Memory and allocation: excessive allocation/churn, large object retention, unnecessary copies, unbounded growth, and avoidable buffering.
Concurrency and contention: lock contention, serialized critical sections, thread/goroutine starvation, queue backpressure, and oversubscription risk.
Caching and reuse: missed caching opportunities on hot read paths, invalidation correctness risk, stampede risk, and low-value cache layers.
Load-facing behavior: missing limits/guards (batch size, page size, concurrency caps), expensive defaults, and no degradation strategy under load.
Performance observability: missing metrics/traces around hot paths, which blocks regression detection and capacity planning.
Severity guidance
Critical: likely to have a visible production impact (unbounded loops/growth, repeated expensive I/O in a hot path, catastrophic query patterns, for example).
Major: strong regression or scalability risk under realistic traffic/data growth.
Minor/suggestion: localized or lower-impact optimization opportunities.
Tone and references
Professional and technical: cite the exact location (file:line, or the query/block).
Emit findings carrying location, category, severity, title, description, and suggestion.
Input & Output
Input
Code scope: files or directories (or a diff) already selected by the user or by a scope skill. This skill does not decide scope; it only examines the code it is given for performance.
Output
Emit zero or more findings in the format defined in specs/findings-list.md, with Categorycognitive-performance.
The category for this skill is cognitive-performance.
Restrictions
Hard Boundaries
Do not perform scope selection, security, architecture, or language/framework style review. Stay inside performance.
Do not state a finding without a concrete location or an actionable suggestion.
Do not claim benchmark numbers unless measurement evidence is supplied in the input.
Skill Boundaries
Do not do these (other skills handle them):
Do not select or define the code scope - it is set by the caller or by orchestrate-code-review
Do not perform security, architecture, or language/framework review — use the respective atomic skills
Do not perform comprehensive SQL performance analysis — use review-sql
Do not run or execute code to measure performance - use automate-tests for test execution
When to stop and hand off:
Once all performance findings are emitted, hand them to orchestrate-code-review for aggregation inside an orchestrated review
When the user wants a full review (scope + language + cognitive), redirect to orchestrate-code-review
When SQL performance issues dominate, suggest also running review-sql for deeper SQL coverage
Self-Check
Core success criteria
Performance scope only: reviews performance dimensions only; performs no scope selection, security, architecture, or language/framework style review
All eight categories assessed: complexity, database/query efficiency, I/O and network cost, memory/allocation, concurrency/contention, caching/reuse, load-facing behavior, and observability are assessed where relevant
Findings format compliant: each finding carries location, category (cognitive-performance), severity, title, description, and an optional suggestion
Severity assigned accurately: production-impacting issues are marked "critical"; scalability risk is marked "major"; localized optimizations are marked "minor"/"suggestion"
Actionable output: every finding carries a concrete location reference and a specific fix or improvement suggestion, and claims no benchmark numbers unless measurement evidence is supplied
Process quality checks
Were only performance dimensions reviewed (no scope/security/architecture/style)?
Were complexity, query efficiency, I/O, memory, concurrency, caching, and load behavior covered where relevant?
Does every finding carry location, category = cognitive-performance, severity, title, description, and an optional suggestion?
Is high-impact regression risk clearly separated from minor optimizations?
Acceptance test
Does the output contain a performance findings list covering all relevant dimensions, with evidence-based severity ratings and actionable, location-referenced suggestions?
Examples
Example 1: N+1 query pattern
Input: a loop that fetches the child records of each parent with one query per iteration.
Expected: a major/critical finding for the N+1 behavior; the suggestion is a batched query or a join strategy. Category = cognitive-performance.
Example 2: allocation churn on a hot path
Input: a request handler that repeatedly allocates large temporary buffers and serializes the payload several times.
Expected: a major finding on allocation pressure and its latency impact; the suggestion is reuse/pooling or a single-pass transformation. Category = cognitive-performance.
Edge case: no material performance risk in a small formatting diff
Input: the diff contains only comments/renames, with no behavior change.
Expected: emit no findings, or a single suggestion-level note; do not invent optimization work. The category for anything emitted is still cognitive-performance.
1---2name: review-performance3description: Review code for performance: complexity, database/query efficiency, I/O and network cost, memory and allocation behavior, concurrency contention, caching, and latency/throughput regressions. Cognitive-only atomic skill; output is a findings list.4license: MIT5---67# Skill: Review Performance89## Purpose1011Review code for **performance** issues only. Do not define scope (diff vs codebase) or analyze security/architecture/language-framework conventions; other atomic skills handle those. Emit a **findings list** in the standard format for aggregation. Focus on algorithmic complexity, query efficiency, I/O and network cost, memory behavior, contention and concurrency bottlenecks, caching strategy, and measurable regression risk.1213---1415## Core Objective1617**Primary goal**: produce a performance-centered findings list covering complexity hotspots, query efficiency, I/O cost, memory behavior, concurrency contention, caching, and regression risk for the given code scope.1819**Success criteria** (all must hold):20211. ✅ **Performance scope only**: reviews performance dimensions only; performs no scope selection, security, architecture, or language/framework style review222. ✅ **All eight categories assessed**: complexity, database/query efficiency, I/O and network cost, memory/allocation, concurrency/contention, caching/reuse, load-facing behavior, and observability are assessed where relevant233. ✅ **Findings format compliant**: each finding carries location, category (`cognitive-performance`), severity, title, description, and an optional suggestion244. ✅ **Severity assigned accurately**: production-impacting issues are marked "critical"; scalability risk is marked "major"; localized optimizations are marked "minor"/"suggestion"255. ✅ **Actionable output**: every finding carries a concrete location reference and a specific fix or improvement suggestion, and claims no benchmark numbers unless measurement evidence is supplied2627**Acceptance** test: does the output contain a performance findings list covering all relevant dimensions, with evidence-based severity ratings and actionable, location-referenced suggestions?2829---3031## Scope Boundaries3233**This skill owns**:3435- Algorithmic complexity hotspots (O(n²)+, nested loops, repeated scans)36- Database/query efficiency (N+1, missing pagination, wide selects)37- I/O and network cost (chatty calls, missing batching, blocking on the critical path)38- Memory and allocation behavior (churn, large object retention, unbounded growth)39- Concurrency and contention (lock contention, goroutine starvation, queue backpressure)40- Caching strategy (missing cache on hot paths, invalidation risk, stampede risk)41- Load-facing behavior (missing limits/guards, expensive defaults)42- Observability for performance (missing metrics/traces around hot paths)4344**This skill does not own**:4546- Scope selection (deciding which files/paths to analyze) — the scope is supplied by the caller47- Security review — use `review-security`48- Architecture review — use `review-architecture`49- Language/framework-specific conventions - use `review-dotnet`, `review-java`, `review-go` and so on.50- Comprehensive SQL performance analysis — use `review-sql`51- Full orchestrated review — use `orchestrate-code-review`5253**Handoff point**: once all performance findings are emitted, hand them to the `orchestrate-code-review` orchestrator for aggregation, or deliver them straight to the user for a performance-centered review session.5455---5657## Use Cases5859- **Orchestrated review**: serves as the cognitive step when [orchestrate-code-review](../orchestrate-code-review/SKILL.md) runs scope -> language -> framework -> library -> cognitive.60- **Performance-centered review**: when the user wants the performance dimensions alone checked before a merge or a release.61- **Regression prevention**: verify that a change introduces no visible latency, throughput, or memory regression.6263**When to use**: when the task includes a performance review. The scope and code range are set by the caller or the user.6465---6667## Behavior6869### What this skill covers7071- **Analyze**: performance dimensions inside the **given code scope** (files or a diff supplied by the caller). Does not decide scope; takes the code scope as input.72- **Do not**: perform scope selection, security review, architecture review, or language/framework style review. Stay on performance.7374### Review checklist (performance dimensions only)75761. **Complexity hotspots**: detect unnecessary O(n^2)+ behavior, repeated scans, nested loops over large collections, and avoidable recomputation.772. **Database and query efficiency**: N+1 access patterns, missing pagination, wide selects, inefficient joins/filters, and query frequency amplification.783. **I/O and network cost**: chatty remote calls, missing batching, blocking calls on the critical path, unbounded retries/timeouts, and poor backoff behavior.794. **Memory and allocation**: excessive allocation/churn, large object retention, unnecessary copies, unbounded growth, and avoidable buffering.805. **Concurrency and contention**: lock contention, serialized critical sections, thread/goroutine starvation, queue backpressure, and oversubscription risk.816. **Caching and reuse**: missed caching opportunities on hot read paths, invalidation correctness risk, stampede risk, and low-value cache layers.827. **Load-facing behavior**: missing limits/guards (batch size, page size, concurrency caps), expensive defaults, and no degradation strategy under load.838. **Performance observability**: missing metrics/traces around hot paths, which blocks regression detection and capacity planning.8485### Severity guidance8687- **Critical**: likely to have a visible production impact (unbounded loops/growth, repeated expensive I/O in a hot path, catastrophic query patterns, for example).88- **Major**: strong regression or scalability risk under realistic traffic/data growth.89- **Minor/suggestion**: localized or lower-impact optimization opportunities.9091### Tone and references9293- **Professional and technical**: cite the exact location (file:line, or the query/block).94- Emit findings carrying location, category, severity, title, description, and suggestion.9596---9798## Input & Output99100### Input101102- **Code scope**: files or directories (or a diff) already selected by the user or by a scope skill. This skill does not decide scope; it only examines the code it is given for performance.103104### Output105106- Emit zero or more **findings** in the format defined in [specs/findings-list.md](../../specs/findings-list.md), with **Category** `cognitive-performance`.107- The category for this skill is **cognitive-performance**.108109---110111## Restrictions112113### Hard Boundaries114115- **Do not** perform scope selection, security, architecture, or language/framework style review. Stay inside performance.116- **Do not** state a finding without a concrete location or an actionable suggestion.117- **Do not** claim benchmark numbers unless measurement evidence is supplied in the input.118119### Skill Boundaries120121**Do not do these** (other skills handle them):122123- Do not select or define the code scope - it is set by the caller or by `orchestrate-code-review`124- Do not perform security, architecture, or language/framework review — use the respective atomic skills125- Do not perform comprehensive SQL performance analysis — use `review-sql`126- Do not run or execute code to measure performance - use `automate-tests` for test execution127128**When to stop and hand off**:129130- Once all performance findings are emitted, hand them to `orchestrate-code-review` for aggregation inside an orchestrated review131- When the user wants a full review (scope + language + cognitive), redirect to `orchestrate-code-review`132- When SQL performance issues dominate, suggest also running `review-sql` for deeper SQL coverage133134---135136## Self-Check137138### Core success criteria139140- [ ] **Performance scope only**: reviews performance dimensions only; performs no scope selection, security, architecture, or language/framework style review141- [ ] **All eight categories assessed**: complexity, database/query efficiency, I/O and network cost, memory/allocation, concurrency/contention, caching/reuse, load-facing behavior, and observability are assessed where relevant142- [ ] **Findings format compliant**: each finding carries location, category (`cognitive-performance`), severity, title, description, and an optional suggestion143- [ ] **Severity assigned accurately**: production-impacting issues are marked "critical"; scalability risk is marked "major"; localized optimizations are marked "minor"/"suggestion"144- [ ] **Actionable output**: every finding carries a concrete location reference and a specific fix or improvement suggestion, and claims no benchmark numbers unless measurement evidence is supplied145146### Process quality checks147148- [ ] Were only performance dimensions reviewed (no scope/security/architecture/style)?149- [ ] Were complexity, query efficiency, I/O, memory, concurrency, caching, and load behavior covered where relevant?150- [ ] Does every finding carry location, category = cognitive-performance, severity, title, description, and an optional suggestion?151- [ ] Is high-impact regression risk clearly separated from minor optimizations?152153### Acceptance test154155Does the output contain a performance findings list covering all relevant dimensions, with evidence-based severity ratings and actionable, location-referenced suggestions?156157---158159## Examples160161### Example 1: N+1 query pattern162163- **Input**: a loop that fetches the child records of each parent with one query per iteration.164- **Expected**: a major/critical finding for the N+1 behavior; the suggestion is a batched query or a join strategy. Category = cognitive-performance.165166### Example 2: allocation churn on a hot path167168- **Input**: a request handler that repeatedly allocates large temporary buffers and serializes the payload several times.169- **Expected**: a major finding on allocation pressure and its latency impact; the suggestion is reuse/pooling or a single-pass transformation. Category = cognitive-performance.170171### Edge case: no material performance risk in a small formatting diff172173- **Input**: the diff contains only comments/renames, with no behavior change.174- **Expected**: emit no findings, or a single suggestion-level note; do not invent optimization work. The category for anything emitted is still cognitive-performance.
Run npx skillmds@latest add nesnilnehc/review-performance in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Review code for performance: complexity, database/query efficiency, I/O and network cost, memory and allocation behavior, concurrency contention, caching, and latency/throughput regressions. Cognitive-only atomic skill; output is a findings list. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
nesnilnehc (@nesnilnehc) published this skill. Their other Agent Skills are listed on their SkillMD profile.