Skip to main content
skill CX Codex

split-components — Claude Code skill: what it does, how to install

The split-components Claude Code skill breaks up oversized component files into focused modules. It applies when a .tsx file grows crowded or before a new component is created.

AGPL-3.0 ★ 1,120 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add rerun-build/rerun --skill split-components -a claude-code
Open on GitHub

What split-components does

The skill separates components, logic, and types into distinct files. Its guide flags files around 250 lines or files containing multiple substantial components with their own state and logic. Small local UI elements can stay beside the main component.

Extracted components get their own files and absolute imports through @/components/.... Move non-visual logic into a useXxx hook or a helper in lib/; place types in types.ts and large configuration arrays in *.constants.ts. Compound primitives in ui/ and ai-elements/ stay intact.

Run cd apps/ui && npx tsc --noEmit to check imports after moving code. The skill also warns against formatting the whole file with prettier --write, which would add unrelated changes to the diff.

What it helps with

  • split a file containing several substantial components
  • move request logic and handlers out of a component
  • put shared types and configuration arrays in separate files
  • create a dedicated file for a new component

Example prompts for the agent

  • Split CreateAgentDialog.tsx into its main component and substantial sub-components.
  • Move the request logic out of this component into a hook.
  • Create the new component in its own file and use an absolute import.

How to install split-components

1Skills CLI (Vercel)

npx skills add rerun-build/rerun --skill split-components -a claude-code

2Manually: put the files in place

~/.claude/skills/split-components/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/split-components/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about split-components

How do I install split-components in Claude Code?

Run npx skills add rerun-build/rerun --skill split-components -a claude-code. The skill file is located at ~/.claude/skills/split-components/SKILL.md.

What does split-components do?

It guides the agent in separating large component files into components, hooks, types, and constants files. It uses cd apps/ui && npx tsc --noEmit to check imports.

Should compound UI primitives be split into separate files?

No. The skill says to keep compound primitives from ui/ and ai-elements/ together, even when they export several related parts.

Similar skills

SKILL.md skills catalog →

From the same set25

The whole set →
security-fix The security-fix Claude Code skill keeps vulnerability fixes in a private GitHub Security Advisory fork. It activates for security audit findings, private reports, or a pre-push rejection tied to vulnerability-related wording. CX Codex +1 ★ 1,120repo stars i18n-strings The i18n-strings Claude Code skill routes Rerun interface text through its translation setup. It activates for UI copy changes, date and number formatting, namespace extraction, or adding a language. CX Codex +1 ★ 1,120repo stars sort-components The sort-components Claude Code skill sorts UI components into folders by feature. It activates when adding a component or reorganizing apps/ui/components/. CX Codex +1 ★ 1,120repo stars confirm-destructive-actions The confirm-destructive-actions Claude Code skill sets confirmation rules for risky UI actions. It activates when adding a destructive button or writing a confirmation dialog. CX Codex +1 ★ 1,120repo stars loading-skeletons A Claude Code skill for building loading skeletons that match each component’s layout. It applies when adding a loading state or replacing a spinner in a content area. CX Codex +1 ★ 1,120repo stars investigate-bug investigate-bug — a skill for Claude Code that gathers evidence and traces a bug to its cause before a fix is written. It starts on bug reports, incidents, customer complaints, or requests to reproduce an issue. CX Codex +1 ★ 1,120repo stars form-field-labels form-field-labels — a Claude Code skill routes form titles through the shared Field component. It activates when adding or redesigning a field in apps/ui. CX Codex +1 ★ 1,120repo stars create-dialog The create-dialog Claude Code skill sets patterns for creating and redesigning app dialogs. Short forms use a basic frame; lists that open detail views use a panel with stepped navigation. CX Codex +1 ★ 1,120repo stars

Project sponsors

Companies that keep this analytics open