Shadcn parity

From udecode/kitcn · View interactive version

Shadcn parity is an AI agent skill from the GitHub repository udecode/kitcn. Skill: shadcn-parity

How to use this skill

Skill file

Shadcn Parity

Use this for UI/component parity work, including shadcn-owned shell files,

registry-style component authorship, React component patterns, and React

Compiler/Effect decisions inside shadcn-compatible surfaces.

Comprehensive References

Load these only when the task needs the detail:

Contract

When the user asks for shadcn parity, treat ../shadcn as the source of

truth. Do not give them "inspired by shadcn". Do not abstract away the parts

that matter. Clone the methodology:

Only diverge when:

  1. the product domain is genuinely different
  2. the current repo has an explicit constraint
  3. the user explicitly asks for a divergence

If you diverge, say exactly why.

Ownership Rule

For kitcn init -t next, shadcn owns the app shell. kitcn

owns the integration layer.

Shadcn-owned files stay shadcn-owned:

kitcn-owned files stay kitcn-owned:

The rule is simple:

For the current Next scaffold, the acceptable shell patches are narrow:

For kitcn init, overwrite behavior must match that ownership split:

If you find yourself authoring a full replacement for a shadcn-owned file,

you are probably doing it wrong.

Universal Create Matrix

Public templates stay concrete:

Internally, kitcn only has two scaffold modes:

Framework detection should feel like shadcn, not like a fake kitcn

abstraction:

react

init -t stays universal. Keep it narrow.

init -t always owns:

Next-only baseline pieces:

React-mode baseline keeps the client core only:

init -t options stay narrow:

Do not grow init -t with fake feature flags.

Optional capability belongs in add:

Auth is the first real bundle. It patches the init -t baseline and owns:

Mode split:

and auth cRPC families only

Auth v1 does not own:

Rule:

Registry Comparison

kitcn should match shadcn on the data model as closely as possible.

Same shape:

packages/kitcn/src/cli/registry/items/<item>/<item>-item.ts

Current kitcn divergence:

That extra install layer is what kitcn adds beyond plain shadcn

registry resolution:

Rule:

shadcn has a real equivalent

Create

fixtures/* is not hand-authored. It is a normalized snapshot of real

CLI output.

The important bit:

codegen during kitcn init -t

Why not direct kitcn codegen?

scaffold -> dependency install -> codegen -> bootstrap retry -> codegen retry

Repo automation adds two deliberate details:

next, next-auth, vite, vite-auth

tmp/scenarios/*

Human Repro

To regenerate the checked-in fixture:

bun run fixtures:sync

To verify the fixture still matches fresh CLI output:

bun run fixtures:check

To materialize runnable tmp apps for manual runtime:

bun run scenario:prepare all

Why this exists:

it owns which scenario keys stop at scenario:dev, which ones add

test:auth and test:e2e, and which ones must use scenario:check

fixtures:check is not just a diff. It validates the fresh generated app with:

bun install
bun typecheck

Next starters also run bun lint. Vite starters intentionally skip lint in

this lane because shadcn's default eslint . sweeps generated/runtime files.

It validates against the current local package under test, not the last

published npm version:

If you need the slower rebuild-first lane, use:

bun run fixtures:check:full

Agent Repro

When checking parity or drift:

  1. run bun run fixtures:sync instead of editing fixtures/* by hand
  2. run bun run fixtures:check
  3. if drift remains, fix kitcn init -t next, not the fixture

Real Generation Flow

tooling/fixtures.ts does this:

  1. create a temp directory
  2. for each committed starter, run the local CLI:

```bash

bunx kitcn --backend concave init -t <next|vite> --yes --cwd <tmp> --name <starter>

```

For auth starters, follow with:

```bash

bunx kitcn --backend concave add auth --yes

```

  1. let create run the actual scaffold flow:
  1. if codegen needs Convex bootstrap, create bootstraps Convex and reruns real

codegen

  1. validate the fresh generated app:
  1. copy the generated app into fixtures/<starter>
  2. apply repo-only normalization:

That means the fixture is allowed to normalize repo-local junk, but it is not

allowed to invent user-facing files.

Do not change this into:

bunx kitcn init -t next --yes --cwd <tmp> --name next
cd <tmp>/next
bunx kitcn codegen

That skips the point of create owning bootstrap/codegen orchestration and can

reintroduce interactive or half-bootstrapped failure modes.

Rule

If fixtures/next differs from fresh output, assume the CLI is wrong first.

Do not "fix" fixture drift by patching the fixture directly unless the change is

strictly part of repo-only normalization.

Primary Sources

Start here before editing:

Prefer shadcn's non-e2e tests over guessing intended behavior.

Method

1. Map direct analogs

Build a parity map between the local surface and the shadcn surface.

Check:

If there is a direct analog, mirror it.

2. Read code and tests before edits

Read the matching shadcn implementation and the relevant unit tests before

changing local code.

Do not stop at the happy path source file. Read the tests too. That is where

the real contract usually lives.

3. Port tests first

For parity work, the first useful move is usually test porting.

Port/adapt shadcn's non-e2e tests for:

Adjust only the domain-specific payloads, paths, and names.

Do not add dead legacy tests like "old API no longer exists". Just delete the

old path.

4. Copy structure, not just behavior

If shadcn splits logic into command modules and shared utilities, mirror that

split locally.

Prefer:

Avoid:

5. Copy presentation too

Parity includes UX, not just logic.

Mirror:

If local dependencies differ, keep the behavior and shape the same with the

closest local equivalent.

6. Keep local extensions narrow

If the repo needs a stronger behavior than shadcn, keep it behind the same

surface.

Good:

Bad:

7. Delete conflicting legacy paths

If an old local abstraction conflicts with the parity target, remove it.

Do not keep:

Make the result look like it was built that way from the start.

Parity Checklist

Before calling the work done, verify:

Anti-Patterns

If you catch yourself doing any of these, stop:

That is how parity rots into fan fiction.

Output Rule

When reporting parity work back to the user, state:

  1. what was cloned directly
  2. what tests were ported/adapted
  3. any intentional divergence

If there was no divergence, say so plainly.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.