react-patterns
Skill9 starsChanged 22 days agoApache-2.0View on GitHub
Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.
47 other projects use a version of this, 14 of them edited.
Adopted by
Most recently taken up by
- gromov0737/skillsedited, first seen Nov 29, 2026
- satvikgbusiness-jpg/Claude-skillstheir own version, first seen Nov 29, 2026
- jayavibhavnk/claude-skillstheir own version, first seen Nov 29, 2026
- harshadmadaye/OPMtheir own version, first seen Nov 29, 2026
- Lukk17/agent-standardstheir own version, first seen Nov 24, 2026
- ku5ic/claude-kittheir own version, first seen Nov 16, 2026
Used with
Projects with it also use typescript-strict, testing-strategy and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkilltypescript-strict
Enable TypeScript strict mode (strict, noImplicitAny, strictNullChecks, etc.) in a project and fix the resulting errors without weakening types, tests, or runtime behavior. Use when asked to "enable strict mode", "turn on TypeScript strict", "fix strict errors", or migrate a codebase to strict type checking.
Also in 3 projects that use this
BlockSkilltesting-strategy
Guidelines for writing effective tests in this project
Also in 4 projects that use this
LangChainSkilldocker-patterns
Best practices for Docker containerization and multi-stage builds
Also in 4 projects that use this
MicrosoftSkillerror-handling
统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。
Also in 5 projects that use this
Wania-KazmiSkillbackend-patterns
Backend architecture patterns, API design, database optimization, and server-side best practices. Use when building APIs, services, or server-side functionality.
Also in 5 projects that use this
LangChainSkilldatabase-migrations
Database migration patterns and schema versioning
Also in 4 projects that use this
- +2 more from microsoft
Other versions47 projects use a version of this.
Word for word · 0
None found.
Edited · 14
- involvex/youtube-music-cli★ 49098% same
- xenitV1/Antigravity-Workflows★ 13096% same
- Fandry96/k3-agentic-skills★ 2798% same
- VoDaiLocz/kilo-kit-mcp★ 2796% same
- xfstudio/skills★ 996% same
- ai4brands-design/claude-skills★ 296% same
- Ghosteken/agent-harness★ 299% same
- gromov0737/skills★ 298% same
- miptah21/skills★ 296% same
- AtilaMedeiros/skills★ 196% same
4 more not listed
Wrote their own version · 33
- naomiaro/waveform-playlist★ 1.7ksame name
- openstory-so/openstory★ 730same name
- TangleML/tangle-ui★ 104same name
- maxyeh0817/Forge★ 34same name
- komluk/scaffolding★ 16same name
- gongyijie85/dsh-ecc★ 8same name
- jdanigo/hydraia★ 8same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- Sagargupta16/claude-code-recipes★ 8same name
- Shiven0504/claude-skills-collection★ 6same name
23 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository275 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .agents/packs/eventtech/AGENTS.mdAGENTS.md
- .agents/packs/hardware/AGENTS.mdAGENTS.md
- .agents/packs/media/AGENTS.mdAGENTS.md
- skills/global_config/postgres-best-practices/AGENTS.mdAGENTS.md
- skills/global_config/react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- global-rulesCursor rule
- bdb-agentsCursor rule
- fabricCursor rule
- advisorSkill
- ao-orchestratorSkill
- bdb-eventagency-skillSkill
- bdbhtmlmanueldocsSkill
- bdbmediastormSkill
- bdb-shipping-skillSkill
- fabric-graphSkill
- fabric-loopSkill
- fabric-multigraphSkill
- fabricSkill
- fabric-swarmSkill
- fabric-teamworkSkill
- godmode-3d-creationSkill
- godmode-engineeringSkill
- godmode-eventtechSkill
- godmode-hardware-pcbSkill
- godmode-media-creationSkill
- godmode-shippingSkill
- godmode-ui-uxSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- master-sessionSkill
- skill-createSkill
- bdb-aosSkill
- bdbrainstormSkill
- codebase-memorySkill
- github-repoSkill
- agentic-harness-patternsSkill
- agent-manager-skillSkill
- agent-memory-mcpSkill
- agent-pipelineSkill
- agent-tool-builderSkill
- agenttrailSkill
- ai-agent-developmentSkill
- ai-productSkill
- aos-a2aSkill
- aos-gatewaySkill
- aos-project-initSkill
- aos-setupSkill
- aos-storeSkill
- aos-updateSkill
- api-design-principlesSkill
- apify-lead-generationSkill
- apify-ultimate-scraperSkill
- api-patternsSkill
- archifySkill
- architect-reviewSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 43 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Prefer small, focused components
- Distinctive: line 126
Check if actually slow
- Distinctive: line 205
Use this image as a reference for a better file structure of the project
- Distinctive: line 215
Use this skill only when the task clearly matches the scope described above.
- Distinctive: line 216
Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Distinctive: line 217
Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Patterns
Principles for building production-ready React applications.
1. Component Design Principles
Component Types
| Type | Use | State |
| Server | Data fetching, static | None |
| Client | Interactivity | useState, effects |
| Presentational | UI display | Props only |
| Container | Logic/state | Heavy 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
| Pattern | Extract When |
| useLocalStorage | Same storage logic needed |
| useDebounce | Multiple debounced values |
| useFetch | Repeated fetch patterns |
| useForm | Complex form state |
Hook Rules
- Hooks at top level only
- Same order every render
- Custom hooks start with "use"
- Clean up effects on unmount
3. State Management Selection
| Complexity | Solution |
| Simple | useState, useReducer |
| Shared local | Context |
| Server state | React Query, SWR |
| Complex global | Zustand, Redux Toolkit |
State Placement
| Scope | Where |
| Single component | useState |
| Parent-child | Lift state up |
| Subtree | Context |
| App-wide | Global store |
4. React 19 Patterns
New Hooks
| Hook | Purpose |
| useActionState | Form submission state |
| useOptimistic | Optimistic UI updates |
| use | Read resources in render |
Compiler Benefits
- 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 Case | Prefer |
| Reusable logic | Custom hook |
| Render flexibility | Render props |
| Cross-cutting | Higher-order component |
6. Performance Principles
When to Optimize
| Signal | Action |
| Slow renders | Profile first |
| Large lists | Virtualize |
| Expensive calc | useMemo |
| Stable callbacks | useCallback |
Optimization Order
- Check if actually slow
- Profile with DevTools
- Identify bottleneck
- Apply targeted fix
7. Error Handling
Error Boundary Usage
| Scope | Placement |
| App-wide | Root level |
| Feature | Route/feature level |
| Component | Around risky component |
Error Recovery
- Show fallback UI
- Log error
- Offer retry option
- Preserve user data
8. TypeScript Patterns
Props Typing
| Pattern | Use |
| Interface | Component props |
| Type | Unions, complex |
| Generic | Reusable components |
Common Types
| Need | Type |
| Children | ReactNode |
| Event handler | MouseEventHandler |
| Ref | RefObject<Element> |
9. Testing Principles
| Level | Focus |
| Unit | Pure functions, hooks |
| Integration | Component behavior |
| E2E | User flows |
Test Priorities
- User-visible behavior
- Edge cases
- Error states
- Accessibility
10. Anti-Patterns
| ❌ 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 |
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.
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

