react-doctor · git:20260412.e139480 · 2026-04-12 · sha256 8e6c3d6c6c2cc2b7

react-doctor git:20260412.e139480A

Immutable. This exact content never changes and is served at /api/v1/blob/8e6c3d6c6c2cc2b7.

---
name: react-doctor
description: Installs and runs Million's React Doctor to audit a React or Next.js codebase for performance, security, correctness, and architecture issues. Use when the user mentions react-doctor, React Doctor, millionco/react-doctor, performance audits, code health, bundle size, or suspicious React patterns.
---

# React Doctor (Million)

Run an automated audit of a React/Next.js codebase and turn the diagnostics into a prioritized fix list.

## Quick Start

Install or refresh the skill package if needed:

```bash
npx skills add millionco/react-doctor
```

Run React Doctor from the repo root:

```bash
npx -y react-doctor@latest . --verbose
```

## Workflow

1. Confirm you are at the project root (the directory containing `package.json`).
2. If the skill is missing or outdated, run:
   - `npx skills add millionco/react-doctor`
3. Run the audit:
   - `npx -y react-doctor@latest . --verbose`
4. Convert the output into an actionable plan:
   - Capture the overall score (0-100).
   - List the top issues by severity (errors first).
   - For each issue, include the file path, what to change, and why it matters.
5. Fix issues starting with highest severity and highest leverage (security/correctness before perf polish).
6. Re-run the audit and confirm the score improves:
   - `npx -y react-doctor@latest . --verbose`

## Next.js App Router Notes

When triaging results for Next.js App Router projects, prioritize:

- Async Client Components (often accidental `"use client"` leaks)
- Client-side fetching for server-owned data (prefer Server Components / Route Handlers)
- Missing or incorrect `metadata` exports
- Server Actions without auth checks
- Excessive client bundle growth (barrel imports, large dependencies)

## Expected Output

When reporting results back, format as:

```markdown
React Doctor score: <number>/100

Top findings:

- <severity> <short title> -- <path(s)>
- ...

Fix plan:

1. <most important fix> (why)
2. ...

Verification:

- npx -y react-doctor@latest . --verbose
```

## Triggers

- User mentions react-doctor, React Doctor, or millionco/react-doctor
- User asks for a React or Next.js audit covering performance, correctness, security, or architecture
- User wants a focused code health pass on suspicious React patterns or bundle growth

## Checklist

- [ ] (Optional) `npx skills add millionco/react-doctor`
- [ ] `npx -y react-doctor@latest . --verbose`
- [ ] Findings summarized with file paths
- [ ] Fixes applied in severity order
- [ ] Audit re-run and score verified improved