diff --git a/skills/shadcn/SKILL.md b/skills/shadcn/SKILL.md index 022142ad53..8a76cc0dc2 100644 --- a/skills/shadcn/SKILL.md +++ b/skills/shadcn/SKILL.md @@ -176,6 +176,7 @@ npx shadcn@latest docs button dialog select - **Reinstall**: `npx shadcn@latest init --preset --force --reinstall`. Overwrites all components. - **Merge**: `npx shadcn@latest init --preset --force --no-reinstall`, then run `npx shadcn@latest info` to list installed components, then for each installed component use `--dry-run` and `--diff` to [smart merge](#updating-components) it individually. - **Skip**: `npx shadcn@latest init --preset --force --no-reinstall`. Only updates config and CSS, leaves components as-is. + - **Important**: Always run preset commands inside the user's project directory. The CLI automatically preserves the current base (`base` vs `radix`) from `components.json`. If you must use a scratch/temp directory (e.g. for `--dry-run` comparisons), pass `--base ` explicitly — preset codes do not encode the base. ## Updating Components diff --git a/skills/shadcn/cli.md b/skills/shadcn/cli.md index 32124036dd..bdbfe401cb 100644 --- a/skills/shadcn/cli.md +++ b/skills/shadcn/cli.md @@ -253,3 +253,5 @@ Ask the user first: **reinstall**, **merge**, or **skip** existing components? - **Re-install** → `npx shadcn@latest init --preset --force --reinstall`. Overwrites all component files with the new preset styles. Use when the user hasn't customized components. - **Merge** → `npx shadcn@latest init --preset --force --no-reinstall`, then run `npx shadcn@latest info` to get the list of installed components and use the [smart merge workflow](./SKILL.md#updating-components) to update them one by one, preserving local changes. Use when the user has customized components. - **Skip** → `npx shadcn@latest init --preset --force --no-reinstall`. Only updates config and CSS variables, leaves existing components as-is. + +Always run preset commands inside the user's project directory. The CLI automatically preserves the current base (`base` vs `radix`) from `components.json`. If you must use a scratch/temp directory (e.g. for `--dry-run` comparisons), pass `--base ` explicitly — preset codes do not encode the base.