EXAMPLE_SKILL.md 8.93 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
---
orphan: true
---

# Documentation Migration Skill

This file is a ready-to-use Cursor skill for AI-assisted documentation migration.

---

## How to Use This Skill

### Option 1: Cursor IDE

1. Create the skill directory:
   ```bash
   mkdir -p .cursor/skills/docs-migration
   ```

2. Copy this file:
   ```bash
   cp docs/templates/EXAMPLE_SKILL.md .cursor/skills/docs-migration/SKILL.md
   ```

3. Remove the `orphan: true` header and this "How to Use" section

4. The skill will be available when working on documentation migration

### Option 2: Claude (or any AI)

1. Copy everything below the separator line (`---`)
2. Paste into your conversation as context
3. Ask the AI: "Help me migrate the [component] documentation to the new structure"

---

## Skill Content

Copy everything below this line for use as an AI prompt:

---
name: docs-migration
description: Migrate Dynamo documentation to the 9-category hierarchy. Use when migrating components, backends, features, or other docs to the new structure.
---

# Documentation Migration

This skill guides you through migrating Dynamo documentation to the new 9-category hierarchy.

## Inputs

| Input | Required | Description |
|-------|----------|-------------|
| Component/Topic | Yes | What to migrate (e.g., "planner", "kubernetes", "multimodal") |
| Source Path | Yes | Current location (e.g., `docs/planner/`) |
| Target Category | Yes | One of: components, backends, features, deploy, performance, infrastructure, integrations |

## Directory Hierarchy

```
docs/
├── components/          # Router, Planner, KVBM, Frontend, Profiler
├── backends/            # vLLM, SGLang, TRT-LLM
├── features/            # Multimodal, LoRA, Speculative Decoding
├── deploy/              # Kubernetes, Helm, Operator
├── performance/         # Tuning, Benchmarks
├── infrastructure/      # Observability, Fault Tolerance, Development
├── integrations/        # LMCache, HiCache, NIXL
├── reference/           # CLI, Glossary, Support Matrix
└── design_docs/         # Tier 3 design documents
```

---

## Phase 1: Analyze Existing Docs

### Step 1.1: Inventory Current Files

```bash
# List existing documentation
ls -la docs/<source_path>/

# Count lines in each file
wc -l docs/<source_path>/*.md
```

### Step 1.2: Categorize Content

For each file, identify content type:

| Category | Target File | Description |
|----------|-------------|-------------|
| Overview | README.md | Component description, feature matrix |
| Quick Start | README.md | Minimal steps to get running |
| Deployment | `<name>_guide.md` | Setup, prerequisites, container images |
| Configuration | `<name>_guide.md` | CLI args, env vars, config files |
| Integration | `<name>_guide.md` | Connecting to other components |
| Troubleshooting | `<name>_guide.md` | Common issues and fixes |
| Examples | `<name>_examples.md` | Code samples, YAML configs |
| Architecture | `<name>_design.md` | Design decisions, algorithms |

**>>> STOP: Share your analysis. Ask if there are content priorities or known issues.**

---

## Phase 2: Create Migration Mapping

### Step 2.1: Document Current → Target Mapping

Create a mapping showing where each section will move:

```markdown
## Content Migration Mapping

### README.md (Tier 2)

| New Section | Source | Est. Lines |
|-------------|--------|------------|
| Overview | source_file.md → Section | X |
| Feature Matrix | source_file.md → Section | X |
| Quick Start | source_file.md → Section | X |
| Next Steps | New | 10 |

### <name>_guide.md (Tier 2)

| New Section | Source | Est. Lines |
|-------------|--------|------------|
| Deployment | source_file.md → Section | X |
| Configuration | source_file.md → Section | X |
| Integration | source_file.md → Section | X |
| Troubleshooting | source_file.md → Section | X |
```

**>>> STOP: Share mapping. Ask if any content should be prioritized or excluded.**

---

## Phase 3: Create File Structure

### Step 3.1: Create Target Directory

```bash
# For components
mkdir -p docs/components/<name>

# For other categories
mkdir -p docs/<category>/<name>
```

### Step 3.2: Create Files

```bash
touch docs/<category>/<name>/README.md
touch docs/<category>/<name>/<name>_guide.md
touch docs/<category>/<name>/<name>_examples.md
touch docs/design_docs/<name>_design.md
```

### Step 3.3: Create Tier 1 Stub (Components Only)

For components, create redirect stub:

```markdown
# Dynamo <Component>

<One-sentence description.>

See `docs/components/<name>/` for documentation.
```

---

## Phase 4: Migrate Content

### Step 4.1: Use Templates

Reference templates in `docs/templates/`:
- `component_readme.md` - Tier 2 README
- `component_guide.md` - Tier 2 Guide
- `component_examples.md` - Tier 2 Examples
- `component_design.md` - Tier 3 Design

