preen-split-react-components

Split oversized React component files into smaller modules with colocated tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/a2f0/tearleads --skill preen-split-react-components
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: preen-split-react-components
Source: https://github.com/a2f0/tearleads/tree/main/.codex/skills/preen-split-react-components
Command: npx skills add https://github.com/a2f0/tearleads --skill preen-split-react-components

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses the challenge of maintaining large, unwieldy React component files by refactoring them into smaller, more manageable, and organized modules.

Core Features & Use Cases

  • Proactive Refactoring: Identifies oversized React component files in a monorepo.
  • Modularization: Splits components into individual files with clear folder structures.
  • Colocated Tests: Ensures tests are placed alongside their respective components.
  • Use Case: Refactor a monolithic UserProfileCard.tsx file that contains multiple distinct UI sections (e.g., header, details, activity feed) into separate, reusable components like UserProfileHeader.tsx, UserDetails.tsx, and UserActivityFeed.tsx.

Quick Start

Run the preen-split-react-components skill to find and refactor large React component files in the current project.

Frequently Asked Questions about preen-split-react-components

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

FAQPage Schema
How do I split large React components into smaller modules?

Splitting large React components involves refactoring oversized files into smaller, single-component modules with organized directories and colocated tests. This Skill identifies files based on size, complexity, and logical UI boundaries to ensure code maintainability.

What is the best way to refactor a monolithic React component file?

The best way to refactor a monolithic React component file is extracting distinct UI sections into separate, reusable components. This Skill structures the extraction by logical UI boundaries, creating organized folder structures with colocated tests.

Does this React component splitting tool work within a monorepo?

Yes, this React component splitting tool works within a monorepo. It proactively identifies oversized React component files across the monorepo and refactors them into manageable, modular directories with colocated tests.

How do I organize colocated tests when extracting React components?

Organizing colocated tests during React component extraction is handled automatically by placing tests alongside their respective components in the new directory structure. This Skill validates the extracted modules to maintain code quality standards.

When should I split a React component file into multiple modules?

You should split a React component file into multiple modules when it becomes oversized and contains multiple distinct UI sections. This Skill addresses code maintainability by identifying files based on size, complexity, and logical UI boundaries.