@damenor/agent-docs 0.1.2 → 0.4.1
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 +3848 -217
- package/package.json +5 -2
- 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 +61 -51
- package/templates/modules/agents/.agents/skills/doc-maintain/references/triggers.md +171 -165
- package/templates/modules/agents/.agents/skills/doc-review/SKILL.md +39 -34
- package/templates/modules/agents/.agents/skills/doc-review/references/health-checklist.md +115 -112
- package/templates/modules/agents/.agents/skills/doc-scaffold/SKILL.md +19 -12
- 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 +47 -18
- 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 -105
- 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
package/templates/modules/agents/.agents/skills/doc-scaffold/references/diataxis-quick-ref.md
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
1
|
---
|
|
2
|
-
created:
|
|
2
|
+
created: '2024-01-15'
|
|
3
3
|
status: active
|
|
4
4
|
type: reference
|
|
5
|
-
tags: [diataxis, framework,
|
|
5
|
+
tags: [diataxis, framework, documentation, reference]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# Diátaxis —
|
|
8
|
+
# Diátaxis — Quick Reference
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## The 4 Quadrants
|
|
11
11
|
|
|
12
|
-
Diátaxis
|
|
12
|
+
Diátaxis classifies documentation into 4 types along two axes:
|
|
13
13
|
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
14
|
+
- **Horizontal axis**: Study (learn) vs Work (apply)
|
|
15
|
+
- **Vertical axis**: Practical (action) vs Theoretical (knowledge)
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
│
|
|
18
|
+
│ Practical (action)
|
|
19
19
|
│
|
|
20
20
|
Tutorial │ How-to
|
|
21
|
-
(
|
|
22
|
-
|
|
21
|
+
(Learning │ (Applying
|
|
22
|
+
by doing) │ solutions)
|
|
23
23
|
│
|
|
24
24
|
────────────────────┼────────────────────
|
|
25
25
|
│
|
|
26
|
-
|
|
27
|
-
(
|
|
28
|
-
|
|
26
|
+
Explanation │ Reference
|
|
27
|
+
(Understanding │ (Looking up
|
|
28
|
+
why) │ information)
|
|
29
29
|
│
|
|
30
|
-
│
|
|
30
|
+
│ Theoretical (knowledge)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
### Tutorial
|
|
34
34
|
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
35
|
+
- **Orientation**: Learning
|
|
36
|
+
- **Purpose**: Guide the beginner step by step to acquire a skill
|
|
37
|
+
- **Tone**: Didactic, patient, encouraging
|
|
38
|
+
- **Example**: "Your first Express.js API" — the user learns while building
|
|
39
39
|
|
|
40
|
-
### How-to
|
|
40
|
+
### How-to
|
|
41
41
|
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
42
|
+
- **Orientation**: Practice
|
|
43
|
+
- **Purpose**: Solve a specific concrete problem
|
|
44
|
+
- **Tone**: Direct, assumes prior knowledge
|
|
45
|
+
- **Example**: "How to configure JWT authentication" — the user already knows Express, needs JWT
|
|
46
46
|
|
|
47
|
-
###
|
|
47
|
+
### Reference
|
|
48
48
|
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
49
|
+
- **Orientation**: Information
|
|
50
|
+
- **Purpose**: Describe the machinery in a factual and complete way
|
|
51
|
+
- **Tone**: Neutral, structured, no narrative
|
|
52
|
+
- **Example**: "API endpoints" — tables with methods, parameters, responses
|
|
53
53
|
|
|
54
|
-
###
|
|
54
|
+
### Explanation
|
|
55
55
|
|
|
56
|
-
- **
|
|
57
|
-
- **
|
|
58
|
-
- **
|
|
59
|
-
- **
|
|
56
|
+
- **Orientation**: Understanding
|
|
57
|
+
- **Purpose**: Clarify why, provide context, connect concepts
|
|
58
|
+
- **Tone**: Discursive, analytical
|
|
59
|
+
- **Example**: "Why we chose event-sourcing" — historical context, alternatives, trade-offs
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## When to Use Each Type
|
|
62
62
|
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
63
|
+
| Situation | Type | Folder |
|
|
64
|
+
| ------------------------------------ | ----------- | -------------- |
|
|
65
|
+
| New user wants to get started | Tutorial | `tutorials/` |
|
|
66
|
+
| User has a specific problem | How-to | `how-to/` |
|
|
67
|
+
| User needs to look up a detail | Reference | `reference/` |
|
|
68
|
+
| User asks "why?" | Explanation | `explanation/` |
|
|
69
|
+
| New dev onboarding | Tutorial | `tutorials/` |
|
|
70
|
+
| Configure something already known | How-to | `how-to/` |
|
|
71
|
+
| Look up function parameters | Reference | `reference/` |
|
|
72
|
+
| Understand an architectural decision | Explanation | `explanation/` |
|
|
73
73
|
|
|
74
|
-
##
|
|
74
|
+
## Decision Tree
|
|
75
75
|
|
|
76
76
|
```
|
|
77
|
-
|
|
78
|
-
├──
|
|
79
|
-
│ ├──
|
|
80
|
-
│ └── NO →
|
|
81
|
-
└── NO →
|
|
82
|
-
├──
|
|
83
|
-
│ ├──
|
|
84
|
-
│ └── NO →
|
|
85
|
-
└── NO →
|
|
86
|
-
├──
|
|
87
|
-
└── NO →
|
|
77
|
+
Does the reader need to learn something new from scratch?
|
|
78
|
+
├── YES → Is it best learned by doing?
|
|
79
|
+
│ ├── YES → TUTORIAL → tutorials/
|
|
80
|
+
│ └── NO → EXPLANATION → explanation/
|
|
81
|
+
└── NO → Do they need to solve a practical problem?
|
|
82
|
+
├── YES → Do they need concrete steps?
|
|
83
|
+
│ ├── YES → HOW-TO → how-to/
|
|
84
|
+
│ └── NO → EXPLANATION → explanation/
|
|
85
|
+
└── NO → Do they need specific information?
|
|
86
|
+
├── YES → REFERENCE → reference/
|
|
87
|
+
└── NO → Re-evaluate the need
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
##
|
|
90
|
+
## Examples by Type in Web Projects
|
|
91
91
|
|
|
92
92
|
### Tutorial (tutorials/)
|
|
93
93
|
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
| `quick-start.md`
|
|
97
|
-
| `first-component.md` |
|
|
98
|
-
| `database-setup.md`
|
|
99
|
-
| `deploy-guide.md`
|
|
94
|
+
| Title | What it teaches |
|
|
95
|
+
| -------------------- | --------------------------------------------- |
|
|
96
|
+
| `quick-start.md` | Create the first endpoint, launch the project |
|
|
97
|
+
| `first-component.md` | Create a React/Vue component from scratch |
|
|
98
|
+
| `database-setup.md` | Set up the database for the first time |
|
|
99
|
+
| `deploy-guide.md` | Make the first deployment step by step |
|
|
100
100
|
|
|
101
101
|
### How-to (how-to/)
|
|
102
102
|
|
|
103
|
-
|
|
|
104
|
-
|
|
105
|
-
| `add-auth.md`
|
|
106
|
-
| `custom-middleware.md` |
|
|
107
|
-
| `migrate-database.md`
|
|
108
|
-
| `configure-ci.md`
|
|
109
|
-
| `add-new-endpoint.md`
|
|
110
|
-
| `debug-connection.md`
|
|
111
|
-
|
|
112
|
-
###
|
|
113
|
-
|
|
114
|
-
|
|
|
115
|
-
|
|
116
|
-
| `api.md`
|
|
117
|
-
| `configuration.md` |
|
|
118
|
-
| `cli.md`
|
|
119
|
-
| `events.md`
|
|
120
|
-
| `errors.md`
|
|
121
|
-
|
|
122
|
-
###
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
126
|
-
| `architecture.md`
|
|
127
|
-
| `authentication-flow.md`
|
|
128
|
-
| `database-design.md`
|
|
129
|
-
| `caching-strategy.md`
|
|
130
|
-
| `adr/001-event-sourcing.md` |
|
|
131
|
-
|
|
132
|
-
##
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
| "
|
|
137
|
-
| "
|
|
138
|
-
| "
|
|
139
|
-
| "
|
|
140
|
-
| "
|
|
141
|
-
| "
|
|
142
|
-
| "
|
|
143
|
-
| "
|
|
144
|
-
|
|
145
|
-
##
|
|
146
|
-
|
|
147
|
-
**
|
|
148
|
-
|
|
149
|
-
|
|
103
|
+
| Title | What it solves |
|
|
104
|
+
| ---------------------- | ------------------------------------- |
|
|
105
|
+
| `add-auth.md` | Add authentication to an existing API |
|
|
106
|
+
| `custom-middleware.md` | Create custom middleware |
|
|
107
|
+
| `migrate-database.md` | Run a database migration |
|
|
108
|
+
| `configure-ci.md` | Set up CI/CD pipeline |
|
|
109
|
+
| `add-new-endpoint.md` | Add a new REST endpoint |
|
|
110
|
+
| `debug-connection.md` | Diagnose connection issues |
|
|
111
|
+
|
|
112
|
+
### Reference (reference/)
|
|
113
|
+
|
|
114
|
+
| Title | What it documents |
|
|
115
|
+
| ------------------ | ---------------------------------------------- |
|
|
116
|
+
| `api.md` | All endpoints: method, route, params, response |
|
|
117
|
+
| `configuration.md` | All configuration variables and their values |
|
|
118
|
+
| `cli.md` | All CLI commands with flags and examples |
|
|
119
|
+
| `events.md` | All system events with payload |
|
|
120
|
+
| `errors.md` | Error codes with meaning and resolution |
|
|
121
|
+
|
|
122
|
+
### Explanation (explanation/)
|
|
123
|
+
|
|
124
|
+
| Title | What it explains |
|
|
125
|
+
| --------------------------- | ------------------------------------ |
|
|
126
|
+
| `architecture.md` | Architecture overview and its layers |
|
|
127
|
+
| `authentication-flow.md` | How auth flow works end-to-end |
|
|
128
|
+
| `database-design.md` | Why the current schema was chosen |
|
|
129
|
+
| `caching-strategy.md` | Caching strategy and its trade-offs |
|
|
130
|
+
| `adr/001-event-sourcing.md` | Architectural decision with context |
|
|
131
|
+
|
|
132
|
+
## Quick Table: User Goal → Type → Location
|
|
133
|
+
|
|
134
|
+
| User goal | Doc type | Location |
|
|
135
|
+
| ----------------------------------------- | ----------- | ----------------- |
|
|
136
|
+
| "I want to learn how to use this" | Tutorial | `tutorials/` |
|
|
137
|
+
| "I want to do X specific thing" | How-to | `how-to/` |
|
|
138
|
+
| "I need to look up something" | Reference | `reference/` |
|
|
139
|
+
| "I want to understand why it's like this" | Explanation | `explanation/` |
|
|
140
|
+
| "How was the architecture decided?" | ADR | `docs/adr/` |
|
|
141
|
+
| "What does this term mean?" | CONTEXT | `docs/CONTEXT.md` |
|
|
142
|
+
| "What does the system look like?" | Design | `DESIGN.md` |
|
|
143
|
+
| "What changed in each version?" | Changelog | `CHANGELOG.md` |
|
|
144
|
+
|
|
145
|
+
## Golden Rule
|
|
146
|
+
|
|
147
|
+
**One document = One purpose = One Diátaxis type.**
|
|
148
|
+
|
|
149
|
+
If a document tries to be both a tutorial AND a reference at the same time, neither works well. Separate to improve.
|
|
@@ -3,7 +3,8 @@ name: doc-write
|
|
|
3
3
|
description: >
|
|
4
4
|
Writes documentation following Diátaxis + ADR + CONTEXT conventions.
|
|
5
5
|
Classifies content by type before writing, generates ADRs when applicable,
|
|
6
|
-
and keeps CONTEXT.md updated. All content in
|
|
6
|
+
and keeps CONTEXT.md updated. All content in the project's documentation language
|
|
7
|
+
(as defined in AGENTS.md § Stack and Conventions), with technical
|
|
7
8
|
terms kept in English.
|
|
8
9
|
TRIGGER: When the user says "write doc", "document X", "create ADR",
|
|
9
10
|
"update CONTEXT", "new documentation", or any documentation file
|
|
@@ -11,7 +12,7 @@ description: >
|
|
|
11
12
|
license: Apache-2.0
|
|
12
13
|
metadata:
|
|
13
14
|
author: damenordev
|
|
14
|
-
version:
|
|
15
|
+
version: '1.0'
|
|
15
16
|
---
|
|
16
17
|
|
|
17
18
|
# doc-write
|
|
@@ -65,6 +66,7 @@ See [ADR Format](references/adr-format.md) for full details.
|
|
|
65
66
|
### RULE #4: Update docs/README.md when adding files
|
|
66
67
|
|
|
67
68
|
The documentation map must always reflect reality:
|
|
69
|
+
|
|
68
70
|
- Add new entries when files are created
|
|
69
71
|
- Mark entries of deleted files as obsolete
|
|
70
72
|
- Update descriptions if content changed significantly
|
|
@@ -73,8 +75,8 @@ The documentation map must always reflect reality:
|
|
|
73
75
|
|
|
74
76
|
```yaml
|
|
75
77
|
---
|
|
76
|
-
created:
|
|
77
|
-
updated:
|
|
78
|
+
created: '2026-05-07'
|
|
79
|
+
updated: '2026-05-07'
|
|
78
80
|
status: active | draft | stub | deprecated
|
|
79
81
|
type: tutorial | how-to | reference | explanation | adr | design | product
|
|
80
82
|
tags: [tag1, tag2, tag3]
|
|
@@ -86,10 +88,11 @@ No `owner`. Always include `updated` when modifying.
|
|
|
86
88
|
### RULE #6: DUAL audience — humans AND AI agents
|
|
87
89
|
|
|
88
90
|
Write for:
|
|
91
|
+
|
|
89
92
|
- **Humans**: Clarity, examples, logical flow
|
|
90
93
|
- **AI agents**: Consistent structure, terms defined in CONTEXT.md, clear cross-references
|
|
91
94
|
|
|
92
|
-
### RULE #7: Content in
|
|
95
|
+
### RULE #7: Content in the project's documentation language
|
|
93
96
|
|
|
94
97
|
```
|
|
95
98
|
✅ "To configure the authentication middleware..."
|
|
@@ -112,9 +115,10 @@ Write for:
|
|
|
112
115
|
**Orientation**: Learning — the user learns by doing
|
|
113
116
|
|
|
114
117
|
**Structure**:
|
|
118
|
+
|
|
115
119
|
```markdown
|
|
116
120
|
---
|
|
117
|
-
created:
|
|
121
|
+
created: '...'
|
|
118
122
|
status: active
|
|
119
123
|
type: tutorial
|
|
120
124
|
tags: [...]
|
|
@@ -123,20 +127,27 @@ tags: [...]
|
|
|
123
127
|
# [Descriptive title of the learning goal]
|
|
124
128
|
|
|
125
129
|
## What you will build
|
|
130
|
+
|
|
126
131
|
[Description of the end result — 2-3 lines]
|
|
127
132
|
|
|
128
133
|
## Prerequisites
|
|
134
|
+
|
|
129
135
|
[Concrete list of what is needed before starting]
|
|
130
136
|
|
|
131
137
|
## Step 1: [Concrete action]
|
|
138
|
+
|
|
132
139
|
[Instructions + code]
|
|
140
|
+
|
|
133
141
|
### ✅ Verification
|
|
142
|
+
|
|
134
143
|
[How to confirm the step worked]
|
|
135
144
|
|
|
136
145
|
## Step 2: [Concrete action]
|
|
146
|
+
|
|
137
147
|
...
|
|
138
148
|
|
|
139
149
|
## Summary
|
|
150
|
+
|
|
140
151
|
[What was learned, what's next]
|
|
141
152
|
```
|
|
142
153
|
|
|
@@ -151,9 +162,10 @@ tags: [...]
|
|
|
151
162
|
**Orientation**: Solve a problem — the user already has prior knowledge
|
|
152
163
|
|
|
153
164
|
**Structure**:
|
|
165
|
+
|
|
154
166
|
```markdown
|
|
155
167
|
---
|
|
156
|
-
created:
|
|
168
|
+
created: '...'
|
|
157
169
|
status: active
|
|
158
170
|
type: how-to
|
|
159
171
|
tags: [...]
|
|
@@ -162,14 +174,17 @@ tags: [...]
|
|
|
162
174
|
# How to [solve specific problem]
|
|
163
175
|
|
|
164
176
|
## When to use this
|
|
177
|
+
|
|
165
178
|
[1-2 lines describing the scenario]
|
|
166
179
|
|
|
167
180
|
## Steps
|
|
181
|
+
|
|
168
182
|
1. [Direct action with code]
|
|
169
183
|
2. [Direct action with code]
|
|
170
|
-
...
|
|
184
|
+
...
|
|
171
185
|
|
|
172
186
|
## Expected result
|
|
187
|
+
|
|
173
188
|
[What should be seen/working at the end]
|
|
174
189
|
```
|
|
175
190
|
|
|
@@ -182,9 +197,10 @@ tags: [...]
|
|
|
182
197
|
**Orientation**: Factual information — the user looks up a specific piece of data
|
|
183
198
|
|
|
184
199
|
**Structure**:
|
|
200
|
+
|
|
185
201
|
```markdown
|
|
186
202
|
---
|
|
187
|
-
created:
|
|
203
|
+
created: '...'
|
|
188
204
|
status: active
|
|
189
205
|
type: reference
|
|
190
206
|
tags: [...]
|
|
@@ -195,10 +211,11 @@ tags: [...]
|
|
|
195
211
|
## [Main section — endpoints, methods, props, etc.]
|
|
196
212
|
|
|
197
213
|
| Name | Type | Description | Default |
|
|
198
|
-
|
|
214
|
+
| ---- | ---- | ----------- | ------- |
|
|
199
215
|
| ... | ... | ... | ... |
|
|
200
216
|
|
|
201
217
|
## Examples
|
|
218
|
+
|
|
202
219
|
[Minimal code for each main use case]
|
|
203
220
|
```
|
|
204
221
|
|
|
@@ -213,9 +230,10 @@ tags: [...]
|
|
|
213
230
|
**Orientation**: Understanding — the user wants to understand the why
|
|
214
231
|
|
|
215
232
|
**Structure**:
|
|
233
|
+
|
|
216
234
|
```markdown
|
|
217
235
|
---
|
|
218
|
-
created:
|
|
236
|
+
created: '...'
|
|
219
237
|
status: active
|
|
220
238
|
type: explanation
|
|
221
239
|
tags: [...]
|
|
@@ -224,15 +242,19 @@ tags: [...]
|
|
|
224
242
|
# [Topic being explained]
|
|
225
243
|
|
|
226
244
|
## Context
|
|
245
|
+
|
|
227
246
|
[Why this exists, what problem it solves]
|
|
228
247
|
|
|
229
248
|
## How it works
|
|
249
|
+
|
|
230
250
|
[Overview without going into code]
|
|
231
251
|
|
|
232
252
|
## Alternatives considered
|
|
253
|
+
|
|
233
254
|
[What other options existed and why this was chosen]
|
|
234
255
|
|
|
235
256
|
## Implications
|
|
257
|
+
|
|
236
258
|
[What this decision means for the future]
|
|
237
259
|
```
|
|
238
260
|
|
|
@@ -267,8 +289,8 @@ tags: [...]
|
|
|
267
289
|
|
|
268
290
|
```markdown
|
|
269
291
|
---
|
|
270
|
-
created:
|
|
271
|
-
updated:
|
|
292
|
+
created: '2026-05-07'
|
|
293
|
+
updated: '2026-05-07'
|
|
272
294
|
status: proposed | accepted | deprecated | superseded
|
|
273
295
|
type: adr
|
|
274
296
|
tags: [architecture, decision]
|
|
@@ -341,10 +363,10 @@ For practical steps, see [[how-to/add-new-endpoint]].
|
|
|
341
363
|
|
|
342
364
|
### Tutorial — Output example
|
|
343
365
|
|
|
344
|
-
|
|
366
|
+
````markdown
|
|
345
367
|
---
|
|
346
|
-
created:
|
|
347
|
-
updated:
|
|
368
|
+
created: '2026-05-07'
|
|
369
|
+
updated: '2026-05-07'
|
|
348
370
|
status: active
|
|
349
371
|
type: tutorial
|
|
350
372
|
tags: [auth, jwt, onboarding]
|
|
@@ -353,9 +375,11 @@ tags: [auth, jwt, onboarding]
|
|
|
353
375
|
# Implement JWT Authentication
|
|
354
376
|
|
|
355
377
|
## What you will build
|
|
378
|
+
|
|
356
379
|
A complete login/registration flow with JWT and refresh tokens.
|
|
357
380
|
|
|
358
381
|
## Prerequisites
|
|
382
|
+
|
|
359
383
|
- Project running locally (see [[tutorials/quick-start]])
|
|
360
384
|
- Basic knowledge of HTTP headers
|
|
361
385
|
|
|
@@ -365,20 +389,25 @@ A complete login/registration flow with JWT and refresh tokens.
|
|
|
365
389
|
npm install jsonwebtoken bcryptjs
|
|
366
390
|
npm install -D @types/jsonwebtoken @types/bcryptjs
|
|
367
391
|
```
|
|
392
|
+
````
|
|
368
393
|
|
|
369
394
|
### ✅ Verification
|
|
395
|
+
|
|
370
396
|
```bash
|
|
371
397
|
npm ls jsonwebtoken
|
|
372
398
|
# → jsonwebtoken@9.0.2
|
|
373
399
|
```
|
|
374
400
|
|
|
375
401
|
## Step 2: Create the auth service
|
|
402
|
+
|
|
376
403
|
...[steps with real code]
|
|
377
404
|
|
|
378
405
|
## Summary
|
|
406
|
+
|
|
379
407
|
You learned to implement JWT with refresh tokens.
|
|
380
408
|
Next: [[guides/how-to-protect-routes]]
|
|
381
|
-
|
|
409
|
+
|
|
410
|
+
````
|
|
382
411
|
|
|
383
412
|
### How-to — Output example
|
|
384
413
|
|
|
@@ -405,7 +434,7 @@ When an approved feature in staging is ready for production.
|
|
|
405
434
|
|
|
406
435
|
## Rollback
|
|
407
436
|
If something fails: Vercel Dashboard → Deployments → "Promote to Production" on the previous deploy
|
|
408
|
-
|
|
437
|
+
````
|
|
409
438
|
|
|
410
439
|
## Resources
|
|
411
440
|
|