ワンクリックで
bootstrap-docs
Expert-level documentation bootstrap using Diátaxis framework and audience-driven planning.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Expert-level documentation bootstrap using Diátaxis framework and audience-driven planning.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Analyze documentation for duplicates, outdated content, and discrepancies with codebase
Quick health check for documentation issues. Verifies content against actual source files.
Commit documentation changes to git after reviewing and confirming.
Create new documentation pages interactively. Searches codebase to ensure accuracy.
Delete documentation pages interactively with confirmation.
Import and configure API specification (OpenAPI, GraphQL, AsyncAPI) for documentation
| name | bootstrap-docs |
| description | Expert-level documentation bootstrap using Diátaxis framework and audience-driven planning. |
When bootstrapping documentation from a repository, follow the Documentation Planning Pyramid approach used by documentation experts:
┌─────────────────────────────────────────────────────────────────────┐
│ DOCUMENTATION PLANNING PYRAMID │
├─────────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ │
│ │ STRATEGY │ ← WHY (Step 1-2) │
│ │ Overview & │ │
│ │ Audience │ │
│ └──────┬──────┘ │
│ │ │
│ ┌───────────┴───────────┐ │
│ │ INFORMATION │ ← WHAT (Step 3-4) │
│ │ ARCHITECTURE │ │
│ └───────────┬───────────┘ │
│ │ │
│ ┌────────┴────────┐ │
│ │ APPROVAL │ ← CONFIRM (Step 5) │
│ │ User confirms │ │
│ │ IA structure │ │
│ └────────┬────────┘ │
│ │ │
│ ┌──────────────────┴──────────────────┐ │
│ │ CONTENT │ ← HOW (Step 6-8) │
│ │ Pages using Diátaxis Types │ │
│ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
Get a quick understanding of the project using git:
# List all tracked files
git ls-files
# Get folder structure (top-level)
git ls-files | cut -d'/' -f1 | sort -u
# Check for key files
git ls-files | grep -E "(README|package\.json|openapi|swagger|schema\.graphql)"
Generate a brief project summary (<100 words):
📁 PROJECT OVERVIEW
Name: [from package.json or README]
Type: [API/Library/CLI/Web App]
Language: [TypeScript/Python/Go/etc.]
Framework: [Next.js/Express/FastAPI/etc.]
Structure:
├── src/ → Source code
├── lib/ → Library code
├── api/ → API routes
├── docs/ → Documentation (if exists)
└── tests/ → Test files
Key Files:
• README.md → Project description
• package.json → Dependencies
• openapi.json → API spec (if exists)
Summary: [One sentence describing what this project does]
If NO codebase found:
If .devdoc/context.json exists: Read and use existing preferences.
Ask the user strategic questions before any scanning:
What is the primary goal of this documentation?
1. **Enable team productivity** - Help internal developers work faster
2. **Onboard new developers** - Get new team members up to speed
3. **Support API consumers** - Help external devs integrate your API
4. **Guide product users** - Help end users accomplish tasks
5. **Inform stakeholders** - Communicate architecture and decisions
Who are your documentation audiences?
═══════════════════════════════════════════════════════════
SINGLE vs MULTI-ROLE PRODUCTS
═══════════════════════════════════════════════════════════
Does your product have multiple user roles with different permissions?
A) **Single audience** - All users have same access
→ Example: Open-source library, public API
B) **Multiple roles** - Different users see different features
→ Example: SaaS with Admin/User roles, Enterprise with permissions
If Single Audience (A), choose one:
1. **Internal Developer** - Engineers on your team
→ Needs: Code flow, architecture, debugging, contribution guides
2. **External Developer** - API consumers, SDK users
→ Needs: Quick start, authentication, code examples, reference
3. **Product User** - End users of your product
→ Needs: Tutorials, feature guides, troubleshooting
4. **Content Author** - Technical writers, doc contributors
→ Needs: MDX syntax, structure guidelines, publishing workflow
5. **Product Manager/Stakeholder** - Non-technical team members
→ Needs: Feature overview, roadmap, IA map
If Multiple Roles (B), define your role matrix:
═══════════════════════════════════════════════════════════
ROLE MATRIX DEFINITION
═══════════════════════════════════════════════════════════
List your user roles and their permissions:
Example for a SaaS product:
┌─────────────────┬────────────────────────────────────────┐
│ Role │ Permissions / Features │
├─────────────────┼────────────────────────────────────────┤
│ Admin │ All features, user management, billing │
│ Editor │ Create/edit content, limited settings │
│ Viewer │ Read-only access │
│ API Developer │ API access, webhooks, integrations │
└─────────────────┴────────────────────────────────────────┘
Your roles:
1. Role name: _______
- Permissions: _______
- Key features: _______
2. Role name: _______
- Permissions: _______
- Key features: _______
(Add more as needed)
For Multi-Role Products, also ask:
How should role-specific content be organized?
1. **Separate sections** - Each role gets its own section/tab
docs/
├── admin/ # Admin-only guides
├── users/ # Regular user guides
└── developers/ # API/developer guides
2. **Inline badges** - Mixed content with role indicators
<RoleBadge roles={["admin", "editor"]}>
This feature is only available to Admins and Editors.
</RoleBadge>
3. **Permission gates** - Content varies by logged-in user
(Requires auth integration)
4. **Hybrid** - Combination of above
What type of documentation are you creating?
1. **API Docs** - REST/GraphQL API reference for developers
→ Voice: Professional, code-focused
2. **Product Docs** - Feature guides and tutorials for end users
→ Voice: Friendly, approachable
3. **Internal Docs** - Team setup, architecture, contribution guides
→ Voice: Technical, direct
What type of API do you have?
1. **OpenAPI/REST** - I have an OpenAPI/Swagger spec
2. **GraphQL** - I have a GraphQL schema
3. **Both** - REST and GraphQL APIs
4. **Manual** - I'll document the API manually (no spec file)
What language should code examples use?
(e.g., TypeScript, Python, curl, Go)
Only if user selected OpenAPI or GraphQL:
For OpenAPI:
Do you have an OpenAPI spec file? Please provide the path, or I can search for:
- openapi.json / openapi.yaml
- swagger.json / swagger.yaml
For GraphQL:
Do you have a GraphQL schema? Please provide the path, or I can search for:
- schema.graphql / schema.gql
After locating spec:
api-reference/ folderClassify each planned page by content type:
| Type | Purpose | When to Use | Example Pages |
|---|---|---|---|
| Tutorial | Learning-oriented | First-time experience, guided learning | "Build Your First..." |
| How-To Guide | Task-oriented | Accomplish specific goals | "Add Custom Domain", "Configure Theme" |
| Reference | Information-oriented | Look up facts, specifications | Component props, CLI flags, Config schema |
| Explanation | Understanding-oriented | Deeper comprehension | "How MDX Processing Works", Architecture |
Map documentation structure based on domain:
docs/
├── index.mdx # [Explanation] Overview, value prop
├── quickstart.mdx # [Tutorial] 5-min getting started
├── authentication.mdx # [How-To] Auth setup
├── guides/
│ ├── overview.mdx # [Explanation] Core concepts
│ └── {use-cases}.mdx # [How-To] Common use cases
├── api-reference/
│ ├── openapi.json # Imported spec
│ ├── introduction.mdx # [Explanation] API overview
│ └── errors.mdx # [Reference] Error codes
└── sdks/ # [Reference] SDK docs
docs/
├── index.mdx # [Explanation] Product overview
├── getting-started/
│ ├── quickstart.mdx # [Tutorial] First experience
│ └── key-concepts.mdx # [Explanation] Core concepts
├── features/
│ └── {feature}.mdx # [How-To] Feature guides
├── tutorials/
│ └── {tutorial}.mdx # [Tutorial] Step-by-step learning
└── troubleshooting/ # [How-To] Problem solving
docs/
├── index.mdx # [Explanation] Product overview (all roles)
├── getting-started/
│ ├── quickstart.mdx # [Tutorial] First experience (all roles)
│ └── key-concepts.mdx # [Explanation] Core concepts (all roles)
│
├── admin/ # 🔒 ADMIN-ONLY SECTION
│ ├── overview.mdx # [Explanation] Admin dashboard overview
│ ├── user-management.mdx # [How-To] Manage users & permissions
│ ├── billing.mdx # [How-To] Billing & subscriptions
│ ├── settings.mdx # [Reference] Admin settings
│ └── audit-logs.mdx # [Reference] Audit & compliance
│
├── users/ # 👤 REGULAR USER SECTION
│ ├── overview.mdx # [Explanation] User dashboard
│ ├── features/ # [How-To] Feature guides
│ └── account.mdx # [How-To] Account settings
│
├── developers/ # 💻 DEVELOPER SECTION
│ ├── overview.mdx # [Explanation] API overview
│ ├── authentication.mdx # [How-To] API auth
│ ├── webhooks.mdx # [How-To] Webhook setup
│ └── api-reference/ # [Reference] API docs
│
└── troubleshooting/ # [How-To] Problem solving (all roles)
When using inline role badges, add to each page's frontmatter:
---
title: User Management
description: Add and manage users in your organization
roles: ["admin", "owner"] # Roles that can access this feature
---
<RoleBadge roles={["admin", "owner"]}>
This feature requires Admin or Owner permissions.
</RoleBadge>
## Overview
User management allows you to...
Pattern 1: Conditional sections within a page
## Basic Settings
All users can configure these settings...
<RoleSection roles={["admin"]}>
## Advanced Settings (Admin Only)
Administrators can additionally configure...
</RoleSection>
Pattern 2: Feature availability matrix
## Feature Availability
| Feature | Viewer | Editor | Admin |
|---------|--------|--------|-------|
| View dashboards | ✅ | ✅ | ✅ |
| Edit content | ❌ | ✅ | ✅ |
| Manage users | ❌ | ❌ | ✅ |
| Billing access | ❌ | ❌ | ✅ |
Pattern 3: Navigation tabs by role
// docs.json with role-based tabs
{
"navigation": {
"tabs": [
{ "tab": "Getting Started", "groups": [...] },
{ "tab": "Admin Guide", "icon": "shield", "groups": [...] },
{ "tab": "User Guide", "icon": "user", "groups": [...] },
{ "tab": "Developer", "icon": "code", "groups": [...] }
]
}
}
docs/
├── index.mdx # [Explanation] Project overview
├── getting-started/
│ ├── setup.mdx # [How-To] Environment setup
│ └── prerequisites.mdx # [Reference] Requirements
├── architecture/
│ ├── overview.mdx # [Explanation] System design
│ ├── data-flow.mdx # [Explanation] How data flows
│ └── decisions/ # [Explanation] ADRs
├── development/
│ ├── workflow.mdx # [How-To] Dev workflow
│ └── debugging.mdx # [How-To] Debugging guide
└── contributing.mdx # [How-To] Contribution guide
IMPORTANT: Always get user approval before generating documentation.
Present the complete Information Architecture to the user, covering:
📋 PROPOSED DOCUMENTATION ARCHITECTURE
Based on your preferences:
- Goal: [selected goal]
- Audience: [primary audience OR "Multi-role"]
- Domain: [api/product/internal]
[If multi-role, show role matrix:]
═══════════════════════════════════════════════════════════════
USER ROLES
═══════════════════════════════════════════════════════════════
┌─────────────────┬────────────────────────────────────────┐
│ Role │ Documentation Sections │
├─────────────────┼────────────────────────────────────────┤
│ Admin │ admin/, shared sections │
│ Editor │ users/, shared sections │
│ Viewer │ users/ (read-only features) │
│ Developer │ developers/, api-reference/ │
└─────────────────┴────────────────────────────────────────┘
Role organization: [Separate sections | Inline badges | Hybrid]
═══════════════════════════════════════════════════════════════
NAVIGATION STRUCTURE
(How documentation appears in the sidebar)
═══════════════════════════════════════════════════════════════
📑 TAB: Guides
├── 📁 Getting Started
│ ├── Introduction # index.mdx [explanation]
│ ├── Quickstart # quickstart.mdx [tutorial]
│ └── Authentication # authentication.mdx [how-to]
│
├── 📁 Core Concepts
│ ├── Overview # guides/overview.mdx [explanation]
│ ├── Working with Resources # guides/resources.mdx [how-to]
│ └── Error Handling # guides/errors.mdx [how-to]
│
└── 📁 SDKs
└── TypeScript SDK # sdks/typescript.mdx [reference]
📑 TAB: API Reference (OpenAPI)
└── [Auto-generated from openapi.json]
├── Introduction # api-reference/introduction.mdx [explanation]
├── Authentication # (from spec)
├── Endpoints # (from spec)
└── Error Codes # api-reference/errors.mdx [reference]
═══════════════════════════════════════════════════════════════
FILE STRUCTURE
(Actual files to be created in docs/)
═══════════════════════════════════════════════════════════════
docs/
├── index.mdx # Introduction
├── quickstart.mdx # Quickstart guide
├── authentication.mdx # Auth setup
├── guides/
│ ├── overview.mdx # Core concepts
│ ├── resources.mdx # Working with resources
│ └── errors.mdx # Error handling
├── api-reference/
│ ├── openapi.json # Imported spec
│ ├── introduction.mdx # API overview
│ └── errors.mdx # Error codes reference
└── sdks/
└── typescript.mdx # TypeScript SDK
═══════════════════════════════════════════════════════════════
CONTENT SUMMARY
═══════════════════════════════════════════════════════════════
By Diátaxis Content Type:
📚 Tutorials: 1 page
└── quickstart.mdx
📝 How-To Guides: 4 pages
├── authentication.mdx
├── guides/resources.mdx
└── guides/errors.mdx
📖 Reference: 2 pages
├── api-reference/errors.mdx
└── sdks/typescript.mdx
💡 Explanations: 3 pages
├── index.mdx (overview)
├── guides/overview.mdx
└── api-reference/introduction.mdx
Total: 10 pages to generate
═══════════════════════════════════════════════════════════════
GAPS ANALYSIS
═══════════════════════════════════════════════════════════════
Potential missing documentation:
⚠️ No troubleshooting guide
⚠️ No changelog/release notes
⚠️ No migration guide
───────────────────────────────────────────────────────────────
Does this architecture look complete?
1. ✅ **Approve** - Generate documentation with this structure
2. ✏️ **Modify** - I want to add/remove/change pages or navigation
3. ➕ **Add suggested** - Add the suggested missing docs
4. ❌ **Restart** - Let's reconsider the goals and audience
If user chooses "Modify":
If user chooses "Add suggested":
If user chooses "Restart":
If user chooses "Approve":
What the IA approval covers:
| Aspect | What's Shown |
|---|---|
| Navigation | Tabs, groups, page ordering (sidebar view) |
| Files | Actual file paths and folder structure |
| Content Types | Diátaxis classification per page |
| Gaps | Suggested missing documentation |
| Scope | Total page count and effort estimate |
Why this step matters:
Save to .devdoc/context.json:
For Single Audience:
{
"$schema": "https://devdoc.sh/schemas/context.json",
"version": "1.0",
"lastUpdated": "2026-01-25T10:00:00Z",
"strategy": {
"goal": "Support API consumers",
"audience": {
"type": "single",
"primary": "External Developer",
"needs": ["Quick start", "Authentication", "Code examples", "Reference"]
}
},
"preferences": {
"docType": "api",
"apiType": "openapi",
"codeLanguage": "TypeScript"
},
"contentPlan": {
"approved": true,
"pages": [
{ "path": "index.mdx", "type": "explanation", "priority": "high" },
{ "path": "quickstart.mdx", "type": "tutorial", "priority": "high" }
]
}
}
For Multi-Role Products:
{
"$schema": "https://devdoc.sh/schemas/context.json",
"version": "1.0",
"lastUpdated": "2026-01-25T10:00:00Z",
"strategy": {
"goal": "Support all user types",
"audience": {
"type": "multi-role",
"organization": "separate-sections", // or "inline-badges" or "hybrid"
"roles": [
{
"name": "Admin",
"slug": "admin",
"permissions": ["all"],
"features": ["user-management", "billing", "settings", "audit-logs"],
"docSection": "admin/"
},
{
"name": "Editor",
"slug": "editor",
"permissions": ["create", "edit", "delete"],
"features": ["content-management", "workflows"],
"docSection": "users/"
},
{
"name": "Viewer",
"slug": "viewer",
"permissions": ["read"],
"features": ["view-content", "search"],
"docSection": "users/"
},
{
"name": "Developer",
"slug": "developer",
"permissions": ["api-access", "webhooks"],
"features": ["api", "integrations", "webhooks"],
"docSection": "developers/"
}
]
}
},
"preferences": {
"docType": "product",
"codeLanguage": "TypeScript"
},
"contentPlan": {
"approved": true,
"pages": [
// Shared pages (all roles)
{ "path": "index.mdx", "type": "explanation", "roles": ["all"] },
{ "path": "quickstart.mdx", "type": "tutorial", "roles": ["all"] },
// Admin-only pages
{ "path": "admin/overview.mdx", "type": "explanation", "roles": ["admin"] },
{ "path": "admin/user-management.mdx", "type": "how-to", "roles": ["admin"] },
{ "path": "admin/billing.mdx", "type": "how-to", "roles": ["admin"] },
// User pages (editor, viewer)
{ "path": "users/overview.mdx", "type": "explanation", "roles": ["editor", "viewer"] },
{ "path": "users/content.mdx", "type": "how-to", "roles": ["editor"] },
// Developer pages
{ "path": "developers/overview.mdx", "type": "explanation", "roles": ["developer"] },
{ "path": "developers/api-reference/", "type": "reference", "roles": ["developer"] }
]
}
}
Only proceed after user has approved the IA structure in Step 5.
CRITICAL: Search and read relevant files BEFORE generating each page.
┌─────────────────────────────────────────────────────────────────┐
│ PAGE GENERATION FLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. SEARCH for relevant files │
│ ↓ │
│ 2. READ the files found │
│ ↓ │
│ 3. ASSESS if enough information exists │
│ ↓ │
│ ┌─────────────┐ ┌─────────────────────────────────┐ │
│ │ Sufficient? │─YES─│ GENERATE content from real data │ │
│ └──────┬──────┘ └─────────────────────────────────┘ │
│ │NO │
│ ↓ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ FLAG and offer options: │ │
│ │ 1. Auto-correct IA (remove/modify page) │ │
│ │ 2. Rename page to match what exists │ │
│ │ 3. Mark as TODO and continue │ │
│ │ 4. Ask user for clarification │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Before generating each page, search for relevant source files:
# For authentication.mdx - search auth-related files
git ls-files | grep -iE "(auth|login|session|jwt|token|credential)"
# For quickstart.mdx - search for README, examples, getting started
git ls-files | grep -iE "(readme|example|getting.?started|quickstart)"
# For errors.mdx - search for error handling
git ls-files | grep -iE "(error|exception|fault|handler)"
# For API reference - search for route handlers, controllers
git ls-files | grep -iE "(route|controller|handler|endpoint|api)"
Also search file contents:
# Search for specific terms in code
rg -l "authentication" --type ts
rg -l "class.*Error" --type ts
rg -l "export.*function" src/
For each relevant file found:
Search for feature flags:
rg -l "featureFlag|feature_flag|isEnabled|FF_" --type ts
rg "if.*\(.*feature|process\.env\.FEATURE" --type ts
Search for duplicate features:
rg "export.*(login|authenticate|signIn)" --type ts -l
Flag for user guidance:
⚠️ FEATURE FLAGS DETECTED for [page]:
📍 src/lib/auth/index.ts:45
Feature: newAuthFlow
- OLD implementation: lines 50-80 (current)
- NEW implementation: lines 82-120 (behind flag)
Question: Which version to document?
1. Current (old) - stable
2. New (flagged) - upcoming
3. Both with notice
🔄 DUPLICATE FEATURES DETECTED:
Similar to [page]:
- src/lib/auth/v2/authenticate.ts → authenticate()
- src/lib/legacy/signIn.ts → signIn()
Question: How to handle?
1. Document primary only
2. Document all with links
3. Mark legacy as deprecated
Before writing, evaluate:
| Assessment | Criteria | Action |
|---|---|---|
| ✅ Sufficient | Found source files, clear implementation | Generate with real data |
| ⚠️ Partial | Some files found, gaps exist | Generate with TODOs for gaps |
| ❌ Insufficient | No relevant files, unclear | Flag and offer options |
If information is insufficient, present options:
⚠️ UNCLEAR SECTION DETECTED
Page: authentication.mdx
Issue: Could not find authentication implementation files.
Searched for:
- **/auth/** → Not found
- **/*auth*.ts → Not found
- src/middleware/auth* → Not found
Options:
1. 🔄 **Auto-correct IA** - Remove this page from the plan
2. ✏️ **Rename page** - Change to match what exists (e.g., "api-keys.mdx")
3. 📝 **Mark as TODO** - Create placeholder, document later
4. ❓ **Ask for path** - "Where is authentication implemented?"
Choose an option (1-4):
For EACH page, show draft content for approval before writing:
═══════════════════════════════════════════════════════════
CONTENT REVIEW: authentication.mdx
═══════════════════════════════════════════════════════════
📂 SOURCES USED:
✓ src/lib/auth/index.ts (main auth module)
✓ src/lib/auth/jwt.ts (JWT handling)
✓ examples/auth-example.ts (code example)
───────────────────────────────────────────────────────────
DRAFT CONTENT
───────────────────────────────────────────────────────────
---
title: Authentication
description: Secure your application with JWT authentication
sources: ["src/lib/auth/index.ts", "src/lib/auth/jwt.ts"]
---
## Overview
Authentication in this project uses JWT tokens...
## login(email, password)
Authenticate user and receive a JWT token.
| Parameter | Type | Description |
|-----------|------|-------------|
| email | string | User email |
| password | string | User password |
**Returns:** `Promise<AuthToken>`
### Example
```typescript
import { login } from '@package/auth';
const token = await login('user@example.com', 'password');
─────────────────────────────────────────────────────────── NOTICES ───────────────────────────────────────────────────────────
⚠️ FEATURE FLAG: newAuthFlow Documenting: OLD implementation (current default) Alternative: New OAuth flow behind flag
🔄 DUPLICATE: authenticate() exists in v2/ This doc covers: login() (primary)
─────────────────────────────────────────────────────────── OPTIONS ───────────────────────────────────────────────────────────
Choose an option:
**Only proceed to write after user approves.**
#### 7h. Generate With Real Data (After Approval)
**Only generate content from actual source files:**
📄 CREATING: authentication.mdx (APPROVED)
Writing file with:
✓ File created successfully
#### Writing Guidelines (Expert Standards)
1. **Use Second Person** - "You can configure..." not "Users can configure..."
2. **Active Voice** - "Run the command" not "The command should be run"
3. **Task-Oriented Headings** - "How to add a custom domain" not "Custom domains"
4. **Include Examples** - Use REAL examples from codebase, not fabricated
5. **Progressive Disclosure** - Basic → Advanced ordering
6. **Cite Sources** - Note which files information came from
7. **Use Mermaid Diagrams** - For architecture, flows, sequences, and relationships
#### Mermaid Diagram Guidelines (REQUIRED for visual content)
**ALWAYS use mermaid diagrams for:**
| Content Type | Diagram Type | When to Use |
|--------------|--------------|-------------|
| Architecture | `flowchart` | System components, module relationships |
| Data Flow | `flowchart LR` | How data moves through the system |
| Sequence | `sequenceDiagram` | API calls, request/response flows |
| State | `stateDiagram-v2` | State machines, lifecycle |
| Entity Relationships | `erDiagram` | Database schemas, data models |
| Class Structure | `classDiagram` | OOP relationships, interfaces |
| User Journey | `journey` | User flows, onboarding steps |
**Mermaid Examples:**
```mdx
## Architecture Overview
```mermaid
flowchart TB
subgraph Client
UI[Web App]
SDK[SDK]
end
subgraph API
Gateway[API Gateway]
Auth[Auth Service]
Core[Core Service]
end
subgraph Data
DB[(Database)]
Cache[(Redis)]
end
UI --> Gateway
SDK --> Gateway
Gateway --> Auth
Gateway --> Core
Core --> DB
Core --> Cache
sequenceDiagram
participant User
participant App
participant API
participant Auth
User->>App: Login request
App->>API: POST /auth/login
API->>Auth: Validate credentials
Auth-->>API: JWT token
API-->>App: Token response
App-->>User: Logged in
stateDiagram-v2
[*] --> Pending
Pending --> Processing: Start
Processing --> Completed: Success
Processing --> Failed: Error
Failed --> Pending: Retry
Completed --> [*]
erDiagram
User ||--o{ Document : creates
User {
string id PK
string email
string name
}
Document {
string id PK
string title
string content
string userId FK
}
**When to include diagrams:**
- Architecture overview pages → flowchart
- API documentation → sequenceDiagram
- Feature explanations → flowchart or stateDiagram
- Database/data model docs → erDiagram
- Integration guides → sequenceDiagram
- Onboarding flows → journey
#### Page Templates (Use After File Search)
**Tutorial Template:**
```mdx
---
title: Build [Something] with [Technology]
description: A complete tutorial to [achieve outcome] from scratch
contentType: tutorial
sources: ["README.md", "examples/basic.ts"] # Files used as reference
---
## What You'll Build
[Based on actual example from examples/ folder]
## Prerequisites
[From package.json dependencies and README]
## Steps
<Steps>
<Step title="Step 1">[Real code from source files]</Step>
</Steps>
## Next Steps
How-To Guide Template:
---
title: How to [Achieve Specific Goal]
description: Learn how to [specific outcome]
contentType: how-to
sources: ["src/lib/feature.ts"]
---
## Overview
[From source file docstrings/comments]
## Steps
<Steps>
<Step title="[Action]">[Actual implementation steps]</Step>
</Steps>
## Example
[Real code from tests or examples]
Reference Template:
---
title: [Component/API/Config] Reference
description: Complete reference for [topic]
contentType: reference
sources: ["src/types/config.ts", "src/lib/api.ts"]
---
## Properties/Parameters
[Extracted from actual TypeScript interfaces/types]
| Property | Type | Description | Default |
|----------|------|-------------|---------|
[From real type definitions]
## Examples
[From tests or examples folder]
Explanation Template:
---
title: Understanding [Concept]
description: Deep dive into [topic] and how it works
contentType: explanation
sources: ["docs/architecture.md", "src/lib/core/"]
---
## How It Works
[From actual implementation, not made up]
## Key Concepts
[Based on real code patterns found]
CRITICAL: Read schema files before creating configuration files.
Before creating or updating docs.json or theme.json, ALWAYS read the schema files:
📋 SCHEMA REFERENCES
Read these files before writing configuration:
1. .claude/skills/bootstrap-docs/../../schemas/docs.schema.json
→ Full schema for docs.json with all valid properties
→ Tab types: docs, openapi, graphql, changelog
→ Group structure and icon options
→ API and SEO configuration
2. .claude/skills/bootstrap-docs/../../schemas/theme.schema.json
→ Full schema for theme.json with all valid properties
→ Logo configuration options
→ Color presets (indigo, blue, green, amber, etc.)
→ Header and navbar options
Schema file locations:
packages/devdoc/ai-agents/schemas/docs.schema.jsonpackages/devdoc/ai-agents/schemas/theme.schema.jsonShow proposed configuration for user approval:
═══════════════════════════════════════════════════════════
CONFIG REVIEW: docs.json
═══════════════════════════════════════════════════════════
{
"$schema": "https://devdoc.sh/docs.json",
"name": "[Product Name]",
"docType": "[api|product|internal]",
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Guides",
"type": "docs",
"groups": [
{
"group": "Getting Started",
"icon": "rocket-launch",
"pages": ["index", "quickstart", "authentication"]
}
]
}
]
}
}
───────────────────────────────────────────────────────────
Validated against: schemas/docs.schema.json ✓
OPTIONS:
1. ✅ Approve - Create this file
2. ✏️ Edit - Make changes
3. ❌ Cancel
═══════════════════════════════════════════════════════════
CONFIG REVIEW: theme.json
═══════════════════════════════════════════════════════════
{
"$schema": "https://devdoc.sh/theme.json",
"logo": {
"light": "/assets/logo/light.svg",
"dark": "/assets/logo/dark.svg",
"alt": "[Product Name]",
"width": 120
},
"colors": {
"primary": "#6366f1",
"primaryLight": "#818cf8",
"primaryDark": "#4f46e5"
},
"header": {
"showAskAI": true,
"showSearch": true,
"showThemeToggle": true
}
}
───────────────────────────────────────────────────────────
Validated against: schemas/theme.schema.json ✓
Color preset used: indigo
OPTIONS:
1. ✅ Approve - Create this file
2. ✏️ Edit - Make changes
3. 🎨 Change colors - Pick different preset
4. ❌ Cancel
docs.json Tab Types:
| Type | Description |
|---|---|
docs | MDX documentation pages |
openapi | Auto-generated API reference |
graphql | GraphQL schema documentation |
changelog | Changelog entries |
Common Phosphor Icons:
rocket-launch, book-open, code, gear, terminal, puzzle-piece, star, shield, user, robot, github-logo, discord-logo
theme.json Color Presets:
| Preset | Primary |
|---|---|
| indigo | #6366f1 |
| blue | #3b82f6 |
| green | #10b981 |
| amber | #f59e0b |
| purple | #8b5cf6 |
| pink | #ec4899 |
✅ Documentation Generated!
Strategy:
- Goal: [selected goal]
- Audience: [primary audience]
- Domain: [api/product/internal]
Content Plan (Diátaxis):
- Tutorials: X pages
- How-To Guides: X pages
- Reference: X pages
- Explanations: X pages
Files created:
- docs.json (navigation)
- .devdoc/context.json (strategy & preferences)
- [list of mdx files with content types]
Next steps:
1. Run `devdoc dev` to preview
2. Review TODO markers in generated docs
3. Run `/whisk-theme` to match your branding
| Principle | Description |
|---|---|
| Project overview first | Quick scan using git to understand structure |
| Strategy first | Define goals and audience before structure |
| Audience-driven | Match content to user needs |
| Diátaxis types | Classify every page by content type |
| IA approval required | Always get user approval before generating content |
| Search before generate | ALWAYS search/read relevant files before writing each page |
| No hallucination | Only use real data from source files, never fabricate |
| Review before write | ALWAYS show draft content for user approval |
| Flag feature flags | Detect conditional features, ask which version to document |
| Flag duplicates | Identify similar features, let user choose |
| Flag unclear sections | If info not found, offer auto-correct IA options |
| Expert writing | Second person, active voice, task-oriented |
| Mark unknowns | Add TODO for sections needing review |
Before completing, verify: