Create Docs
Generate a complete, production-ready documentation site for any project.
Workflow
- Analyze - Detect package manager, monorepo structure, read context
- Initialize - Create docs directory with correct setup
- Generate - Write documentation pages using templates
- Configure - Set up AI integration (MCP, llms.txt)
- Finalize - Provide next steps with correct commands
Package Manager Reference
Detect from lock files, default to npm if none found:
| Lock File |
PM |
Install |
Run |
Add |
pnpm-lock.yaml |
pnpm |
pnpm install |
pnpm run |
pnpm add |
package-lock.json |
npm |
npm install |
npm run |
npm install |
yarn.lock |
yarn |
yarn install |
yarn |
yarn add |
bun.lockb |
bun |
bun install |
bun run |
bun add |
Use [pm] as placeholder in commands below.
Step 1: Analyze Project
Detect Project Structure
Check for:
โโโ pnpm-workspace.yaml โ pnpm monorepo
โโโ turbo.json โ Turborepo monorepo
โโโ lerna.json โ Lerna monorepo
โโโ nx.json โ Nx monorepo
โโโ apps/ โ Apps directory (monorepo)
โโโ packages/ โ Packages directory (monorepo)
โโโ docs/ โ Existing docs (avoid overwriting)
โโโ README.md โ Main documentation source
โโโ src/ or lib/ โ Source code location
Determine Docs Location
| Project Type |
Target Directory |
Workspace Entry |
| Standard project |
./docs |
N/A |
Monorepo with apps/ |
./apps/docs |
apps/docs |
Monorepo with packages/ |
./docs |
docs |
Existing docs/ folder |
Ask user or ./documentation |
โ |
Read Context Files
| File |
Extract |
README.md |
Project name, description, features, usage examples |
package.json |
Name, description, dependencies, repository URL |
src/ or lib/ |
Exported functions, composables for API docs |
Detect i18n Requirement
Check if project needs multi-language docs:
| Indicator |
Action |
@nuxtjs/i18n in dependencies |
Use i18n template |
locales/ or i18n/ folder exists |
Use i18n template |
| Multiple language README files |
Use i18n template |
| User explicitly mentions multiple languages |
Use i18n template |
| None of the above |
Use default template |
Step 2: Initialize Docs
Create Directory Structure
Default template:
[docs-location]/
โโโ app/ # Optional: for customization
โ โโโ app.config.ts
โ โโโ components/
โ โโโ layouts/
โ โโโ pages/
โโโ content/
โ โโโ index.md
โ โโโ 1.getting-started/
โ โโโ .navigation.yml
โ โโโ 1.introduction.md
โโโ public/
โ โโโ favicon.ico
โโโ package.json
โโโ .gitignore
i18n template (if multi-language detected):
[docs-location]/
โโโ app/
โ โโโ app.config.ts
โโโ content/
โ โโโ en/
โ โ โโโ index.md
โ โ โโโ 1.getting-started/
โ โ โโโ .navigation.yml
โ โ โโโ 1.introduction.md
โ โโโ fr/ # Or other detected languages
โ โโโ index.md
โ โโโ 1.getting-started/
โ โโโ .navigation.yml
โ โโโ 1.introduction.md
โโโ nuxt.config.ts # Required for i18n config
โโโ public/
โ โโโ favicon.ico
โโโ package.json
โโโ .gitignore
Create package.json
Default:
{
"name": "[project-name]-docs",
"private": true,
"scripts": {
"dev": "nuxt dev --extends docus",
"build": "nuxt build --extends docus",
"generate": "nuxt generate --extends docus",
"preview": "nuxt preview --extends docus"
},
"dependencies": {
"docus": "latest",
"better-sqlite3": "^12.5.0",
"nuxt": "^4.2.2"
}
}
i18n (add @nuxtjs/i18n):
{
"name": "[project-name]-docs",
"private": true,
"scripts": {
"dev": "nuxt dev --extends docus",
"build": "nuxt build --extends docus",
"generate": "nuxt generate --extends docus",
"preview": "nuxt preview --extends docus"
},
"dependencies": {
"@nuxtjs/i18n": "^10.2.1",
"docus": "latest",
"better-sqlite3": "^12.5.0",
"nuxt": "^4.2.2"
}
}
Create nuxt.config.ts (i18n only)
export default defineNuxtConfig({
modules: ['@nuxtjs/i18n'],
i18n: {
locales: [
{ code: 'en', language: 'en-US', name: 'English' },
{ code: 'fr', language: 'fr-FR', name: 'Franรงais' }
],
defaultLocale: 'en'
}
})
Create .gitignore
node_modules
.nuxt
.output
.data
dist
Update Monorepo Configuration (if applicable)
pnpm Monorepo
- Add docs to workspace and configure
onlyBuiltDependencies (required for better-sqlite3):
packages:
- 'apps/*'
- 'docs'
onlyBuiltDependencies:
- better-sqlite3
- Add dev script to root package.json:
{
"scripts": {
"docs:dev": "pnpm run --filter [docs-package-name] dev"
}
}
Or with directory path:
{
"scripts": {
"docs:dev": "cd docs && pnpm dev"
}
}
npm/yarn Monorepo
{
"workspaces": ["apps/*", "docs"],
"scripts": {
"docs:dev": "npm run dev --workspace=docs"
}
}
Step 3: Generate Documentation
Use templates from references/templates.md.
CRITICAL: MDC Component Naming
All Nuxt UI components in MDC must use the u- prefix:
| Correct |
Wrong |
::u-page-hero |
::page-hero |
::u-page-section |
::page-section |
:::u-page-feature |
:::page-feature |
:::u-button |
:::button |
::::u-page-card |
::::page-card |
Without the u- prefix, Vue will fail to resolve the components.
Documentation Structure
content/
โโโ index.md # Landing page
โโโ 1.getting-started/
โ โโโ .navigation.yml
โ โโโ 1.introduction.md
โ โโโ 2.installation.md
โโโ 2.guide/
โ โโโ .navigation.yml
โ โโโ 1.configuration.md
โ โโโ 2.authentication.md
โ โโโ 3.deployment.md
โโโ 3.api/ # If applicable
โโโ .navigation.yml
โโโ 1.reference.md
Generate Pages
- Landing page (
index.md) - Hero + features grid
- Introduction - What & why, use cases
- Installation - Prerequisites, install commands
- Guide pages - Feature documentation with action-based H2 headings
For writing style, see references/writing-guide.md.
For MDC components, see references/mdc-components.md.
Step 4: Configure AI Integration
Docus automatically includes MCP server (/mcp) and llms.txt generation. No configuration needed.
Do NOT add AI Integration sections to the landing page. These features work automatically.
Optionally mention in the introduction page:
::note
This documentation includes AI integration with MCP server and automatic `llms.txt` generation.
::
Optional: app.config.ts
export default defineAppConfig({
docus: {
name: '[Project Name]',
description: '[Project description]',
url: 'https://[docs-url]',
socials: {
github: '[org]/[repo]'
}
}
})
Optional: Theme Customization
If the project has a design system or brand colors, customize the docs theme.
Custom CSS
Create app/assets/css/main.css:
@import "tailwindcss";
@import "@nuxt/ui";
@theme {
--font-sans: 'Inter', sans-serif;
--ui-container: 90rem;