agentleFS
omidnwomidnw/my-skills/skills/shadcn-library/SKILL.md

shadcn-library

Skill0 starsChanged 12 days agoMITView on GitHub

Use when creating or adding shadcn/ui components in any project — copy the raw source from a local snapshot of the shadcn/ui registry (create it with the refresh procedure below) instead of writing components from memory or hand-rolling equivalents. Covers copying, adapting imports, and restyling.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Why: when shadcn/ui is the project's chosen system, copying verified raw source is faster and more reliable than regenerating it from …

    line 10
  2. Very specific:

    Pick from the snapshot: Read ~/.agents/component-library/shadcn/INDEX.md.

    line 17
  3. Very specific:

    Verify: run the applicable project typecheck/lint through code-quality, confirm imports resolve, and inspect rendered keyboard/focus and …

    line 25
  4. Very specific:

    When the user asks to refresh the library: refetch https://ui.shadcn.com/r/index.json, then per component …

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

shadcn Library

Local raw snapshot of the shadcn/ui registry at ~/.agents/component-library/shadcn/ (see its INDEX.md for the component list and dependencies). If the snapshot does not exist on this machine yet, create it with the snapshot refresh procedure at the end of this skill, or fetch the same JSON from the registry URLs directly for a one-off component.

Why: when shadcn/ui is the project's chosen system, copying verified raw source is faster and more reliable than regenerating it from memory, and works offline. Do not introduce shadcn into a project with another established system merely because this skill exists.

Non-negotiable: the snapshot is raw upstream source. It carries no design decisions. Every project has its own design system — restyle at copy time; never carry over upstream visual styling (colors, radii, shadows, typography) into a project that defines its own.

Procedure

  1. Check the project first. Search its existing components and reuse them before copying. For missing shadcn primitives, use the local snapshot as stated in this skill's description; do not switch to the registry CLI by default. Inspect the project's framework, React/Tailwind versions and primitive dependencies for snapshot compatibility.
  2. Pick from the snapshot. Read ~/.agents/component-library/shadcn/INDEX.md; find the component and its deps (dependencies = npm packages, registryDependencies = other components in the same lib — copy those too).
  3. Copy the source into the project's component dir (typically components/ui/<name>.tsx). Do not rename internals (data-slot attributes stay).
  4. Adapt imports to the project's convention:
    • from "cn" → the project's cn util (usually @/lib/utils)
    • from "radix-ui" → either install the unified radix-ui package, or split into @radix-ui/react-<primitive> per the project's existing imports
    • lucide-react icons: swap to the project's icon family if it uses a different one
  5. Resolve missing deps against the project's package manager, existing versions and lockfile. Verify compatibility before adding only the dependencies required by the chosen component; do not migrate the project's Radix package layout incidentally.
  6. Restyle to the project's design system — map className values onto the project's tokens/CSS variables. Match existing components in the project (radius scale, color tokens, spacing).
  7. Verify: run the applicable project typecheck/lint through code-quality, confirm imports resolve, and inspect rendered keyboard/focus and interaction states via design-validation when a preview is available. Report unverified rendering explicitly.

Update the snapshot

When the user asks to refresh the library: refetch https://ui.shadcn.com/r/index.json, then per component https://ui.shadcn.com/r/styles/new-york-v4/<name>.json, write each files[].content, regenerate MANIFEST.json and INDEX.md. Skip entries that 404 (dead upstream).

Validation

  • The component was reused locally or copied from the inspected snapshot; imports/dependencies match the target project and existing user code was preserved.
  • Applicable installed checks ran, rendered interaction checks are recorded or explicitly unverified, and no registry fetch was substituted for the local source without an explicit refresh request.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.