upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/archive/2025-11-04-diataxis-migration.md
blob: deed23d7ab273d4b261b8362113ae0e2377a4477 (plain)
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
# Diátaxis Migration Complete ✅

**Date:** November 4, 2025  
**Status:** COMPLETE

---

## What Changed?

We migrated all documentation to the **[Diátaxis](https://diataxis.fr/) framework**, which organizes content into four clear categories based on purpose and audience.

---

## Before and After

### Before (Flat Structure)
```
docs/
├── ARCHITECTURE.md
├── COMPARISON.md
├── DECISION_SUMMARY.md
├── GETTING_STARTED.md
├── GIT_PROTOCOL.md
├── TEST_STRATEGY.md
├── learnings/
│   ├── nix-flakes.md
│   ├── nostr-sdk.md
│   └── grasp-audit.md
└── archive/
```

**Problems:**
- Unclear where to put new docs
- Mixed purposes (learning, reference, explanation)
- Hard for readers to know what to expect
- "learnings" was ambiguous

### After (Diátaxis Structure)
```
docs/
├── tutorials/           # Learning-oriented
│   ├── getting-started.md
│   └── first-audit.md
├── how-to/             # Task-oriented
│   └── nix-flakes.md
├── reference/          # Information-oriented
│   ├── configuration.md
│   ├── git-protocol.md
│   └── test-strategy.md
├── explanation/        # Understanding-oriented
│   ├── architecture.md
│   ├── inline-authorization.md
│   ├── comparison.md
│   └── decisions.md
└── archive/            # Historical
```

**Benefits:**
- ✅ Clear categorization by purpose
- ✅ Easy to know where to put new docs
- ✅ Readers know what to expect
- ✅ Follows industry best practice

---

## Migration Map

| Old Location | New Location | Category |
|-------------|-------------|----------|
| `GETTING_STARTED.md` | `tutorials/getting-started.md` | Tutorial |
| *(new)* | `tutorials/first-audit.md` | Tutorial |
| `learnings/nix-flakes.md` | `how-to/nix-flakes.md` | How-To |
| *(planned)* | `how-to/deploy.md` | How-To |
| `GIT_PROTOCOL.md` | `reference/git-protocol.md` | Reference |
| `TEST_STRATEGY.md` | `reference/test-strategy.md` | Reference |
| *(new)* | `reference/configuration.md` | Reference |
| `ARCHITECTURE.md` | `explanation/architecture.md` | Explanation |
| `DECISION_SUMMARY.md` | `explanation/decisions.md` | Explanation |
| `COMPARISON.md` | `explanation/comparison.md` | Explanation |
| *(new)* | `explanation/inline-authorization.md` | Explanation |
| `learnings/` | **DEPRECATED** | *(distributed)* |

---

## The Diátaxis Quadrants

```
                    PRACTICAL          THEORETICAL
                    ─────────          ───────────
                    
LEARNING      │   Tutorials    │    Explanation   │
              │                │                  │
              │  "Can you      │   "Why does      │
              │   teach me?"   │    this work?"   │
              │                │                  │
              ├────────────────┼──────────────────┤
              │                │                  │
WORKING       │  How-To        │    Reference     │
              │  Guides        │                  │
              │                │   "What is the   │
              │  "How do I?"   │    syntax?"      │
              │                │                  │
```

### When to Use Each Category

**Tutorials** (`docs/tutorials/`)
- ✅ Teaching beginners
- ✅ Step-by-step lessons
- ✅ Guaranteed outcomes
- ❓ "Can you teach me to use ngit-grasp?"
- 📝 Example: Getting Started

**How-To Guides** (`docs/how-to/`)
- ✅ Solving specific problems
- ✅ Practical recipes
- ✅ Assumes basic knowledge
- ❓ "How do I deploy ngit-grasp?"
- 📝 Example: Configure Nix Flakes

**Reference** (`docs/reference/`)
- ✅ Technical specifications
- ✅ Factual information
- ✅ Comprehensive details
- ❓ "What are all the config options?"
- 📝 Example: Configuration Reference

**Explanation** (`docs/explanation/`)
- ✅ Understanding concepts
- ✅ Design decisions
- ✅ Discussing alternatives
- ❓ "Why inline authorization?"
- 📝 Example: Architecture Overview

---

## New Documentation Created

### Tutorials
- ✅ `tutorials/getting-started.md` - Migrated and enhanced
- ✅ `tutorials/first-audit.md` - **NEW** - Learn grasp-audit

### How-To Guides
- ✅ `how-to/nix-flakes.md` - Migrated from learnings

### Reference
- ✅ `reference/configuration.md` - **NEW** - Complete config reference
- ✅ `reference/git-protocol.md` - Migrated
- ✅ `reference/test-strategy.md` - Migrated

### Explanation
- ✅ `explanation/inline-authorization.md` - **NEW** - Deep dive on key decision
- ✅ `explanation/architecture.md` - Migrated
- ✅ `explanation/comparison.md` - Migrated
- ✅ `explanation/decisions.md` - Migrated

### Category Indexes
- ✅ `tutorials/README.md` - Category guide
- ✅ `how-to/README.md` - Category guide
- ✅ `reference/README.md` - Category guide
- ✅ `explanation/README.md` - Category guide

### Navigation
- ✅ `docs/README.md` - Main navigation with Diátaxis diagram
- ✅ `learnings/README.md` - Deprecation notice

---

## Updated Files

### Project Documentation
- ✅ `AGENTS.md` - Updated with Diátaxis guidelines
- ✅ `README.md` - Updated links to new structure

### Moved Files
```bash
# Explanation
docs/ARCHITECTURE.md → docs/explanation/architecture.md
docs/COMPARISON.md → docs/explanation/comparison.md
docs/DECISION_SUMMARY.md → docs/explanation/decisions.md

# Reference
docs/GIT_PROTOCOL.md → docs/reference/git-protocol.md
docs/TEST_STRATEGY.md → docs/reference/test-strategy.md

# How-To
docs/learnings/nix-flakes.md → docs/how-to/nix-flakes.md
```

---

## For Content Authors

### Creating New Documentation

**Ask yourself:**

1. **"Can you teach me to...?"**
   - → Tutorial (`docs/tutorials/`)
   - Example: "Can you teach me to deploy ngit-grasp?"

2. **"How do I...?"**
   - → How-To (`docs/how-to/`)
   - Example: "How do I configure rate limiting?"

3. **"What is...?"**
   - → Reference (`docs/reference/`)
   - Example: "What is the NGIT_DOMAIN variable?"

4. **"Why...?"**
   - → Explanation (`docs/explanation/`)
   - Example: "Why use Rust instead of Go?"

### Quick Decision Tree

```
Is it teaching a beginner from scratch?
├─ YES → Tutorial
└─ NO
   └─ Is it solving a specific problem?
      ├─ YES → How-To
      └─ NO
         └─ Is it factual/technical information?
            ├─ YES → Reference
            └─ NO → Explanation
```

---

## For Readers

### Finding What You Need

**I'm brand new:**
1. Start with [README.md](README.md)
2. Follow [Getting Started Tutorial](docs/tutorials/getting-started.md)
3. Read [Architecture Explanation](docs/explanation/architecture.md)

**I have a specific problem:**
1. Check [How-To Guides](docs/how-to/)
2. Search for your problem
3. Follow the recipe

**I need technical details:**
1. Check [Reference](docs/reference/)
2. Use search or table of contents
3. Look up what you need

**I want to understand the design:**
1. Read [Explanation](docs/explanation/)
2. Start with [Architecture](docs/explanation/architecture.md)
3. Dive into specific decisions

---

## Benefits of Diátaxis

### For Authors
- ✅ Clear guidelines on where to put content
- ✅ Consistent structure across all docs
- ✅ Easy to know what style to use
- ✅ Less decision fatigue

### For Readers
- ✅ Know what to expect from each doc
- ✅ Easy to find what you need
- ✅ Can navigate by purpose
- ✅ Better learning experience

### For Maintainers
- ✅ Easier to review contributions
- ✅ Clearer documentation standards
- ✅ Less duplicate content
- ✅ Sustainable structure

---

## Compliance with AGENTS.md

Updated `AGENTS.md` to enforce Diátaxis:

- ✅ Documentation structure section updated
- ✅ File lifecycle includes Diátaxis categories
- ✅ "Before creating documents" includes Diátaxis questions
- ✅ Cleanup process updated
- ✅ `learnings/` marked as deprecated

**AI agents will now:**
- Ask Diátaxis questions before creating docs
- Place content in correct category
- Follow category-specific guidelines
- Maintain consistent structure

---

## Migration Checklist

- ✅ Create Diátaxis directory structure
- ✅ Migrate existing docs to appropriate categories
- ✅ Create new documentation (tutorials, how-to, reference)
- ✅ Create category README files
- ✅ Update main docs/README.md with Diátaxis diagram
- ✅ Update AGENTS.md with Diátaxis guidelines
- ✅ Mark learnings/ as deprecated
- ✅ Update project README.md links
- ✅ Create this migration document
- ✅ Test all internal links

---

## Next Steps

### Immediate
- ✅ Archive this document after review
- ✅ Update any broken links
- ✅ Commit all changes

### Short-term
- 🔜 Complete planned how-to guides (deploy, test-compliance)
- 🔜 Migrate remaining learnings content
- 🔜 Add more tutorials as features complete

### Long-term
- 🔜 Generate API reference from code
- 🔜 Add video tutorials
- 🔜 Create interactive examples
- 🔜 Translate to other languages

---

## Resources

- **[Diátaxis Framework](https://diataxis.fr/)** - Official documentation
- **[Diátaxis: How to use](https://diataxis.fr/how-to-use-diataxis/)** - Implementation guide
- **[Examples](https://diataxis.fr/examples/)** - Real-world examples

---

## Questions?

- Check [docs/README.md](docs/README.md) for navigation
- Read category README files for guidelines
- See [AGENTS.md](AGENTS.md) for contribution rules
- Open an issue if something is unclear

---

**Migration completed:** November 4, 2025  
**Migrated by:** AI Agent (Dork)  
**Framework:** [Diátaxis](https://diataxis.fr/)  
**Status:** ✅ Complete and enforced

---

*This document will be archived to `docs/archive/` after review.*