| name | setup-react-doctor |
| description | One-time setup skill that adds React performance and pattern analysis via pre-commit hook and CI. Detects React usage, configures react-doctor checks for component anti-patterns, unnecessary re-renders, and performance issues. Use when user wants automated React quality enforcement. |
Setup React Doctor
One-time guided setup. Adds react-doctor analysis at both CI and pre-commit hook level. Defaults to setting up both -- confirms with user before proceeding.
Workflow
Step 1 -- Detect project setup
Present findings to user and ask them to confirm or correct. Use AskUserQuestion to clarify:
- If component directories can't be determined: ask where React components live
- If multiple potential component roots found (e.g. monorepo): ask which to include
Step 2 -- Ask user preferences
Use AskUserQuestion for each:
- Where to enforce -- default is both, confirm with user:
- Both CI and pre-commit hook (recommended)
- CI only -- GitHub Actions workflow
- Pre-commit hook only -- local enforcement
- Scope -- what to analyze:
- Changed files only (recommended for pre-commit) -- fast, focused
- Full project scan (recommended for CI) -- comprehensive
- CI enforcement mode (if CI selected):
- Fail the check (recommended) -- PR cannot merge
- Warn only -- post a comment but don't block
Step 3 -- Generate files
Step 4 -- Verify
Key rules
- Skip setup entirely if the project doesn't use React -- inform user and exit
- Never overwrite existing workflow files or hooks without asking
- Idempotent -- running again detects existing setup and skips