@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
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Explanation Template (Diátaxis: Understanding-Oriented)
|
|
2
|
+
|
|
3
|
+
**Purpose:** Help users understand concepts, architecture, and the "why" behind decisions.
|
|
4
|
+
|
|
5
|
+
**When to use:**
|
|
6
|
+
- Architecture documentation
|
|
7
|
+
- Conceptual overviews
|
|
8
|
+
- Background knowledge
|
|
9
|
+
- Design decisions (ADRs)
|
|
10
|
+
- "How it works" content
|
|
11
|
+
|
|
12
|
+
## Format
|
|
13
|
+
|
|
14
|
+
```mdx
|
|
15
|
+
---
|
|
16
|
+
title: Understanding [Concept]
|
|
17
|
+
description: Deep dive into [topic] and how it works
|
|
18
|
+
contentType: explanation
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
Why this matters: 2-3 sentences explaining the importance of understanding this concept.
|
|
24
|
+
|
|
25
|
+
## Background / Context
|
|
26
|
+
|
|
27
|
+
What problem does this solve? What existed before?
|
|
28
|
+
|
|
29
|
+
## How It Works
|
|
30
|
+
|
|
31
|
+
### High-Level Architecture
|
|
32
|
+
|
|
33
|
+
```mermaid
|
|
34
|
+
flowchart TB
|
|
35
|
+
subgraph Client[Browser]
|
|
36
|
+
UI[User Interface]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
subgraph Server[Backend]
|
|
40
|
+
API[API Layer]
|
|
41
|
+
Logic[Business Logic]
|
|
42
|
+
DB[(Database)]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
UI --> API
|
|
46
|
+
API --> Logic
|
|
47
|
+
Logic --> DB
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Key Components
|
|
51
|
+
|
|
52
|
+
| Component | Responsibility | Location |
|
|
53
|
+
|-----------|----------------|----------|
|
|
54
|
+
| Component A | Does X | `src/a/` |
|
|
55
|
+
| Component B | Does Y | `src/b/` |
|
|
56
|
+
| Component C | Does Z | `src/c/` |
|
|
57
|
+
|
|
58
|
+
### The Flow
|
|
59
|
+
|
|
60
|
+
1. **Step 1**: What happens first and why
|
|
61
|
+
2. **Step 2**: What happens next
|
|
62
|
+
3. **Step 3**: Final result
|
|
63
|
+
|
|
64
|
+
### Sequence Diagram
|
|
65
|
+
|
|
66
|
+
```mermaid
|
|
67
|
+
sequenceDiagram
|
|
68
|
+
participant User
|
|
69
|
+
participant System
|
|
70
|
+
participant External
|
|
71
|
+
|
|
72
|
+
User->>System: Action
|
|
73
|
+
System->>External: Request
|
|
74
|
+
External-->>System: Response
|
|
75
|
+
System-->>User: Result
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Key Concepts
|
|
79
|
+
|
|
80
|
+
### Concept A
|
|
81
|
+
|
|
82
|
+
Explanation of the concept with examples.
|
|
83
|
+
|
|
84
|
+
<Tip>
|
|
85
|
+
Key insight or mental model to help understanding.
|
|
86
|
+
</Tip>
|
|
87
|
+
|
|
88
|
+
### Concept B
|
|
89
|
+
|
|
90
|
+
Another important concept.
|
|
91
|
+
|
|
92
|
+
### Concept C
|
|
93
|
+
|
|
94
|
+
Third concept with its relationships to A and B.
|
|
95
|
+
|
|
96
|
+
## Design Decisions
|
|
97
|
+
|
|
98
|
+
### Why [Decision X]?
|
|
99
|
+
|
|
100
|
+
**Context:** What situation led to this decision?
|
|
101
|
+
|
|
102
|
+
**Decision:** What we decided.
|
|
103
|
+
|
|
104
|
+
**Rationale:** Why this approach over alternatives.
|
|
105
|
+
|
|
106
|
+
**Trade-offs:**
|
|
107
|
+
- ✅ Benefit 1
|
|
108
|
+
- ✅ Benefit 2
|
|
109
|
+
- ⚠️ Trade-off 1
|
|
110
|
+
- ⚠️ Trade-off 2
|
|
111
|
+
|
|
112
|
+
### Alternatives Considered
|
|
113
|
+
|
|
114
|
+
| Option | Pros | Cons | Why Not |
|
|
115
|
+
|--------|------|------|---------|
|
|
116
|
+
| Option A | Fast | Complex | Too much overhead |
|
|
117
|
+
| Option B (chosen) | Simple, maintainable | Slower | Best balance |
|
|
118
|
+
|
|
119
|
+
## When to Use
|
|
120
|
+
|
|
121
|
+
| Scenario | Recommendation |
|
|
122
|
+
|----------|----------------|
|
|
123
|
+
| Scenario A | Use this approach |
|
|
124
|
+
| Scenario B | Consider alternative |
|
|
125
|
+
| Scenario C | Not recommended |
|
|
126
|
+
|
|
127
|
+
## Common Misconceptions
|
|
128
|
+
|
|
129
|
+
<Warning>
|
|
130
|
+
**Misconception:** [Common wrong belief]
|
|
131
|
+
|
|
132
|
+
**Reality:** [Correct understanding]
|
|
133
|
+
</Warning>
|
|
134
|
+
|
|
135
|
+
## Deeper Dive
|
|
136
|
+
|
|
137
|
+
For those who want to understand more:
|
|
138
|
+
|
|
139
|
+
- [Technical detail 1]
|
|
140
|
+
- [Technical detail 2]
|
|
141
|
+
- [Edge cases]
|
|
142
|
+
|
|
143
|
+
## Related
|
|
144
|
+
|
|
145
|
+
<CardGroup cols={2}>
|
|
146
|
+
<Card title="Tutorial" href="/tutorial">
|
|
147
|
+
Learn by building with this concept
|
|
148
|
+
</Card>
|
|
149
|
+
<Card title="How-To Guide" href="/how-to">
|
|
150
|
+
Practical tasks using this concept
|
|
151
|
+
</Card>
|
|
152
|
+
<Card title="Reference" href="/reference">
|
|
153
|
+
Complete API reference
|
|
154
|
+
</Card>
|
|
155
|
+
</CardGroup>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Guidelines
|
|
159
|
+
|
|
160
|
+
- **Focus on understanding** - Explain the "why", not just the "what"
|
|
161
|
+
- **Use analogies** - Relate to familiar concepts
|
|
162
|
+
- **Provide context** - Historical background helps understanding
|
|
163
|
+
- **Show relationships** - How concepts connect to each other
|
|
164
|
+
- **Address misconceptions** - Clear up common confusion
|
|
165
|
+
- **Use diagrams liberally** - Visual aids help comprehension
|
|
166
|
+
- **Link to practical content** - Connect to tutorials and how-tos
|
|
167
|
+
|
|
168
|
+
## Diátaxis Principles for Explanation
|
|
169
|
+
|
|
170
|
+
| Principle | Application |
|
|
171
|
+
|-----------|-------------|
|
|
172
|
+
| Understanding-oriented | Focus on comprehension |
|
|
173
|
+
| Conceptual | Abstract from specifics |
|
|
174
|
+
| Reflective | Encourage thinking |
|
|
175
|
+
| Connected | Show relationships |
|
|
176
|
+
| Contextual | Provide background |
|
|
177
|
+
|
|
178
|
+
## Mermaid Diagrams for Explanations
|
|
179
|
+
|
|
180
|
+
### Architecture Diagram
|
|
181
|
+
|
|
182
|
+
```mermaid
|
|
183
|
+
flowchart TB
|
|
184
|
+
subgraph Client["Client Layer"]
|
|
185
|
+
A[Web App]
|
|
186
|
+
B[Mobile App]
|
|
187
|
+
end
|
|
188
|
+
subgraph Services["Service Layer"]
|
|
189
|
+
C[Auth Service]
|
|
190
|
+
D[API Gateway]
|
|
191
|
+
end
|
|
192
|
+
subgraph Data["Data Layer"]
|
|
193
|
+
E[(Database)]
|
|
194
|
+
F[(Cache)]
|
|
195
|
+
end
|
|
196
|
+
A --> D
|
|
197
|
+
B --> D
|
|
198
|
+
D --> C
|
|
199
|
+
D --> E
|
|
200
|
+
D --> F
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Data Flow Diagram
|
|
204
|
+
|
|
205
|
+
```mermaid
|
|
206
|
+
flowchart LR
|
|
207
|
+
A[Request] --> B[Validate]
|
|
208
|
+
B --> C{Valid?}
|
|
209
|
+
C -->|Yes| D[Process]
|
|
210
|
+
C -->|No| E[Error]
|
|
211
|
+
D --> F[Response]
|
|
212
|
+
E --> F
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Entity Relationship
|
|
216
|
+
|
|
217
|
+
```mermaid
|
|
218
|
+
erDiagram
|
|
219
|
+
USER ||--o{ ORDER : places
|
|
220
|
+
ORDER ||--|{ LINE_ITEM : contains
|
|
221
|
+
PRODUCT ||--o{ LINE_ITEM : "ordered in"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### State Machine
|
|
225
|
+
|
|
226
|
+
```mermaid
|
|
227
|
+
stateDiagram-v2
|
|
228
|
+
[*] --> Draft
|
|
229
|
+
Draft --> Pending: submit
|
|
230
|
+
Pending --> Approved: approve
|
|
231
|
+
Pending --> Rejected: reject
|
|
232
|
+
Approved --> Published: publish
|
|
233
|
+
Rejected --> Draft: revise
|
|
234
|
+
Published --> [*]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## ADR (Architecture Decision Record) Format
|
|
238
|
+
|
|
239
|
+
```mdx
|
|
240
|
+
---
|
|
241
|
+
title: "ADR-001: [Decision Title]"
|
|
242
|
+
description: Architecture decision record for [topic]
|
|
243
|
+
contentType: explanation
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Status
|
|
247
|
+
|
|
248
|
+
Accepted | Proposed | Deprecated | Superseded by ADR-XXX
|
|
249
|
+
|
|
250
|
+
## Context
|
|
251
|
+
|
|
252
|
+
What situation led to this decision?
|
|
253
|
+
|
|
254
|
+
## Decision
|
|
255
|
+
|
|
256
|
+
What did we decide?
|
|
257
|
+
|
|
258
|
+
## Rationale
|
|
259
|
+
|
|
260
|
+
Why this approach over alternatives?
|
|
261
|
+
|
|
262
|
+
## Consequences
|
|
263
|
+
|
|
264
|
+
### Positive
|
|
265
|
+
- Benefit 1
|
|
266
|
+
- Benefit 2
|
|
267
|
+
|
|
268
|
+
### Negative
|
|
269
|
+
- Trade-off 1
|
|
270
|
+
- Trade-off 2
|
|
271
|
+
|
|
272
|
+
### Neutral
|
|
273
|
+
- Change 1
|
|
274
|
+
- Change 2
|
|
275
|
+
|
|
276
|
+
## Alternatives Considered
|
|
277
|
+
|
|
278
|
+
### Option A: [Name]
|
|
279
|
+
- Pros: ...
|
|
280
|
+
- Cons: ...
|
|
281
|
+
- Why not: ...
|
|
282
|
+
|
|
283
|
+
### Option B: [Name] (Chosen)
|
|
284
|
+
- Pros: ...
|
|
285
|
+
- Cons: ...
|
|
286
|
+
- Why chosen: ...
|
|
287
|
+
|
|
288
|
+
## Related Decisions
|
|
289
|
+
|
|
290
|
+
- [ADR-002](/decisions/002)
|
|
291
|
+
- [ADR-003](/decisions/003)
|
|
292
|
+
```
|
|
@@ -1,133 +1,60 @@
|
|
|
1
|
-
# Guide Template
|
|
1
|
+
# Guide Template (Diátaxis: How-To)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Note:** This template is an alias for the How-To template. Use `how-to.md` for new guides.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Guides are task-oriented documentation that help users accomplish specific goals.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
title: [Action] + [Topic]
|
|
10
|
-
description: Learn how to [achieve specific outcome]
|
|
11
|
-
---
|
|
7
|
+
## When to Use
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- User needs to solve a specific problem
|
|
10
|
+
- Task-focused documentation
|
|
11
|
+
- Practical, goal-oriented scenarios
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
- What this guide covers
|
|
17
|
-
- Who it's for
|
|
18
|
-
- What you'll achieve
|
|
13
|
+
## See Also
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
For the full template, refer to: `how-to.md`
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
Before you begin, ensure you have:
|
|
24
|
-
- [Requirement 1]
|
|
25
|
-
- [Requirement 2]
|
|
26
|
-
</Note>
|
|
17
|
+
## Quick Reference
|
|
27
18
|
|
|
28
|
-
|
|
19
|
+
```mdx
|
|
20
|
+
---
|
|
21
|
+
title: How to [Achieve Specific Goal]
|
|
22
|
+
description: Learn how to [specific outcome]
|
|
23
|
+
contentType: how-to
|
|
24
|
+
---
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
## Overview
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
B --> C[Output]
|
|
36
|
-
```
|
|
28
|
+
[2-3 sentences: What, Who, Why]
|
|
29
|
+
|
|
30
|
+
## Prerequisites (if applicable)
|
|
37
31
|
|
|
38
32
|
## Steps
|
|
39
33
|
|
|
40
34
|
<Steps>
|
|
41
|
-
<Step title="
|
|
42
|
-
Explanation of what this step does.
|
|
43
|
-
|
|
44
|
-
```language
|
|
45
|
-
// Code example
|
|
46
|
-
```
|
|
47
|
-
</Step>
|
|
48
|
-
|
|
49
|
-
<Step title="Next step">
|
|
50
|
-
Continue with clear, actionable steps.
|
|
51
|
-
</Step>
|
|
35
|
+
<Step title="[Action verb] [object]">Content</Step>
|
|
52
36
|
</Steps>
|
|
53
37
|
|
|
54
38
|
## Example
|
|
55
39
|
|
|
56
|
-
Complete working example showing the end result.
|
|
57
|
-
|
|
58
|
-
```language
|
|
59
|
-
// Full example code
|
|
60
|
-
```
|
|
61
|
-
|
|
62
40
|
## Next Steps
|
|
63
|
-
|
|
64
|
-
<CardGroup cols={2}>
|
|
65
|
-
<Card title="Related Guide" href="/path">
|
|
66
|
-
Brief description
|
|
67
|
-
</Card>
|
|
68
|
-
</CardGroup>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Mermaid Diagram Guidelines
|
|
72
|
-
|
|
73
|
-
### When to Use Diagrams
|
|
74
|
-
|
|
75
|
-
- **Flowcharts**: For processes, decision trees, workflows
|
|
76
|
-
- **Sequence diagrams**: For API calls, request/response flows
|
|
77
|
-
- **Entity diagrams**: For data models, relationships
|
|
78
|
-
- **State diagrams**: For state machines, status transitions
|
|
79
|
-
|
|
80
|
-
### Flowchart Example
|
|
81
|
-
|
|
82
|
-
```mermaid
|
|
83
|
-
flowchart TD
|
|
84
|
-
A[Start] --> B{Decision?}
|
|
85
|
-
B -->|Yes| C[Action 1]
|
|
86
|
-
B -->|No| D[Action 2]
|
|
87
|
-
C --> E[End]
|
|
88
|
-
D --> E
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Sequence Diagram Example
|
|
92
|
-
|
|
93
|
-
```mermaid
|
|
94
|
-
sequenceDiagram
|
|
95
|
-
participant Client
|
|
96
|
-
participant API
|
|
97
|
-
participant Database
|
|
98
|
-
|
|
99
|
-
Client->>API: POST /users
|
|
100
|
-
API->>Database: INSERT user
|
|
101
|
-
Database-->>API: user_id
|
|
102
|
-
API-->>Client: 201 Created
|
|
103
41
|
```
|
|
104
42
|
|
|
105
|
-
|
|
43
|
+
## Content Type Classification
|
|
106
44
|
|
|
107
|
-
|
|
108
|
-
erDiagram
|
|
109
|
-
USER ||--o{ ORDER : places
|
|
110
|
-
ORDER ||--|{ LINE_ITEM : contains
|
|
111
|
-
PRODUCT ||--o{ LINE_ITEM : "ordered in"
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### State Diagram Example
|
|
45
|
+
When creating documentation, classify each page using the Diátaxis framework:
|
|
115
46
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Failed --> Processing: retry
|
|
123
|
-
Completed --> [*]
|
|
124
|
-
```
|
|
47
|
+
| Type | Template | Purpose |
|
|
48
|
+
|------|----------|---------|
|
|
49
|
+
| Tutorial | `tutorial.md` | Learning-oriented, build understanding |
|
|
50
|
+
| How-To Guide | `how-to.md` | Task-oriented, accomplish goals |
|
|
51
|
+
| Reference | `reference.md` | Information-oriented, look up facts |
|
|
52
|
+
| Explanation | `explanation.md` | Understanding-oriented, comprehension |
|
|
125
53
|
|
|
126
|
-
## Guidelines
|
|
54
|
+
## Writing Guidelines
|
|
127
55
|
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
- Keep diagrams simple - max 7-10 nodes
|
|
56
|
+
1. **Second Person** - "You can configure..." not "Users can configure..."
|
|
57
|
+
2. **Active Voice** - "Run the command" not "The command should be run"
|
|
58
|
+
3. **Task-Oriented Headings** - "How to add a custom domain" not "Custom domains"
|
|
59
|
+
4. **Include Examples** - Every concept needs a code example
|
|
60
|
+
5. **Progressive Disclosure** - Basic → Advanced ordering
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# How-To Guide Template (Diátaxis: Task-Oriented)
|
|
2
|
+
|
|
3
|
+
**Purpose:** Help users accomplish a specific real-world task.
|
|
4
|
+
|
|
5
|
+
**When to use:**
|
|
6
|
+
- Users need to solve a specific problem
|
|
7
|
+
- Task-focused documentation
|
|
8
|
+
- Practical, goal-oriented scenarios
|
|
9
|
+
|
|
10
|
+
## Format
|
|
11
|
+
|
|
12
|
+
```mdx
|
|
13
|
+
---
|
|
14
|
+
title: How to [Achieve Specific Goal]
|
|
15
|
+
description: Learn how to [specific outcome]
|
|
16
|
+
contentType: how-to
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
Brief introduction (2-3 sentences):
|
|
22
|
+
- What this guide covers
|
|
23
|
+
- Who it's for
|
|
24
|
+
- What you'll achieve
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
<Note>
|
|
29
|
+
Before you begin, ensure you have:
|
|
30
|
+
- [Requirement 1]
|
|
31
|
+
- [Requirement 2]
|
|
32
|
+
</Note>
|
|
33
|
+
|
|
34
|
+
## Architecture / Flow (if applicable)
|
|
35
|
+
|
|
36
|
+
Use mermaid diagrams to visualize:
|
|
37
|
+
|
|
38
|
+
```mermaid
|
|
39
|
+
flowchart LR
|
|
40
|
+
A[Input] --> B[Process]
|
|
41
|
+
B --> C[Output]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Steps
|
|
45
|
+
|
|
46
|
+
<Steps>
|
|
47
|
+
<Step title="[Action verb] + [object]">
|
|
48
|
+
Explanation of what this step does and why.
|
|
49
|
+
|
|
50
|
+
```language
|
|
51
|
+
// Code example
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
<Tip>
|
|
55
|
+
Pro tip for this step.
|
|
56
|
+
</Tip>
|
|
57
|
+
</Step>
|
|
58
|
+
|
|
59
|
+
<Step title="[Next action]">
|
|
60
|
+
Continue with clear, actionable steps.
|
|
61
|
+
|
|
62
|
+
Each step should be independently verifiable.
|
|
63
|
+
</Step>
|
|
64
|
+
|
|
65
|
+
<Step title="[Final action]">
|
|
66
|
+
Complete the task.
|
|
67
|
+
</Step>
|
|
68
|
+
</Steps>
|
|
69
|
+
|
|
70
|
+
## Example
|
|
71
|
+
|
|
72
|
+
Complete working example showing the end result.
|
|
73
|
+
|
|
74
|
+
```language
|
|
75
|
+
// Full example code with all pieces together
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Variations
|
|
79
|
+
|
|
80
|
+
<Tabs>
|
|
81
|
+
<Tab title="Option A">
|
|
82
|
+
Alternative approach for specific use case.
|
|
83
|
+
</Tab>
|
|
84
|
+
<Tab title="Option B">
|
|
85
|
+
Another variation.
|
|
86
|
+
</Tab>
|
|
87
|
+
</Tabs>
|
|
88
|
+
|
|
89
|
+
## Troubleshooting
|
|
90
|
+
|
|
91
|
+
<AccordionGroup>
|
|
92
|
+
<Accordion title="[Common issue]">
|
|
93
|
+
**Problem:** Description of the issue.
|
|
94
|
+
|
|
95
|
+
**Solution:** How to resolve it.
|
|
96
|
+
</Accordion>
|
|
97
|
+
</AccordionGroup>
|
|
98
|
+
|
|
99
|
+
## Next Steps
|
|
100
|
+
|
|
101
|
+
<CardGroup cols={2}>
|
|
102
|
+
<Card title="Related Guide" href="/path">
|
|
103
|
+
Brief description of related task
|
|
104
|
+
</Card>
|
|
105
|
+
<Card title="Reference" href="/path">
|
|
106
|
+
Deep dive into configuration options
|
|
107
|
+
</Card>
|
|
108
|
+
</CardGroup>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Guidelines
|
|
112
|
+
|
|
113
|
+
- **Start with the outcome** - readers should know what they'll achieve
|
|
114
|
+
- **Each step should be independently verifiable** - readers can check progress
|
|
115
|
+
- **Use action verbs** in step titles - "Configure", "Add", "Create", "Enable"
|
|
116
|
+
- **Include error handling** in code examples
|
|
117
|
+
- **Provide alternatives** when multiple approaches exist
|
|
118
|
+
- **Link to related guides** at the end
|
|
119
|
+
- **Use mermaid diagrams** to visualize complex flows
|
|
120
|
+
- **Keep diagrams simple** - max 7-10 nodes
|
|
121
|
+
|
|
122
|
+
## Diátaxis Principles for How-To Guides
|
|
123
|
+
|
|
124
|
+
| Principle | Application |
|
|
125
|
+
|-----------|-------------|
|
|
126
|
+
| Task-oriented | Focus on achieving a specific goal |
|
|
127
|
+
| Practical | Solves a real problem |
|
|
128
|
+
| Flexible | Can adapt to different contexts |
|
|
129
|
+
| Direct | Gets to the point quickly |
|
|
130
|
+
| Assumes competence | Reader knows the basics |
|
|
131
|
+
|
|
132
|
+
## Mermaid Diagram Types for How-To Guides
|
|
133
|
+
|
|
134
|
+
### Flowchart (for processes)
|
|
135
|
+
```mermaid
|
|
136
|
+
flowchart TD
|
|
137
|
+
A[Start] --> B{Decision?}
|
|
138
|
+
B -->|Yes| C[Action 1]
|
|
139
|
+
B -->|No| D[Action 2]
|
|
140
|
+
C --> E[End]
|
|
141
|
+
D --> E
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Sequence (for API calls)
|
|
145
|
+
```mermaid
|
|
146
|
+
sequenceDiagram
|
|
147
|
+
participant Client
|
|
148
|
+
participant API
|
|
149
|
+
participant Database
|
|
150
|
+
|
|
151
|
+
Client->>API: POST /users
|
|
152
|
+
API->>Database: INSERT user
|
|
153
|
+
Database-->>API: user_id
|
|
154
|
+
API-->>Client: 201 Created
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### State (for status transitions)
|
|
158
|
+
```mermaid
|
|
159
|
+
stateDiagram-v2
|
|
160
|
+
[*] --> Pending
|
|
161
|
+
Pending --> Processing: start
|
|
162
|
+
Processing --> Completed: success
|
|
163
|
+
Processing --> Failed: error
|
|
164
|
+
Failed --> Processing: retry
|
|
165
|
+
Completed --> [*]
|
|
166
|
+
```
|