sickn33/antigravity-awesome-skills/react-patterns

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.

Install

npx vskill@latest install sickn33/antigravity-awesome-skills/react-patterns

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

React Patterns

Principles for building production-ready React applications.

1. Component Design Principles

Component Types
TypeUseState
ServerData fetching, staticNone
ClientInteractivityuseState, effects
PresentationalUI displayProps only
ContainerLogic/stateHeavy state
Design Rules
  • One responsibility per component
  • Props down, events up
  • Composition over inheritance
  • Prefer small, focused components

2. Hook Patterns

When to Extract Hooks
PatternExtract When
useLocalStorageSame storage logic needed
useDebounceMultiple debounced values
useFetchRepeated fetch patterns
useFormComplex form state
Hook Rules
  • Hooks at top level only; React’s use API is an exception that can be called in loops/conditions inside a component or Hook (not in try/catch); see use
  • Same order every render
  • Custom hooks start with "use"
  • Clean up effects on unmount

3. State Management Selection

ComplexitySolution
SimpleuseState, useReducer
Shared localContext
Server stateReact Query, SWR
Complex globalZustand, Redux Toolkit
State Placement
ScopeWhere
Single componentuseState
Parent-childLift state up
SubtreeContext
App-wideGlobal store

4. React 19 Patterns

New Hooks
HookPurpose
useActionStateForm submission state
useOptimisticOptimistic UI updates
useRead resources in render
Compiler Benefits

These apply when React Compiler is installed and enabled in the build, not automatically on upgrading to React 19; see installation.

  • Automatic memoization
  • Less manual useMemo/useCallback
  • Focus on pure components

5. Composition Patterns

Compound Components
  • Parent provides context
  • Children consume context
  • Flexible slot-based composition
  • Example: Tabs, Accordion, Dropdown
Render Props vs Hooks
Use CasePrefer
Reusable logicCustom hook
Render flexibilityRender props
Cross-cuttingHigher-order component

6. Performance Principles

When to Optimize
SignalAction
Slow rendersProfile first
Large listsVirtualize
Expensive calcuseMemo
Stable callbacksuseCallback
Optimization Order
  1. Check if actually slow
  2. Profile with DevTools
  3. Identify bottleneck
  4. Apply targeted fix

7. Error Handling

Error Boundary Usage
ScopePlacement
App-wideRoot level
FeatureRoute/feature level
ComponentAround risky component
Error Recovery
  • Show fallback UI
  • Log error
  • Offer retry option
  • Preserve user data

8. TypeScript Patterns

Props Typing
PatternUse
InterfaceComponent props
TypeUnions, complex
GenericReusable components
Common Types
NeedType
ChildrenReactNode
Event handlerMouseEventHandler
RefRefObject<Element>

9. Testing Principles

LevelFocus
UnitPure functions, hooks
IntegrationComponent behavior
E2EUser flows
Test Priorities
  • User-visible behavior
  • Edge cases
  • Error states
  • Accessibility

10. Anti-Patterns

❌ Don't✅ Do
Prop drilling deepUse context
Giant componentsSplit smaller
useEffect for everythingDerive values during render; reserve effects for external synchronization and use server components only in a supporting framework
Premature optimizationProfile first
Index as keyStable unique ID

11. File Structure

<img width="1150" height="1438" alt="image" src="https://github.com/user-attachments/assets/10369698-472c-4695-a494-2c0672103aa1" />

Use this image as a reference for a better file structure of the project


Remember: React is about composition. Build small, combine thoughtfully.

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Example

User request:

Use @react-patterns for this task: Modern React patterns and principles.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
27,555
Repository forks
4,639
Repository npm downloads, 7 days
11,772
7-day trend score
73

Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 21 Mar 2026, 7 months ago.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sickn33/antigravity-awesome-skills/react-patterns/badge)](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/react-patterns)

Something wrong with this skill or its page? Tell us.