[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:
- read a version from
components.json(e.g. acli/versionfield) and use it in the directive andallowed-tools; - honour an environment variable such as
SHADCN_VERSIONin the same two places; - at minimum, add
Bash(npx shadcn@* *)(and twins) toallowed-toolsso a pinned invocation is pre-approved alongsidelatest.
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, andskills-lock.jsonrecords a content hash only, so a downstream patch cannot be kept acrossskills update. - In Claude Code a same-named personal skill shadows a project one, so the copy that runs is the user-level
~/.agents/skills/shadcntree, which projects should not hand-edit either. - Today
shadcn@latestis4.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
Source: shadcn-ui/ui