# split-components

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 1120 repo stars
- Author: rerun-build
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rerun-build/rerun/tree/HEAD/.claude/skills/split-components/SKILL.md
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/split-components

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add rerun-build/rerun --skill split-components -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/split-components/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/split-components/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add rerun-build/rerun --skill split-components -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/split-components/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add rerun-build/rerun --skill split-components -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/split-components/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install rerun-build/rerun .claude/skills/split-components
```

2. **Manually: put the files in place**
- File: `.github/skills/split-components/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add rerun-build/rerun --skill split-components -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/rerun-build/rerun --path .claude/skills/split-components
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/split-components/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/rerun-build/rerun/tree/HEAD/.claude/skills/split-components/SKILL.md

## When to use it
- 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
- 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.

## Similar
- [split-layout-technical](https://affpapa.org/en/nevibecode/skills/split-layout-technical.md) — skill · 1800 installs
- [mcore-split-pr](https://affpapa.org/en/nevibecode/skills/mcore-split-pr.md) — skill · 1800 installs
- [flipoff-split-flap-display](https://affpapa.org/en/nevibecode/skills/flipoff-split-flap-display.md) — skill · 856 installs
- [smart-split](https://affpapa.org/en/nevibecode/skills/smart-split.md) — skill · 460 installs
- [rspack-split-chunks](https://affpapa.org/en/nevibecode/skills/rspack-split-chunks.md) — skill · 187 installs
- [subagent-split-check](https://affpapa.org/en/nevibecode/skills/subagent-split-check.md) — skill · ★ 741 repo stars

From the same set: [rerun-build/rerun](https://affpapa.org/en/nevibecode/by/rerun-build/rerun.md) — 25 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
