Generate Documentation
Every code change MUST have corresponding documentation updates.
Documentation by Change Type
| What Changed | Documentation Required |
|---|---|
| API endpoint | docs/API_REFERENCE.md, docs/api/[collection].md |
| Component | docs/COMPONENTS.md, docs/components/[name].md |
| Hook | docs/HOOKS.md |
| Collection | docs/COLLECTIONS.md, docs/schemas/[name].schema.json |
| Feature | docs/features/[name].md |
| Workflow | docs/WORKFLOWS.md |
| Any change | docs/CHANGELOG.md (always!) |
Process
- Read the code that was changed or created
- Identify doc type from the table above
- Generate docs following the templates below
- Update CHANGELOG.md with a dated entry
API Route Documentation Template
## [Method] /api/[endpoint]
**Description:** Brief description
**Authentication:** Required / Public
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
**Response:**
| Status | Body | Description |
|--------|------|-------------|
**Example:**
Component Documentation Template
## ComponentName
**Import:** `import { ComponentName } from '@/components/ui/component-name'`
**Props:**
| Prop | Type | Default | Description |
|------|------|---------|-------------|
**Usage:**
[Working code example]
Standards
- JSDoc comments on all exported functions/types
- Usage examples for every public API
- Complete prop tables for components
- Working code examples that can be copy-pasted
References
- Documentation guidelines