@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,228 +1,235 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: doc-scaffold
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
TRIGGER:
|
|
8
|
-
"
|
|
4
|
+
Initializes complete documentation for a new or existing project.
|
|
5
|
+
Detects the tech stack, creates essential file structure, and generates
|
|
6
|
+
initial documentation with real content based on code analysis.
|
|
7
|
+
TRIGGER: When the user says "initialize docs", "new project", "scaffold docs",
|
|
8
|
+
"create documentation", "setup docs", or a project without documentation is detected.
|
|
9
9
|
license: Apache-2.0
|
|
10
10
|
metadata:
|
|
11
11
|
author: damenordev
|
|
12
|
-
version:
|
|
12
|
+
version: '1.0'
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
# doc-scaffold
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## When to Use
|
|
18
18
|
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **Post-setup**:
|
|
19
|
+
- **New project**: A project is created from scratch and needs initial documentation
|
|
20
|
+
- **Existing project without docs**: A project with code but lacking structured documentation is detected
|
|
21
|
+
- **Docs migration**: Existing documentation is reorganized toward the Diátaxis + ADR structure
|
|
22
|
+
- **Post-setup**: After initializing a repository, before starting to develop features
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Critical Patterns
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### RULE #1: NEVER create empty folders
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Only create files with real, verifiable content. If there is no content for a file, do not create it.
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
❌
|
|
32
|
-
✅
|
|
31
|
+
❌ BAD: mkdir docs/api/ # empty folder
|
|
32
|
+
✅ GOOD: Create docs/api/endpoints.md ONLY when there are documentable endpoints
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### RULE #2: Detect before creating
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Always analyze the project BEFORE generating documentation:
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
39
|
+
- Detect language: `package.json` → Node, `requirements.txt` → Python, `go.mod` → Go, `Cargo.toml` → Rust, `pom.xml` → Java
|
|
40
|
+
- Detect framework: imports in main code, dependencies
|
|
41
|
+
- Check existing docs: DO NOT overwrite existing documentation without asking
|
|
42
|
+
- Identify domain terms: search in code, module names, key variables
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### RULE #3: Essential files only
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Create ONLY these files with real content:
|
|
47
47
|
|
|
48
|
-
|
|
|
49
|
-
|
|
50
|
-
| `README.md`
|
|
51
|
-
| `CHANGELOG.md`
|
|
52
|
-
| `AGENTS.md`
|
|
53
|
-
| `docs/README.md`
|
|
54
|
-
| `docs/CONTEXT.md`
|
|
55
|
-
| `docs/adr/TEMPLATE.md`
|
|
56
|
-
| `docs/adr/001-*.md`
|
|
57
|
-
| `tutorials/quick-start.md` |
|
|
48
|
+
| File | Purpose | When to create |
|
|
49
|
+
| -------------------------- | -------------------------------- | -------------------------------------- |
|
|
50
|
+
| `README.md` | Project entry point | Always |
|
|
51
|
+
| `CHANGELOG.md` | Version history | Always (with initial entry) |
|
|
52
|
+
| `AGENTS.md` | Protocol for AI agents | Always |
|
|
53
|
+
| `docs/README.md` | Documentation map + growth rules | Always |
|
|
54
|
+
| `docs/CONTEXT.md` | Domain terms found in code | Always |
|
|
55
|
+
| `docs/adr/TEMPLATE.md` | Template for ADRs | Always |
|
|
56
|
+
| `docs/adr/001-*.md` | First ADR if applicable | When there are architectural decisions |
|
|
57
|
+
| `tutorials/quick-start.md` | Quick start tutorial | Always |
|
|
58
58
|
|
|
59
|
-
###
|
|
59
|
+
### RULE #4: CONTEXT.md is generated by analyzing code
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Do not invent terms. Extract from code:
|
|
62
62
|
|
|
63
|
-
1.
|
|
64
|
-
2.
|
|
65
|
-
3.
|
|
66
|
-
4.
|
|
63
|
+
1. Search for module names, classes, main functions
|
|
64
|
+
2. Identify abbreviations and their meaning
|
|
65
|
+
3. Map relationships between components
|
|
66
|
+
4. Detect ambiguous terms and document them
|
|
67
67
|
|
|
68
|
-
###
|
|
68
|
+
### RULE #5: YAML frontmatter required
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Every documentation file must include frontmatter:
|
|
71
71
|
|
|
72
72
|
```yaml
|
|
73
73
|
---
|
|
74
|
-
created:
|
|
74
|
+
created: '2024-01-15'
|
|
75
75
|
status: active
|
|
76
76
|
type: tutorial | how-to | reference | explanation
|
|
77
77
|
tags: [tag1, tag2]
|
|
78
78
|
---
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
###
|
|
81
|
+
### RULE #6: Growth manifest in docs/README.md
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Include explicit rules for when and how to add new documentation.
|
|
84
84
|
|
|
85
|
-
##
|
|
85
|
+
## Process Flow
|
|
86
86
|
|
|
87
|
-
###
|
|
87
|
+
### Step 1: Detect stack
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
Use the auto-detection table from `AGENTS.md` § Stack. Additionally, analyze:
|
|
90
90
|
|
|
91
91
|
```
|
|
92
|
-
|
|
93
|
-
├──
|
|
94
|
-
├── Framework (imports,
|
|
95
|
-
├──
|
|
96
|
-
├──
|
|
97
|
-
└──
|
|
92
|
+
Analyze:
|
|
93
|
+
├── Primary language (package.json, go.mod, requirements.txt, Cargo.toml, pom.xml)
|
|
94
|
+
├── Framework (imports, dependencies, config files)
|
|
95
|
+
├── Existing folder structure
|
|
96
|
+
├── Build/test tools (detect ecosystem commands)
|
|
97
|
+
└── Existing docs (DO NOT overwrite)
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
###
|
|
100
|
+
### Step 2: Verify existing documentation
|
|
101
101
|
|
|
102
102
|
```
|
|
103
|
-
|
|
104
|
-
├──
|
|
105
|
-
├──
|
|
106
|
-
├──
|
|
107
|
-
├──
|
|
108
|
-
└──
|
|
103
|
+
Check:
|
|
104
|
+
├── Does README.md exist? → DO NOT overwrite, suggest improvements
|
|
105
|
+
├── Does CHANGELOG.md exist? → DO NOT overwrite
|
|
106
|
+
├── Does docs/ exist? → Integrate, do not replace
|
|
107
|
+
├── Do ADRs exist? → Preserve numbering
|
|
108
|
+
└── Does AGENTS.md exist? → Preserve, suggest additions
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
###
|
|
111
|
+
### Step 3: Create AGENTS.md with protocol
|
|
112
112
|
|
|
113
113
|
```markdown
|
|
114
|
-
# AGENTS.md —
|
|
115
|
-
|
|
116
|
-
##
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
# AGENTS.md — Documentation Protocol
|
|
115
|
+
|
|
116
|
+
## Before starting a task
|
|
117
|
+
|
|
118
|
+
1. Read docs/CONTEXT.md to understand the domain
|
|
119
|
+
2. Read docs/README.md to navigate the documentation
|
|
120
|
+
3. Review relevant ADRs in docs/adr/
|
|
121
|
+
|
|
122
|
+
## After completing a task
|
|
123
|
+
|
|
124
|
+
1. Update CONTEXT.md if new terms emerged
|
|
125
|
+
2. Update docs/README.md if files were added/removed
|
|
126
|
+
3. Evaluate if an ADR is needed (is it hard to reverse? is it surprising? is there a trade-off?)
|
|
127
|
+
4. Pass the protocol to the subagent if work is delegated
|
|
128
|
+
|
|
129
|
+
## When delegating work
|
|
130
|
+
|
|
131
|
+
1. Include this protocol in the subagent's prompt
|
|
132
|
+
2. Specify which doc files to update
|
|
133
|
+
3. Verify the subagent followed the protocol
|
|
131
134
|
```
|
|
132
135
|
|
|
133
|
-
###
|
|
136
|
+
### Step 4: Create docs/README.md
|
|
137
|
+
|
|
138
|
+
Include:
|
|
139
|
+
|
|
140
|
+
- Complete map of documentation files (generated, not placeholder)
|
|
141
|
+
- Growth rules: when to add each type of doc
|
|
142
|
+
- Naming conventions
|
|
143
|
+
- Links to related skills: `doc-write`, `doc-review`, `doc-maintain`
|
|
144
|
+
|
|
145
|
+
### Step 5: Create docs/CONTEXT.md
|
|
146
|
+
|
|
147
|
+
Generate with real domain terms detected in the code:
|
|
134
148
|
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
- Enlaces a skills relacionados: `doc-write`, `doc-review`, `doc-maintain`
|
|
149
|
+
- Table of terms with definitions
|
|
150
|
+
- Relationships between terms
|
|
151
|
+
- Flagged ambiguous terms
|
|
152
|
+
- Source: source code analysis
|
|
140
153
|
|
|
141
|
-
###
|
|
154
|
+
### Step 6: Create docs/adr/TEMPLATE.md + first ADR
|
|
142
155
|
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
- Relaciones entre términos
|
|
146
|
-
- Términos ambiguos señalados
|
|
147
|
-
- Origen: análisis del código fuente
|
|
156
|
+
- TEMPLATE.md: reusable template
|
|
157
|
+
- First ADR: only if an architectural decision already exists that meets the 3 criteria (hard to reverse, surprising, real trade-off)
|
|
148
158
|
|
|
149
|
-
###
|
|
159
|
+
### Step 7: Create tutorials/quick-start.md
|
|
150
160
|
|
|
151
|
-
|
|
152
|
-
- Primer ADR: solo si ya existe una decisión arquitectónica que cumpla los 3 criterios (difícil de revertir, sorprendente, trade-off real)
|
|
161
|
+
Based on the detected stack:
|
|
153
162
|
|
|
154
|
-
|
|
163
|
+
- Stack-specific prerequisites
|
|
164
|
+
- Real installation steps
|
|
165
|
+
- First runnable example
|
|
166
|
+
- Verification at each step
|
|
155
167
|
|
|
156
|
-
|
|
157
|
-
- Prerequisitos específicos del stack
|
|
158
|
-
- Pasos de instalación reales
|
|
159
|
-
- Primer ejemplo ejecutable
|
|
160
|
-
- Verificación en cada paso
|
|
168
|
+
### Step 8: Create essential reference files
|
|
161
169
|
|
|
162
|
-
|
|
170
|
+
Only those applicable to the detected stack:
|
|
163
171
|
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
- Si hay CLI: `reference/cli.md`
|
|
172
|
+
- If there is an API: `reference/api.md`
|
|
173
|
+
- If there is configuration: `reference/configuration.md`
|
|
174
|
+
- If there is a CLI: `reference/cli.md`
|
|
168
175
|
|
|
169
|
-
###
|
|
176
|
+
### Step 9: Report results
|
|
170
177
|
|
|
171
178
|
```
|
|
172
|
-
✅
|
|
179
|
+
✅ Created:
|
|
173
180
|
- README.md (entry point)
|
|
174
|
-
- CHANGELOG.md (
|
|
175
|
-
- AGENTS.md (
|
|
176
|
-
- docs/README.md (
|
|
177
|
-
- docs/CONTEXT.md (X
|
|
181
|
+
- CHANGELOG.md (initialized)
|
|
182
|
+
- AGENTS.md (protocol)
|
|
183
|
+
- docs/README.md (map + rules)
|
|
184
|
+
- docs/CONTEXT.md (X domain terms)
|
|
178
185
|
- docs/adr/TEMPLATE.md
|
|
179
|
-
- tutorials/quick-start.md (
|
|
186
|
+
- tutorials/quick-start.md (based on {stack})
|
|
180
187
|
|
|
181
|
-
⏭️
|
|
182
|
-
- docs/adr/001-*.md (
|
|
183
|
-
- reference/api.md (
|
|
184
|
-
- how-to/ (
|
|
188
|
+
⏭️ Pending (add when there is content):
|
|
189
|
+
- docs/adr/001-*.md (when there is an architectural decision)
|
|
190
|
+
- reference/api.md (when there are documentable endpoints)
|
|
191
|
+
- how-to/ (when repeatable problems arise)
|
|
185
192
|
```
|
|
186
193
|
|
|
187
|
-
##
|
|
194
|
+
## Commands
|
|
188
195
|
|
|
189
|
-
###
|
|
196
|
+
### Files to create (in order)
|
|
190
197
|
|
|
191
198
|
```bash
|
|
192
|
-
#
|
|
199
|
+
# Root files
|
|
193
200
|
README.md
|
|
194
201
|
CHANGELOG.md
|
|
195
202
|
AGENTS.md
|
|
196
203
|
|
|
197
|
-
#
|
|
204
|
+
# docs/ structure
|
|
198
205
|
docs/README.md
|
|
199
206
|
docs/CONTEXT.md
|
|
200
207
|
docs/adr/TEMPLATE.md
|
|
201
208
|
|
|
202
|
-
#
|
|
209
|
+
# Tutorials
|
|
203
210
|
tutorials/quick-start.md
|
|
204
211
|
|
|
205
|
-
#
|
|
206
|
-
reference/api.md #
|
|
207
|
-
reference/configuration.md #
|
|
212
|
+
# Reference (only if applicable)
|
|
213
|
+
reference/api.md # Only if there is an API
|
|
214
|
+
reference/configuration.md # Only if there is config
|
|
208
215
|
```
|
|
209
216
|
|
|
210
|
-
###
|
|
217
|
+
### Post-creation verification
|
|
211
218
|
|
|
212
219
|
```
|
|
213
|
-
1.
|
|
214
|
-
2.
|
|
215
|
-
3.
|
|
216
|
-
4.
|
|
217
|
-
5.
|
|
220
|
+
1. Verify that EVERY file has real content (no placeholders)
|
|
221
|
+
2. Verify that EVERY file has YAML frontmatter
|
|
222
|
+
3. Verify that CONTEXT.md contains real terms from the code
|
|
223
|
+
4. Verify that quick-start.md is runnable for the detected stack
|
|
224
|
+
5. Verify that docs/README.md maps all created files
|
|
218
225
|
```
|
|
219
226
|
|
|
220
|
-
##
|
|
227
|
+
## Concrete Example
|
|
221
228
|
|
|
222
|
-
### Input:
|
|
229
|
+
### Input: React + Express project detected
|
|
223
230
|
|
|
224
231
|
```
|
|
225
|
-
|
|
232
|
+
Detection:
|
|
226
233
|
├── package.json → Node.js, React 18, Express 4
|
|
227
234
|
├── tsconfig.json → TypeScript 5
|
|
228
235
|
├── tailwind.config.ts → Tailwind CSS
|
|
@@ -230,48 +237,48 @@ Detección:
|
|
|
230
237
|
└── .github/workflows/ci.yml → {{TECH_STACK}} CI/CD
|
|
231
238
|
```
|
|
232
239
|
|
|
233
|
-
### Output:
|
|
240
|
+
### Output: Created files
|
|
234
241
|
|
|
235
242
|
```
|
|
236
243
|
✅ README.md
|
|
237
|
-
- "
|
|
238
|
-
- Stack table
|
|
244
|
+
- "Web platform built with React 18 and Express 4"
|
|
245
|
+
- Stack table with React, Express, PostgreSQL, {{TECH_STACK}}
|
|
239
246
|
- Commands: npm run dev, npm run build, npm run test, npm run lint
|
|
240
247
|
|
|
241
248
|
✅ CHANGELOG.md
|
|
242
|
-
-
|
|
249
|
+
- Initial entry: "## [0.1.0] - 2026-05-07 / ### Added / - Initial release"
|
|
243
250
|
|
|
244
251
|
✅ AGENTS.md
|
|
245
252
|
- Stack: React 18, Express 4, PostgreSQL, Prisma, Tailwind, {{TECH_STACK}}
|
|
246
253
|
- Commands: npm run dev/build/test/lint/typecheck
|
|
247
|
-
-
|
|
254
|
+
- Complete protocol (before/after/delegate)
|
|
248
255
|
|
|
249
256
|
✅ docs/README.md
|
|
250
|
-
-
|
|
251
|
-
- Growth rules: "
|
|
252
|
-
-
|
|
257
|
+
- Map with 8 created files
|
|
258
|
+
- Growth rules: "Create reference/api.md when there are 5+ endpoints"
|
|
259
|
+
- Diátaxis table: tutorials/ ✅, guides/ ⏭️, reference/ ⏭️, explanation/ ⏭️
|
|
253
260
|
|
|
254
261
|
✅ docs/CONTEXT.md
|
|
255
|
-
- 6
|
|
256
|
-
-
|
|
257
|
-
- ⚠️
|
|
262
|
+
- 6 terms extracted: User, Session, Workspace, Role, Permission, Token
|
|
263
|
+
- Relationships: User → Session, User ← Role ← Permission
|
|
264
|
+
- ⚠️ AMBIGUOUS: "workspace" (could be team or project)
|
|
258
265
|
|
|
259
266
|
✅ docs/adr/TEMPLATE.md
|
|
260
|
-
-
|
|
267
|
+
- Minimal format ready to use
|
|
261
268
|
|
|
262
269
|
✅ docs/tutorials/quick-start.md
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
|
|
267
|
-
⏭️
|
|
268
|
-
- docs/adr/0001-*.md →
|
|
269
|
-
- docs/DESIGN.md →
|
|
270
|
-
- docs/reference/api.md →
|
|
271
|
-
- docs/guides/deployment.md →
|
|
270
|
+
- Prerequisites: Node 20+, {{TECH_STACK}}, npm
|
|
271
|
+
- Steps: clone → npm install → cp .env.example .env → npx prisma migrate dev → npm run dev
|
|
272
|
+
- Verification: "Open http://localhost:3000 — you should see the landing"
|
|
273
|
+
|
|
274
|
+
⏭️ Pending (lazy):
|
|
275
|
+
- docs/adr/0001-*.md → when there is an architectural decision
|
|
276
|
+
- docs/DESIGN.md → when design tokens are defined
|
|
277
|
+
- docs/reference/api.md → when there are 5+ stable endpoints
|
|
278
|
+
- docs/guides/deployment.md → when there is a deploy process
|
|
272
279
|
```
|
|
273
280
|
|
|
274
|
-
##
|
|
281
|
+
## Resources
|
|
275
282
|
|
|
276
|
-
- [Diátaxis Quick Reference](references/diataxis-quick-ref.md) —
|
|
277
|
-
-
|
|
283
|
+
- [Diátaxis Quick Reference](references/diataxis-quick-ref.md) — Summary of the Diátaxis framework with decision tree
|
|
284
|
+
- Related skills: `doc-write` (write docs), `doc-review` (audit docs), `doc-maintain` (keep docs synced)
|