@damenor/agent-docs 0.1.0 → 0.1.2
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 +141 -71
- package/dist/index.js +259 -13
- package/package.json +11 -11
- package/templates/base/README.md +64 -69
- package/templates/base/docs/CONTEXT.md +111 -111
- package/templates/modules/agents/.agents/skills/doc-maintain/SKILL.md +193 -193
- package/templates/modules/agents/.agents/skills/doc-review/SKILL.md +223 -223
- package/templates/modules/agents/.agents/skills/doc-scaffold/SKILL.md +155 -155
- package/templates/modules/agents/.agents/skills/doc-write/SKILL.md +197 -197
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
@@ -14,60 +14,60 @@ metadata:
|
|
|
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
|
---
|
|
@@ -78,151 +78,151 @@ 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
|
-
1.
|
|
118
|
-
2.
|
|
119
|
-
3.
|
|
120
|
-
|
|
121
|
-
##
|
|
122
|
-
1.
|
|
123
|
-
2.
|
|
124
|
-
3.
|
|
125
|
-
4.
|
|
126
|
-
|
|
127
|
-
##
|
|
128
|
-
1.
|
|
129
|
-
2.
|
|
130
|
-
3.
|
|
114
|
+
# AGENTS.md — Documentation Protocol
|
|
115
|
+
|
|
116
|
+
## Before starting a task
|
|
117
|
+
1. Read docs/CONTEXT.md to understand the domain
|
|
118
|
+
2. Read docs/README.md to navigate the documentation
|
|
119
|
+
3. Review relevant ADRs in docs/adr/
|
|
120
|
+
|
|
121
|
+
## After completing a task
|
|
122
|
+
1. Update CONTEXT.md if new terms emerged
|
|
123
|
+
2. Update docs/README.md if files were added/removed
|
|
124
|
+
3. Evaluate if an ADR is needed (is it hard to reverse? is it surprising? is there a trade-off?)
|
|
125
|
+
4. Pass the protocol to the subagent if work is delegated
|
|
126
|
+
|
|
127
|
+
## When delegating work
|
|
128
|
+
1. Include this protocol in the subagent's prompt
|
|
129
|
+
2. Specify which doc files to update
|
|
130
|
+
3. Verify the subagent followed the protocol
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### Step 4: Create docs/README.md
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
135
|
+
Include:
|
|
136
|
+
- Complete map of documentation files (generated, not placeholder)
|
|
137
|
+
- Growth rules: when to add each type of doc
|
|
138
|
+
- Naming conventions
|
|
139
|
+
- Links to related skills: `doc-write`, `doc-review`, `doc-maintain`
|
|
140
140
|
|
|
141
|
-
###
|
|
141
|
+
### Step 5: Create docs/CONTEXT.md
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
143
|
+
Generate with real domain terms detected in the code:
|
|
144
|
+
- Table of terms with definitions
|
|
145
|
+
- Relationships between terms
|
|
146
|
+
- Flagged ambiguous terms
|
|
147
|
+
- Source: source code analysis
|
|
148
148
|
|
|
149
|
-
###
|
|
149
|
+
### Step 6: Create docs/adr/TEMPLATE.md + first ADR
|
|
150
150
|
|
|
151
|
-
- TEMPLATE.md:
|
|
152
|
-
-
|
|
151
|
+
- TEMPLATE.md: reusable template
|
|
152
|
+
- First ADR: only if an architectural decision already exists that meets the 3 criteria (hard to reverse, surprising, real trade-off)
|
|
153
153
|
|
|
154
|
-
###
|
|
154
|
+
### Step 7: Create tutorials/quick-start.md
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
156
|
+
Based on the detected stack:
|
|
157
|
+
- Stack-specific prerequisites
|
|
158
|
+
- Real installation steps
|
|
159
|
+
- First runnable example
|
|
160
|
+
- Verification at each step
|
|
161
161
|
|
|
162
|
-
###
|
|
162
|
+
### Step 8: Create essential reference files
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
164
|
+
Only those applicable to the detected stack:
|
|
165
|
+
- If there is an API: `reference/api.md`
|
|
166
|
+
- If there is configuration: `reference/configuration.md`
|
|
167
|
+
- If there is a CLI: `reference/cli.md`
|
|
168
168
|
|
|
169
|
-
###
|
|
169
|
+
### Step 9: Report results
|
|
170
170
|
|
|
171
171
|
```
|
|
172
|
-
✅
|
|
172
|
+
✅ Created:
|
|
173
173
|
- README.md (entry point)
|
|
174
|
-
- CHANGELOG.md (
|
|
175
|
-
- AGENTS.md (
|
|
176
|
-
- docs/README.md (
|
|
177
|
-
- docs/CONTEXT.md (X
|
|
174
|
+
- CHANGELOG.md (initialized)
|
|
175
|
+
- AGENTS.md (protocol)
|
|
176
|
+
- docs/README.md (map + rules)
|
|
177
|
+
- docs/CONTEXT.md (X domain terms)
|
|
178
178
|
- docs/adr/TEMPLATE.md
|
|
179
|
-
- tutorials/quick-start.md (
|
|
179
|
+
- tutorials/quick-start.md (based on {stack})
|
|
180
180
|
|
|
181
|
-
⏭️
|
|
182
|
-
- docs/adr/001-*.md (
|
|
183
|
-
- reference/api.md (
|
|
184
|
-
- how-to/ (
|
|
181
|
+
⏭️ Pending (add when there is content):
|
|
182
|
+
- docs/adr/001-*.md (when there is an architectural decision)
|
|
183
|
+
- reference/api.md (when there are documentable endpoints)
|
|
184
|
+
- how-to/ (when repeatable problems arise)
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
##
|
|
187
|
+
## Commands
|
|
188
188
|
|
|
189
|
-
###
|
|
189
|
+
### Files to create (in order)
|
|
190
190
|
|
|
191
191
|
```bash
|
|
192
|
-
#
|
|
192
|
+
# Root files
|
|
193
193
|
README.md
|
|
194
194
|
CHANGELOG.md
|
|
195
195
|
AGENTS.md
|
|
196
196
|
|
|
197
|
-
#
|
|
197
|
+
# docs/ structure
|
|
198
198
|
docs/README.md
|
|
199
199
|
docs/CONTEXT.md
|
|
200
200
|
docs/adr/TEMPLATE.md
|
|
201
201
|
|
|
202
|
-
#
|
|
202
|
+
# Tutorials
|
|
203
203
|
tutorials/quick-start.md
|
|
204
204
|
|
|
205
|
-
#
|
|
206
|
-
reference/api.md #
|
|
207
|
-
reference/configuration.md #
|
|
205
|
+
# Reference (only if applicable)
|
|
206
|
+
reference/api.md # Only if there is an API
|
|
207
|
+
reference/configuration.md # Only if there is config
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
-
###
|
|
210
|
+
### Post-creation verification
|
|
211
211
|
|
|
212
212
|
```
|
|
213
|
-
1.
|
|
214
|
-
2.
|
|
215
|
-
3.
|
|
216
|
-
4.
|
|
217
|
-
5.
|
|
213
|
+
1. Verify that EVERY file has real content (no placeholders)
|
|
214
|
+
2. Verify that EVERY file has YAML frontmatter
|
|
215
|
+
3. Verify that CONTEXT.md contains real terms from the code
|
|
216
|
+
4. Verify that quick-start.md is runnable for the detected stack
|
|
217
|
+
5. Verify that docs/README.md maps all created files
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
-
##
|
|
220
|
+
## Concrete Example
|
|
221
221
|
|
|
222
|
-
### Input:
|
|
222
|
+
### Input: React + Express project detected
|
|
223
223
|
|
|
224
224
|
```
|
|
225
|
-
|
|
225
|
+
Detection:
|
|
226
226
|
├── package.json → Node.js, React 18, Express 4
|
|
227
227
|
├── tsconfig.json → TypeScript 5
|
|
228
228
|
├── tailwind.config.ts → Tailwind CSS
|
|
@@ -230,48 +230,48 @@ Detección:
|
|
|
230
230
|
└── .github/workflows/ci.yml → {{TECH_STACK}} CI/CD
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
### Output:
|
|
233
|
+
### Output: Created files
|
|
234
234
|
|
|
235
235
|
```
|
|
236
236
|
✅ README.md
|
|
237
|
-
- "
|
|
238
|
-
- Stack table
|
|
237
|
+
- "Web platform built with React 18 and Express 4"
|
|
238
|
+
- Stack table with React, Express, PostgreSQL, {{TECH_STACK}}
|
|
239
239
|
- Commands: npm run dev, npm run build, npm run test, npm run lint
|
|
240
240
|
|
|
241
241
|
✅ CHANGELOG.md
|
|
242
|
-
-
|
|
242
|
+
- Initial entry: "## [0.1.0] - 2026-05-07 / ### Added / - Initial release"
|
|
243
243
|
|
|
244
244
|
✅ AGENTS.md
|
|
245
245
|
- Stack: React 18, Express 4, PostgreSQL, Prisma, Tailwind, {{TECH_STACK}}
|
|
246
246
|
- Commands: npm run dev/build/test/lint/typecheck
|
|
247
|
-
-
|
|
247
|
+
- Complete protocol (before/after/delegate)
|
|
248
248
|
|
|
249
249
|
✅ docs/README.md
|
|
250
|
-
-
|
|
251
|
-
- Growth rules: "
|
|
252
|
-
-
|
|
250
|
+
- Map with 8 created files
|
|
251
|
+
- Growth rules: "Create reference/api.md when there are 5+ endpoints"
|
|
252
|
+
- Diátaxis table: tutorials/ ✅, guides/ ⏭️, reference/ ⏭️, explanation/ ⏭️
|
|
253
253
|
|
|
254
254
|
✅ docs/CONTEXT.md
|
|
255
|
-
- 6
|
|
256
|
-
-
|
|
257
|
-
- ⚠️
|
|
255
|
+
- 6 terms extracted: User, Session, Workspace, Role, Permission, Token
|
|
256
|
+
- Relationships: User → Session, User ← Role ← Permission
|
|
257
|
+
- ⚠️ AMBIGUOUS: "workspace" (could be team or project)
|
|
258
258
|
|
|
259
259
|
✅ docs/adr/TEMPLATE.md
|
|
260
|
-
-
|
|
260
|
+
- Minimal format ready to use
|
|
261
261
|
|
|
262
262
|
✅ 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 →
|
|
263
|
+
- Prerequisites: Node 20+, {{TECH_STACK}}, npm
|
|
264
|
+
- Steps: clone → npm install → cp .env.example .env → npx prisma migrate dev → npm run dev
|
|
265
|
+
- Verification: "Open http://localhost:3000 — you should see the landing"
|
|
266
|
+
|
|
267
|
+
⏭️ Pending (lazy):
|
|
268
|
+
- docs/adr/0001-*.md → when there is an architectural decision
|
|
269
|
+
- docs/DESIGN.md → when design tokens are defined
|
|
270
|
+
- docs/reference/api.md → when there are 5+ stable endpoints
|
|
271
|
+
- docs/guides/deployment.md → when there is a deploy process
|
|
272
272
|
```
|
|
273
273
|
|
|
274
|
-
##
|
|
274
|
+
## Resources
|
|
275
275
|
|
|
276
|
-
- [Diátaxis Quick Reference](references/diataxis-quick-ref.md) —
|
|
277
|
-
-
|
|
276
|
+
- [Diátaxis Quick Reference](references/diataxis-quick-ref.md) — Summary of the Diátaxis framework with decision tree
|
|
277
|
+
- Related skills: `doc-write` (write docs), `doc-review` (audit docs), `doc-maintain` (keep docs synced)
|