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
npx skills add rerun-build/rerun --skill split-components -a claude-codeWhat 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.tsxinto 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-code2Manually: put the files in place
~/.claude/skills/split-components/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/split-components/
1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill split-components -a codex2Manually: put the files in place
.agents/skills/split-components/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill split-components -a cursor2Manually: put the files in place
.cursor/skills/split-components/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install rerun-build/rerun .claude/skills/split-components2Manually: put the files in place
.github/skills/split-components/SKILL.md1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill split-components -a gemini-cli2Platform CLI
gemini skills install https://github.com/rerun-build/rerun --path .claude/skills/split-componentsManually: put the files in place
.devin/skills/split-components/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.