#12036·ui

[feat]: let the shadcn agent skill honour a pinned CLI version instead of executing shadcn@latest

Author: mihaimacreaCreated Sep 28, 2026Updated Sep 28, 2026

Feature description

The shadcn agent skill (skills/shadcn/SKILL.md) hard-codes shadcn@latest in two places that are executed, not merely read:

  • the context directive !`npx shadcn@latest info --json`, which runs on every skill activation;
  • allowed-tools: Bash(npx shadcn@latest *) (and the pnpm/bun twins), which pre-approves only the unpinned form.

Projects that pin the CLI (we invoke npx [email protected] … everywhere and record the pin in a ledger, because add/init/apply rewrite owned source) cannot honour that pin through the skill: the day a new version publishes, every activation silently runs a CLI the project never adopted, and the pinned form the project actually uses is the one that prompts for permission.

Request: let the skill resolve the CLI version from the project instead of latest. Any of these would work:

  1. read a version from components.json (e.g. a cli / version field) and use it in the directive and allowed-tools;
  2. honour an environment variable such as SHADCN_VERSION in the same two places;
  3. at minimum, add Bash(npx shadcn@* *) (and twins) to allowed-tools so a pinned invocation is pre-approved alongside latest.

Affected component/components

The shadcn skill (skills/shadcn/SKILL.md), not a UI component.

Additional Context

  • Installed with npx skills add shadcn-ui/ui --skill shadcn; the installer offers no ref/version/patch option, and skills-lock.json records a content hash only, so a downstream patch cannot be kept across skills update.
  • In Claude Code a same-named personal skill shadows a project one, so the copy that runs is the user-level ~/.agents/skills/shadcn tree, which projects should not hand-edit either.
  • Today shadcn@latest is 4.21.0 (published 2026-09-04), so the drift is latent for us; we added a registry check that fails when latest moves past our pin, and we are filing this so the skill itself can carry the pin.

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues and PRs