/react18-upgrade:react-audit-grep-patternsfrom react18-upgrade
Provides verified grep command libraries for React 18.3.1 and React 19 migration audits, covering deprecated/removed APIs, unsafe lifecycles, batching risks, tests, and dependency conflicts.
Ships in react18-upgrade. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Select the correct bundled scan catalog for a React migration audit, preserve the verified grep syntax, and report findings consistently instead of relying on memory for fragile multi-line and context-flag patterns.
| Target | Read this bundled reference | Contains |
|---|---|---|
| React 16/17 → 18.3.1 audit | references/react18-scans.md | Codebase profile, unsafe lifecycles, automatic batching vulnerabilities, legacy context, string refs, findDOMNode, root API, event delegation, Enzyme detection, and summary script. |
| React 18 → 19 audit | references/react19-scans.md | Removed APIs, deprecated APIs, test-file scans, StrictMode behavior, and summary script. |
| Tests for either target | references/test-scans.md | Setup file discovery, imports, Enzyme, react-test-renderer, old act, render helpers, assertions, async timers, waitFor, and findBy. |
| Dependencies for either target | references/dep-scans.md | React-related package versions, peer dependency conflicts, Enzyme detection, React Router version check, lockfile consistency, and duplicate React installs. |
Use these exact base fragments unless the repository uses a different source root or extension set:
# Standard flags used throughout:
# -r = recursive
# -n = show line numbers
# -l = show filenames only (for counting affected files)
# --include="*.js" --include="*.jsx" = JS/JSX files only
# | grep -v "\.test\.\|\.spec\.\|__tests__" = exclude test files
# | grep -v "node_modules" = safety (usually handled by not scanning node_modules)
# 2>/dev/null = suppress "no files found" errors
# Source files only (exclude tests):
SRC_FLAGS='--include="*.js" --include="*.jsx"'
EXCLUDE_TESTS='grep -v "\.test\.\|\.spec\.\|__tests__"'
# Test files only:
TEST_FLAGS='--include="*.test.js" --include="*.test.jsx" --include="*.spec.js" --include="*.spec.jsx"'
| Finding type | Severity default | Interpretation |
|---|---|---|
| React 19 removed API | Critical | ReactDOM.render, ReactDOM.hydrate, unmountComponentAtNode, findDOMNode, createFactory, legacy context, string refs, and removed react-dom/test-utils exports must be fixed before upgrade. |
| React 18 warning/deprecation | High | Unsafe lifecycle methods, string refs, legacy context, findDOMNode, and ReactDOM.render should be migrated before moving further. |
| Automatic batching risk | Medium | Async setState, .then(), .catch(), setTimeout, addEventListener, and post-await this.state reads require manual review; grep hits are candidates, not proof. |
| Test ecosystem issue | High | Enzyme, react-test-renderer, old act, Simulate, and brittle call-count assertions can block or destabilize upgrades. |
| Dependency conflict | High | Peer warnings, invalid packages, duplicate React installs, and React Router v5 require explicit assessment. |
references/react18-scans.md: full React 18.3.1 scan phases and summary script.references/react19-scans.md: full React 19 removed/deprecated API and test scan phases.references/test-scans.md: test-specific commands shared by both auditors.references/dep-scans.md: dependency, peer conflict, Enzyme, router, lockfile, and duplicate React commands.-A and -B context flags, then a second grep to locate nearby setState or await evidence..propTypes is not a deletion command: runtime validation changes, but the standalone prop-types package can remain documentation/tooling.## React audit grep result
**Status:** complete | partial | blocked
**Target:** React 18.3.1 | React 19 | tests | dependencies
| Scan area | Command source | Hits | Risk | Follow-up |
| --- | --- | --- | --- | --- |
| `<area>` | `references/<file>.md` | `<count or sample>` | Critical/High/Medium/Low | `<inspect/migrate/none>` |
### Commands run
```bash
<commands actually executed>
```
### Validation
- Reference files consulted: `<list>`
- Source root and extensions: `<src root and include flags>`
SRC_FLAGS, EXCLUDE_TESTS, and TEST_FLAGS semantics were preserved or repository-specific changes were stated.node_modules and separated source files from test files where required.-A or -B context flags.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/react18-batching-patternsDiagnose and fix React 18 automatic batching regressions in class components. Use when multiple setState calls occur after await, inside setTimeout, Promise .then() or .catch(), native addEventListener callbacks, or when tests fail because they assert intermediate state after a React 18 upgrade./react18-dep-compatibilityCheck React 18.3.1 and React 19 dependency compatibility before npm installs, peer-dependency resolutions, or upgrade plans. Use when reviewing a React upgrade matrix, resolving npm peer conflicts, choosing minimum compatible package versions, deciding on --legacy-peer-deps, or separating a react-router v5 to v6 migration./react18-enzyme-to-rtlRewrite Enzyme tests for React 18 into React Testing Library behavior tests. Use when a test imports enzyme, uses shallow, mount, wrapper.find(), wrapper.simulate(), wrapper.prop(), wrapper.state(), wrapper.instance(), Enzyme configure/Adapter, or needs React 18-compatible RTL migration patterns./react18-legacy-contextMigrate React legacy context API usage from contextTypes, childContextTypes, and getChildContext to modern createContext. Use this skill when touching legacy context in class or function components because provider and every consumer must be updated together to avoid React 18 warnings and React 19 runtime failures./react18-lifecycle-patternsMigrate unsafe React class component lifecycle methods to React 18.3.1-safe patterns. Use when fixing `componentWillMount`, `componentWillReceiveProps`, `componentWillUpdate`, `UNSAFE_` lifecycle warnings, choosing `getDerivedStateFromProps` versus `componentDidUpdate`, or adding `getSnapshotBeforeUpdate`./react18-string-refsMigrate React string refs, ref="name" assignments, and this.refs.name access to React.createRef(), callback refs, or child ref forwarding. Use this skill when migrating React 18.3.1 warnings or React 19 removals involving single refs, multiple refs, list refs, callback refs, or refs passed to child components.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin react18-upgradeOther plugins' skills for the same job