.agent/skills/react-expert/SKILL.md
Provides React 18/19 expertise including hooks, component patterns, performance optimization, state management, and Server Components. Use this skill for React component issues, hook errors, re-rendering problems, or state management challenges.
npx skillsauth add ripgraphics/authorsinfo react-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert in React 18/19 with deep knowledge of hooks, component patterns, performance optimization, state management, and Server Components.
If the issue is specifically about:
# Detect React version
npm list react --depth=0 2>/dev/null | grep react@ || node -e "console.log(require('./package.json').dependencies?.react || 'Not found')" 2>/dev/null
# Check for React DevTools and build tools
if [ -f "next.config.js" ] || [ -f "next.config.mjs" ]; then echo "Next.js detected"
elif [ -f "vite.config.js" ] || [ -f "vite.config.ts" ]; then echo "Vite detected"
elif [ -f "webpack.config.js" ]; then echo "Webpack detected"
elif grep -q "react-scripts" package.json 2>/dev/null; then echo "Create React App detected"
else echo "Unknown build tool"
fi
# Check for Strict Mode and router
grep -r "React.StrictMode\|<StrictMode" src/ 2>/dev/null || echo "No Strict Mode found"
npm list react-router-dom @tanstack/react-router --depth=0 2>/dev/null | grep -E "(react-router-dom|@tanstack/react-router)" || echo "No router detected"
Common Issues:
Diagnosis:
# Check for hook violations
npx eslint src/ --rule 'react-hooks/rules-of-hooks: error' --rule 'react-hooks/exhaustive-deps: warn' 2>/dev/null || echo "No ESLint React hooks rules configured"
# Find useEffect patterns
grep -r "useEffect" --include="*.jsx" --include="*.tsx" src/ | head -10
# Check for render-phase state updates
grep -r "setState\|useState.*(" --include="*.jsx" --include="*.tsx" src/ | grep -v "useEffect\|onClick\|onChange"
Prioritized Fixes:
Validation:
npm run lint 2>/dev/null || npx eslint src/ --ext .jsx,.tsx
npm test -- --watchAll=false --passWithNoTests 2>/dev/null || echo "No tests configured"
Resources:
Common Issues:
Diagnosis:
# Check for React.memo usage
grep -r "React.memo\|memo(" --include="*.jsx" --include="*.tsx" src/ | wc -l
# Find potential performance issues
grep -r "map\|filter\|reduce" --include="*.jsx" --include="*.tsx" src/ | grep -v "useMemo\|useCallback" | head -5
# Check for object creation in render
grep -r "=.*{.*}" --include="*.jsx" --include="*.tsx" src/ | grep -v "useState\|useEffect" | head -5
Prioritized Fixes:
Validation: Use React DevTools Profiler to measure render count reduction and performance improvements.
Resources:
Common Issues:
Diagnosis:
# Find effects without cleanup
grep -A 5 -r "useEffect" --include="*.jsx" --include="*.tsx" src/ | grep -B 5 -A 5 "useEffect" | grep -c "return.*(" || echo "No cleanup functions found"
# Check for async effects (anti-pattern)
grep -r "async.*useEffect\|useEffect.*async" --include="*.jsx" --include="*.tsx" src/
# Find potential memory leaks
grep -r "addEventListener\|setInterval\|setTimeout" --include="*.jsx" --include="*.tsx" src/ | grep -v "cleanup\|clear\|remove"
Prioritized Fixes:
Validation:
# Check for memory leaks (if tests are configured)
npm test -- --detectLeaks --watchAll=false 2>/dev/null || echo "No test configuration for leak detection"
Resources:
Common Issues:
Diagnosis:
# Find potential prop drilling patterns
grep -r "props\." --include="*.jsx" --include="*.tsx" src/ | wc -l
# Check Context usage
grep -r "useContext\|createContext" --include="*.jsx" --include="*.tsx" src/
# Look for direct state mutations
grep -r "\.push\|\.pop\|\.splice" --include="*.jsx" --include="*.tsx" src/ | grep -v "useState.*=\|setState"
# Find object rendering patterns
grep -r "{\w*}" --include="*.jsx" --include="*.tsx" src/ | grep -v "props\|style" | head -5
Prioritized Fixes:
Resources:
Common Issues:
Diagnosis:
# Check for client-only code
grep -r "window\.\|document\.\|localStorage\|sessionStorage" --include="*.jsx" --include="*.tsx" src/ | head -10
# Find server components (if using App Router)
grep -r "use server\|async function.*await" --include="*.jsx" --include="*.tsx" src/
# Check for hydration-sensitive code
grep -r "Date\(\)\|Math.random\(\)" --include="*.jsx" --include="*.tsx" src/
Prioritized Fixes:
typeof window !== 'undefined' checks, use suppressHydrationWarning sparinglyssr: false, consistent data fetchingResources:
Common Issues:
Diagnosis:
# Check component size and complexity
find src/ -name "*.jsx" -o -name "*.tsx" | xargs wc -l | sort -rn | head -10
# Find list rendering without keys
grep -r "\.map(" --include="*.jsx" --include="*.tsx" src/ | grep -v "key=" | head -5
# Check for ref usage
grep -r "useRef\|ref\.current" --include="*.jsx" --include="*.tsx" src/
# Find repeated patterns
grep -r "interface.*Props\|type.*Props" --include="*.tsx" src/ | wc -l
Prioritized Fixes:
Resources:
When reviewing React code, focus on these framework-specific aspects:
useReact.memo for expensive componentsuseMemo and useCallback used where beneficial (not overused)tools
Webpack build optimization expert with deep knowledge of configuration patterns, bundle analysis, code splitting, module federation, performance optimization, and plugin/loader ecosystem. Use PROACTIVELY for any Webpack bundling issues including complex optimizations, build performance, custom plugins/loaders, and modern architecture patterns. If a specialized expert is a better fit, I will recommend switching and stop.
development
Web application security expert. OWASP Top 10, XSS, SQLi, CSRF, SSRF, authentication bypass, IDOR. Use for web app security testing.
testing
Vitest testing framework expert for Vite integration, Jest migration, browser mode testing, and performance optimization
tools
Vite build optimization expert with deep knowledge of ESM-first development, HMR optimization, plugin ecosystem, production builds, library mode, and SSR configuration. Use PROACTIVELY for any Vite bundling issues including dev server performance, build optimization, plugin development, and modern ESM patterns. If a specialized expert is a better fit, I will recommend switching and stop.