sort-components — Claude Code skill for organizing 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/.
AGPL-3.0 ★ 1,120 updated 2026-11-16
npx skills add rerun-build/rerun --skill sort-components -a claude-codeWhat sort-components does
The skill groups files in apps/ui/components/ by what they do: chat pieces go in chat/, modal windows in dialogs/, and reusable primitives in ui/. New .tsx files belong in a subfolder, not at the directory root. If a component could fit by either its feature or its technical kind, the feature determines its location.
For an existing pile of root-level files, the workflow is to list them, assign destinations, move them with git mv, then switch imports to the @/components/<folder>/<File> alias. References between components and imports from apps/ui/app/ also need attention. Run cd apps/ui && npx tsc --noEmit to check import resolution; this requires the TypeScript npm package. Linting may still report existing code-quality issues.
What it helps with
- place a new component in its feature folder
- sort component files collected at the directory root
- repair imports after moving components
Example prompts for the agent
- Where should the new agent panel component go in
apps/ui/components/? - Sort the files at the root of
apps/ui/components/and update their imports.
How to install sort-components
1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill sort-components -a claude-code2Manually: put the files in place
~/.claude/skills/sort-components/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/sort-components/
1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill sort-components -a codex2Manually: put the files in place
.agents/skills/sort-components/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill sort-components -a cursor2Manually: put the files in place
.cursor/skills/sort-components/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install rerun-build/rerun .claude/skills/sort-components2Manually: put the files in place
.github/skills/sort-components/SKILL.md1Skills CLI (Vercel)
npx skills add rerun-build/rerun --skill sort-components -a gemini-cli2Platform CLI
gemini skills install https://github.com/rerun-build/rerun --path .claude/skills/sort-componentsManually: put the files in place
.devin/skills/sort-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 sort-components
How do I install sort-components in Claude Code?
Run npx skills add rerun-build/rerun --skill sort-components -a claude-code. The skill file is at ~/.claude/skills/sort-components/SKILL.md.
What does sort-components do?
It provides folder-placement rules for UI components and a process for moving existing files while repairing their imports.
How does sort-components check moved files?
Run cd apps/ui && npx tsc --noEmit to check whether imports resolve. The skill also mentions npm run lint and git status --short.