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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "react-gradual-architecture" with this command: npx skills add vandriesh/react-gradual-architecture/vandriesh-react-gradual-architecture-react-gradual-architecture

React 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

PriorityCategoryWhen to ApplyPrefix
1FoundationBefore starting any featureframework-
2StartingWhen beginning a new featurestart-
3Organization & StructureWhen organizing files and foldersorganize-
4ExtractionWhen refactoring or extracting codeextract-
5Data & StateWhen managing types and statedata-, state-

Quick Reference

1. Foundation (CRITICAL)

  • framework-conventions - Follow framework conventions and keep domain code framework-agnostic
  • framework-react-router - Use .server suffix for server-only code (React Router / Remix)

2. Starting (CRITICAL)

  • start-small - Begin features in a single file;
  • if a file has more that 100 lines of code proceed with organization and extractions accordingly.
  • component-composition - Prefer composition over configuration; use children instead of many props (exception: variant props)

3. Organization & Structure

  • organize-features-folder - Place features under src/features/<feature>/ or app/features/<feature>/
  • organize-locality - Keep related files close to the feature
  • organize-reuse-boundaries - Wait for the second use before extracting shared code
  • organize-feature-readme - Create README.md for each feature documenting structure and specifications

4. Extraction

  • extract-scrolling - Extract when scanning becomes difficult
  • extract-to-share - Use hooks for React logic, plain functions for everything else
  • extract-ui-logic-utils - Extract UI, logic, and utils when concerns diverge
  • extract-container-presentational - Extract container (data) from presentational (UI) components

5. Data & State

  • data-types-placement - Define types where the data is born. NEVER create separate types.ts files
  • state-placement - Keep state local; lift only as high as needed

Rules Reference

The guidelines are organized into focused rule files. Reference the specific rules when making architectural decisions:

Foundation

Starting

Organization & Structure

Extraction

Data & State

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:

  1. Start with the overview above to understand the incremental approach
  2. Reference specific rule files when making architectural decisions
  3. Apply the smallest change that restores clarity
  4. 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 rules/ for in-depth explanations and code examples.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated