shadcn-docs-nuxt component library documentation
With the goal of "minimal usable + fast and stable", establish a long-term maintainable shadcn-docs-nuxt documentation site for any project.
This skill is split into three layers:
- SKILL.md — navigation and workflow
- references/ — troubleshooting manual and configuration guide
- templates/ — directly copyable code templates (with complete comments; the comments are the documentation)
During execution, proceed according to the workflow; when encountering configuration details, consult reference; when code is needed, read template directly.
Template file index (templates/)
Code templates contain complete explanatory comments;the comments record the root cause of each configuration item, the consequences of not configuring it, and historical incidents. When using them, read the template files directly; do not skip the comments.
| Template file | Corresponding documentation site file | Description |
|---|---|---|
templates/nuxt.config.minimal.ts |
nuxt.config.ts |
Minimal startup skeleton |
templates/nuxt.config.full.ts |
nuxt.config.ts |
Production baseline (Nitro trace retained by default) |
templates/app.config.ts |
app.config.ts |
Site metadata and UI configuration |
templates/tailwind.config.js |
tailwind.config.js |
Complete Tailwind + shadcn-vue theme |
templates/assets/css/tailwind.css |
assets/css/tailwind.css |
CSS entry + light/dark theme variables |
templates/assets/css/main.css |
assets/css/main.css |
Custom style example |
templates/shims/debug.ts |
shims/debug.ts |
debug ESM compatibility shim |
templates/workspace-aliases.ts |
workspace-aliases.ts |
Component library source alias function |
templates/plugins/ui-lib.ts |
plugins/xxx.ts |
Nuxt Plugin registration pattern |
templates/package.json |
package.json |
Dependencies and scripts baseline |
templates/prettierrc.json |
.prettierrc |
MDC protection (fallback solution) |
templates/prettierignore |
.prettierignore |
MDC protection (primary solution) |
Reference documentation index (references/)
| File | Content |
|---|---|
references/nuxt-config.md |
On-demand patch strategy, list of items not to modify |
references/compat.md |
ESM/CJS compatibility quick reference table, troubleshooting order, common misjudgment table |
references/tailwind-css.md |
content scanning rules, CSS variable format, common style issue troubleshooting |
references/mdc-prettier.md |
MDC standard syntax, comparison of 5 incorrect writing styles, hydration mismatch causal chain |
references/windows.md |
Build false hang, child process chain cleanup, EPERM file lock, single-process reproduction method |
references/workspace.md |
Alias order pitfalls, dependency matrix, plugin registration, i18n monolingual, OG Image, directory structure |
references/incident-repair.md |
Nuxt Content/H3 version drift, prerender hook history and layered build failure troubleshooting |
references/dependency-triage.md |
Dependency hoisting layer troubleshooting, packageExtensions/overrides/patch decisions, optimizeDeps blind spots, fork governance, platform binary tracking |
references/ssr-hydration.md |
Hydration diagnostic toolchain, non-SSR-safe package isolation techniques, hoisted component resolution pitfalls, HTTP 200 illusion, SSR acceptance checklist |
references/production-graph-and-runtime-closure.md |
production graph、final Nitro OOM、standalone MODULE_NOT_FOUND, Turbo cache and artifact acceptance |
references/README.md |
Signal navigation and migration ledger for the nine current references |
Core principles (6 iron rules)
- Keep it lean:
nuxt.config.tsandapp.config.tsshould be minimized first; do not pile on features first. - Get it running before beautifying: prioritize ensuring
dev/buildis stable, then do styling and content expansion. - Fix the runtime chain before fixing styles: for interaction anomalies (dark mode, sidebar collapse failure), check hydration and module import errors first; do not change CSS first.
- Avoid incorrect extensions: do not immediately tinker with i18n / icon customization solutions; first use the template's default usable path.
- Strict content syntax: MDC container syntax must be standardized; see
references/mdc-prettier.md。 - Production closure: evidence first, configuration second:Vercel
READYIt only means the deployment orchestration is complete, not that the Function runtime is available; the deployment package manifest, final artifact, remote requests, and runtime logs must be chained into an evidence chain.
Hard constraints from historical incidents (22 memories)
When executing this skill,you must by default carry these "already happened" incident memories:
- Do not assume the workspace component library has already been built first; the documentation site needs to be able to start directly from source. → See
references/workspace.md - Do not first attribute interaction failure to styles; first rule out hydration being interrupted by a module import error. → See
references/compat.md - Do not let prettier rewrite
content/**/\*.md's MDC structure. → Seereferences/mdc-prettier.md - Do not directly judge "logs stopped" as "process hung" under Windows, first investigate residual child processes. → See
references/windows.md - Do not rewrite the i18n / icon system right from the start; first get the template's default path working. → See
references/nuxt-config.md - Do not directly enable the
ogImagemodule; it will triggervue.runtime.mjs does not provide an export named toValue's 500 error. → Seereferences/nuxt-config.md - Core runtime packages must be pinned according to the compatibility matrix: at minimum review simultaneously
shadcn-docs-nuxt、@ztl-uwu/nuxt-content、nuxt、h3, and do not look only at the theme's transitive dependency scope. prerender:routesis not an unconditional disable item, but a historical workaround: it was once used to mitigate the Windows build long tail, but for document-driven Nuxt Content it causes the content database to be empty; it can only be discussed when it is confirmed that the project does not depend on Content prerender and equivalent verification has been completed. → Seereferences/incident-repair.md- final Nitro OOM and standalone
MODULE_NOT_FOUNDmust return to the first failing gate: the former requires measuring the heap and artifact stage, the latter requires distinguishing Vite SSR transform, Nitro inline, trace, and manifest, and cannot be masked with broad configuration. → Seereferences/production-graph-and-runtime-closure.md - A Turbo cache hit does not mean the runtime closure is trustworthy: only when diagnosing cache trustworthiness or when cache/artifact evidence conflicts, execute
turbo run <task> --force; routine production acceptance does not execute this command, but must start the.outputserver and complete an HTTP smoke test. → Seereferences/production-graph-and-runtime-closure.md nuxt-og-imagealso belongs to the Nuxt generation boundary: the conservative Nuxt 3 baseline must pinnuxt-og-imageto5.1.9;5.1.10+may resolve Nuxt 4's@nuxt/kit/H3 v2. Pinning onlyh3: 1.15.11is insufficient to constrain this transitive module; you must usepackage.jsonat the rootpnpm.overrides, and usepnpm why nuxt-og-image @nuxt/kit h3to recheck the actual tree. → Seereferences/incident-repair.md- Vercel
READYdoes not equal runtime passing: after READY, you must request the deployed URL's pages and Content cache/search API, and read the Function runtime logs; without HTTP/log evidence you can only markcandidateorneeds_check, and cannot write "production passed". → Seereferences/production-graph-and-runtime-closure.md - Protect the dirty tree before and after modifications: first record
git status --short --untracked-files=alland the target diff; under time pressure it is forbidden to without authorizationgit add ., overwrite, reset, or mix the user's dirty changes into verification/commit. → Seereferences/production-graph-and-runtime-closure.md - Build tool overrides must be narrowed based on package and registry evidence:
tsdown@0.3.1>rolldownis only used to reproducerolldown@nightlyregistry resolution blockage; it is forbidden to use a root globalrolldownoverride to mask peer/API incompatibility; you must first checkpnpm why/list、manifest、lockfile and clean fresh install. → Seereferences/production-graph-and-runtime-closure.md - Dependency hoisting layer pollution (2026-09-05 ai-vue-doc evidence): in a monorepo, any package introducing a new transitive dependency (e.g., h3 v2) flips the pnpm hoisting layer, and all packages that "bare-import the dependency without declaring it" are affected at the same time;
pnpm whyshows a single version ≠ a single runtime instance. Fix withpackageExtensionsper-package injection; disable global override. → Seereferences/dependency-triage.md - optimizeDeps pre-bundling blind spot (2026-09-05 evidence):
.clientplugin imports and packages dynamically imported inside plugins are not in the scan entry, and CJS transitive dependencies have no interop → the whole site does not hydrate and the console often shows no errors. Fix withvite.optimizeDeps.includeexplicitly included (nested>syntax). → Seereferences/dependency-triage.md - HTTP 200 ≠ content normal (catch-all illusion):
pages/[...slug].vuereturns the 404 UI with 200; verification must assert<title>or the body content. → Seereferences/ssr-hydration.md - Module execution failure does not necessarily go through console (hydration diagnostic toolchain): determine hydration with
__vue_app__; capture real errors with dynamicimport(entry + '?v=diag'); locate the import chain with CDPNetwork.requestWillBeSent'sinitiator.url; when automatic startup fails on Chrome 152, use the manual CDP fallback path. → Seereferences/ssr-hydration.md - Client/server component registration asymmetry (hoisted resolution trap): Vue hoists component resolution to the beginning of render,
v-ifis also executed when false; a component registered client-only that is referenced by SSR will necessarily warn, and fixing it with a static import will pull non-SSR-safe packages into the SSR graph causing 500; the standard solution isdefineAsyncComponent. → Seereferences/ssr-hydration.md - Hardcoded self-reference remnants from renaming a forked package (2026-09-05 evidence): inside the fork's dist there may be hardcoded
optimizeDeps.includeentries with the old package name prefix, which vite will necessarily fail to resolve; usepnpm patchto fix the prefix (first confirm the dependency chain is physically complete). After introducing a fork, first grep its dist for self-reference strings. → Seereferences/dependency-triage.md - Isolation of non-SSR-safe packages and UI configuration traps: non-SSR-safe packages (top-level DOM APIs, CSS imports inside dist) must all go through the
.clientboundary; UI configuration (logo, etc.) changes must be accepted through a desktop-viewport browser; source-codev-ifbranch inference is unreliable. → Seereferences/ssr-hydration.md - Build-time platform binary warnings: verify before characterizing, and disable traceInclude:
sharp binaries cannot be founddoes not necessarily mean a missing dependency — under nitrotrace: falsethe traced directory is necessarily empty; first verify sharp loadability before characterizing.Do not configuretraceInclude: ["sharp"]on any platform (falsified on real Vercel linux production: nft emitDependency throws a hard error on a resolved pseudo-path, failing the build). → Seereferences/dependency-triage.md
Troubleshooting entry points (must be executed after a hit signal)
When a Content cache/search API 500、ERR_INVALID_URL、H3 sendError export is missing,
entities/decode or @vueuse/core missing package,registerMessageResolver, Nitro prerender failure,
page._id is empty, Windows builds with no output for a long time, or other signals appear,first read
references/incident-repair.md, then modify the configuration or content.
When dependency-resolution-type signals appear —Failed to resolve dependency, a whole batch of packages simultaneously reporting a missing export of the same dependency,
sharp binaries ... cannot be found, batch WARNs after a fork package upgrade,pnpm why contradicting actual behavior —
first read references/dependency-triage.md。
SSR/hydration-type signals appear—the page returns 200 but all interactivity is dead, the console is clean yet hydration does not occur,
Failed to resolve component: X, rendering a non-SSR-safe package during SSR causes a 500,
dark mode/sidebar stops working and components are registered in the .client plugin—first read
references/ssr-hydration.md。
When final Nitro OOM occurs, standalone MODULE_NOT_FOUND, the production graph is inflated by aliases or broad externalization,
Turbo cache and .output are inconsistent, the artifact cannot start, or the HTTP smoke test fails,first read
references/production-graph-and-runtime-closure.md。
Before modifying any nuxt.config.ts, manifest, or lockfile, first read the current working tree state; during deployment verification, you must distinguish four types of evidence: local, CI, Vercel, and browser.
During troubleshooting, you must first answer four things:
- Whether the actually installed
shadcn-docs-nuxt、@ztl-uwu/nuxt-content、nuxt、h3、nuxt-og-image、@nuxt/kitbelongs to the same compatibility generation; whether the version of.pnpm/node_modulesin the hoisted layer and the resolution target of the bare import are consistent withpnpm why; - Whether the current error belongs to a Content/H3 runtime mismatch, a dependency hoisting layer/prebuild blind spot (→ dependency-triage.md), an SSR/hydration boundary (→ ssr-hydration.md), a Windows OOM/NFT build long tail, or the production graph's Vite SSR transform, Nitro inline, or trace/manifest closure;
- Whether the current configuration mistakenly uses legacy
prerender:routes/routes.clear(), unconditionaltrace: false, or fullinline; - Whether the verification criteria include content assertions, hydration determination, browser desktop viewport screenshots, and an interaction loop (a 200 status code and a clean console are both insufficient as evidence).
Do not use a single homepage 200 or a successful local Windows build as a substitute for Content API, a fresh dependency tree, and Linux/Vercel verification.
Recommended reference repository priority
Learn from and extract configuration in the following order (from high to low):
nuxt-umami-docs(a stable configuration paradigm for real projects)shadcn-docs-nuxt-starter(minimal skeleton)shadcn-docs-nuxt(framework source, used only to check default behavior)shadcn-docs-ui-thing(component library extension ideas, absorb with caution)
For each repository, prioritize reading these 6 files:package.json → nuxt.config.ts → app.config.ts → tailwind.config.* → assets/css/* → content/index.md
Standard implementation process
Step 1: Establish a minimal skeleton
docs-site/
├─ package.json
├─ nuxt.config.ts
├─ app.config.ts
├─ tailwind.config.js
├─ assets/css/
│ ├─ tailwind.css
│ └─ main.css
├─ content/
│ └─ index.md
├─ shims/ ← 按需,仅当 debug 兼容问题出现时
│ └─ debug.ts
├─ components/content/ ← 按需,自定义 MDC 组件
└─ plugins/ ← 按需,注册 workspace 组件库
If you are refactoring an existing documentation site, first preserve the existing content/ hierarchy; do not mix it with "foundation rebuild" in a single change.
Step 2: Dependencies and scripts
See references/workspace.md § package.json baseline。
Core points:
- Dependencies:
nuxt、shadcn-docs-nuxt、vue、vue-router、tailwindcss、tailwindcss-animate - A Nuxt 3 documentation site must also pin
nuxt-og-image: 5.1.9; if the theme's transitive dependencies declare a wider range, addpackage.jsonat the rootpnpm.overrides.nuxt-og-image: 5.1.9 - If you need to consume a workspace component library, add
workspace:*dependencies - devDependencies:
@iconify-json/lucide(required for Nuxt Icon) - The script must include
predev/prebuild/postinstallall three placesnuxt prepare - After a fresh install, you must check the actual resolved tree and commit the lockfile; do not let a transitive range such as
^2.13.9determine the Content version
Step 3: Nuxt configuration
See references/nuxt-config.md。
First start with the minimal skeleton, and when client-side errors occur, patch compatibility item by item using the "patch on demand" strategy.
Step 4: Tailwind + CSS
See references/tailwind-css.md。
Hard checks:content scanning must cover node_modules/shadcn-docs-nuxt, otherwise theme classes are missing and dark styles behave abnormally.
Step 5: MDC content
See references/mdc-prettier.md。
Step 6: Verification
After execution, provide at least the following evidence:
| Verification item | Method |
|---|---|
| Startup | pnpm --filter <pkg> dev → homepage HTTP 200 |
| Dependencies | pnpm list / pnpm why h3 → actual versions of core packages are explainable |
| Nuxt generation | pnpm why nuxt-og-image @nuxt/kit h3 → nuxt-og-image@5.1.9 and no Nuxt 4/H3 v2 mixing occurs |
| Content | fresh dev request cache/search API → HTTP 200 and index is non-empty |
| Build | pnpm --filter <pkg> build → has .output artifacts |
| Production graph | check alias, externalization, inline, trace, and the actual deployment package manifest at the first failing gate |
| Artifacts | must start .output server → key pages and Content API HTTP smoke pass |
| Cache diagnostics | only when diagnosing cache credibility or when cache/artifact evidence conflicts, execute turbo run <task> --force; routine production acceptance does not execute this command |
| Interaction | dark mode toggle and sidebar collapse work |
| Content | spot-check at least 1 ::demo-playground page, no bare marker text |
| console | no error |
| Vercel runtime | after READY, record the deployment URL, Function logs, page and Content API responses; do not mark complete without actual testing |
| Browser | use a visible browser to walk the homepage/component demo user path, record console, hydration, and at least one interaction result; if no browser tool is available, explicitly mark as incomplete |
Production closure hard gates (must be executed)
Proceed in the following order; do not skip or treat a later stage's green light as a fix for an earlier stage:
- Protect the write set: save a dirty-tree snapshot, confirm the target files and the boundaries of user changes.
- Lock the resolution tree: after fresh install, run
pnpm why/list, verify the documentation package manifest, root trace entry, and lockfile. - Locate the first-error stage: attribute the error to Vite SSR transform, Nitro Rollup, NFT trace, Function manifest, or runtime startup.
- Minimal change: prefer fixing the manifest/entry; only add a narrow
noExternal、inlineor alias when the exact error proves the stage requires it; by default do not addnitro.externals。 - Local artifacts: start
.output/server/index.mjs, request pages and Content cache/search, record PID, response body, and logs. - Remote closed loop: Linux/Vercel build, Function artifact, deployment URL, HTTP smoke, runtime logs, and visible browser evidence must each be recorded separately.
- Status criteria: if any external gate is missing, write
candidate/needs_check; only after all runnable gates pass, writeverified, and retain the deployment ID/SHA.
compatibilityDate must maintain the same object contract as the nitro-api-development skill: list both Cloudflare and Vercel platforms, their respective official documentation links, and fix it as 2024-09-19. It only represents the compatibility baseline of the target Nitro provider, not a fix for entities/decode or other runtime closures; do not degrade it to a single string or blindly copy a date from another project.
Documentation site runtime verified It is a separate chain from npm/plugin publishing; this skill does not treat the success of changeset, registry, tarball, or GitHub Release as the documentation site passing at runtime. When a task also requires publishing, establish an independent evidence chain according to the project publishing skill.
Common troubleshooting order
When interactions fail (dark mode toggle fails, sidebar buttons do not work),strictly follow this order:
- Firstcheck whether the browser console has module import errors →
references/compat.md - Thenfix dependency entry compatibility according to the first error (alias / optimizeDeps / dedupe /
ssr.noExternal); Vite SSR transform, Nitro inline, and trace/manifest cannot substitute for each other. →references/production-graph-and-runtime-closure.md - Finallyperform Tailwind / theme style checks →
references/tailwind-css.md
When Content API returns 500, H3 export errors occur, or versions drift → references/incident-repair.md
final Nitro OOM、standalone MODULE_NOT_FOUND, artifact startup fails, or Turbo cache is untrustworthy → references/production-graph-and-runtime-closure.md
When the build hangs → references/windows.md
MDC raw text / hydration mismatch → references/mdc-prettier.md
Do-not-modify items (do not touch without clear evidence)
extends: ["shadcn-docs-nuxt"](it is usually not the root cause)- Content directory hierarchy (avoid coupling with content rearrangement during the foundation refactor phase)
- i18n multilingual approach (keep the minimal configuration for a single-language documentation site first)
- Major icon system overhaul (continue using the template's usable default solution first)
ogImage: { enabled: false }(enabling it directly will trigger a 500)- Production templates must not configure
nitro.externalsby default; the Windows trace workaround can only be used as a local, rollback-capable diagnostic switch according toreferences/windows.md. - Do not expand the registry resolution workaround for
tsdowninto a root globalrolldownoverride。
Anti-pattern list
- Writing a large amount of "custom configuration" first, and only verifying whether it can start at the end.
- Using style changes to mask runtime import errors.
- Batch formatting
content/**/*.mdwithout doing page and console regression. - Rearranging the content architecture and refactoring the foundation in the same round, making regressions impossible to localize.
- Reporting only that it "looks good" without attaching any reproducible verification evidence.
- Writing
::demo-playgroundas## ::demo-playground。 - On Windows, directly judging "logs stopped" as "process hung" without first cleaning up old processes.
- Treating the historical
prerender:routesclearing hook as the default configuration for allshadcn-docs-nuxtprojects; you should first determine whether document-driven Content is used. - Writing Vercel
READY, a single page200, or local build results as production runtime passing. - Overwriting configuration, executing
git add ., or bringing user changes into release/verification without checking the dirty tree. - Using a root global
rolldownoverride to makepnpm installtemporarily succeed, without verifying tsdown's peer/range/API compatibility.
Output requirements
When executing this skill, at minimum provide in the end:
- List of key changed files (configuration, styles, content)
- Run and build verification results
- If there are risk items, provide the next minimal remediation suggestion
- Clearly state whether the status is
verified、candidateorneeds_check, and list the unfinished provider/browser evidence gates