name: add-documentation description: Add or update documentation in content/docs/ for features, APIs, or tools
.claude/skills/add-documentation/scripts/create-doc.sh <filename> "<title>" "<description>"
# Example
.claude/skills/add-documentation/scripts/create-doc.sh dialog-system "Dialog System" "Global dialog system for modals"
This creates content/docs/<filename>.mdx with proper structure.
Template structure (auto-generated by script):
---
title: "Feature Name"
description: "Brief description of what this feature does"
keywords: ["keyword1", "keyword2", "feature"]
tags: ["developer", "components"]
order: 10
subcategory: "Components"
---
Brief introduction explaining what this feature does and why it's useful.
## Installation
How to set up or enable this feature (if needed).
## Import
\`\`\`tsx
import { Component } from "@/features/feature-name";
\`\`\`
## Usage
### Basic Example
\`\`\`tsx
<Component prop="value" />
\`\`\`
### Advanced Example
\`\`\`tsx
<Component
prop="value"
onAction={async () => {
await doSomething();
}}
/>
\`\`\`
## API Reference
| Option | Type | Description |
|--------|------|-------------|
| `prop` | `string` | Description of the prop |
## Best Practices
- Tip 1
- Tip 2
Run to verify: pnpm dev and check /docs/[slug]
Ask yourself these questions:
- Who is the audience? (developers, end-users, admins)
- What problem does this solve? (document the "why", not just the "how")
- What's the minimal example? (start simple, then add complexity)
- What are common mistakes? (add warnings/tips)
```tsx dialogManager.confirm({ title: "Delete Item", description: "This cannot be undone.", action: { label: "Delete", onClick: async () => { await deleteItem(); }, }, }); ```
</right>
<wrong>
Overly complex first example:
```mdx
## Basic Usage
\`\`\`tsx
<Component
prop1="value"
prop2={42}
prop3={{ nested: true }}
onAction={handleAction}
variant="complex"
/>
\`\`\`
With Options
```tsx
</right>
</anti_patterns>
<existing_docs>
Current documentation files in `content/docs/`:
- `getting-started.mdx` - Project setup guide
- `auth-components.mdx` - Authentication components
- `contact-components.mdx` - Contact form components
- `dialog-manager.mdx` - Dialog system documentation
- `layout-components.mdx` - Layout components
- `markdown-components.mdx` - Markdown rendering
- `safe-actions.mdx` - Server actions patterns
- `zod-route.mdx` - API route validation
- `embedding.mdx` - Testimonial embedding
- `file-adapters.mdx` - File storage adapters
- `api-testimonials-*.mdx` - API documentation
</existing_docs>
<reference_guides>
For detailed documentation patterns and complete examples:
- **`references/documentation-format.md`** - Complete frontmatter reference and structure guidelines
- **`templates/doc-template.mdx`** - Base template used by the script
</reference_guides>
<critical_rules>
**NEVER create documentation files manually. ALWAYS use the script:**
```bash
.claude/skills/add-documentation/scripts/create-doc.sh <filename> "<title>" "<description>"
Then edit the generated file to add content.