@damenor/agent-docs 0.1.1 → 0.4.0
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 +65 -29
- package/dist/index.js +3834 -217
- package/package.json +14 -11
- package/templates/modules/agents/.agents/agents/doc-designer.md +39 -37
- package/templates/modules/agents/.agents/agents/doc-maintainer.md +35 -35
- package/templates/modules/agents/.agents/agents/doc-reviewer.md +55 -46
- package/templates/modules/agents/.agents/agents/doc-writer.md +34 -33
- package/templates/modules/agents/.agents/agents/reviewer.md +114 -100
- package/templates/modules/agents/.agents/skills/doc-design/SKILL.md +176 -174
- package/templates/modules/agents/.agents/skills/doc-design/references/design-system-format.md +241 -247
- package/templates/modules/agents/.agents/skills/doc-maintain/SKILL.md +205 -195
- package/templates/modules/agents/.agents/skills/doc-maintain/references/triggers.md +171 -165
- package/templates/modules/agents/.agents/skills/doc-review/SKILL.md +245 -240
- package/templates/modules/agents/.agents/skills/doc-review/references/health-checklist.md +115 -112
- package/templates/modules/agents/.agents/skills/doc-scaffold/SKILL.md +164 -157
- package/templates/modules/agents/.agents/skills/doc-scaffold/references/diataxis-quick-ref.md +110 -110
- package/templates/modules/agents/.agents/skills/doc-write/SKILL.md +240 -212
- package/templates/modules/agents/.agents/skills/doc-write/references/adr-format.md +99 -93
- package/templates/modules/agents/.agents/skills/doc-write/references/diataxis-patterns.md +221 -200
- package/templates/base/AGENTS.md +0 -177
- package/templates/base/CHANGELOG.md +0 -86
- package/templates/base/README.md +0 -110
- package/templates/base/docs/CONTEXT.md +0 -111
- package/templates/base/docs/README.md +0 -131
- package/templates/base/docs/adr/TEMPLATE.md +0 -83
- package/templates/modules/design/docs/DESIGN.md +0 -253
- package/templates/modules/explanation/docs/explanation/agent-flow.md +0 -15
- package/templates/modules/explanation/docs/explanation/architecture.md +0 -138
- package/templates/modules/guides/docs/guides/deployment.md +0 -189
- package/templates/modules/guides/docs/guides/runbooks/TEMPLATE.md +0 -86
- package/templates/modules/guides/docs/guides/troubleshooting.md +0 -65
- package/templates/modules/operations/docs/operations/README.md +0 -115
- package/templates/modules/product/docs/product/overview.md +0 -90
- package/templates/modules/product/docs/roadmap.md +0 -80
- package/templates/modules/reference/docs/reference/api.md +0 -131
- package/templates/modules/reference/docs/reference/code-style.md +0 -275
- package/templates/modules/reference/docs/reference/configuration.md +0 -117
- package/templates/modules/reference/docs/reference/infrastructure.md +0 -191
- package/templates/modules/tutorials/docs/tutorials/environment-setup.md +0 -212
- package/templates/modules/tutorials/docs/tutorials/first-task.md +0 -246
- package/templates/modules/tutorials/docs/tutorials/quick-start.md +0 -146
|
@@ -1,386 +1,414 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: doc-write
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
TRIGGER:
|
|
9
|
-
"
|
|
10
|
-
|
|
4
|
+
Writes documentation following Diátaxis + ADR + CONTEXT conventions.
|
|
5
|
+
Classifies content by type before writing, generates ADRs when applicable,
|
|
6
|
+
and keeps CONTEXT.md updated. All content in English with technical
|
|
7
|
+
terms kept in English.
|
|
8
|
+
TRIGGER: When the user says "write doc", "document X", "create ADR",
|
|
9
|
+
"update CONTEXT", "new documentation", or any documentation file
|
|
10
|
+
needs to be created/updated.
|
|
11
11
|
license: Apache-2.0
|
|
12
12
|
metadata:
|
|
13
13
|
author: damenordev
|
|
14
|
-
version:
|
|
14
|
+
version: '1.0'
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
# doc-write
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## When to Use
|
|
20
20
|
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **Post-feature**:
|
|
21
|
+
- **Create new documentation**: Any doc file that needs to be generated
|
|
22
|
+
- **Update existing documentation**: Modify docs that are outdated
|
|
23
|
+
- **Write ADRs**: Document significant architectural decisions
|
|
24
|
+
- **Update CONTEXT.md**: Add domain terms that emerged
|
|
25
|
+
- **Update docs/README.md**: Reflect changes in the documentation map
|
|
26
|
+
- **Post-feature**: After implementing a feature that needs documentation
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Critical Patterns
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### RULE #1: Classify by Diátaxis BEFORE writing
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Always determine the type BEFORE starting to write:
|
|
33
33
|
|
|
34
34
|
```
|
|
35
|
-
1.
|
|
36
|
-
├──
|
|
37
|
-
├──
|
|
38
|
-
├──
|
|
39
|
-
└──
|
|
35
|
+
1. What does the reader need?
|
|
36
|
+
├── Learn something new → Tutorial
|
|
37
|
+
├── Solve a problem → How-to
|
|
38
|
+
├── Look up information → Reference
|
|
39
|
+
└── Understand the why → Explanation
|
|
40
40
|
|
|
41
|
-
2.
|
|
41
|
+
2. Is it an architectural decision? → ADR (check criteria)
|
|
42
42
|
|
|
43
|
-
3.
|
|
43
|
+
3. Is it a domain term? → CONTEXT.md
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### RULE #2: ADRs — Only when all 3 criteria are met
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
An ADR is written ONLY when ALL these conditions are true:
|
|
49
49
|
|
|
50
|
-
1. **
|
|
51
|
-
2. **
|
|
52
|
-
3. **
|
|
50
|
+
1. **Hard to reverse**: Changing this decision would have high cost (time, money, data)
|
|
51
|
+
2. **Surprising**: A newcomer would not expect this decision or would need context
|
|
52
|
+
3. **Real trade-off**: There are valid alternatives with genuine pros/cons
|
|
53
53
|
|
|
54
|
-
**
|
|
54
|
+
**If any criterion fails, it is NOT an ADR.**
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
See [ADR Format](references/adr-format.md) for full details.
|
|
57
57
|
|
|
58
|
-
###
|
|
58
|
+
### RULE #3: CONTEXT.md — Add terms when they emerge
|
|
59
59
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
60
|
+
- Add new terms when they appear in code or conversations
|
|
61
|
+
- Mark ambiguous terms with `⚠️ AMBIGUOUS`
|
|
62
|
+
- Show relationships between terms (`→`, `←→`, `part-of`)
|
|
63
|
+
- Do not repeat what is already in reference — only domain terms
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### RULE #4: Update docs/README.md when adding files
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
- Agregar nuevas entradas cuando se crean archivos
|
|
69
|
-
- Marcar como obsoletas las entradas de archivos eliminados
|
|
70
|
-
- Actualizar descripciones si el contenido cambió significativamente
|
|
67
|
+
The documentation map must always reflect reality:
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
- Add new entries when files are created
|
|
70
|
+
- Mark entries of deleted files as obsolete
|
|
71
|
+
- Update descriptions if content changed significantly
|
|
72
|
+
|
|
73
|
+
### RULE #5: YAML frontmatter required
|
|
73
74
|
|
|
74
75
|
```yaml
|
|
75
76
|
---
|
|
76
|
-
created:
|
|
77
|
-
updated:
|
|
77
|
+
created: '2026-05-07'
|
|
78
|
+
updated: '2026-05-07'
|
|
78
79
|
status: active | draft | stub | deprecated
|
|
79
80
|
type: tutorial | how-to | reference | explanation | adr | design | product
|
|
80
81
|
tags: [tag1, tag2, tag3]
|
|
81
82
|
---
|
|
82
83
|
```
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
No `owner`. Always include `updated` when modifying.
|
|
85
86
|
|
|
86
|
-
###
|
|
87
|
+
### RULE #6: DUAL audience — humans AND AI agents
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
- **Humanos**: Claridad, ejemplos, flujo lógico
|
|
90
|
-
- **Agentes IA**: Estructura consistente, términos definidos en CONTEXT.md, referencias cruzadas claras
|
|
89
|
+
Write for:
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
- **Humans**: Clarity, examples, logical flow
|
|
92
|
+
- **AI agents**: Consistent structure, terms defined in CONTEXT.md, clear cross-references
|
|
93
|
+
|
|
94
|
+
### RULE #7: Content in English
|
|
93
95
|
|
|
94
96
|
```
|
|
95
|
-
✅ "
|
|
96
|
-
✅ "
|
|
97
|
-
✅ "
|
|
97
|
+
✅ "To configure the authentication middleware..."
|
|
98
|
+
✅ "The endpoint /api/users returns an array of objects..."
|
|
99
|
+
✅ "The Button component accepts the `variant` prop..."
|
|
98
100
|
```
|
|
99
101
|
|
|
100
|
-
###
|
|
102
|
+
### RULE #8: NEVER create placeholder/TODO content
|
|
101
103
|
|
|
102
104
|
```
|
|
103
|
-
❌
|
|
104
|
-
❌
|
|
105
|
-
✅
|
|
105
|
+
❌ BAD: "TODO: add examples" — better NOT to create the file
|
|
106
|
+
❌ BAD: "Content pending writing" — better NOT to create the file
|
|
107
|
+
✅ GOOD: Write real and complete content, or do not create the file
|
|
106
108
|
```
|
|
107
109
|
|
|
108
|
-
##
|
|
110
|
+
## Guides by Type
|
|
109
111
|
|
|
110
112
|
### Tutorial
|
|
111
113
|
|
|
112
|
-
**
|
|
114
|
+
**Orientation**: Learning — the user learns by doing
|
|
115
|
+
|
|
116
|
+
**Structure**:
|
|
113
117
|
|
|
114
|
-
**Estructura**:
|
|
115
118
|
```markdown
|
|
116
119
|
---
|
|
117
|
-
created:
|
|
120
|
+
created: '...'
|
|
118
121
|
status: active
|
|
119
122
|
type: tutorial
|
|
120
123
|
tags: [...]
|
|
121
124
|
---
|
|
122
125
|
|
|
123
|
-
# [
|
|
126
|
+
# [Descriptive title of the learning goal]
|
|
127
|
+
|
|
128
|
+
## What you will build
|
|
129
|
+
|
|
130
|
+
[Description of the end result — 2-3 lines]
|
|
131
|
+
|
|
132
|
+
## Prerequisites
|
|
133
|
+
|
|
134
|
+
[Concrete list of what is needed before starting]
|
|
135
|
+
|
|
136
|
+
## Step 1: [Concrete action]
|
|
124
137
|
|
|
125
|
-
|
|
126
|
-
[Descripción del resultado final — 2-3 líneas]
|
|
138
|
+
[Instructions + code]
|
|
127
139
|
|
|
128
|
-
|
|
129
|
-
[Lista concreta de lo que se necesita antes de empezar]
|
|
140
|
+
### ✅ Verification
|
|
130
141
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[Cómo confirmar que el paso funcionó]
|
|
142
|
+
[How to confirm the step worked]
|
|
143
|
+
|
|
144
|
+
## Step 2: [Concrete action]
|
|
135
145
|
|
|
136
|
-
## Paso 2: [Acción concreta]
|
|
137
146
|
...
|
|
138
147
|
|
|
139
|
-
##
|
|
140
|
-
|
|
148
|
+
## Summary
|
|
149
|
+
|
|
150
|
+
[What was learned, what's next]
|
|
141
151
|
```
|
|
142
152
|
|
|
143
|
-
**
|
|
153
|
+
**Tone**: Didactic, patient. One concept at a time. Verify understanding at each step.
|
|
154
|
+
|
|
155
|
+
**Length**: 500-2000 words. If longer, split into sequential tutorials.
|
|
144
156
|
|
|
145
|
-
**
|
|
157
|
+
**Do not include**: Deep explanations of why (that is explanation), reference other docs.
|
|
146
158
|
|
|
147
|
-
|
|
159
|
+
### How-to (Practical guide)
|
|
148
160
|
|
|
149
|
-
|
|
161
|
+
**Orientation**: Solve a problem — the user already has prior knowledge
|
|
150
162
|
|
|
151
|
-
**
|
|
163
|
+
**Structure**:
|
|
152
164
|
|
|
153
|
-
**Estructura**:
|
|
154
165
|
```markdown
|
|
155
166
|
---
|
|
156
|
-
created:
|
|
167
|
+
created: '...'
|
|
157
168
|
status: active
|
|
158
169
|
type: how-to
|
|
159
170
|
tags: [...]
|
|
160
171
|
---
|
|
161
172
|
|
|
162
|
-
#
|
|
173
|
+
# How to [solve specific problem]
|
|
163
174
|
|
|
164
|
-
##
|
|
165
|
-
[1-2 líneas describiendo el escenario]
|
|
175
|
+
## When to use this
|
|
166
176
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
...
|
|
177
|
+
[1-2 lines describing the scenario]
|
|
178
|
+
|
|
179
|
+
## Steps
|
|
171
180
|
|
|
172
|
-
|
|
173
|
-
[
|
|
181
|
+
1. [Direct action with code]
|
|
182
|
+
2. [Direct action with code]
|
|
183
|
+
...
|
|
184
|
+
|
|
185
|
+
## Expected result
|
|
186
|
+
|
|
187
|
+
[What should be seen/working at the end]
|
|
174
188
|
```
|
|
175
189
|
|
|
176
|
-
**
|
|
190
|
+
**Tone**: Direct, no fluff. Assume the reader knows the system. Do not explain basic concepts.
|
|
177
191
|
|
|
178
|
-
**
|
|
192
|
+
**When to split**: If it has more than 10 steps or covers more than one problem, split into multiple how-tos.
|
|
179
193
|
|
|
180
|
-
###
|
|
194
|
+
### Reference
|
|
181
195
|
|
|
182
|
-
**
|
|
196
|
+
**Orientation**: Factual information — the user looks up a specific piece of data
|
|
197
|
+
|
|
198
|
+
**Structure**:
|
|
183
199
|
|
|
184
|
-
**Estructura**:
|
|
185
200
|
```markdown
|
|
186
201
|
---
|
|
187
|
-
created:
|
|
202
|
+
created: '...'
|
|
188
203
|
status: active
|
|
189
204
|
type: reference
|
|
190
205
|
tags: [...]
|
|
191
206
|
---
|
|
192
207
|
|
|
193
|
-
# [
|
|
208
|
+
# [Name of the API/system/interface]
|
|
209
|
+
|
|
210
|
+
## [Main section — endpoints, methods, props, etc.]
|
|
194
211
|
|
|
195
|
-
|
|
212
|
+
| Name | Type | Description | Default |
|
|
213
|
+
| ---- | ---- | ----------- | ------- |
|
|
214
|
+
| ... | ... | ... | ... |
|
|
196
215
|
|
|
197
|
-
|
|
198
|
-
|--------|------|-------------|---------|
|
|
199
|
-
| ... | ... | ... | ... |
|
|
216
|
+
## Examples
|
|
200
217
|
|
|
201
|
-
|
|
202
|
-
[Código mínimo por cada caso de uso principal]
|
|
218
|
+
[Minimal code for each main use case]
|
|
203
219
|
```
|
|
204
220
|
|
|
205
|
-
**
|
|
221
|
+
**Tone**: Neutral, factual, no narrative. Tables and lists over prose.
|
|
206
222
|
|
|
207
|
-
**
|
|
223
|
+
**What to include**: ALL parameters, ALL possible values, ALL edge cases.
|
|
208
224
|
|
|
209
|
-
**
|
|
225
|
+
**What NOT to include**: Explanations of why, usage tutorials, narrative.
|
|
210
226
|
|
|
211
|
-
###
|
|
227
|
+
### Explanation
|
|
212
228
|
|
|
213
|
-
**
|
|
229
|
+
**Orientation**: Understanding — the user wants to understand the why
|
|
230
|
+
|
|
231
|
+
**Structure**:
|
|
214
232
|
|
|
215
|
-
**Estructura**:
|
|
216
233
|
```markdown
|
|
217
234
|
---
|
|
218
|
-
created:
|
|
235
|
+
created: '...'
|
|
219
236
|
status: active
|
|
220
237
|
type: explanation
|
|
221
238
|
tags: [...]
|
|
222
239
|
---
|
|
223
240
|
|
|
224
|
-
# [
|
|
241
|
+
# [Topic being explained]
|
|
242
|
+
|
|
243
|
+
## Context
|
|
244
|
+
|
|
245
|
+
[Why this exists, what problem it solves]
|
|
246
|
+
|
|
247
|
+
## How it works
|
|
248
|
+
|
|
249
|
+
[Overview without going into code]
|
|
225
250
|
|
|
226
|
-
##
|
|
227
|
-
[Por qué existe esto, qué problema resuelve]
|
|
251
|
+
## Alternatives considered
|
|
228
252
|
|
|
229
|
-
|
|
230
|
-
[Vista general sin entrar en código]
|
|
253
|
+
[What other options existed and why this was chosen]
|
|
231
254
|
|
|
232
|
-
##
|
|
233
|
-
[Qué otras opciones existían y por qué se eligió esta]
|
|
255
|
+
## Implications
|
|
234
256
|
|
|
235
|
-
|
|
236
|
-
[Qué significa esta decisión para el futuro]
|
|
257
|
+
[What this decision means for the future]
|
|
237
258
|
```
|
|
238
259
|
|
|
239
|
-
**
|
|
260
|
+
**Tone**: Discursive, analytical. Connect to ADRs when applicable (`docs/adr/001-*.md`).
|
|
240
261
|
|
|
241
|
-
**
|
|
262
|
+
**When needed**: When an ADR needs more context than fits in the minimal format, or when a concept is referenced repeatedly in how-tos and tutorials.
|
|
242
263
|
|
|
243
|
-
##
|
|
264
|
+
## ADR Guides
|
|
244
265
|
|
|
245
|
-
###
|
|
266
|
+
### Strict criteria (all 3 must be met)
|
|
246
267
|
|
|
247
|
-
1. **
|
|
248
|
-
2. **
|
|
249
|
-
3. **
|
|
268
|
+
1. **Hard to reverse**: The change has high cost if reversed
|
|
269
|
+
2. **Surprising**: Someone new wouldn't expect it or would ask "why?"
|
|
270
|
+
3. **Real trade-off**: There are genuine alternatives with advantages and disadvantages
|
|
250
271
|
|
|
251
|
-
###
|
|
272
|
+
### What qualifies as an ADR
|
|
252
273
|
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
274
|
+
- Architecture shape (monolith vs microservices, layered vs hexagonal)
|
|
275
|
+
- Integration patterns (sync vs async, REST vs GraphQL vs gRPC)
|
|
276
|
+
- Technology lock-in (database, cloud provider, core library)
|
|
277
|
+
- Boundary decisions (what goes inside vs outside the service)
|
|
278
|
+
- Deliberate deviations (when a convention is broken on purpose)
|
|
279
|
+
- Invisible constraints (non-obvious limitations of the stack or domain)
|
|
259
280
|
|
|
260
|
-
###
|
|
281
|
+
### What does NOT qualify as an ADR
|
|
261
282
|
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
283
|
+
- Obvious choices (using Git, using testing)
|
|
284
|
+
- Easy to reverse (renaming a variable, moving a file)
|
|
285
|
+
- No real alternatives (no other reasonable option)
|
|
265
286
|
|
|
266
|
-
###
|
|
287
|
+
### Minimal ADR format
|
|
267
288
|
|
|
268
289
|
```markdown
|
|
269
290
|
---
|
|
270
|
-
created:
|
|
271
|
-
updated:
|
|
291
|
+
created: '2026-05-07'
|
|
292
|
+
updated: '2026-05-07'
|
|
272
293
|
status: proposed | accepted | deprecated | superseded
|
|
273
294
|
type: adr
|
|
274
|
-
tags: [
|
|
295
|
+
tags: [architecture, decision]
|
|
275
296
|
---
|
|
276
297
|
|
|
277
|
-
# ADR-001: [
|
|
298
|
+
# ADR-001: [Brief title of the decision]
|
|
278
299
|
|
|
279
|
-
[1-3
|
|
280
|
-
No
|
|
300
|
+
[1-3 sentences explaining the decision, the why, and the alternatives considered.
|
|
301
|
+
No more than one paragraph. If more context is needed, create a linked explanation/]
|
|
281
302
|
```
|
|
282
303
|
|
|
283
|
-
**
|
|
304
|
+
**Real example**:
|
|
284
305
|
|
|
285
306
|
```markdown
|
|
286
|
-
# ADR-002:
|
|
307
|
+
# ADR-002: Use PostgreSQL with Prisma ORM
|
|
287
308
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
TypeScript.
|
|
291
|
-
|
|
309
|
+
We chose PostgreSQL + Prisma as the data layer because the project needs
|
|
310
|
+
complex relationships between entities and Prisma provides type-safety in
|
|
311
|
+
TypeScript. MongoDB + Mongoose was considered (rejected due to frequent joins
|
|
312
|
+
needed) and raw SQL (rejected due to losing type-safety).
|
|
292
313
|
```
|
|
293
314
|
|
|
294
|
-
|
|
315
|
+
See [ADR Format](references/adr-format.md) for complete reference.
|
|
295
316
|
|
|
296
|
-
##
|
|
317
|
+
## Cross-References
|
|
297
318
|
|
|
298
|
-
|
|
319
|
+
Use wikilinks where helpful:
|
|
299
320
|
|
|
300
321
|
```markdown
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
322
|
+
See [[CONTEXT]] for domain term definitions.
|
|
323
|
+
Related to [[ADR-001-event-sourcing]].
|
|
324
|
+
For practical steps, see [[how-to/add-new-endpoint]].
|
|
304
325
|
```
|
|
305
326
|
|
|
306
|
-
##
|
|
327
|
+
## Writing Process
|
|
307
328
|
|
|
308
329
|
```
|
|
309
|
-
1.
|
|
310
|
-
2.
|
|
311
|
-
3.
|
|
312
|
-
4.
|
|
313
|
-
5.
|
|
314
|
-
6.
|
|
315
|
-
7.
|
|
316
|
-
8.
|
|
330
|
+
1. Identify WHAT needs to be documented
|
|
331
|
+
2. Classify by Diátaxis (tutorial/how-to/reference/explanation) or ADR
|
|
332
|
+
3. Verify a file for the same content does not already exist
|
|
333
|
+
4. Write with the format and tone corresponding to the type
|
|
334
|
+
5. Add YAML frontmatter
|
|
335
|
+
6. Update docs/README.md if it is a new file
|
|
336
|
+
7. Update docs/CONTEXT.md if there are new terms
|
|
337
|
+
8. Verify the content is real (no placeholders)
|
|
317
338
|
```
|
|
318
339
|
|
|
319
|
-
##
|
|
340
|
+
## Commands
|
|
320
341
|
|
|
321
|
-
###
|
|
342
|
+
### Pre-writing verification
|
|
322
343
|
|
|
323
344
|
```
|
|
324
|
-
1.
|
|
325
|
-
2.
|
|
326
|
-
3.
|
|
327
|
-
4.
|
|
345
|
+
1. Does a file for this content already exist? → Search in docs/README.md
|
|
346
|
+
2. Is the type correct? → Verify with Diátaxis decision tree
|
|
347
|
+
3. Are there new domain terms? → Prepare entry for CONTEXT.md
|
|
348
|
+
4. Does it need an ADR? → Check the 3 criteria
|
|
328
349
|
```
|
|
329
350
|
|
|
330
|
-
###
|
|
351
|
+
### Post-writing verification
|
|
331
352
|
|
|
332
353
|
```
|
|
333
|
-
1.
|
|
334
|
-
2.
|
|
335
|
-
3.
|
|
336
|
-
4.
|
|
337
|
-
5.
|
|
354
|
+
1. Does it have YAML frontmatter? → status, type, tags, created
|
|
355
|
+
2. Is it in the correct folder? → tutorials/, how-to/, reference/, explanation/, docs/adr/
|
|
356
|
+
3. Does docs/README.md reflect the new file? → Update map
|
|
357
|
+
4. Does CONTEXT.md have the new terms? → Add if applicable
|
|
358
|
+
5. Is the content real? → No TODO, no placeholder, no empty sections
|
|
338
359
|
```
|
|
339
360
|
|
|
340
|
-
##
|
|
361
|
+
## Real Examples by Type
|
|
341
362
|
|
|
342
|
-
### Tutorial —
|
|
363
|
+
### Tutorial — Output example
|
|
343
364
|
|
|
344
|
-
|
|
365
|
+
````markdown
|
|
345
366
|
---
|
|
346
|
-
created:
|
|
347
|
-
updated:
|
|
367
|
+
created: '2026-05-07'
|
|
368
|
+
updated: '2026-05-07'
|
|
348
369
|
status: active
|
|
349
370
|
type: tutorial
|
|
350
371
|
tags: [auth, jwt, onboarding]
|
|
351
372
|
---
|
|
352
373
|
|
|
353
|
-
#
|
|
374
|
+
# Implement JWT Authentication
|
|
375
|
+
|
|
376
|
+
## What you will build
|
|
377
|
+
|
|
378
|
+
A complete login/registration flow with JWT and refresh tokens.
|
|
354
379
|
|
|
355
|
-
##
|
|
356
|
-
Un flujo completo de login/registro con JWT y refresh tokens.
|
|
380
|
+
## Prerequisites
|
|
357
381
|
|
|
358
|
-
|
|
359
|
-
-
|
|
360
|
-
- Conocimiento básico de HTTP headers
|
|
382
|
+
- Project running locally (see [[tutorials/quick-start]])
|
|
383
|
+
- Basic knowledge of HTTP headers
|
|
361
384
|
|
|
362
|
-
##
|
|
385
|
+
## Step 1: Install dependencies
|
|
363
386
|
|
|
364
387
|
```bash
|
|
365
388
|
npm install jsonwebtoken bcryptjs
|
|
366
389
|
npm install -D @types/jsonwebtoken @types/bcryptjs
|
|
367
390
|
```
|
|
391
|
+
````
|
|
392
|
+
|
|
393
|
+
### ✅ Verification
|
|
368
394
|
|
|
369
|
-
### ✅ Verificación
|
|
370
395
|
```bash
|
|
371
396
|
npm ls jsonwebtoken
|
|
372
397
|
# → jsonwebtoken@9.0.2
|
|
373
398
|
```
|
|
374
399
|
|
|
375
|
-
##
|
|
376
|
-
...[pasos con código real]
|
|
400
|
+
## Step 2: Create the auth service
|
|
377
401
|
|
|
378
|
-
|
|
379
|
-
Aprendiste a implementar JWT con refresh tokens.
|
|
380
|
-
Siguiente: [[guides/how-to-protect-routes]]
|
|
381
|
-
```
|
|
402
|
+
...[steps with real code]
|
|
382
403
|
|
|
383
|
-
|
|
404
|
+
## Summary
|
|
405
|
+
|
|
406
|
+
You learned to implement JWT with refresh tokens.
|
|
407
|
+
Next: [[guides/how-to-protect-routes]]
|
|
408
|
+
|
|
409
|
+
````
|
|
410
|
+
|
|
411
|
+
### How-to — Output example
|
|
384
412
|
|
|
385
413
|
```markdown
|
|
386
414
|
---
|
|
@@ -391,24 +419,24 @@ type: how-to
|
|
|
391
419
|
tags: [deployment, vercel, production]
|
|
392
420
|
---
|
|
393
421
|
|
|
394
|
-
#
|
|
422
|
+
# How to deploy to production
|
|
395
423
|
|
|
396
|
-
##
|
|
397
|
-
|
|
424
|
+
## When to use this
|
|
425
|
+
When an approved feature in staging is ready for production.
|
|
398
426
|
|
|
399
|
-
##
|
|
400
|
-
1.
|
|
401
|
-
2.
|
|
402
|
-
3.
|
|
403
|
-
4. Vercel
|
|
404
|
-
5.
|
|
427
|
+
## Steps
|
|
428
|
+
1. Create PR from `develop` to `main`
|
|
429
|
+
2. Wait for CI to pass (lint + test + build)
|
|
430
|
+
3. Squash merge
|
|
431
|
+
4. Vercel auto-deploys from `main`
|
|
432
|
+
5. Verify at https://[domain]
|
|
405
433
|
|
|
406
434
|
## Rollback
|
|
407
|
-
|
|
408
|
-
|
|
435
|
+
If something fails: Vercel Dashboard → Deployments → "Promote to Production" on the previous deploy
|
|
436
|
+
````
|
|
409
437
|
|
|
410
|
-
##
|
|
438
|
+
## Resources
|
|
411
439
|
|
|
412
|
-
- [Diátaxis Patterns](references/diataxis-patterns.md) —
|
|
413
|
-
- [ADR Format](references/adr-format.md) —
|
|
414
|
-
-
|
|
440
|
+
- [Diátaxis Patterns](references/diataxis-patterns.md) — Detailed patterns by type with examples
|
|
441
|
+
- [ADR Format](references/adr-format.md) — Complete ADR format reference
|
|
442
|
+
- Related skills: `doc-scaffold` (initialize docs), `doc-review` (audit docs), `doc-maintain` (keep docs synced), `doc-design` (design system)
|