Skip to content

Commit 743db5f

Browse files
chore: sync templates after release [skip release]
1 parent 05e7996 commit 743db5f

38 files changed

Lines changed: 1333 additions & 721 deletions

templates/plate-playground-template/.agents/skills/shadcn/SKILL.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ These rules are **always enforced**. Each links to a file with Incorrect/Correct
7777

7878
### CLI
7979

80-
- **Never decode or fetch preset codes manually.** Pass them directly to `npx shadcn@latest apply --preset <code>` for existing projects, or `npx shadcn@latest init --preset <code>` when initializing.
80+
- **Never decode preset codes or build preset URLs manually.** Use `npx shadcn@latest preset decode <code>`, `preset url <code>`, or `preset open <code>`. For project-aware preset detection, use `npx shadcn@latest preset resolve`.
81+
- **Apply preset codes directly with the CLI.** Use `npx shadcn@latest apply <code>` for existing projects, or `npx shadcn@latest init --preset <code>` when initializing.
8182

8283
## Key Patterns
8384

@@ -150,6 +151,7 @@ The injected project context contains these key fields:
150151
- **`resolvedPaths`** → exact file-system destinations for components, utils, hooks, etc.
151152
- **`framework`** → routing and file conventions (e.g. Next.js App Router vs Vite SPA).
152153
- **`packageManager`** → use this for any non-shadcn dependency installs (e.g. `pnpm add date-fns` vs `npm install date-fns`).
154+
- **`preset`** → resolved preset code and values for the current project. Use `npx shadcn@latest preset resolve --json` when you only need preset information.
153155

154156
See [cli.md — `info` command](./cli.md) for the full field reference.
155157

@@ -174,8 +176,10 @@ npx shadcn@latest docs button dialog select
174176
7. **Review added components** — After adding a component or block from any registry, **always read the added files and verify they are correct**. Check for missing sub-components (e.g. `SelectItem` without `SelectGroup`), missing imports, incorrect composition, or violations of the [Critical Rules](#critical-rules). Also replace any icon imports with the project's `iconLibrary` from the project context (e.g. if the registry item uses `lucide-react` but the project uses `hugeicons`, swap the imports and icon names accordingly). Fix all issues before moving on.
175177
8. **Registry must be explicit** — When the user asks to add a block or component, **do not guess the registry**. If no registry is specified (e.g. user says "add a login block" without specifying `@shadcn`, `@tailark`, etc.), ask which registry to use. Never default to a registry on behalf of the user.
176178
9. **Switching presets** — Ask the user first: **overwrite**, **partial**, **merge**, or **skip**?
177-
- **Overwrite**: `npx shadcn@latest apply --preset <code>`. Overwrites detected components, fonts, and CSS variables.
178-
- **Partial**: `npx shadcn@latest apply --preset <code> --only theme,font`. Updates only the selected preset parts without reinstalling UI components. Supported values are `theme` and `font`; comma-separated combinations are allowed. `icon` is intentionally not supported, because icon changes may require full component reinstall and transforms.
179+
- **Inspect current preset**: `npx shadcn@latest preset resolve`. Use `--json` when you need structured values.
180+
- **Inspect incoming preset**: `npx shadcn@latest preset decode <code>`. Use `preset url <code>` or `preset open <code>` to share or open the preset builder.
181+
- **Overwrite**: `npx shadcn@latest apply <code>`. Overwrites detected components, fonts, and CSS variables.
182+
- **Partial**: `npx shadcn@latest apply <code> --only theme,font`. Updates only the selected preset parts without reinstalling UI components. Supported values are `theme` and `font`; comma-separated combinations are allowed. `icon` is intentionally not supported, because icon changes may require full component reinstall and transforms.
179183
- **Merge**: `npx shadcn@latest init --preset <code> --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.
180184
- **Skip**: `npx shadcn@latest init --preset <code> --force --no-reinstall`. Only updates config and CSS, leaves components as-is.
181185
- **Important**: Always run preset commands inside the user's project directory. `apply` only works in an existing project with a `components.json` file. 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 <current-base>` explicitly — preset codes do not encode the base.
@@ -208,11 +212,17 @@ npx shadcn@latest init --preset base-nova
208212
npx shadcn@latest init --defaults # shortcut: --template=next --preset=nova (base style implied)
209213

210214
# Apply a preset to an existing project.
211-
npx shadcn@latest apply --preset a2r6bw
212215
npx shadcn@latest apply a2r6bw
213-
npx shadcn@latest apply --preset a2r6bw --only theme
214-
npx shadcn@latest apply --preset a2r6bw --only font
215-
npx shadcn@latest apply --preset a2r6bw --only theme,font
216+
npx shadcn@latest apply a2r6bw --only theme
217+
npx shadcn@latest apply a2r6bw --only font
218+
npx shadcn@latest apply a2r6bw --only theme,font
219+
220+
# Inspect preset codes and project preset state.
221+
npx shadcn@latest preset decode a2r6bw
222+
npx shadcn@latest preset url a2r6bw
223+
npx shadcn@latest preset open a2r6bw
224+
npx shadcn@latest preset resolve
225+
npx shadcn@latest preset resolve --json
216226

217227
# Add components.
218228
npx shadcn@latest add button card dialog

0 commit comments

Comments
 (0)