skills/react-patterns/SKILL.md
Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.
npx skillsauth add pcruvinel/antig react-patternsInstall 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.
Principles for building production-ready React applications.
| Type | Use | State | |------|-----|-------| | Server | Data fetching, static | None | | Client | Interactivity | useState, effects | | Presentational | UI display | Props only | | Container | Logic/state | Heavy state |
| Pattern | Extract When | |---------|-------------| | useLocalStorage | Same storage logic needed | | useDebounce | Multiple debounced values | | useFetch | Repeated fetch patterns | | useForm | Complex form state |
| Complexity | Solution | |------------|----------| | Simple | useState, useReducer | | Shared local | Context | | Server state | React Query, SWR | | Complex global | Zustand, Redux Toolkit |
| Scope | Where | |-------|-------| | Single component | useState | | Parent-child | Lift state up | | Subtree | Context | | App-wide | Global store |
| Hook | Purpose | |------|---------| | useActionState | Form submission state | | useOptimistic | Optimistic UI updates | | use | Read resources in render |
| Use Case | Prefer | |----------|--------| | Reusable logic | Custom hook | | Render flexibility | Render props | | Cross-cutting | Higher-order component |
| Signal | Action | |--------|--------| | Slow renders | Profile first | | Large lists | Virtualize | | Expensive calc | useMemo | | Stable callbacks | useCallback |
| Scope | Placement | |-------|-----------| | App-wide | Root level | | Feature | Route/feature level | | Component | Around risky component |
| Pattern | Use | |---------|-----| | Interface | Component props | | Type | Unions, complex | | Generic | Reusable components |
| Need | Type | |------|------| | Children | ReactNode | | Event handler | MouseEventHandler | | Ref | RefObject<Element> |
| Level | Focus | |-------|-------| | Unit | Pure functions, hooks | | Integration | Component behavior | | E2E | User flows |
| ❌ Don't | ✅ Do | |----------|-------| | Prop drilling deep | Use context | | Giant components | Split smaller | | useEffect for everything | Server components | | Premature optimization | Profile first | | Index as key | Stable unique ID |
Remember: React is about composition. Build small, combine thoughtfully.
development
Master Unity ECS (Entity Component System) with DOTS, Jobs, and Burst for high-performance game development. Use when building data-oriented games, optimizing performance, or working with large entity counts.
development
Build Unity games with optimized C# scripts, efficient rendering, and proper asset management. Masters Unity 6 LTS, URP/HDRP pipelines, and cross-platform deployment. Handles gameplay systems, UI implementation, and platform optimization. Use PROACTIVELY for Unity performance issues, game mechanics, or cross-platform builds.
testing
Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.
development
Rigorous visual validation expert specializing in UI testing, design system compliance, and accessibility verification. Masters screenshot analysis, visual regression testing, and component validation. Use PROACTIVELY to verify UI modifications have achieved their intended goals through comprehensive visual analysis.