component-splitter

Decompose large React components into smaller files with migration guides.

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/saddam-eng-tech/ai-agent-skills --skill component-splitter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-splitter
Source: https://github.com/saddam-eng-tech/ai-agent-skills/tree/main/component-splitter
Command: npx skills add https://github.com/saddam-eng-tech/ai-agent-skills --skill component-splitter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill tackles the issue of overly large and complex React components that become difficult to manage, understand, and maintain by automatically decomposing them into smaller, more focused units.

Core Features & Use Cases

  • Automated Component Decomposition: Analyzes large React components (100+ lines) and identifies logical boundaries for splitting.
  • Refactoring Strategy: Applies standard patterns like Container/Presentational, custom hook extraction, or sub-component extraction.
  • Migration Guidance: Generates a clear migration guide detailing the changes and how to update imports.
  • Use Case: When a React component grows to over 150 lines with mixed UI, data fetching, and business logic, use this Skill to split it into a custom hook for logic, a presentational component for UI, and potentially smaller sub-components for distinct UI sections.

Quick Start

Use the component-splitter skill to refactor the file '/path/to/LargeComponent.tsx' into smaller, manageable components.

Frequently Asked Questions about component-splitter

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

FAQPage Schema
How do I break down a large React component into smaller files?

To break down large React components, this Skill analyzes files exceeding 100 lines and decomposes them into smaller, focused units based on data fetching, business logic, and UI rendering concerns. It automatically identifies logical boundaries for splitting.

When do I need to extract custom hooks from my React components?

You need to extract custom hooks when a React component grows past 150 lines with mixed UI, data fetching, and business logic. This separation refactors logic into custom hooks and UI into presentational components for better maintainability.

What refactoring patterns are used to split React components?

Standard refactoring patterns used to split React components include container and presentational splits, custom hook extraction, and sub-component creation. These patterns isolate distinct concerns like data fetching and UI rendering into separate files.

How do I update imports after splitting a React component?

To update imports after splitting a React component, this Skill generates a clear migration guide detailing the changes. The guide ensures seamless integration by explaining how to update imports for the newly created hooks and sub-components.

Can I use this to refactor React components with mixed business logic and UI?

Yes, you can use this to refactor React components with mixed business logic and UI. It identifies these mixed concerns and applies decomposition strategies to separate logic into custom hooks and rendering into presentational components.