component-organization

Enforce one-component-per-file organization for React feature pages.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/dinogit/motocho --skill component-organization-dinogit
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: component-organization
Source: https://github.com/dinogit/motocho/tree/main/.claude/skills-disabled/component-organization
Command: npx skills add https://github.com/dinogit/motocho --skill component-organization-dinogit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In React feature pages, developers frequently place multiple components in a single page.tsx, which leads to tangled code, difficult reuse, and higher maintenance costs.

Core Features & Use Cases

  • Enforces a one-component-per-file pattern for feature pages to improve readability and maintainability.
  • Encourages a dedicated components/ folder structure and a page.tsx that only composes imported components.
  • Useful during creating new pages, refactoring existing pages, or when breaking apart a large mixed file into modular pieces.

Quick Start

Organize your feature pages by moving all subcomponents into separate files under features/<feature>/components/ and ensure page.tsx only imports and renders those components.

Frequently Asked Questions about component-organization

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

FAQPage Schema
How do I split multiple components in a single React page.tsx file?▼

To split multiple components in a single React page.tsx file, move each subcomponent into a separate file under a dedicated components/ directory, leaving page.tsx as a thin composition layer that only imports and renders them.

What is the best way to organize React feature pages for better code quality?▼

The best way to organize React feature pages for code quality is enforcing a one-component-per-file pattern, keeping page.tsx strictly as a composition layer that imports from a dedicated components directory.

Does refactoring a mixed React page file require a specific folder structure?▼

Refactoring a mixed React page file requires organizing code into a dedicated components/ folder, ensuring each subcomponent resides in its own file while page.tsx acts only as an import and render layer.

When should I enforce a single-component-per-file pattern in React?▼

You should enforce a single-component-per-file pattern in React when creating new pages, refactoring existing page.tsx files, or separating tangled mixed files to improve readability and reduce maintenance costs.

Why does mixing components in a single React page.tsx increase maintenance costs?▼

Mixing components in a single React page.tsx increases maintenance costs because it leads to tangled code and difficult reuse, making the feature page harder to read and modify over time.

Can I use a thin composition layer for page.tsx without a components directory?▼

No, keeping page.tsx as a thin composition layer requires a dedicated components/ directory to hold the extracted subcomponents, ensuring page.tsx only imports and renders those modular pieces.