Generated banner for React Audit Grep Patterns
Generated logo for React Audit Grep Patterns

React Audit Grep Patterns

GitHubOfficialFirst committed by SaravananRajaramanDistributed by GitHub

  • Skill
  • Tool integration
  • Software development
  • MIT
  • No issues found

From the author

Provides the complete, verified grep scan command library for auditing React codebases before a React 18.3.1 or React 19 upgrade. Use this skill whenever running a migration audit - for both the react18-auditor and react19-auditor agents. Contains every grep pattern needed to find deprecated APIs, removed APIs, unsafe lifecycle methods, batching vulnerabilities, test file issues, dependency conflicts, and React 19 specific removals. Always use this skill when writing audit scan commands - do not rely on memory for grep syntax, especially for the multi-line async setState patterns which require context flags.
— the description by SaravananRajaraman

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a comprehensive collection of grep patterns designed to identify potential breaking changes, deprecated APIs, and migration blockers in React applications. It is structured to support automated audit agents by providing specific scan commands for lifecycle methods, automatic batching vulnerabilities, legacy context usage, and dependency conflicts. The patterns are organized by migration target (React 18.3.1 or 19) and include specific handling for test files and dependency management.

What it does

  • Provides grep patterns to detect unsafe React lifecycle methods.
  • Identifies potential automatic batching vulnerabilities in async code.
  • Scans for legacy Context API usage.
  • Checks for dependency conflicts and peer dependency issues.
  • Detects Enzyme usage which is a blocker for React 18+.
  • Verifies React Router versioning and lock file consistency.

When to use it

  • When preparing a React codebase for an upgrade to version 18.3.1 or 19.
  • When running automated migration audits using react18-auditor or react19-auditor agents.
  • When assessing the scope of work required for a major React version migration.
  • When troubleshooting dependency conflicts related to React upgrades.

Advantages

  • Reduces manual effort by providing verified, ready-to-use scan commands.
  • Ensures consistent audit coverage across different codebases.
  • Includes context-aware patterns for complex issues like async setState.
  • Helps identify hidden blockers like legacy context or Enzyme early in the process.

Usage examples

“Find all instances of componentWillMount in my project that haven't been migrated to UNSAFE_ yet.”
The agent executes the grep command from the Phase 1 lifecycle scans, returning a list of file paths and line numbers for all non-prefixed componentWillMount occurrences.
“Check if my project has any React 18 blockers related to dependencies.”
The agent runs the dependency scan library, identifying if Enzyme is present or if there are peer dependency conflicts that must be resolved before the upgrade.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/github/react-audit-grep-patterns/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip react-audit-grep-patterns.zip -d .agents/skills

Documentation by SaravananRajaraman

React Audit Grep Patterns

Complete scan command library for React 18.3.1 and React 19 migration audits.

Usage

Read the relevant section for your target:

  • references/react18-scans.md - all scans for React 16/17 → 18.3.1 audit

  • references/react19-scans.md - all scans for React 18 → 19 audit

  • references/test-scans.md - test file specific scans (used by both auditors)

  • references/dep-scans.md - dependency and peer conflict scans

Base Patterns Used Across All Scans

# 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"'

Files

references/dep-scans.md

Dependency Scans - Both Auditors

Scans for dependency compatibility and peer conflicts. Run during both R18 and R19 audits.


Current Versions

# All react-related package versions in one shot
cat package.json | python3 -c "
import sys, json
d = json.load(sys.stdin)
deps = {**d.get('dependencies',{}), **d.get('devDependencies',{})}
keys = ['react', 'react-dom', 'react-router', 'react-router-dom',
        '@testing-library/react', '@testing-library/jest-dom',
        '@testing-library/user-event', '@apollo/client', 'graphql',
        '@emotion/react', '@emotion/styled', 'jest', 'enzyme',
        'react-redux', '@reduxjs/toolkit', 'prop-types']
for k in keys:
    if k in deps:
        print(f'{k}: {deps[k]}')
" 2>/dev/null

Peer Dependency Conflicts

# All peer dep warnings (must be 0 before migration completes)
npm ls 2>&1 | grep -E "WARN|ERR|peer|invalid|unmet"

# Count of peer errors
npm ls 2>&1 | grep -E "WARN|ERR|peer|invalid|unmet" | wc -l

# Specific package peer dep requirements
npm info @testing-library/react peerDependencies 2>/dev/null
npm info @apollo/client peerDependencies 2>/dev/null
npm info @emotion/react peerDependencies 2>/dev/null
npm info react-router-dom peerDependencies 2>/dev/null

Enzyme Detection (R18 Blocker)

# In package.json
cat package.json | python3 -c "
import sys, json
d = json.load(sys.stdin)
deps = {**d.get('dependencies',{}), **d.get('devDependencies',{})}
enzyme = {k: v for k, v in deps.items() if 'enzyme' in k.lower()}
if enzyme:
    print('BLOCKER - Enzyme found:', enzyme)
else:
    print('No Enzyme - OK')
" 2>/dev/null

# Enzyme adapter files
find . -name "enzyme-adapter*" -not -path "*/node_modules/*" 2>/dev/null

React Router Version Check

ROUTER=$(node -e "console.log(require('./node_modules/react-router-dom/package.json').version)" 2>/dev/null)
echo "react-router-dom version: $ROUTER"

# If v5 - flag for assessment
if [[ $ROUTER == 5* ]]; then
  echo "WARNING: react-router v5 found - requires scope assessment before upgrade"
  echo "Run router migration scope scan:"
  echo "  Routes: $(grep -rn "<Route\|<Switch\|<Redirect" src/ --include="*.js" --include="*.jsx" | grep -v "\.test\." | wc -l) hits"
  echo "  useHistory: $(grep -rn "useHistory()" src/ --include="*.js" --include="*.jsx" | grep -v "\.test\." | wc -l) hits"
fi

Lock File Consistency

# Check lockfile is in sync with package.json
npm ls --depth=0 2>&1 | head -20

# Check for duplicate react installs (can cause hooks errors)
find node_modules -name "package.json" -path "*/react/package.json" 2>/dev/null \
  | grep -v "node_modules/node_modules" \
  | xargs grep '"version"' | sort -u

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of SaravananRajaramanSaravananRajaraman
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/react-audit-grep-patterns · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
SaravananRajaraman

AutoGineer is not affiliated with or endorsed by SaravananRajaraman or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download react-audit-grep-patterns.zip