@damenor/agent-docs 0.1.0 β 0.1.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 +141 -71
- package/dist/index.js +259 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,115 +1,185 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
|
-
|
|
3
|
-
<br>
|
|
4
|
-
@damenor/agent-docs
|
|
2
|
+
π€π @damenor/agent-docs
|
|
5
3
|
</h1>
|
|
6
4
|
|
|
7
5
|
<p align="center">
|
|
8
|
-
<strong>
|
|
6
|
+
<strong>Stop writing docs from scratch. Start shipping AI-ready documentation in 30 seconds.</strong>
|
|
9
7
|
<br>
|
|
10
|
-
<sub>
|
|
8
|
+
<sub>One command β complete DiΓ‘taxis structure with AGENTS.md, ADRs, and agent skills</sub>
|
|
11
9
|
</p>
|
|
12
10
|
|
|
13
11
|
<p align="center">
|
|
14
|
-
<img src="https://img.shields.io/npm/v/@damenor/agent-docs?style=flat-square" alt="npm version">
|
|
15
|
-
<img src="https://img.shields.io/npm/dt/@damenor/agent-docs?style=flat-square" alt="downloads">
|
|
16
|
-
<img src="https://img.shields.io/
|
|
17
|
-
<img src="https://img.shields.io/node/v/@damenor/agent-docs?style=flat-square" alt="node version">
|
|
12
|
+
<img src="https://img.shields.io/npm/v/@damenor/agent-docs?style=flat-square&color=blueviolet" alt="npm version">
|
|
13
|
+
<img src="https://img.shields.io/npm/dt/@damenor/agent-docs?style=flat-square&color=blueviolet" alt="downloads">
|
|
14
|
+
<img src="https://img.shields.io/node/v/@damenor/agent-docs?style=flat-square&color=blueviolet" alt="node version">
|
|
18
15
|
</p>
|
|
19
16
|
|
|
20
17
|
---
|
|
21
18
|
|
|
22
|
-
##
|
|
19
|
+
## β‘ One command. Full docs. Zero BS.
|
|
23
20
|
|
|
24
21
|
```bash
|
|
25
22
|
npx @damenor/agent-docs
|
|
26
23
|
```
|
|
27
24
|
|
|
28
|
-
That's it.
|
|
25
|
+
That's literally it. 30 seconds later you have a professional documentation structure that would take hours to build manually.
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
No config files. No boilerplate repos. No "just copy this template". One interactive wizard, done.
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
npx @damenor/agent-docs
|
|
34
|
-
β
|
|
35
|
-
βββ 1. Project name
|
|
36
|
-
βββ 2. Target directory
|
|
37
|
-
βββ 3. Stack detection (auto/manual/skip)
|
|
38
|
-
β package.json Β· pyproject.toml Β· go.mod Β· Cargo.toml Β· pom.xml
|
|
39
|
-
βββ 4. Language (ES/EN)
|
|
40
|
-
βββ 5. Module selection
|
|
41
|
-
βββ 6. Git init
|
|
42
|
-
βββ 7. Generate β docs/ ready to customize
|
|
43
|
-
```
|
|
29
|
+
---
|
|
44
30
|
|
|
45
|
-
##
|
|
31
|
+
## π€ The problem
|
|
46
32
|
|
|
47
|
-
|
|
48
|
-
|--------|-----------|
|
|
49
|
-
| Tutorials | quick-start, environment-setup, first-task |
|
|
50
|
-
| Guides | deployment, troubleshooting, runbooks |
|
|
51
|
-
| Reference | API, configuration, infrastructure, code-style |
|
|
52
|
-
| Explanation | architecture.md |
|
|
53
|
-
| Product | overview, roadmap |
|
|
54
|
-
| Operations | monitoring, incidents, SLAs |
|
|
55
|
-
| Design System | DESIGN.md with tokens |
|
|
56
|
-
| AI Agent Skills | `.agents/` with 5 skills + 5 agents |
|
|
57
|
-
| CI/CD | GitHub Actions docs-check workflow |
|
|
33
|
+
You know the drill:
|
|
58
34
|
|
|
59
|
-
|
|
35
|
+
- π« **"I'll add docs later"** β later never comes
|
|
36
|
+
- π€ **AI agents hallucinate** because there's no context, no structure, no rules
|
|
37
|
+
- π **Every project documents differently** β if it documents at all
|
|
38
|
+
- π° **Onboarding new devs** means 2 hours of "where is...?" and "how do I...?"
|
|
39
|
+
- π **Writing docs from zero** feels like homework nobody asked for
|
|
60
40
|
|
|
61
|
-
|
|
41
|
+
**You deserve better. Your team deserves better. Your AI agents deserve better.**
|
|
62
42
|
|
|
63
|
-
|
|
43
|
+
---
|
|
64
44
|
|
|
65
|
-
|
|
66
|
-
|---------------|-------|
|
|
67
|
-
| `package.json` | Node.js (npm/pnpm/yarn/bun) |
|
|
68
|
-
| `pyproject.toml` / `requirements.txt` | Python (pip/poetry) |
|
|
69
|
-
| `go.mod` | Go |
|
|
70
|
-
| `Cargo.toml` | Rust |
|
|
71
|
-
| `pom.xml` / `build.gradle` | Java/Kotlin |
|
|
45
|
+
## πͺ The solution
|
|
72
46
|
|
|
73
|
-
|
|
47
|
+
`agent-docs` gives you the documentation structure that **top engineering teams use** β in the time it takes to order a coffee.
|
|
48
|
+
|
|
49
|
+
### What you get in 30 seconds:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
npx @damenor/agent-docs
|
|
53
|
+
β
|
|
54
|
+
βββ 1. π Project name
|
|
55
|
+
βββ 2. π Target directory
|
|
56
|
+
βββ 3. π Auto-detect your stack
|
|
57
|
+
β Reads package.json Β· pyproject.toml Β· go.mod Β· Cargo.toml Β· pom.xml
|
|
58
|
+
β Injects YOUR dev/build/test/lint commands automatically
|
|
59
|
+
βββ 4. π Language (ES/EN)
|
|
60
|
+
βββ 5. π¦ Pick your modules (or take them all)
|
|
61
|
+
βββ 6. π§ Git init
|
|
62
|
+
βββ 7. β‘ Done. 30+ files generated. Docs ready.
|
|
63
|
+
```
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
### What comes out:
|
|
76
66
|
|
|
77
67
|
```
|
|
78
68
|
my-project/
|
|
79
|
-
βββ AGENTS.md
|
|
69
|
+
βββ AGENTS.md π€ AI agent protocol (they finally behave)
|
|
80
70
|
βββ docs/
|
|
81
|
-
β βββ CONTEXT.md
|
|
82
|
-
β βββ README.md
|
|
83
|
-
β βββ tutorials/
|
|
84
|
-
β βββ guides/
|
|
85
|
-
β βββ reference/
|
|
86
|
-
β βββ explanation/
|
|
87
|
-
β βββ product/
|
|
88
|
-
β βββ operations/
|
|
89
|
-
β βββ DESIGN.md
|
|
90
|
-
β βββ adr/
|
|
91
|
-
βββ .agents/
|
|
92
|
-
βββ .github/workflows/
|
|
71
|
+
β βββ CONTEXT.md π Domain glossary (everyone speaks the same language)
|
|
72
|
+
β βββ README.md π Docs index (navigable from day one)
|
|
73
|
+
β βββ tutorials/ π Step-by-step learning (onboarding in 15 min, not 2 hours)
|
|
74
|
+
β βββ guides/ π How-to guides (deployment, troubleshooting, runbooks)
|
|
75
|
+
β βββ reference/ π Technical reference (API, config, infra, code-style)
|
|
76
|
+
β βββ explanation/ ποΈ Architecture decisions (ADRs, not lost Slack messages)
|
|
77
|
+
β βββ product/ π Overview & roadmap (what are we building again?)
|
|
78
|
+
β βββ operations/ π§ Monitoring & incidents (when prod goes brrr)
|
|
79
|
+
β βββ DESIGN.md π¨ Design system tokens (colors, typography, spacing)
|
|
80
|
+
β βββ adr/ π Architecture Decision Records (decisions that last)
|
|
81
|
+
βββ .agents/ π€ 5 skills + 5 agents (your AI team is ready)
|
|
82
|
+
βββ .github/workflows/ βοΈ CI/CD for docs (never ship broken docs again)
|
|
93
83
|
βββ .editorconfig
|
|
94
84
|
βββ .markdownlint.json
|
|
95
85
|
```
|
|
96
86
|
|
|
97
|
-
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## π§© 9 modules β pick what you need
|
|
90
|
+
|
|
91
|
+
Every project is different. Mix and match:
|
|
92
|
+
|
|
93
|
+
| π― Module | π What you get | π‘ Why you care |
|
|
94
|
+
|-----------|----------------|----------------|
|
|
95
|
+
| π Tutorials | quick-start, setup, first-task | New dev productive in 15 min |
|
|
96
|
+
| π Guides | deployment, troubleshooting, runbooks | No more "it works on my machine" |
|
|
97
|
+
| π Reference | API, config, infra, code-style | Stop answering the same questions |
|
|
98
|
+
| ποΈ Explanation | architecture.md | Everyone understands the big picture |
|
|
99
|
+
| π Product | overview, roadmap | Stakeholders know what's happening |
|
|
100
|
+
| π§ Operations | monitoring, incidents, SLAs | Prod issues resolved faster |
|
|
101
|
+
| π¨ Design System | DESIGN.md with tokens | Consistent UI, no guesswork |
|
|
102
|
+
| π€ AI Agent Skills | 5 skills + 5 agents | AI agents that actually help |
|
|
103
|
+
| βοΈ CI/CD | GitHub Actions workflow | Docs checked on every PR |
|
|
104
|
+
|
|
105
|
+
**Plus** the base layer is always included: `AGENTS.md`, `CONTEXT.md`, `README.md`, ADR template, and shared configs.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## π Auto-detects your stack
|
|
110
|
+
|
|
111
|
+
No manual configuration. The CLI reads your project and figures it out:
|
|
98
112
|
|
|
99
|
-
|
|
113
|
+
| π Found | π οΈ Detected | β¨ Auto-injected |
|
|
114
|
+
|----------|-------------|-----------------|
|
|
115
|
+
| `package.json` | Node.js + framework + pkg manager | `npm run dev`, `npm test`, etc. |
|
|
116
|
+
| `pyproject.toml` | Python + Django/FastAPI/Flask | `python manage.py runserver`, etc. |
|
|
117
|
+
| `go.mod` | Go | `go run .`, `go test ./...` |
|
|
118
|
+
| `Cargo.toml` | Rust | `cargo run`, `cargo test` |
|
|
119
|
+
| `pom.xml` / `build.gradle` | Java/Kotlin + Spring | `mvn spring-boot:run`, etc. |
|
|
120
|
+
|
|
121
|
+
Supports **Next.js, Nuxt, Astro, SvelteKit, React, Vue, Express, NestJS, Fastify, Hono, Django, FastAPI, Flask**, and more.
|
|
122
|
+
|
|
123
|
+
---
|
|
100
124
|
|
|
101
|
-
|
|
125
|
+
## π€ Why your AI agents will love you
|
|
102
126
|
|
|
103
|
-
|
|
127
|
+
AI agents without context are expensive guesswork machines. `agent-docs` gives them:
|
|
104
128
|
|
|
105
|
-
- **
|
|
106
|
-
- **
|
|
107
|
-
- **
|
|
129
|
+
- **AGENTS.md** β operating rules, so they follow YOUR conventions
|
|
130
|
+
- **CONTEXT.md** β domain vocabulary, so they use YOUR terminology
|
|
131
|
+
- **ADRs** β decision records, so they respect YOUR architecture
|
|
132
|
+
- **Skills** β specialized instructions for doc tasks, so they do it RIGHT
|
|
108
133
|
|
|
109
|
-
|
|
134
|
+
**Result**: AI agents that produce better code, fewer hallucinations, and actually follow your project's patterns.
|
|
135
|
+
|
|
136
|
+
### `--agents-guide` β Built-in instructions for AI agents
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx @damenor/agent-docs --agents-guide
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Outputs a structured guide that tells AI agents **exactly** what to do after generation:
|
|
143
|
+
- β
What files to fill and in what order
|
|
144
|
+
- β
What to delete if it doesn't apply
|
|
145
|
+
- β
Which placeholders to verify
|
|
146
|
+
- β
Rules for clean, real documentation
|
|
147
|
+
|
|
148
|
+
No guessing. No "I'll add docs later". Your AI agent runs this and knows the drill.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## π Before vs After
|
|
153
|
+
|
|
154
|
+
| π© Before | π€© After |
|
|
155
|
+
|-----------|----------|
|
|
156
|
+
| "Where are the docs?" β "What docs?" | Professional docs index, navigable from day one |
|
|
157
|
+
| New dev onboarding: 2 hours | New dev onboarding: 15 minutes |
|
|
158
|
+
| AI agent: "I don't know the context" | AI agent: "I read AGENTS.md, I know the rules" |
|
|
159
|
+
| "How do we deploy?" β Slack thread with 47 messages | `docs/guides/deployment.md` β one click |
|
|
160
|
+
| Every project documents differently | Consistent DiΓ‘taxis structure across all projects |
|
|
161
|
+
| Architecture decisions lost in Slack/Notion | ADRs that persist and are searchable |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## π Web docs β coming soon
|
|
166
|
+
|
|
167
|
+
A beautiful documentation site powered by Astro + Starlight. Publish your docs as a searchable website with zero config.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## π Requirements
|
|
110
172
|
|
|
111
173
|
- Node.js >= 18
|
|
112
174
|
|
|
113
|
-
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## π― TL;DR
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npx @damenor/agent-docs
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
30 seconds. Full docs structure. AI-ready. Team-ready. Production-ready.
|
|
114
184
|
|
|
115
|
-
|
|
185
|
+
**Ship docs, not excuses.** π
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import * as p from "@clack/prompts";
|
|
5
5
|
import pc2 from "picocolors";
|
|
6
6
|
import path4 from "path";
|
|
7
|
+
import fs3 from "fs";
|
|
8
|
+
import url from "url";
|
|
7
9
|
|
|
8
10
|
// src/utils/colors.ts
|
|
9
11
|
import pc from "picocolors";
|
|
@@ -129,6 +131,15 @@ var LANGUAGES = [
|
|
|
129
131
|
{ value: "es", label: "Espa\xF1ol", hint: "recomendado" },
|
|
130
132
|
{ value: "en", label: "English" }
|
|
131
133
|
];
|
|
134
|
+
var PLACEHOLDERS = {
|
|
135
|
+
projectName: "{{PROJECT_NAME}}",
|
|
136
|
+
techStack: "{{TECH_STACK}}",
|
|
137
|
+
devCommand: "{{DEV_COMMAND}}",
|
|
138
|
+
buildCommand: "{{BUILD_COMMAND}}",
|
|
139
|
+
testCommand: "{{TEST_COMMAND}}",
|
|
140
|
+
lintCommand: "{{LINT_COMMAND}}",
|
|
141
|
+
date: "{{DATE}}"
|
|
142
|
+
};
|
|
132
143
|
|
|
133
144
|
// src/detector.ts
|
|
134
145
|
import fs from "fs";
|
|
@@ -215,8 +226,8 @@ function detectStack(targetDir) {
|
|
|
215
226
|
return null;
|
|
216
227
|
}
|
|
217
228
|
function detectNodeStack(packageJsonContent, dir) {
|
|
218
|
-
const
|
|
219
|
-
const deps = { ...
|
|
229
|
+
const pkg2 = JSON.parse(packageJsonContent);
|
|
230
|
+
const deps = { ...pkg2.dependencies, ...pkg2.devDependencies };
|
|
220
231
|
let framework;
|
|
221
232
|
if (deps["next"]) framework = `Next.js ${deps["next"].replace("^", "").replace("~", "")}`;
|
|
222
233
|
else if (deps["nuxt"]) framework = `Nuxt ${deps["nuxt"].replace("^", "").replace("~", "")}`;
|
|
@@ -232,7 +243,7 @@ function detectNodeStack(packageJsonContent, dir) {
|
|
|
232
243
|
if (fs.existsSync(path.join(dir, "pnpm-lock.yaml"))) packageManager = "pnpm";
|
|
233
244
|
else if (fs.existsSync(path.join(dir, "yarn.lock"))) packageManager = "yarn";
|
|
234
245
|
else if (fs.existsSync(path.join(dir, "bun.lockb"))) packageManager = "bun";
|
|
235
|
-
const scripts =
|
|
246
|
+
const scripts = pkg2.scripts || {};
|
|
236
247
|
const run = packageManager === "npm" ? "npm run" : packageManager;
|
|
237
248
|
const hasTypeScript = deps["typescript"] || fs.existsSync(path.join(dir, "tsconfig.json"));
|
|
238
249
|
return {
|
|
@@ -376,11 +387,232 @@ function formatStackForTemplate(stack) {
|
|
|
376
387
|
return parts.join(" + ");
|
|
377
388
|
}
|
|
378
389
|
|
|
390
|
+
// src/agents-guide.ts
|
|
391
|
+
function generateAgentsGuide() {
|
|
392
|
+
const lines = [];
|
|
393
|
+
lines.push("# AGENT GUIDE \u2014 @damenor/agent-docs");
|
|
394
|
+
lines.push("");
|
|
395
|
+
lines.push("This guide tells you how to personalize the generated documentation.");
|
|
396
|
+
lines.push("Read each file for details. This guide tells you WHAT to do, not what they say.");
|
|
397
|
+
lines.push("");
|
|
398
|
+
lines.push("## WORK ORDER (follow this sequence)");
|
|
399
|
+
lines.push("");
|
|
400
|
+
lines.push("1. CONTEXT.md \u2014 domain language (blocks everything else)");
|
|
401
|
+
lines.push("2. AGENTS.md \u2014 stack, commands, conventions (your operating rules)");
|
|
402
|
+
lines.push("3. docs/roadmap.md \u2014 real features and status");
|
|
403
|
+
lines.push("4. docs/tutorials/ \u2014 concrete steps for THIS project");
|
|
404
|
+
lines.push("5. docs/guides/ \u2014 deployment and troubleshooting for THIS project");
|
|
405
|
+
lines.push("6. docs/reference/ \u2014 technical reference for THIS project");
|
|
406
|
+
lines.push("7. docs/explanation/architecture.md \u2014 architecture decisions");
|
|
407
|
+
lines.push("8. Everything else");
|
|
408
|
+
lines.push("");
|
|
409
|
+
lines.push("## BASE FILES (always generated)");
|
|
410
|
+
lines.push("");
|
|
411
|
+
lines.push("### AGENTS.md");
|
|
412
|
+
lines.push("- ACTION: Verify detected commands match reality (dev, build, test, lint)");
|
|
413
|
+
lines.push("- ACTION: Adjust stack section if auto-detection was wrong");
|
|
414
|
+
lines.push("- ACTION: Remove module sections that don't apply to this project");
|
|
415
|
+
lines.push("- ACTION: Add project-specific conventions if any");
|
|
416
|
+
lines.push("- KEEP: Always. This is your operating protocol.");
|
|
417
|
+
lines.push("");
|
|
418
|
+
lines.push("### docs/CONTEXT.md");
|
|
419
|
+
lines.push("- ACTION: Replace ALL generic examples with real domain terms");
|
|
420
|
+
lines.push("- ACTION: Fill the entity table with THIS project's concepts");
|
|
421
|
+
lines.push("- ACTION: Add project-specific terms to the glossary");
|
|
422
|
+
lines.push("- ACTION: Update completeness % \u2014 if < 50%, prioritize this over code");
|
|
423
|
+
lines.push("- RULE: Every term used in code, APIs, or conversations MUST be here");
|
|
424
|
+
lines.push("- KEEP: Always. This is the shared vocabulary.");
|
|
425
|
+
lines.push("");
|
|
426
|
+
lines.push("### docs/adr/TEMPLATE.md");
|
|
427
|
+
lines.push("- ACTION: Keep as reference template. Do NOT fill.");
|
|
428
|
+
lines.push("- ACTION: When you make an architectural decision, copy this template and fill it.");
|
|
429
|
+
lines.push("- KEEP: Always.");
|
|
430
|
+
lines.push("");
|
|
431
|
+
lines.push("### docs/README.md");
|
|
432
|
+
lines.push("- ACTION: Update the documentation index to match what actually exists");
|
|
433
|
+
lines.push("- ACTION: Remove links to sections that don't exist");
|
|
434
|
+
lines.push("- KEEP: Always. This is the docs entry point.");
|
|
435
|
+
lines.push("");
|
|
436
|
+
lines.push("### README.md (project root)");
|
|
437
|
+
lines.push("- ACTION: Replace template content with real project info");
|
|
438
|
+
lines.push("- ACTION: Add real quick-start steps using detected commands");
|
|
439
|
+
lines.push("- KEEP: Always.");
|
|
440
|
+
lines.push("");
|
|
441
|
+
lines.push("### CHANGELOG.md");
|
|
442
|
+
lines.push("- ACTION: Remove template entries, keep format structure");
|
|
443
|
+
lines.push("- ACTION: Add real first entry if this is a new project");
|
|
444
|
+
lines.push("- KEEP: Always.");
|
|
445
|
+
lines.push("");
|
|
446
|
+
lines.push("## MODULES (only the ones the user selected)");
|
|
447
|
+
lines.push("");
|
|
448
|
+
for (const mod of DOC_MODULES) {
|
|
449
|
+
lines.push(`### Module: ${mod.value}`);
|
|
450
|
+
lines.push(`- FILES: ${mod.files.join(", ")}`);
|
|
451
|
+
switch (mod.value) {
|
|
452
|
+
case "tutorials":
|
|
453
|
+
lines.push("- ACTION: Replace generic steps with REAL steps for this project");
|
|
454
|
+
lines.push("- ACTION: Use actual commands from stack detection");
|
|
455
|
+
lines.push("- ACTION: Include real URLs, ports, env vars");
|
|
456
|
+
lines.push("- DELETE IF: Project doesn't need onboarding tutorials");
|
|
457
|
+
break;
|
|
458
|
+
case "guides":
|
|
459
|
+
lines.push("- ACTION: Fill deployment.md with real deployment process");
|
|
460
|
+
lines.push("- ACTION: Fill troubleshooting.md with real known issues");
|
|
461
|
+
lines.push("- ACTION: Delete runbooks/TEMPLATE.md after creating first runbook");
|
|
462
|
+
lines.push("- DELETE IF: Project doesn't have deployment/ops");
|
|
463
|
+
break;
|
|
464
|
+
case "reference":
|
|
465
|
+
lines.push("- ACTION: Fill api.md with real CLI/API surface");
|
|
466
|
+
lines.push("- ACTION: Fill configuration.md with real config options");
|
|
467
|
+
lines.push("- ACTION: Fill infrastructure.md with real infra");
|
|
468
|
+
lines.push("- ACTION: Fill code-style.md with real linting/formatting rules");
|
|
469
|
+
lines.push("- DELETE IF: Project is too small for reference docs");
|
|
470
|
+
break;
|
|
471
|
+
case "explanation":
|
|
472
|
+
lines.push("- ACTION: Fill architecture.md with real system design");
|
|
473
|
+
lines.push("- ACTION: Add Mermaid diagrams if helpful");
|
|
474
|
+
lines.push("- DELETE IF: Project is trivial and needs no architecture doc");
|
|
475
|
+
break;
|
|
476
|
+
case "product":
|
|
477
|
+
lines.push("- ACTION: Fill overview.md with real product vision and users");
|
|
478
|
+
lines.push("- ACTION: Fill roadmap.md with real features, priorities, status");
|
|
479
|
+
lines.push("- DELETE IF: Internal project with no product dimension");
|
|
480
|
+
break;
|
|
481
|
+
case "operations":
|
|
482
|
+
lines.push("- ACTION: Fill with real monitoring, incidents, SLAs");
|
|
483
|
+
lines.push("- DELETE IF: No production operations");
|
|
484
|
+
break;
|
|
485
|
+
case "design":
|
|
486
|
+
lines.push("- ACTION: Extract real tokens from CSS/Tailwind/theme");
|
|
487
|
+
lines.push("- DELETE IF: No design system");
|
|
488
|
+
break;
|
|
489
|
+
case "agents":
|
|
490
|
+
lines.push("- ACTION: Customize skill instructions for this project's needs");
|
|
491
|
+
lines.push("- ACTION: Adjust agent roles if the project has different needs");
|
|
492
|
+
lines.push("- DELETE IF: Team doesn't use AI agents");
|
|
493
|
+
break;
|
|
494
|
+
case "ci":
|
|
495
|
+
lines.push("- ACTION: Verify the workflow matches real CI needs");
|
|
496
|
+
lines.push("- DELETE IF: Using different CI platform");
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
lines.push("");
|
|
500
|
+
}
|
|
501
|
+
lines.push("## SHARED FILES (always generated)");
|
|
502
|
+
lines.push("");
|
|
503
|
+
lines.push("### .editorconfig");
|
|
504
|
+
lines.push("- ACTION: Verify it matches the project's formatting style");
|
|
505
|
+
lines.push("- KEEP: Always.");
|
|
506
|
+
lines.push("");
|
|
507
|
+
lines.push("### .markdownlint.json");
|
|
508
|
+
lines.push("- ACTION: Verify rules match team preferences");
|
|
509
|
+
lines.push("- KEEP: Always.");
|
|
510
|
+
lines.push("");
|
|
511
|
+
lines.push("## PLACEHOLDERS \u2014 search and verify");
|
|
512
|
+
lines.push("");
|
|
513
|
+
lines.push("The CLI replaced these automatically. VERIFY they are correct:");
|
|
514
|
+
lines.push("");
|
|
515
|
+
const placeholderEntries = [
|
|
516
|
+
[PLACEHOLDERS.projectName, "Project name \u2014 verify it's correct"],
|
|
517
|
+
[PLACEHOLDERS.techStack, "Language + framework \u2014 verify or update"],
|
|
518
|
+
[PLACEHOLDERS.devCommand, "Dev command \u2014 verify it works"],
|
|
519
|
+
[PLACEHOLDERS.buildCommand, "Build command \u2014 verify it works"],
|
|
520
|
+
[PLACEHOLDERS.testCommand, "Test command \u2014 verify it works"],
|
|
521
|
+
[PLACEHOLDERS.lintCommand, "Lint command \u2014 verify it works"],
|
|
522
|
+
[PLACEHOLDERS.date, "Generation date \u2014 should be correct"]
|
|
523
|
+
];
|
|
524
|
+
for (const [ph, desc] of placeholderEntries) {
|
|
525
|
+
lines.push(`- ${ph} \u2192 ${desc}`);
|
|
526
|
+
}
|
|
527
|
+
lines.push("");
|
|
528
|
+
lines.push("If any placeholder was NOT replaced (shows as [BRACKETED TEXT]):");
|
|
529
|
+
lines.push("- Fill it with the real value");
|
|
530
|
+
lines.push("- If the value doesn't apply to this project, remove the placeholder and the surrounding context");
|
|
531
|
+
lines.push("");
|
|
532
|
+
lines.push("## RULES");
|
|
533
|
+
lines.push("");
|
|
534
|
+
lines.push('1. NEVER leave empty sections with "TODO", "pendiente", or "agregar aqu\xED"');
|
|
535
|
+
lines.push(" - If you don't have content for a section, REMOVE the section entirely");
|
|
536
|
+
lines.push(" - A shorter doc with real content > a long doc with placeholders");
|
|
537
|
+
lines.push("");
|
|
538
|
+
lines.push("2. If a generated file doesn't apply to this project, DELETE it");
|
|
539
|
+
lines.push(` - Don't keep files "just in case"`);
|
|
540
|
+
lines.push(" - Update docs/README.md index after deleting");
|
|
541
|
+
lines.push("");
|
|
542
|
+
lines.push("3. If a whole module doesn't apply, DELETE the entire folder");
|
|
543
|
+
lines.push(" - Also remove it from AGENTS.md module list");
|
|
544
|
+
lines.push("");
|
|
545
|
+
lines.push("4. CONTEXT.md completeness must be > 50% before implementing features");
|
|
546
|
+
lines.push(" - If < 50%, stop and fill it first");
|
|
547
|
+
lines.push("");
|
|
548
|
+
lines.push("5. All content in docs/ should use the domain terms from CONTEXT.md");
|
|
549
|
+
lines.push(" - Consistency > creativity");
|
|
550
|
+
lines.push("");
|
|
551
|
+
lines.push("6. After filling all docs, run the project's lint and build to verify nothing is broken");
|
|
552
|
+
lines.push("");
|
|
553
|
+
return lines.join("\n");
|
|
554
|
+
}
|
|
555
|
+
|
|
379
556
|
// src/cli.ts
|
|
557
|
+
var __dirname2 = path4.dirname(url.fileURLToPath(import.meta.url));
|
|
558
|
+
var pkg = JSON.parse(fs3.readFileSync(path4.join(__dirname2, "..", "package.json"), "utf-8"));
|
|
559
|
+
function showHelp() {
|
|
560
|
+
console.log(`
|
|
561
|
+
${pc2.bold(brand.title("@damenor/agent-docs"))} ${pc2.dim(`v${pkg.version}`)}
|
|
562
|
+
|
|
563
|
+
${pc2.bold("USAGE")}
|
|
564
|
+
${pc2.cyan("npx @damenor/agent-docs")} ${pc2.dim("# Interactive wizard (default)")}
|
|
565
|
+
${pc2.cyan("npx @damenor/agent-docs --help")} ${pc2.dim("# Show this help")}
|
|
566
|
+
${pc2.cyan("npx @damenor/agent-docs --version")} ${pc2.dim("# Show version")}
|
|
567
|
+
|
|
568
|
+
${pc2.bold("WHAT IT DOES")}
|
|
569
|
+
Generates a professional documentation structure for your project:
|
|
570
|
+
Di\xE1taxis (Tutorials/Guides/Reference/Explanation) + AGENTS.md + ADRs + AI agent skills.
|
|
571
|
+
|
|
572
|
+
${pc2.bold("WIZARD STEPS")}
|
|
573
|
+
1. ${pc2.bold("Project name")} \u2014 How your project is called
|
|
574
|
+
2. ${pc2.bold("Target directory")} \u2014 Where to generate docs (default: ./)
|
|
575
|
+
3. ${pc2.bold("Stack detection")} \u2014 Auto-detect or configure manually
|
|
576
|
+
4. ${pc2.bold("Language")} \u2014 Espa\xF1ol or English
|
|
577
|
+
5. ${pc2.bold("Modules")} \u2014 Pick from 9 available modules
|
|
578
|
+
6. ${pc2.bold("Git init")} \u2014 Initialize git repo with first commit
|
|
579
|
+
7. ${pc2.bold("Generate")} \u2014 Confirm and create all files
|
|
580
|
+
|
|
581
|
+
${pc2.bold("MODULES")}
|
|
582
|
+
${DOC_MODULES.map((m) => ` ${pc2.cyan(m.value.padEnd(12))} ${m.label} \u2014 ${m.hint ?? ""}`).join("\n")}
|
|
583
|
+
|
|
584
|
+
${pc2.bold("STACK DETECTION")}
|
|
585
|
+
Reads package.json, pyproject.toml, go.mod, Cargo.toml, pom.xml, build.gradle.
|
|
586
|
+
Supports Node.js, Python, Go, Rust, Java/Kotlin + 10+ frameworks.
|
|
587
|
+
|
|
588
|
+
${pc2.bold("OPTIONS")}
|
|
589
|
+
${pc2.cyan("-h, --help")} Show this help
|
|
590
|
+
${pc2.cyan("-v, --version")} Show version
|
|
591
|
+
${pc2.cyan("--agents-guide")} Output guide for AI agents (what to fill, what to delete, priorities)
|
|
592
|
+
|
|
593
|
+
${pc2.dim("Made with \u2764\uFE0F by damenordev")}
|
|
594
|
+
`);
|
|
595
|
+
}
|
|
596
|
+
function showVersion() {
|
|
597
|
+
console.log(`@damenor/agent-docs v${pkg.version}`);
|
|
598
|
+
}
|
|
380
599
|
async function cli() {
|
|
600
|
+
const args = process.argv.slice(2);
|
|
601
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
602
|
+
showHelp();
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
606
|
+
showVersion();
|
|
607
|
+
process.exit(0);
|
|
608
|
+
}
|
|
609
|
+
if (args.includes("--agents-guide")) {
|
|
610
|
+
console.log(generateAgentsGuide());
|
|
611
|
+
process.exit(0);
|
|
612
|
+
}
|
|
381
613
|
console.clear();
|
|
382
614
|
p.intro(
|
|
383
|
-
`${icons.docs} ${brand.title("@damenor/agent-docs")} ${pc2.dim(
|
|
615
|
+
`${icons.docs} ${brand.title("@damenor/agent-docs")} ${pc2.dim(`v${pkg.version}`)}
|
|
384
616
|
${pc2.dim("Documentaci\xF3n profesional para proyectos con agentes AI")}`
|
|
385
617
|
);
|
|
386
618
|
const projectName = await p.text({
|
|
@@ -487,19 +719,33 @@ async function cli() {
|
|
|
487
719
|
p.cancel("Operaci\xF3n cancelada.");
|
|
488
720
|
process.exit(0);
|
|
489
721
|
}
|
|
490
|
-
const
|
|
491
|
-
message: `${icons.package}
|
|
492
|
-
|
|
493
|
-
value: mod.value,
|
|
494
|
-
label: mod.label,
|
|
495
|
-
hint: mod.hint
|
|
496
|
-
})),
|
|
497
|
-
required: false
|
|
722
|
+
const allModules = await p.confirm({
|
|
723
|
+
message: `${icons.package} \xBFIncluir todos los m\xF3dulos?`,
|
|
724
|
+
initialValue: true
|
|
498
725
|
});
|
|
499
|
-
if (p.isCancel(
|
|
726
|
+
if (p.isCancel(allModules)) {
|
|
500
727
|
p.cancel("Operaci\xF3n cancelada.");
|
|
501
728
|
process.exit(0);
|
|
502
729
|
}
|
|
730
|
+
let selectedModules;
|
|
731
|
+
if (allModules) {
|
|
732
|
+
selectedModules = DOC_MODULES.map((mod) => mod.value);
|
|
733
|
+
} else {
|
|
734
|
+
const picked = await p.multiselect({
|
|
735
|
+
message: `${icons.package} M\xF3dulos a incluir ${pc2.dim("(espacio para seleccionar, enter para confirmar)")}`,
|
|
736
|
+
options: DOC_MODULES.map((mod) => ({
|
|
737
|
+
value: mod.value,
|
|
738
|
+
label: mod.label,
|
|
739
|
+
hint: mod.hint
|
|
740
|
+
})),
|
|
741
|
+
required: false
|
|
742
|
+
});
|
|
743
|
+
if (p.isCancel(picked)) {
|
|
744
|
+
p.cancel("Operaci\xF3n cancelada.");
|
|
745
|
+
process.exit(0);
|
|
746
|
+
}
|
|
747
|
+
selectedModules = picked;
|
|
748
|
+
}
|
|
503
749
|
const initGit2 = await p.confirm({
|
|
504
750
|
message: `${icons.gear} \xBFInicializar repositorio git?`,
|
|
505
751
|
initialValue: true
|