shadcn-component-boundaries — Claude Code skill: what it does
Sets architectural boundaries for shadcn UI components. It prevents mixing product logic into registry primitives and enforces one-way imports.
npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a claude-codeWhat shadcn-component-boundaries does
This skill sets directory and import rules for projects that use shadcn. It checks components.json to extract path aliases for components and ui. The agent stops guessing whether your files live in components/ or src/components/.
The resolved ui folder remains reserved for upstream registry primitives. Domain wrappers, page sections, and feature logic never belong there. Reusable product elements go into common/, while feature-specific components stay in their own feature folders. The dependency direction flows one way: feature to common to ui. Reverse imports are prohibited.
When @shadcn/lint is active, the rule shadcn/no-restyle restricts how styles are applied. Call sites can pass layout classes through className, but appearance changes require variants inside the primitive. Without a valid components.json, the agent cannot resolve aliases and will misplace files.
What it helps with
- isolate registry UI primitives from product business logic
- prevent reverse imports from feature folders into the
uidirectory - place reusable wrapper components inside a dedicated
common/folder - resolve exact component paths using aliases from
components.json
Example prompts for the agent
- Create a button with a loading state following our shadcn component boundaries.
- Review imports in the
components/uidirectory to ensure no feature dependencies leaked in. - Where should I place the user profile card according to our component structure?
How to install shadcn-component-boundaries
1Skills CLI (Vercel)
npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a claude-code2Manually: put the files in place
~/.claude/skills/shadcn-component-boundaries/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/shadcn-component-boundaries/
1Skills CLI (Vercel)
npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a codex2Manually: put the files in place
.agents/skills/shadcn-component-boundaries/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a cursor2Manually: put the files in place
.cursor/skills/shadcn-component-boundaries/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install C3SC0-V4113/Scaffold shadcn-component-boundaries2Manually: put the files in place
.github/skills/shadcn-component-boundaries/SKILL.md1Skills CLI (Vercel)
npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a gemini-cli2Platform CLI
gemini skills install https://github.com/C3SC0-V4113/Scaffold --path skills/shadcn-component-boundariesManually: put the files in place
.devin/skills/shadcn-component-boundaries/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a opencodeClaude.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 shadcn-component-boundaries
How to install shadcn-component-boundaries in Claude Code?
Run npx skills add C3SC0-V4113/Scaffold --skill shadcn-component-boundaries -a claude-code. The agent loads the skill and uses its component placement contract.
What does shadcn-component-boundaries do?
It prevents AI tools from placing domain logic into shadcn primitives. Base components stay untouched in the ui folder, while custom elements go into common/ or feature directories.
What import rules does the skill enforce?
Dependencies must flow in one direction: feature imports common, and common imports ui. Files in the ui directory must never import from common or feature folders.
Source text
SKILL.md · Apache-2.0
--- name: shadcn-component-boundaries description: "Trigger: components/ui, shadcn, component placement, common components, feature components, atomic design. Enforce registry and product component boundaries." license: Apache-2.0 metadata: author: purrfold version: "1.0" --- # shadcn Component Boundaries ## Activation Contract Load this skill when creating, moving, wrapping, or reviewing UI components in a project that uses shadcn. ## Hard Rules 1. Resolve paths from `components.json` (its `aliases` for `components` and `ui`) or the installed shadcn skill's project-context command. Never assume `components/` versus `src/components/`. 2. Reserve the resolved `ui` directory for registry-managed primitives installed from shadcn or compatible registries. 3. Never place product-owned wrappers, composites, sections, domain components, or feature behavior in the `ui` directory. 4. Put reusable product-owned components under `common/` in the resolved components directory. 5. Put feature-owned components in a named feature folder or colocate them with that feature. 6. Compose: wrap a registry primitive from `common/` or a feature folder instead of adding product behavior to the primitive. 7. Keep dependencies one-way: feature → common → ui. The `ui` directory never imports from `common` or feature folders. 8. Use semantic tokens from the global stylesheet. Treat tokens as quarks and registry primitives as atoms; do not force molecule or organism names into paths. 9. When `@shadcn/lint` is configured, `shadcn/no-restyle` enforces the `ui` boundary: call sites may pass layout classes through `className`, but look comes from variants and sizes. Add a variant to the primitive instead of restyling at the call site. ## Decision Gates | Component ownership | Destination | | --- | --- | | shadcn or compatible registry primitive | resolved `ui` directory | | reusable product-owned component | `<components>/common/` | | feature-specific component | `<components>/<feature>/` or feature colocation | | route or page composition | framework route/page directory | | theme token | global stylesheet variables | ## Execution Steps 1. Read `components.json` and resolve the `components` and `ui` aliases to directories. 2. Search installed primitives before creating custom markup. 3. Classify ownership and reuse scope with the table above. 4. Place the component; see [references/placement-examples.md](references/placement-examples.md) for edge cases. 5. Verify no product-owned file entered `ui` and no reverse import was introduced. ## Output Contract State the ownership classification and final path for every component created or moved, and confirm the dependency direction holds. ## References - [references/placement-examples.md](references/placement-examples.md) — worked placement decisions.
© purrfold · Apache-2.0 · C3SC0-V4113/Scaffold