用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arbazkhan971/godmode --skill react命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | react |
| description | React architecture -- components, state, performance, Server Components, testing. |
/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
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 |