@brainfish-ai/devdoc 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/ai-agents/.claude/skills/bootstrap-docs/SKILL.md +475 -334
- package/ai-agents/.claude/skills/commit-doc/SKILL.md +1 -1
- package/ai-agents/.claude/skills/create-doc/SKILL.md +1 -1
- package/ai-agents/.claude/skills/update-doc/SKILL.md +1 -1
- package/ai-agents/.cursor/rules/devdoc-bootstrap.mdc +222 -198
- package/ai-agents/.cursor/rules/devdoc-commit.mdc +1 -1
- package/ai-agents/.devdoc/templates/explanation.md +292 -0
- package/ai-agents/.devdoc/templates/guide.md +35 -108
- package/ai-agents/.devdoc/templates/how-to.md +166 -0
- package/ai-agents/.devdoc/templates/quickstart.md +104 -125
- package/ai-agents/.devdoc/templates/reference.md +264 -0
- package/ai-agents/.devdoc/templates/tutorial.md +40 -72
- package/ai-agents/schemas/context.schema.json +109 -10
- package/dist/cli/commands/create.js +13 -15
- package/dist/cli/commands/whoami.js +16 -4
- package/package.json +1 -1
- package/ai-agents/schemas/code-graph.schema.json +0 -413
|
@@ -1,74 +1,140 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bootstrap-docs
|
|
3
|
-
description:
|
|
3
|
+
description: Expert-level documentation bootstrap using Diátaxis framework and audience-driven planning.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Instructions
|
|
7
7
|
|
|
8
|
-
When bootstrapping documentation from a repository:
|
|
8
|
+
When bootstrapping documentation from a repository, follow the **Documentation Planning Pyramid** approach used by documentation experts:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
12
|
+
│ DOCUMENTATION PLANNING PYRAMID │
|
|
13
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
14
|
+
│ ┌─────────────┐ │
|
|
15
|
+
│ │ STRATEGY │ ← WHY (Step 1-2) │
|
|
16
|
+
│ │ Overview & │ │
|
|
17
|
+
│ │ Audience │ │
|
|
18
|
+
│ └──────┬──────┘ │
|
|
19
|
+
│ │ │
|
|
20
|
+
│ ┌───────────┴───────────┐ │
|
|
21
|
+
│ │ INFORMATION │ ← WHAT (Step 3-4) │
|
|
22
|
+
│ │ ARCHITECTURE │ │
|
|
23
|
+
│ └───────────┬───────────┘ │
|
|
24
|
+
│ │ │
|
|
25
|
+
│ ┌────────┴────────┐ │
|
|
26
|
+
│ │ APPROVAL │ ← CONFIRM (Step 5) │
|
|
27
|
+
│ │ User confirms │ │
|
|
28
|
+
│ │ IA structure │ │
|
|
29
|
+
│ └────────┬────────┘ │
|
|
30
|
+
│ │ │
|
|
31
|
+
│ ┌──────────────────┴──────────────────┐ │
|
|
32
|
+
│ │ CONTENT │ ← HOW (Step 6-8) │
|
|
33
|
+
│ │ Pages using Diátaxis Types │ │
|
|
34
|
+
│ └─────────────────────────────────────┘ │
|
|
35
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Phase 1: Strategy (WHY)
|
|
41
|
+
|
|
42
|
+
### Step 1: Project Overview (Quick Scan)
|
|
43
|
+
|
|
44
|
+
**Get a quick understanding of the project using git:**
|
|
9
45
|
|
|
10
|
-
|
|
46
|
+
```bash
|
|
47
|
+
# List all tracked files
|
|
48
|
+
git ls-files
|
|
49
|
+
|
|
50
|
+
# Get folder structure (top-level)
|
|
51
|
+
git ls-files | cut -d'/' -f1 | sort -u
|
|
11
52
|
|
|
12
|
-
|
|
53
|
+
# Check for key files
|
|
54
|
+
git ls-files | grep -E "(README|package\.json|openapi|swagger|schema\.graphql)"
|
|
13
55
|
```
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
56
|
+
|
|
57
|
+
**Generate a brief project summary (<100 words):**
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
📁 PROJECT OVERVIEW
|
|
61
|
+
|
|
62
|
+
Name: [from package.json or README]
|
|
63
|
+
Type: [API/Library/CLI/Web App]
|
|
64
|
+
Language: [TypeScript/Python/Go/etc.]
|
|
65
|
+
Framework: [Next.js/Express/FastAPI/etc.]
|
|
66
|
+
|
|
67
|
+
Structure:
|
|
68
|
+
├── src/ → Source code
|
|
69
|
+
├── lib/ → Library code
|
|
70
|
+
├── api/ → API routes
|
|
71
|
+
├── docs/ → Documentation (if exists)
|
|
72
|
+
└── tests/ → Test files
|
|
73
|
+
|
|
74
|
+
Key Files:
|
|
75
|
+
• README.md → Project description
|
|
76
|
+
• package.json → Dependencies
|
|
77
|
+
• openapi.json → API spec (if exists)
|
|
78
|
+
|
|
79
|
+
Summary: [One sentence describing what this project does]
|
|
18
80
|
```
|
|
19
81
|
|
|
20
82
|
**If NO codebase found:**
|
|
21
83
|
- Tell user: "No codebase detected. Creating docs-only project."
|
|
22
|
-
- Skip
|
|
23
|
-
- Proceed to Step 2 for preferences, then Step 6 for structure
|
|
84
|
+
- Skip to Step 2
|
|
24
85
|
|
|
25
|
-
**If
|
|
26
|
-
```bash
|
|
27
|
-
git rev-parse HEAD # Current commit hash
|
|
28
|
-
git rev-parse --abbrev-ref HEAD # Current branch
|
|
29
|
-
```
|
|
86
|
+
**If `.devdoc/context.json` exists:** Read and use existing preferences.
|
|
30
87
|
|
|
31
|
-
|
|
32
|
-
1. Read `git.commitHash` from the file
|
|
33
|
-
2. Compare to current HEAD:
|
|
34
|
-
- **Same commit** → "Code graph up to date (commit: {short_hash})"
|
|
35
|
-
- Skip to Step 6 (Plan Documentation)
|
|
36
|
-
- **Different commit** → Changes detected
|
|
37
|
-
- Run: `git diff {old_hash}..HEAD --name-only`
|
|
38
|
-
- Tell user: "{N} files changed since last scan"
|
|
39
|
-
- Ask: "1. Full rescan 2. Incremental (changed files only) 3. Skip"
|
|
88
|
+
### Step 2: Define Documentation Goals & Audience
|
|
40
89
|
|
|
41
|
-
**
|
|
42
|
-
- Read the context file
|
|
43
|
-
- Tell user: "Found existing product context."
|
|
44
|
-
- If code-graph needs refresh → Go to Step 4
|
|
45
|
-
- If code-graph is current → Skip to Step 6
|
|
90
|
+
**Ask the user strategic questions before any scanning:**
|
|
46
91
|
|
|
47
|
-
|
|
48
|
-
|
|
92
|
+
#### Question 1: Documentation Purpose (WHY)
|
|
93
|
+
```
|
|
94
|
+
What is the primary goal of this documentation?
|
|
49
95
|
|
|
50
|
-
|
|
96
|
+
1. **Enable team productivity** - Help internal developers work faster
|
|
97
|
+
2. **Onboard new developers** - Get new team members up to speed
|
|
98
|
+
3. **Support API consumers** - Help external devs integrate your API
|
|
99
|
+
4. **Guide product users** - Help end users accomplish tasks
|
|
100
|
+
5. **Inform stakeholders** - Communicate architecture and decisions
|
|
101
|
+
```
|
|
51
102
|
|
|
52
|
-
|
|
103
|
+
#### Question 2: Primary Audience (WHO)
|
|
104
|
+
```
|
|
105
|
+
Who is your PRIMARY audience? (Choose one)
|
|
53
106
|
|
|
54
|
-
|
|
107
|
+
1. **Internal Developer** - Engineers on your team
|
|
108
|
+
→ Needs: Code flow, architecture, debugging, contribution guides
|
|
109
|
+
|
|
110
|
+
2. **External Developer** - API consumers, SDK users
|
|
111
|
+
→ Needs: Quick start, authentication, code examples, reference
|
|
112
|
+
|
|
113
|
+
3. **Product User** - End users of your product
|
|
114
|
+
→ Needs: Tutorials, feature guides, troubleshooting
|
|
115
|
+
|
|
116
|
+
4. **Content Author** - Technical writers, doc contributors
|
|
117
|
+
→ Needs: MDX syntax, structure guidelines, publishing workflow
|
|
118
|
+
|
|
119
|
+
5. **Product Manager/Stakeholder** - Non-technical team members
|
|
120
|
+
→ Needs: Feature overview, roadmap, IA map
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Question 3: Documentation Domain
|
|
55
124
|
```
|
|
56
125
|
What type of documentation are you creating?
|
|
57
126
|
|
|
58
127
|
1. **API Docs** - REST/GraphQL API reference for developers
|
|
128
|
+
→ Voice: Professional, code-focused
|
|
129
|
+
|
|
59
130
|
2. **Product Docs** - Feature guides and tutorials for end users
|
|
131
|
+
→ Voice: Friendly, approachable
|
|
132
|
+
|
|
60
133
|
3. **Internal Docs** - Team setup, architecture, contribution guides
|
|
134
|
+
→ Voice: Technical, direct
|
|
61
135
|
```
|
|
62
136
|
|
|
63
|
-
#### Question
|
|
64
|
-
```
|
|
65
|
-
I detected a codebase. Would you like me to:
|
|
66
|
-
|
|
67
|
-
1. **Scan codebase** - Build code-graph for accurate docs (recommended)
|
|
68
|
-
2. **Skip scanning** - I'll write docs without code analysis
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
#### Question 3: API Type (if API Docs selected)
|
|
137
|
+
#### Question 4: API Type (if API Docs selected)
|
|
72
138
|
```
|
|
73
139
|
What type of API do you have?
|
|
74
140
|
|
|
@@ -78,18 +144,16 @@ What type of API do you have?
|
|
|
78
144
|
4. **Manual** - I'll document the API manually (no spec file)
|
|
79
145
|
```
|
|
80
146
|
|
|
81
|
-
#### Question
|
|
82
|
-
```
|
|
83
|
-
Who is your primary audience?
|
|
84
|
-
(e.g., "Backend developers integrating our payment API", "Internal engineering team")
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### Question 4: Code Examples Language
|
|
147
|
+
#### Question 5: Code Examples Language
|
|
88
148
|
```
|
|
89
149
|
What language should code examples use?
|
|
90
150
|
(e.g., TypeScript, Python, curl, Go)
|
|
91
151
|
```
|
|
92
152
|
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Phase 2: Information Architecture (WHAT)
|
|
156
|
+
|
|
93
157
|
### Step 3: Locate & Import API Specs (if applicable)
|
|
94
158
|
|
|
95
159
|
**Only if user selected OpenAPI or GraphQL:**
|
|
@@ -112,310 +176,384 @@ Do you have a GraphQL schema? Please provide the path, or I can search for:
|
|
|
112
176
|
2. Validate the spec
|
|
113
177
|
3. Extract metadata (endpoints, types, auth)
|
|
114
178
|
|
|
115
|
-
### Step 4:
|
|
179
|
+
### Step 4: Plan Content Using Diátaxis Framework
|
|
116
180
|
|
|
117
|
-
**
|
|
118
|
-
- No codebase detected
|
|
119
|
-
- User chose "Skip scanning" in Question 2
|
|
120
|
-
- User is creating docs-only project
|
|
181
|
+
**Classify each planned page by content type:**
|
|
121
182
|
|
|
122
|
-
|
|
183
|
+
| Type | Purpose | When to Use | Example Pages |
|
|
184
|
+
|------|---------|-------------|---------------|
|
|
185
|
+
| **Tutorial** | Learning-oriented | First-time experience, guided learning | "Build Your First..." |
|
|
186
|
+
| **How-To Guide** | Task-oriented | Accomplish specific goals | "Add Custom Domain", "Configure Theme" |
|
|
187
|
+
| **Reference** | Information-oriented | Look up facts, specifications | Component props, CLI flags, Config schema |
|
|
188
|
+
| **Explanation** | Understanding-oriented | Deeper comprehension | "How MDX Processing Works", Architecture |
|
|
123
189
|
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
Scan and extract:
|
|
127
|
-
├── README.md → Product name, description, features
|
|
128
|
-
├── package.json → Language, framework, dependencies
|
|
129
|
-
├── LICENSE → License type
|
|
130
|
-
└── .env.example → Required environment variables
|
|
131
|
-
```
|
|
190
|
+
**Map documentation structure based on domain:**
|
|
132
191
|
|
|
133
|
-
####
|
|
192
|
+
#### For API Docs:
|
|
134
193
|
```
|
|
135
|
-
|
|
136
|
-
├──
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
│ ├──
|
|
141
|
-
│ └──
|
|
142
|
-
├──
|
|
143
|
-
|
|
194
|
+
docs/
|
|
195
|
+
├── index.mdx # [Explanation] Overview, value prop
|
|
196
|
+
├── quickstart.mdx # [Tutorial] 5-min getting started
|
|
197
|
+
├── authentication.mdx # [How-To] Auth setup
|
|
198
|
+
├── guides/
|
|
199
|
+
│ ├── overview.mdx # [Explanation] Core concepts
|
|
200
|
+
│ └── {use-cases}.mdx # [How-To] Common use cases
|
|
201
|
+
├── api-reference/
|
|
202
|
+
│ ├── openapi.json # Imported spec
|
|
203
|
+
│ ├── introduction.mdx # [Explanation] API overview
|
|
204
|
+
│ └── errors.mdx # [Reference] Error codes
|
|
205
|
+
└── sdks/ # [Reference] SDK docs
|
|
144
206
|
```
|
|
145
207
|
|
|
146
|
-
####
|
|
208
|
+
#### For Product Docs:
|
|
147
209
|
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
-
|
|
210
|
+
docs/
|
|
211
|
+
├── index.mdx # [Explanation] Product overview
|
|
212
|
+
├── getting-started/
|
|
213
|
+
│ ├── quickstart.mdx # [Tutorial] First experience
|
|
214
|
+
│ └── key-concepts.mdx # [Explanation] Core concepts
|
|
215
|
+
├── features/
|
|
216
|
+
│ └── {feature}.mdx # [How-To] Feature guides
|
|
217
|
+
├── tutorials/
|
|
218
|
+
│ └── {tutorial}.mdx # [Tutorial] Step-by-step learning
|
|
219
|
+
└── troubleshooting/ # [How-To] Problem solving
|
|
155
220
|
```
|
|
156
221
|
|
|
157
|
-
####
|
|
222
|
+
#### For Internal Docs:
|
|
223
|
+
```
|
|
224
|
+
docs/
|
|
225
|
+
├── index.mdx # [Explanation] Project overview
|
|
226
|
+
├── getting-started/
|
|
227
|
+
│ ├── setup.mdx # [How-To] Environment setup
|
|
228
|
+
│ └── prerequisites.mdx # [Reference] Requirements
|
|
229
|
+
├── architecture/
|
|
230
|
+
│ ├── overview.mdx # [Explanation] System design
|
|
231
|
+
│ ├── data-flow.mdx # [Explanation] How data flows
|
|
232
|
+
│ └── decisions/ # [Explanation] ADRs
|
|
233
|
+
├── development/
|
|
234
|
+
│ ├── workflow.mdx # [How-To] Dev workflow
|
|
235
|
+
│ └── debugging.mdx # [How-To] Debugging guide
|
|
236
|
+
└── contributing.mdx # [How-To] Contribution guide
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Step 5: Present IA for Approval (REQUIRED)
|
|
240
|
+
|
|
241
|
+
**IMPORTANT: Always get user approval before generating documentation.**
|
|
242
|
+
|
|
243
|
+
Present the **complete Information Architecture** to the user, covering:
|
|
244
|
+
1. **Navigation Structure** - Tabs, groups, and page ordering (what users see in sidebar)
|
|
245
|
+
2. **File Structure** - Actual files to be created
|
|
246
|
+
3. **Content Summary** - Diátaxis content type breakdown
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
📋 PROPOSED DOCUMENTATION ARCHITECTURE
|
|
250
|
+
|
|
251
|
+
Based on your preferences:
|
|
252
|
+
- Goal: [selected goal]
|
|
253
|
+
- Audience: [primary audience]
|
|
254
|
+
- Domain: [api/product/internal]
|
|
255
|
+
|
|
256
|
+
═══════════════════════════════════════════════════════════════
|
|
257
|
+
NAVIGATION STRUCTURE
|
|
258
|
+
(How documentation appears in the sidebar)
|
|
259
|
+
═══════════════════════════════════════════════════════════════
|
|
260
|
+
|
|
261
|
+
📑 TAB: Guides
|
|
262
|
+
├── 📁 Getting Started
|
|
263
|
+
│ ├── Introduction # index.mdx [explanation]
|
|
264
|
+
│ ├── Quickstart # quickstart.mdx [tutorial]
|
|
265
|
+
│ └── Authentication # authentication.mdx [how-to]
|
|
266
|
+
│
|
|
267
|
+
├── 📁 Core Concepts
|
|
268
|
+
│ ├── Overview # guides/overview.mdx [explanation]
|
|
269
|
+
│ ├── Working with Resources # guides/resources.mdx [how-to]
|
|
270
|
+
│ └── Error Handling # guides/errors.mdx [how-to]
|
|
271
|
+
│
|
|
272
|
+
└── 📁 SDKs
|
|
273
|
+
└── TypeScript SDK # sdks/typescript.mdx [reference]
|
|
274
|
+
|
|
275
|
+
📑 TAB: API Reference (OpenAPI)
|
|
276
|
+
└── [Auto-generated from openapi.json]
|
|
277
|
+
├── Introduction # api-reference/introduction.mdx [explanation]
|
|
278
|
+
├── Authentication # (from spec)
|
|
279
|
+
├── Endpoints # (from spec)
|
|
280
|
+
└── Error Codes # api-reference/errors.mdx [reference]
|
|
281
|
+
|
|
282
|
+
═══════════════════════════════════════════════════════════════
|
|
283
|
+
FILE STRUCTURE
|
|
284
|
+
(Actual files to be created in docs/)
|
|
285
|
+
═══════════════════════════════════════════════════════════════
|
|
158
286
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
"structure": {
|
|
184
|
-
"sourceDir": "src/",
|
|
185
|
-
"testsDir": "tests/",
|
|
186
|
-
"examplesDir": "examples/",
|
|
187
|
-
"docsDir": "docs/"
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
"modules": [
|
|
191
|
-
{
|
|
192
|
-
"name": "auth",
|
|
193
|
-
"path": "src/auth/",
|
|
194
|
-
"description": "Authentication and authorization",
|
|
195
|
-
"files": ["index.ts", "jwt.ts", "middleware.ts"],
|
|
196
|
-
"exports": [
|
|
197
|
-
{
|
|
198
|
-
"name": "login",
|
|
199
|
-
"type": "function",
|
|
200
|
-
"signature": "login(email: string, password: string): Promise<AuthToken>",
|
|
201
|
-
"description": "Authenticate user and return JWT",
|
|
202
|
-
"params": [
|
|
203
|
-
{ "name": "email", "type": "string", "description": "User email" },
|
|
204
|
-
{ "name": "password", "type": "string", "description": "User password" }
|
|
205
|
-
],
|
|
206
|
-
"returns": { "type": "Promise<AuthToken>", "description": "JWT token" },
|
|
207
|
-
"async": true
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"name": "verifyToken",
|
|
211
|
-
"type": "function",
|
|
212
|
-
"signature": "verifyToken(token: string): Promise<User>",
|
|
213
|
-
"async": true
|
|
214
|
-
}
|
|
215
|
-
],
|
|
216
|
-
"dependencies": ["users", "config"],
|
|
217
|
-
"docPriority": "high"
|
|
218
|
-
}
|
|
219
|
-
],
|
|
220
|
-
|
|
221
|
-
"types": [
|
|
222
|
-
{
|
|
223
|
-
"name": "User",
|
|
224
|
-
"path": "src/types/user.ts",
|
|
225
|
-
"kind": "interface",
|
|
226
|
-
"definition": "interface User { id: string; email: string; name: string; }",
|
|
227
|
-
"properties": [
|
|
228
|
-
{ "name": "id", "type": "string" },
|
|
229
|
-
{ "name": "email", "type": "string" },
|
|
230
|
-
{ "name": "name", "type": "string" }
|
|
231
|
-
]
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
"name": "AuthToken",
|
|
235
|
-
"path": "src/types/auth.ts",
|
|
236
|
-
"kind": "interface",
|
|
237
|
-
"definition": "interface AuthToken { token: string; expiresAt: Date; }"
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
|
|
241
|
-
"api": {
|
|
242
|
-
"type": "REST",
|
|
243
|
-
"baseUrl": "/api/v1",
|
|
244
|
-
"specPath": "api-reference/openapi.json",
|
|
245
|
-
"authentication": {
|
|
246
|
-
"type": "bearer",
|
|
247
|
-
"headerName": "Authorization",
|
|
248
|
-
"description": "JWT token required"
|
|
249
|
-
},
|
|
250
|
-
"endpoints": [
|
|
251
|
-
{
|
|
252
|
-
"method": "POST",
|
|
253
|
-
"path": "/auth/login",
|
|
254
|
-
"handler": "src/routes/auth.ts:login",
|
|
255
|
-
"description": "User login",
|
|
256
|
-
"auth": "none"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"method": "GET",
|
|
260
|
-
"path": "/users/:id",
|
|
261
|
-
"handler": "src/routes/users.ts:getUser",
|
|
262
|
-
"auth": "required",
|
|
263
|
-
"responseType": "User"
|
|
264
|
-
}
|
|
265
|
-
]
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
"examples": [
|
|
269
|
-
{
|
|
270
|
-
"path": "examples/basic-auth.ts",
|
|
271
|
-
"description": "Basic authentication flow",
|
|
272
|
-
"tags": ["auth", "login"],
|
|
273
|
-
"runnable": true
|
|
274
|
-
}
|
|
275
|
-
],
|
|
287
|
+
docs/
|
|
288
|
+
├── index.mdx # Introduction
|
|
289
|
+
├── quickstart.mdx # Quickstart guide
|
|
290
|
+
├── authentication.mdx # Auth setup
|
|
291
|
+
├── guides/
|
|
292
|
+
│ ├── overview.mdx # Core concepts
|
|
293
|
+
│ ├── resources.mdx # Working with resources
|
|
294
|
+
│ └── errors.mdx # Error handling
|
|
295
|
+
├── api-reference/
|
|
296
|
+
│ ├── openapi.json # Imported spec
|
|
297
|
+
│ ├── introduction.mdx # API overview
|
|
298
|
+
│ └── errors.mdx # Error codes reference
|
|
299
|
+
└── sdks/
|
|
300
|
+
└── typescript.mdx # TypeScript SDK
|
|
301
|
+
|
|
302
|
+
═══════════════════════════════════════════════════════════════
|
|
303
|
+
CONTENT SUMMARY
|
|
304
|
+
═══════════════════════════════════════════════════════════════
|
|
305
|
+
|
|
306
|
+
By Diátaxis Content Type:
|
|
307
|
+
📚 Tutorials: 1 page
|
|
308
|
+
└── quickstart.mdx
|
|
276
309
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
]
|
|
282
|
-
},
|
|
310
|
+
📝 How-To Guides: 4 pages
|
|
311
|
+
├── authentication.mdx
|
|
312
|
+
├── guides/resources.mdx
|
|
313
|
+
└── guides/errors.mdx
|
|
283
314
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
],
|
|
315
|
+
📖 Reference: 2 pages
|
|
316
|
+
├── api-reference/errors.mdx
|
|
317
|
+
└── sdks/typescript.mdx
|
|
288
318
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
319
|
+
💡 Explanations: 3 pages
|
|
320
|
+
├── index.mdx (overview)
|
|
321
|
+
├── guides/overview.mdx
|
|
322
|
+
└── api-reference/introduction.mdx
|
|
323
|
+
|
|
324
|
+
Total: 10 pages to generate
|
|
325
|
+
|
|
326
|
+
═══════════════════════════════════════════════════════════════
|
|
327
|
+
GAPS ANALYSIS
|
|
328
|
+
═══════════════════════════════════════════════════════════════
|
|
329
|
+
|
|
330
|
+
Potential missing documentation:
|
|
331
|
+
⚠️ No troubleshooting guide
|
|
332
|
+
⚠️ No changelog/release notes
|
|
333
|
+
⚠️ No migration guide
|
|
334
|
+
|
|
335
|
+
───────────────────────────────────────────────────────────────
|
|
336
|
+
|
|
337
|
+
Does this architecture look complete?
|
|
338
|
+
|
|
339
|
+
1. ✅ **Approve** - Generate documentation with this structure
|
|
340
|
+
2. ✏️ **Modify** - I want to add/remove/change pages or navigation
|
|
341
|
+
3. ➕ **Add suggested** - Add the suggested missing docs
|
|
342
|
+
4. ❌ **Restart** - Let's reconsider the goals and audience
|
|
294
343
|
```
|
|
295
344
|
|
|
296
|
-
|
|
345
|
+
**If user chooses "Modify":**
|
|
346
|
+
- Ask what they want to change:
|
|
347
|
+
- Add/remove pages?
|
|
348
|
+
- Change navigation grouping?
|
|
349
|
+
- Rename tabs or groups?
|
|
350
|
+
- Reorder pages?
|
|
351
|
+
- Update the proposed structure
|
|
352
|
+
- Present again for approval
|
|
353
|
+
|
|
354
|
+
**If user chooses "Add suggested":**
|
|
355
|
+
- Add the suggested missing documentation to the plan
|
|
356
|
+
- Present updated structure for final approval
|
|
357
|
+
|
|
358
|
+
**If user chooses "Restart":**
|
|
359
|
+
- Go back to Step 2 (Define Documentation Goals & Audience)
|
|
360
|
+
|
|
361
|
+
**If user chooses "Approve":**
|
|
362
|
+
- Proceed to Step 6 (Create Context File)
|
|
363
|
+
|
|
364
|
+
**What the IA approval covers:**
|
|
365
|
+
|
|
366
|
+
| Aspect | What's Shown |
|
|
367
|
+
|--------|--------------|
|
|
368
|
+
| **Navigation** | Tabs, groups, page ordering (sidebar view) |
|
|
369
|
+
| **Files** | Actual file paths and folder structure |
|
|
370
|
+
| **Content Types** | Diátaxis classification per page |
|
|
371
|
+
| **Gaps** | Suggested missing documentation |
|
|
372
|
+
| **Scope** | Total page count and effort estimate |
|
|
373
|
+
|
|
374
|
+
**Why this step matters:**
|
|
375
|
+
- Clarifies exactly what will be created
|
|
376
|
+
- Shows how users will navigate the docs
|
|
377
|
+
- Identifies missing documentation before writing
|
|
378
|
+
- Allows user to adjust navigation structure
|
|
379
|
+
- Prevents wasted effort on unwanted content
|
|
380
|
+
- Ensures alignment on scope and priorities
|
|
381
|
+
|
|
382
|
+
### Step 6: Create Context File (After Approval)
|
|
297
383
|
|
|
298
384
|
Save to `.devdoc/context.json`:
|
|
299
385
|
```json
|
|
300
386
|
{
|
|
301
387
|
"$schema": "https://devdoc.sh/schemas/context.json",
|
|
302
388
|
"version": "1.0",
|
|
303
|
-
"lastUpdated": "2026-01-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
"
|
|
307
|
-
"
|
|
389
|
+
"lastUpdated": "2026-01-25T10:00:00Z",
|
|
390
|
+
|
|
391
|
+
"strategy": {
|
|
392
|
+
"goal": "Support API consumers",
|
|
393
|
+
"audience": {
|
|
394
|
+
"primary": "External Developer",
|
|
395
|
+
"needs": ["Quick start", "Authentication", "Code examples", "Reference"]
|
|
396
|
+
}
|
|
308
397
|
},
|
|
398
|
+
|
|
309
399
|
"preferences": {
|
|
310
400
|
"docType": "api",
|
|
311
401
|
"apiType": "openapi",
|
|
312
|
-
"audience": "Backend developers",
|
|
313
402
|
"codeLanguage": "TypeScript"
|
|
314
403
|
},
|
|
404
|
+
|
|
315
405
|
"product": {
|
|
316
406
|
"name": "Product Name",
|
|
317
407
|
"description": "From README",
|
|
318
408
|
"type": "api"
|
|
319
409
|
},
|
|
410
|
+
|
|
320
411
|
"api": {
|
|
321
412
|
"style": "REST",
|
|
322
413
|
"specPath": "api-reference/openapi.json",
|
|
323
414
|
"baseUrl": "https://api.example.com"
|
|
324
415
|
},
|
|
416
|
+
|
|
325
417
|
"documentation": {
|
|
326
418
|
"voice": "professional",
|
|
327
419
|
"codeExamples": {
|
|
328
420
|
"primaryLanguage": "TypeScript"
|
|
329
421
|
}
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
"contentPlan": {
|
|
425
|
+
"approved": true,
|
|
426
|
+
"approvedAt": "2026-01-25T10:00:00Z",
|
|
427
|
+
"pages": [
|
|
428
|
+
{ "path": "index.mdx", "type": "explanation", "priority": "high", "status": "planned" },
|
|
429
|
+
{ "path": "quickstart.mdx", "type": "tutorial", "priority": "high", "status": "planned" },
|
|
430
|
+
{ "path": "authentication.mdx", "type": "how-to", "priority": "high", "status": "planned" },
|
|
431
|
+
{ "path": "guides/overview.mdx", "type": "explanation", "priority": "medium", "status": "planned" },
|
|
432
|
+
{ "path": "api-reference/errors.mdx", "type": "reference", "priority": "medium", "status": "planned" }
|
|
433
|
+
]
|
|
330
434
|
}
|
|
331
435
|
}
|
|
332
436
|
```
|
|
333
437
|
|
|
334
|
-
|
|
335
|
-
```
|
|
336
|
-
✅ Context saved!
|
|
438
|
+
### Step 7: Generate Documentation
|
|
337
439
|
|
|
338
|
-
|
|
339
|
-
- API: REST (45 endpoints)
|
|
340
|
-
- Audience: Backend developers
|
|
341
|
-
- Code examples: TypeScript
|
|
440
|
+
**Only proceed after user has approved the IA structure in Step 5.**
|
|
342
441
|
|
|
343
|
-
|
|
344
|
-
Ready to generate documentation.
|
|
345
|
-
```
|
|
442
|
+
**Use project overview and Diátaxis principles:**
|
|
346
443
|
|
|
347
|
-
|
|
444
|
+
#### Writing Guidelines (Expert Standards)
|
|
348
445
|
|
|
349
|
-
|
|
446
|
+
1. **Use Second Person** - "You can configure..." not "Users can configure..."
|
|
447
|
+
2. **Active Voice** - "Run the command" not "The command should be run"
|
|
448
|
+
3. **Task-Oriented Headings** - "How to add a custom domain" not "Custom domains"
|
|
449
|
+
4. **Include Examples** - Every concept needs a code example
|
|
450
|
+
5. **Progressive Disclosure** - Basic → Advanced ordering
|
|
350
451
|
|
|
351
|
-
####
|
|
352
|
-
```
|
|
353
|
-
docs/
|
|
354
|
-
├── index.mdx # Overview, value prop
|
|
355
|
-
├── quickstart.mdx # 5-min getting started
|
|
356
|
-
├── authentication.mdx # Auth setup
|
|
357
|
-
├── guides/
|
|
358
|
-
│ ├── overview.mdx # Core concepts
|
|
359
|
-
│ └── {use-cases}.mdx # Common use cases
|
|
360
|
-
├── api-reference/
|
|
361
|
-
│ ├── openapi.json # Imported spec
|
|
362
|
-
│ ├── introduction.mdx
|
|
363
|
-
│ └── errors.mdx
|
|
364
|
-
└── sdks/ # If SDKs exist
|
|
365
|
-
```
|
|
452
|
+
#### Page Structure by Content Type
|
|
366
453
|
|
|
367
|
-
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
├── features/
|
|
375
|
-
│ └── {feature}.mdx
|
|
376
|
-
├── tutorials/
|
|
377
|
-
└── troubleshooting/
|
|
378
|
-
```
|
|
454
|
+
**Tutorial Template:**
|
|
455
|
+
```mdx
|
|
456
|
+
---
|
|
457
|
+
title: Build [Something] with [Technology]
|
|
458
|
+
description: A complete tutorial to [achieve outcome] from scratch
|
|
459
|
+
contentType: tutorial
|
|
460
|
+
---
|
|
379
461
|
|
|
380
|
-
|
|
381
|
-
```
|
|
382
|
-
docs/
|
|
383
|
-
├── index.mdx
|
|
384
|
-
├── getting-started/
|
|
385
|
-
│ ├── setup.mdx
|
|
386
|
-
│ └── prerequisites.mdx
|
|
387
|
-
├── architecture/
|
|
388
|
-
├── development/
|
|
389
|
-
└── contributing.mdx
|
|
390
|
-
```
|
|
462
|
+
## What You'll Build
|
|
391
463
|
|
|
392
|
-
|
|
464
|
+
[End result description + estimated time]
|
|
465
|
+
|
|
466
|
+
## Prerequisites
|
|
467
|
+
|
|
468
|
+
<Note>Before you begin, ensure you have: [requirements]</Note>
|
|
393
469
|
|
|
394
|
-
|
|
470
|
+
## Steps
|
|
395
471
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
5. **Match voice to audience** (technical for API, friendly for product)
|
|
472
|
+
<Steps>
|
|
473
|
+
<Step title="Step 1">Content</Step>
|
|
474
|
+
<Step title="Step 2">Content</Step>
|
|
475
|
+
</Steps>
|
|
401
476
|
|
|
402
|
-
|
|
477
|
+
## Next Steps
|
|
478
|
+
|
|
479
|
+
[Links to related content]
|
|
403
480
|
```
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
481
|
+
|
|
482
|
+
**How-To Guide Template:**
|
|
483
|
+
```mdx
|
|
484
|
+
---
|
|
485
|
+
title: How to [Achieve Specific Goal]
|
|
486
|
+
description: Learn how to [specific outcome]
|
|
487
|
+
contentType: how-to
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## Overview
|
|
491
|
+
|
|
492
|
+
[2-3 sentences: What, Who, Why]
|
|
493
|
+
|
|
494
|
+
## Prerequisites (if applicable)
|
|
495
|
+
|
|
496
|
+
## Steps
|
|
497
|
+
|
|
498
|
+
<Steps>
|
|
499
|
+
<Step title="[Action verb] [object]">Content</Step>
|
|
500
|
+
</Steps>
|
|
501
|
+
|
|
502
|
+
## Example
|
|
503
|
+
|
|
504
|
+
[Complete working example]
|
|
505
|
+
|
|
506
|
+
## Next Steps
|
|
410
507
|
```
|
|
411
508
|
|
|
412
|
-
**
|
|
509
|
+
**Reference Template:**
|
|
510
|
+
```mdx
|
|
511
|
+
---
|
|
512
|
+
title: [Component/API/Config] Reference
|
|
513
|
+
description: Complete reference for [topic]
|
|
514
|
+
contentType: reference
|
|
515
|
+
---
|
|
516
|
+
|
|
517
|
+
## Overview
|
|
518
|
+
|
|
519
|
+
[Brief description]
|
|
520
|
+
|
|
521
|
+
## Properties/Parameters
|
|
522
|
+
|
|
523
|
+
| Property | Type | Description | Default |
|
|
524
|
+
|----------|------|-------------|---------|
|
|
525
|
+
| ... | ... | ... | ... |
|
|
526
|
+
|
|
527
|
+
## Examples
|
|
528
|
+
|
|
529
|
+
## Related
|
|
530
|
+
|
|
531
|
+
[Links to related references]
|
|
413
532
|
```
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
533
|
+
|
|
534
|
+
**Explanation Template:**
|
|
535
|
+
```mdx
|
|
536
|
+
---
|
|
537
|
+
title: Understanding [Concept]
|
|
538
|
+
description: Deep dive into [topic] and how it works
|
|
539
|
+
contentType: explanation
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## Overview
|
|
543
|
+
|
|
544
|
+
[Why this matters]
|
|
545
|
+
|
|
546
|
+
## How It Works
|
|
547
|
+
|
|
548
|
+
[Conceptual explanation with diagrams]
|
|
549
|
+
|
|
550
|
+
## Key Concepts
|
|
551
|
+
|
|
552
|
+
## When to Use
|
|
553
|
+
|
|
554
|
+
## Related
|
|
555
|
+
|
|
556
|
+
[Links to tutorials and how-tos that apply this concept]
|
|
419
557
|
```
|
|
420
558
|
|
|
421
559
|
### Step 8: Update docs.json
|
|
@@ -431,7 +569,18 @@ Configure navigation based on doc type:
|
|
|
431
569
|
"tabs": [
|
|
432
570
|
{
|
|
433
571
|
"tab": "Guides",
|
|
434
|
-
"groups": [
|
|
572
|
+
"groups": [
|
|
573
|
+
{
|
|
574
|
+
"group": "Getting Started",
|
|
575
|
+
"icon": "rocket-launch",
|
|
576
|
+
"pages": ["index", "quickstart", "authentication"]
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"group": "Guides",
|
|
580
|
+
"icon": "book-open",
|
|
581
|
+
"pages": ["guides/overview"]
|
|
582
|
+
}
|
|
583
|
+
]
|
|
435
584
|
},
|
|
436
585
|
{
|
|
437
586
|
"tab": "API Reference",
|
|
@@ -443,39 +592,26 @@ Configure navigation based on doc type:
|
|
|
443
592
|
}
|
|
444
593
|
```
|
|
445
594
|
|
|
446
|
-
**API Docs with GraphQL:**
|
|
447
|
-
```json
|
|
448
|
-
{
|
|
449
|
-
"navigation": {
|
|
450
|
-
"tabs": [
|
|
451
|
-
{ "tab": "Guides", "groups": [...] },
|
|
452
|
-
{
|
|
453
|
-
"tab": "GraphQL API",
|
|
454
|
-
"type": "graphql",
|
|
455
|
-
"schema": "api-reference/schema.graphql",
|
|
456
|
-
"endpoint": "https://api.example.com/graphql"
|
|
457
|
-
}
|
|
458
|
-
]
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
```
|
|
462
|
-
|
|
463
595
|
### Step 9: Summary
|
|
464
596
|
|
|
465
597
|
```
|
|
466
598
|
✅ Documentation Generated!
|
|
467
599
|
|
|
468
|
-
|
|
469
|
-
-
|
|
470
|
-
-
|
|
471
|
-
-
|
|
472
|
-
- authentication.mdx
|
|
473
|
-
- guides/overview.mdx
|
|
474
|
-
- api-reference/openapi.json (imported)
|
|
600
|
+
Strategy:
|
|
601
|
+
- Goal: [selected goal]
|
|
602
|
+
- Audience: [primary audience]
|
|
603
|
+
- Domain: [api/product/internal]
|
|
475
604
|
|
|
476
|
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
605
|
+
Content Plan (Diátaxis):
|
|
606
|
+
- Tutorials: X pages
|
|
607
|
+
- How-To Guides: X pages
|
|
608
|
+
- Reference: X pages
|
|
609
|
+
- Explanations: X pages
|
|
610
|
+
|
|
611
|
+
Files created:
|
|
612
|
+
- docs.json (navigation)
|
|
613
|
+
- .devdoc/context.json (strategy & preferences)
|
|
614
|
+
- [list of mdx files with content types]
|
|
479
615
|
|
|
480
616
|
Next steps:
|
|
481
617
|
1. Run `devdoc dev` to preview
|
|
@@ -489,17 +625,22 @@ Next steps:
|
|
|
489
625
|
|
|
490
626
|
| Principle | Description |
|
|
491
627
|
|-----------|-------------|
|
|
492
|
-
|
|
|
493
|
-
|
|
|
494
|
-
|
|
|
495
|
-
|
|
|
496
|
-
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
-
|
|
505
|
-
-
|
|
628
|
+
| **Project overview first** | Quick scan using git to understand structure |
|
|
629
|
+
| **Strategy first** | Define goals and audience before structure |
|
|
630
|
+
| **Audience-driven** | Match content to user needs |
|
|
631
|
+
| **Diátaxis types** | Classify every page by content type |
|
|
632
|
+
| **IA approval required** | Always get user approval before generating content |
|
|
633
|
+
| **Expert writing** | Second person, active voice, task-oriented |
|
|
634
|
+
| **Mark unknowns** | Add TODO for sections needing review |
|
|
635
|
+
|
|
636
|
+
## Quality Checklist
|
|
637
|
+
|
|
638
|
+
Before completing, verify:
|
|
639
|
+
|
|
640
|
+
- [ ] Title is clear and specific
|
|
641
|
+
- [ ] Introduction explains the "why"
|
|
642
|
+
- [ ] Content type matches page purpose
|
|
643
|
+
- [ ] Code examples are complete and tested
|
|
644
|
+
- [ ] Links to related docs included
|
|
645
|
+
- [ ] Follows writing guidelines (2nd person, active voice)
|
|
646
|
+
- [ ] Progressive disclosure (basic → advanced)
|