react-improvelisted
Install: claude install-skill riseshinee/superclaude-react
# react-improve
Target: `$ARGUMENTS`
## Flags
| Flag | Meaning |
|---|---|
| `--type` | Limit the kind of improvement (default: decide from the target) |
| `--preview` | Don't edit; present a before/after plan only |
| `--safe` | If there are no tests, add characterization tests first, then refactor |
## Behavioral Flow
1. **Detect** — Confirm the stack with `react-stack`. Then get a fresh `react-map` and use it to locate code, following its token budget rules. Fan-in (`←N`) shows how far a change reaches.
2. **Baseline** — Find and run tests related to the target; record the current pass state. If there are no tests and the change is large, recommend `--safe` or tell the user.
3. **Diagnose** — Pick the applicable recipes below and present a short change plan.
4. **Refactor** — Make small steps, each of which can be verified to preserve behavior.
5. **Verify** — Re-run typecheck / lint / related tests and compare with the baseline.
6. **Report** — What changed and why; explicitly state whether the public API (props, exports) changed.
## Refactoring Recipes
**R1. Remove unnecessary useEffect** (most common, highest impact)
- Values computable from props/state synced via effect+setState → compute during render (`useMemo` if expensive)
- Work that should happen because of an event, done in an effect → move into the event handler
- Resetting state when a prop changes → change `key` from the parent
**R2. Extract custom hooks**
- A bundle of state + effects + handlers unrel