skills/react/SKILL.md
React architecture -- components, state, performance, Server Components, testing.
npx skillsauth add arbazkhan971/godmode reactInstall 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.
/godmode:react, "React app", "component architecture"grep -E "react|zustand|jotai|redux|react-query" \
package.json 2>/dev/null
grep -r "use client\|use server" \
--include="*.tsx" -l 2>/dev/null | head -10
Framework: Next.js | Remix | Vite | CRA
React: 18 | 19+ | Rendering: SPA | SSR | SSG
Pain points: re-renders, prop drilling, bundle size
Composition (default): small focused components, slot pattern for layouts. Custom Hooks: extract stateful logic (useDebounce, useMediaQuery, useLocalStorage). Render Props: when parent controls rendering.
Hierarchy: Pages -> Features -> UI Components -> Atoms. Rules: one thing per component, small props, composition over configuration, feature folders over tech folders.
| Type | Solution | |--|--| | Server/async (API) | TanStack Query / SWR | | URL (params) | useSearchParams / nuqs | | Form | React Hook Form + Zod | | Local UI | useState / useReducer | | Shared UI | Zustand or Jotai | | Complex global | Zustand or Redux Toolkit |
IF bundle >500KB: enable code splitting. IF re-renders >3 per interaction: add memoization.
GOLDEN RULE: measure before optimizing. Use React DevTools Profiler.
RSC: server-only, zero client JS, direct DB access. useTransition: non-urgent state updates. useDeferredValue: defer expensive re-renders.
Pyramid: E2E (Playwright) -> Integration (RTL) -> Unit. Query priority: getByRole > getByLabelText > getByText
getByTestId (last resort). Rules: test behavior not implementation. userEvent > fireEvent. MSW for API mocking.
[ ] Composition over prop drilling
[ ] Custom hooks for reusable logic
[ ] State management per category
[ ] memo/useMemo with evidence only
[ ] Code splitting at route level
[ ] Error boundaries
[ ] Tests with accessible queries
[ ] TypeScript strict
<!-- tier-3 -->
any. Use unknown + type guard.tsc --noEmit after changes.Append .godmode/react-results.tsv:
timestamp action components hooks test_status build_status notes
KEEP if: tsc passes AND tests pass AND no new
ESLint warnings AND bundle size stable.
DISCARD if: type errors OR test failures OR hooks
rules violated OR bundle regressed.
STOP when ALL of:
- tsc --noEmit exits 0
- All tests pass
- No ESLint react-hooks warnings
- Bundle within budget
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action | |--|--| | Infinite re-render | Check useEffect deps, stabilize refs | | Hydration mismatch | useEffect for client-only code | | Bundle too large | Analyze, lazy-load routes | | State on unmounted | Cleanup in useEffect, AbortController |
development
Web performance optimization. Lighthouse, bundle analysis, code splitting, image optimization, critical CSS, fonts, service workers, CDN.
development
Webhook design, delivery, retry, HMAC verification, event subscriptions, dead letter queues.
development
Vue.js mastery. Composition API, Pinia, Vue Router, Nuxt SSR/SSG, Vite optimization, testing.
development
Evidence gate. Run command, read full output, confirm or deny claim. No trust, only proof.