Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-doctor

> 前端框架
Open source

Your agent writes bad React. This catches it

14.2K stars0 likes2 views
WebsiteGitHub

About

Your agent writes bad React. This catches it

Your agent writes bad React, this catches it.

React Doctor deterministically scans your codebase and finds issues across state and effects, performance, architecture, security, accessibility, and maintainability. It highlights overly complex React functions and repeated JSX trees that are good candidates for composition.

Works across React frameworks and React-enabled sites - Next.js, Vite, Astro, TanStack, React Native, Expo, you name it.

Website →

Install

1. Quick start

Run this at your project root to get an audit.

bash
npx react-doctor@latest

Pass file paths to scan only the files that another CI step selected.

bash
npx react-doctor@latest src/a.tsx src/b.tsx

https://github.com/user-attachments/assets/07cc88d9-9589-44c3-aa73-5d603cb1c570

2. Install for agents

Once you have an audit, you can install the skill for your coding agent to learn from the issues and fix them in the future.

bash
npx react-doctor@latest install

Works with Claude Code, Cursor, Codex, OpenCode, and many more.

3. Run in CI

React Doctor reviews every pull request and reports only the issues your change introduced, not your existing backlog. Set it up with one command:

bash
npx react-doctor@latest ci install

This adds the workflow, scans every pull request, and posts a summary comment. Change the gate, scan scope, and comments anytime with react-doctor ci config, and bump the action with react-doctor ci upgrade. GitHub Actions is fully supported; GitLab CI gets a gate-only scaffold.

CI docs →

4. Configure rules

You can configure which rules to run and how to run them in doctor.config.ts.

Learn more →

Runtime performance traces

Record a Chrome DevTools performance trace while you interact with a running React app:

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

React Doctor opens system Chrome in a temporary isolated profile, records until you press Enter (up to five minutes), and flashes purple outlines with component names as React renders. It then returns a readable summary plus the path to a compressed DevTools trace. Use --format json or --format jsonl for coding agents. In an interactive terminal, you can run react-doctor scan without a URL and choose a detected localhost app or enter another URL; coding agents and CI must pass the URL explicitly.

An already-open normal browser is left alone. To reuse an authenticated session, start a dedicated Chrome profile with remote debugging, sign in, close its non-blank tabs, and pass its endpoint:

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

Chrome performance tracing is browser-wide, so React Doctor rejects attached profiles with open pages. It closes blank startup tabs before tracing and closes its scan tab afterward; the attached browser stays open. The trace is stored locally and is never uploaded, but it can contain page URLs, source paths, and React profiling details. Treat it as sensitive application data.

Telemetry

The CLI reports crashes, basic run traces, and anonymous usage counters to Sentry to help us fix bugs and prioritize work.

We collect:

  • Environment: CLI version, platform, Node version
  • Invocation: which command, package manager, and run context (whether it's local vs. CI vs. coding agent)
  • Project shape: framework, React version, TypeScript, project size (NO file contents)
  • Rules fired: rule names and counts only (e.g. react-doctor/no-array-index-as-key) (NO code or specific findings)
  • De-minified React Doctor CLI stack traces

To opt out, run: npx react-doctor@latest --no-telemetry

Contributing

Issues welcome!

MIT-licensed

Issues· 130 open

View all issuesOpen on GitHub
  • #1853

    Feature request: copy multiple contexts at once

    Updated Oct 1, 2026
  • #1851

    Ignore `.cloudflare` by default

    Updated Oct 1, 2026
  • #1849

    Always install CI at the repo root

    Updated Oct 1, 2026
  • #1847

    Respect project package manager and installation in workflows

    Updated Oct 1, 2026
  • #1843

    Disable rule `react-doctor/require-pnpm-hardening` by default

    Updated Sep 28, 2026
  • #1839

    async-await-in-loop: already-parallel map callbacks reported inside a Promise.allSettled wrapper

    Updated Sep 26, 2026
  • #1840

    async await diagnostics claim parallelism benefits for serialized or synchronous work

    Updated Sep 26, 2026
  • #1835

    Add react-doctor to awesome-ai-plugins?

    Updated Sep 23, 2026
  • #1829

    REACT_DOCTOR_NO_TELEMETRY=1 does not suppress the /api/score upload

    Updated Sep 20, 2026
  • #1413

    Feature Request: Define exit code for warnings

    Updated Sep 16, 2026

> Tags

TypeScriptagentscode-reviewdoctorreact

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架