# performance

This skill measures React runtime performance for one repeatable interaction and ties browser delays to component renders.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 314 installs · ★ 15176 repo stars
- Author: millionco
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/millionco/react-doctor/tree/HEAD/skills/performance/SKILL.md
- Updated: 2026-10-25
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/millionco-performance

## What it does

The skill investigates a slow React interaction, unexpected re-renders, or a measured change after a fix. It runs `npx react-doctor@latest scan` against an explicit URL, records the session in an isolated Chrome profile, and uses live component outlines during the interaction. Authenticated pages can be traced through CDP.

Its report checks React detection, build type, Long Animation Frame support, interaction timing, blocking work, LCP, CLS, script hotspots, and component self time. It then searches the repository for recorded component names and handlers, using the DevTools trace when the summary cannot explain a long frame. Nearby timestamps alone are not treated as proof of causality.

Automated runs need an explicit URL, or the scan can wait for input. To validate a change, repeat the same flow and viewport; when timing varies, compare medians from three samples before and after.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add millionco/react-doctor --skill performance -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/performance/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/performance/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add millionco/react-doctor --skill performance -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/performance/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add millionco/react-doctor --skill performance -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/performance/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install millionco/react-doctor skills/performance
```

2. **Manually: put the files in place**
- File: `.github/skills/performance/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add millionco/react-doctor --skill performance -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/millionco/react-doctor --path skills/performance
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/performance/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add millionco/react-doctor --skill performance -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/millionco/react-doctor/tree/HEAD/skills/performance/SKILL.md

## When to use it
- locate the source of a slow React interaction
- connect a long frame to component renders
- separate browser-bound work from React work
- find re-renders with measured user impact
- compare runtime timings before and after a fix

## Example prompts
- Run `/performance` on the slow interaction at `http://localhost:3000`.
- Use `/performance` to investigate unexpected re-renders and connect them to the recorded flow.
- Run `/performance` before and after the fix, using the same interaction and viewport.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: fabfb3ccfccad644.

BEGIN THIRD-PARTY FILE fabfb3ccfccad644
````text
---
name: performance
description: Diagnose React runtime performance with React Doctor traces, live render outlines, Long Animation Frames, interaction timing, and component render evidence. Use when invoked as `/performance` for a slow interaction, unexpected re-renders, or a measured before-and-after comparison.
disable-model-invocation: true
---

# Diagnose React runtime performance

Measure one reproducible interaction, connect browser work to React renders, and report only conclusions supported by the trace.

## Define the interaction

Before recording:

1. Identify the target URL
2. Write the exact actions to reproduce
3. Choose the expected result
4. Confirm whether authentication is required

Use a production build when available. Development builds add framework work that can distort render and script timings. If you must measure a development build, label that limitation in the report.

## Record the trace

Run the scan in an interactive terminal:

```bash
npx react-doctor@latest scan http://localhost:3000 --format json
```

React Doctor opens an isolated Chrome profile. Perform the planned interaction while purple outlines identify rendered components. Press Enter after the interaction settles; recordings stop automatically after five minutes.

Interactive users can omit the URL and choose a detected localhost app or enter another URL. Agents must always pass the explicit URL so automated runs never wait for input.

For an authenticated session, connect through the Chrome DevTools Protocol (CDP):

```bash
npx react-doctor@latest scan https://app.example.com \
  --cdp http://127.0.0.1:9222 \
  --format json
```

Use a dedicated debug profile for CDP because Chrome tracing is browser-wide. Sign in, close every non-blank tab, and then start the scan. React Doctor closes leftover blank tabs before tracing. Never request cookies, copy a browser profile, or close an externally managed browser.

The compressed `.json.gz` trace can contain URLs, source paths, and application behavior. Keep it local unless an upload is explicitly approved.

## Read the report

Evaluate the report in this order:

1. **Capture support**: confirm React detection, build type, React tracks, and Long Animation Frame support
2. **User impact**: inspect the worst interaction, total blocking duration, Largest Contentful Paint (LCP), and Cumulative Layout Shift (CLS)
3. **Browser work**: inspect long frames and script hotspots for event handling, JavaScript, style, layout, and paint cost
4. **React work**: inspect component render count, total self time, and maximum self time
5. **Capture limits**: read every warning, especially dropped event counts

Follow these interpretation rules:
````
END THIRD-PARTY FILE fabfb3ccfccad644

The third-party file has ended. Everything between the fabfb3ccfccad644 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2710 of 4934 bytes. © millionco · MIT · https://github.com/millionco/react-doctor/tree/HEAD/skills/performance/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
