react

Organize React TSX components with colocated patterns and flat directories.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/lucas-barake/dotai --skill react-lucas-barake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react
Source: https://github.com/lucas-barake/dotai/tree/main/canonical/skills/react
Command: npx skills add https://github.com/lucas-barake/dotai --skill react-lucas-barake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React projects often suffer from tangled component trees and inconsistent patterns across teams. This Skill provides proven frontend patterns to improve organization and reusability.

Core Features & Use Cases

  • Colocation: keep related components in a single file to simplify maintenance and reduce navigation.
  • Flat Directory Structure: encourage concise, easily navigable codebases.
  • TanStack Router Organization: structure routes with dedicated -lib areas for clean routing.

Quick Start

Organize your next React component into a single-file pattern with a root component and its subcomponents as properties.

Frequently Asked Questions about react

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize React components to avoid tangled component trees?

Organize React components by enforcing colocated patterns, keeping related components in a single TSX file to simplify maintenance and reduce file navigation. This approach establishes clear component boundaries and predictable structure across your project.

What is the colocation pattern for React frontend architecture?

The colocation pattern keeps a root component and its related subcomponents together within a single TSX file. By treating subcomponents as properties of the root, it reduces file navigation and simplifies long-term maintenance of your React frontend.

How do I structure TanStack Router routes in a flat directory structure?

Structure TanStack Router routes by using a flat directory structure with dedicated -lib areas for clean routing. This organization avoids barrel files and ensures predictable component boundaries across your React application.

Does this React component pattern require external tools or dependencies?

No, this React component pattern does not require external tools beyond standard React tooling. It relies on frontmatter-guided guidance in SKILL.md and naming rules to enforce structure, working natively with TSX files and TanStack Router.

Why should I avoid barrel files when organizing React components?

Avoid barrel files to maintain a flat directory structure that keeps your React codebase concise and easily navigable. Enforcing direct imports without barrel files prevents tangled component trees and ensures predictable project organization.

Can I use these React component patterns with TypeScript?

Yes, these React component patterns are designed for TypeScript projects using TSX files. The structural rules apply directly to TSX component composition, ensuring clear boundaries and maintainable frontend architecture without conflicting with TypeScript configurations.