### Step 4.2: Preserve All Content

- Copy content exactly unless errors exist
- Preserve code examples
- Preserve diagrams (Mermaid, images)
- Update internal links to new paths

**>>> STOP: Share migrated documents. Ask if content is complete.**

---

## Phase 5: Update Links

### Step 5.1: Find Files Linking to Old Path

```bash
# Find all files with links to old path
rg -l "docs/<old_path>" docs/ fern/

# Find RST cross-references
rg ":doc:\`.*<old_path>" docs/

# Find relative markdown links
rg "\]\(.*<old_path>" docs/
```

### Step 5.2: Update Sphinx Navigation

1. **index.rst** - Update toctree entries:
   ```rst
   .. toctree::
      Page Title <../new/path/file>
   ```

2. **_sections/*.rst** - Update section toctrees

3. **conf.py** - Add redirect for moved files:
   ```python
   redirects = {
       "old/path/file": "../new/path/file.html",
   }
   ```

### Step 5.3: Update Fern Navigation

1. **versions/next.yml** - Update page paths:
   ```yaml
   - page: Page Title
     path: ../pages/new/path.md
   ```

2. **Move files** in `fern/pages/` to match new structure

### Step 5.4: Update Cross-References in Other Docs

For each file found in Step 5.1:
- Update relative paths to new locations
- Verify links work

**>>> STOP: Share link update summary. List files modified.**

---

## Phase 6: Edit for Style

Review migrated documents for FLOW, STYLE, and CONSISTENCY.

**Do NOT change content meaning - only improve presentation.**

### Step 6.1: Review Checklist

For each document:

**FLOW:**
- [ ] First paragraph states what the doc covers
- [ ] Sections ordered: Overview → Setup → Usage → Troubleshooting
- [ ] No orphaned paragraphs (single sentences between sections)

**STYLE:**
- [ ] Instructions use active voice ("Run", "Create", "Add")
- [ ] No redundant phrases ("To" not "In order to")
- [ ] Sentences ≤25 words

**CONSISTENCY:**
- [ ] Component names: vLLM, SGLang, TensorRT-LLM
- [ ] Status indicators: ✅ 🚧 ❌
- [ ] Heading hierarchy: # → ## → ### (no skips)
- [ ] Code blocks specify language

### Step 6.2: Generate Suggested Edits

Present suggestions using FLAG format:

```markdown
---

### FLAG: [FLOW|STYLE|CONSISTENCY] - [Brief Description]

**File:** `path/to/file.md`
**Line(s):** X-Y

**Current:**
> [Original text]

**Suggested:**
> [Improved text]

**Reasoning:** [Why this improves flow/style/consistency]

---
```

### Step 6.3: Apply Approved Edits

After user reviews:
- Apply approved edits only
- Skip rejected suggestions
- Document patterns for future reference

**>>> STOP: Share suggested edits. Ask which to apply.**

---

## Phase 7: Validate and Cleanup

### Step 7.1: Validation Checklist

```
Validation for: [COMPONENT_NAME]
- [ ] All content from original files preserved
- [ ] No broken links (test with docs build)
- [ ] Feature matrix matches current capabilities
- [ ] Code examples are correct
- [ ] Mermaid diagrams render
- [ ] Navigation links work between files
- [ ] Sphinx toctree updated
- [ ] Fern navigation updated
- [ ] conf.py redirects added
```

### Step 7.2: Test Docs Build

```bash
# Build Sphinx docs
cd docs && make html

# Check for warnings about missing references
```

### Step 7.3: Cleanup Old Files

After validation and approval:
1. Delete original files
2. Keep deprecated files with deprecation notice if needed
3. Commit changes

**>>> STOP: Share validation results. Ask for approval before deleting originals.**

---

## Category-Specific Notes

### Components (Router, Planner, KVBM, Frontend, Profiler)

- Target: `docs/components/<name>/`
- Requires Tier 1 stub in `components/src/dynamo/<name>/README.md`
- Tier 3 design doc in `docs/design_docs/<name>_design.md`

### Backends (vLLM, SGLang, TRT-LLM)

- Target: `docs/backends/<name>/`
- Tier 3 is external (upstream project docs)
- Create `docs/backends/README.md` for backend comparison

### Deploy (Kubernetes)

- Target: `docs/deploy/`
- Flat structure (no subdirectories per topic)
- Examples go in `docs/deploy/examples/`

### Performance

- Target: `docs/performance/`
- Includes tuning and benchmarks (merged)
- Flat structure

### Infrastructure (Observability, Fault Tolerance, Development)

- Target: `docs/infrastructure/<topic>/`
- Subdirectory per topic
- Development guides for contributors