Awesome-omni-skill react-gradual-architecture
Incremental React code organization guidelines. Start small, then extract when scanning and responsibilities start to blur. Use when creating features, organizing files, refactoring components, or deciding when to extract hooks, UI, or utils.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/react-gradual-architecture-vandriesh" ~/.claude/skills/diegosouzapw-awesome-omni-skill-react-gradual-architecture && rm -rf "$T"
skills/development/react-gradual-architecture-vandriesh/SKILL.mdReact Gradual Architecture
Lightweight guidance for organizing React code without over-structuring. The core idea: start small, minimum necessary (one file), extract only when it improves clarity or reuse. Contains 12 rules across 5 categories, prioritized by when to apply them in the development lifecycle.
When to Use This Skill
Reference these guidelines when:
- Creating new React features or components
- Organizing component files and folders
- Refactoring a growing component
- Deciding when to extract hooks, UI, or utils
- Structuring feature directories and shared code
- Creating feature documentation (README.md)
Rule Categories by Priority
| Priority | Category | When to Apply | Prefix |
|---|---|---|---|
| 1 | Foundation | Before starting any feature | |
| 2 | Starting | When beginning a new feature | |
| 3 | Organization & Structure | When organizing files and folders | |
| 4 | Extraction | When refactoring or extracting code | |
| 5 | Data & State | When managing types and state | , |
Quick Reference
1. Foundation (CRITICAL)
- Follow framework conventions and keep domain code framework-agnosticframework-conventions
- Useframework-react-router
suffix for server-only code (React Router / Remix).server
2. Starting (CRITICAL)
- Begin features in a single file;start-small- if a file has more that 100 lines of code proceed with organization and extractions accordingly.
- Prefer composition over configuration; use children instead of many props (exception: variant props)component-composition
3. Organization & Structure
- Place features underorganize-features-folder
orsrc/features/<feature>/app/features/<feature>/
- Keep related files close to the featureorganize-locality
- Wait for the second use before extracting shared codeorganize-reuse-boundaries
- Create README.md for each feature documenting structure and specificationsorganize-feature-readme
4. Extraction
- Extract when scanning becomes difficultextract-scrolling
- Use hooks for React logic, plain functions for everything elseextract-to-share
- Extract UI, logic, and utils when concerns divergeextract-ui-logic-utils
- Extract container (data) from presentational (UI) componentsextract-container-presentational
5. Data & State
- Define types where the data is born. NEVER create separatedata-types-placement
filestypes.ts
- Keep state local; lift only as high as neededstate-placement
Rules Reference
The guidelines are organized into focused rule files. Reference the specific rules when making architectural decisions:
Foundation
- Follow framework conventions and keep domain code framework-agnosticframework-conventions.md
- Useframework-react-router.md
suffix for server-only code (React Router / Remix).server
Starting
- Begin features in a single filestart-small.md
- Prefer composition over configuration; use children instead of many propscomponent-composition.md
Organization & Structure
- Place features underorganize-features-folder.md
orsrc/features/<feature>/app/features/<feature>/
- Keep related files close to the featureorganize-locality.md
- Wait for the second use before extracting shared codeorganize-reuse-boundaries.md
- Create README.md for each feature documenting structure and specificationsorganize-feature-readme.md
Extraction
- Extract when scanning becomes difficultextract-scrolling.md
- Use hooks for React logic, plain functions for everything elseextract-to-share.md
- Extract UI, logic, and utils when concerns divergeextract-ui-logic-utils.md
- Extract container (data) from presentational (UI) componentsextract-container-presentational.md
Data & State
- Define types where the data is borndata-types-placement.md
- Keep state local; lift only as high as neededstate-placement.md
How to Use
Read individual rule files for detailed explanations and code examples:
rules/start-small.md rules/extract-scrolling.md rules/organize-features-folder.md
Each rule file contains:
- Brief explanation of why it matters
- Examples showing the pattern
- Guidance on when to apply it
- Additional context and references
Core Principles:
- Start with the overview above to understand the incremental approach
- Reference specific rule files when making architectural decisions
- Apply the smallest change that restores clarity
- Extract only when it improves readability or enables reuse
Full Compiled Document
For the complete guide with all rules expanded and optimized for AI agents: AGENTS.md
Detailed Rule Documentation
See individual rule files in
for in-depth explanations and code examples.rules/