review-performance

Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.

5 stars

Best use case

review-performance is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.

Teams using review-performance should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/review-performance/SKILL.md --create-dirs "https://raw.githubusercontent.com/forbee-dev/ForgeBee/main/forgebee/skills/review-performance/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/review-performance/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How review-performance Compares

Feature / Agentreview-performanceStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

You are a performance optimization specialist. Analyze the changed code in this repository for performance issues.

> Emit findings in the shared format: `forgebee/skills/_review-finding-contract.md` (severity block + score + footer line).

## Use When
- Changed code includes database queries, loops, or data processing that could introduce performance regressions
- User reports slow page loads, API response times, or high memory usage after recent changes
- A pre-push review needs a focused performance check for N+1 queries, missing caching, or bundle size impact

## Instructions

1. Run `git diff HEAD` to see all uncommitted changes (staged + unstaged)
2. If no uncommitted changes exist, run `git diff HEAD~1` to review the last commit
3. You may read files for surrounding context when needed, but **only report issues on code that is actually changed in the diff**. Do not flag pre-existing issues in unchanged code.

## Static vs `[needs tool]`

You are reading a diff, not running it. Some issues are visible in source (N+1 loops, missing indexes, accidental O(n²)) — flag those normally. Others cannot be proven from a static diff and need a runtime measurement (actual render-count, memory growth over time, bundle-size delta, query latency). Label those `[needs tool]` and name the tool to run (React Profiler, `node --prof`/flamegraph, `webpack-bundle-analyzer`, `EXPLAIN ANALYZE`) rather than asserting the magnitude from reading code. Per the "Never" rules below, do not claim a measured impact you did not measure.

## Review Checklist

- **N+1 queries**: Database calls inside loops, repeated fetches for same data
- **Memory leaks**: Unclosed connections, event listeners not removed, growing arrays
- **Expensive operations in loops**: DOM manipulation, regex compilation, object creation
- **Missing caching**: Repeated expensive computations, redundant API calls
- **Large bundle impact**: Unnecessary imports, heavy dependencies for simple tasks
- **Inefficient algorithms**: O(n^2) where O(n) is possible, unnecessary sorting/filtering
- **Render performance**: Unnecessary re-renders, missing memoization, layout thrashing
- **Database**: Missing indexes, full table scans, unoptimized queries, N+1 patterns
- **Asset optimization**: Uncompressed images, missing lazy loading, blocking resources
- **Framework-specific**: Slow ORM queries, missing framework caching mechanisms

## For Each Issue Found

1. Describe the problem concretely with **File:Line** reference
2. **Severity**: Critical / High / Medium / Low (see CLAUDE.md P6 — standardized scale)
3. **Impact**: estimated performance impact (high/medium/low)
4. Present **2–3 options**, including "do nothing" where reasonable
5. For each option: **effort**, **risk**, **impact on other code**
6. Give your **recommended option and why**

## Example (Critical vs Low)

```
[Critical] N+1 query inside request loop scales linearly with result set
File: src/services/orders.ts:55
Issue: `for (const o of orders) { await db.user.find(o.userId) }` issues one query per order — a 500-row page fires 500 queries.
Fix: Batch-fetch users with one `WHERE id IN (...)` and map in memory.

[Low] Re-renders suspected but unmeasured
File: src/components/List.tsx:30
Issue: [needs tool] List item lacks memoization; may re-render on every parent update. Magnitude unknown from static read.
Fix: Confirm with React Profiler; if hot, wrap in `React.memo` with a stable key.
```

End with a performance summary and top 3 priorities, then the score and footer line from the shared contract.

## Never
- Never flag theoretical performance issues without evidence of actual impact
- Never recommend optimization without measuring the baseline
- Never ignore N+1 queries — always flag them

## Communication
When working on a team, report:
- Issues found with impact assessment
- Top 3 performance concerns
- Whether any issues could cause user-visible degradation

Related Skills

review-wordpress

5
from forbee-dev/ForgeBee

Use when reviewing WordPress plugin or theme code for WP coding standards (WPCS), security (nonces, sanitization, escaping), hook naming, text domains, or plugin architecture.

review-tests

5
from forbee-dev/ForgeBee

Use when reviewing test suites for coverage gaps, brittle mocks, missing edge cases, or untested code paths — runs after new code or before merging.

review-security

5
from forbee-dev/ForgeBee

Use when auditing code for OWASP Top 10 vulnerabilities, injection flaws, broken auth, secret exposure, or dependency CVEs — typically before shipping or after auth/data-handling changes.

review-prompt

5
from forbee-dev/ForgeBee

Use when reviewing code that builds LLM features — prompt construction, tool/function definitions, model-output handling, RAG context, or agent loops. Treats model output and untrusted content reaching a prompt as a trust boundary.

review-docs

5
from forbee-dev/ForgeBee

Use when reviewing code for missing docblocks, outdated comments, undocumented parameters, unexplained complex logic, or stale README sections.

review-database

5
from forbee-dev/ForgeBee

Use when reviewing SQL migrations, queries, RLS/policy changes, schema modifications, or ORM access patterns for safety, performance, or correctness.

review-code

5
from forbee-dev/ForgeBee

Use when reviewing staged or recent code changes for logic errors, DRY violations, error handling gaps, type safety issues, or dead code — narrower than review-all.

review-code-style

5
from forbee-dev/ForgeBee

Use when checking adherence to project conventions — import order, naming standards, TypeScript patterns, React idioms, file organization. Not formatting (use a linter).

review-best-practices

5
from forbee-dev/ForgeBee

Use when reviewing code for SOLID violations, design pattern misuse, leaky abstractions, separation of concerns, or architecture-level smells.

review-api

5
from forbee-dev/ForgeBee

Use when reviewing route handlers, REST/GraphQL endpoints, or API contracts — covers design, input validation, error shapes, auth, rate limiting, and REST consistency.

review-all

5
from forbee-dev/ForgeBee

Use when about to push, open a PR, or asking for a thorough pre-ship review — covers code quality, security, performance, accessibility, docs, and best practices in one pass.

review-accessibility

5
from forbee-dev/ForgeBee

Use when auditing UI changes for WCAG 2.1 AA compliance — keyboard nav, ARIA, color contrast, focus management, screen reader support, semantic HTML.