@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 CHANGED
@@ -1,115 +1,185 @@
1
1
  <h1 align="center">
2
- <img src="https://img.shields.io/badge/agents-docs-blueviolet?style=for-the-badge" alt="agent-docs">
3
- <br>
4
- @damenor/agent-docs
2
+ πŸ€–πŸ“š @damenor/agent-docs
5
3
  </h1>
6
4
 
7
5
  <p align="center">
8
- <strong>DocumentaciΓ³n profesional para proyectos con agentes AI</strong>
6
+ <strong>Stop writing docs from scratch. Start shipping AI-ready documentation in 30 seconds.</strong>
9
7
  <br>
10
- <sub>CLI interactivo que genera estructura DiΓ‘taxis + ADR + AGENTS.md en segundos</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/github/license/damenordev/doc-projects?style=flat-square" alt="license">
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
- ## Quick start
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. The wizard guides you through 7 steps and generates a complete documentation structure.
25
+ That's literally it. 30 seconds later you have a professional documentation structure that would take hours to build manually.
29
26
 
30
- ## What it does
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
- ## 9 selectable modules
31
+ ## 😀 The problem
46
32
 
47
- | Module | Generates |
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
- **Plus**, every run includes the base layer: `AGENTS.md`, `CONTEXT.md`, `README.md`, ADR template, and shared config files.
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
- ## Stack detection
41
+ **You deserve better. Your team deserves better. Your AI agents deserve better.**
62
42
 
63
- Automatically detects your tech stack from project files:
43
+ ---
64
44
 
65
- | File detected | Stack |
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
- Detected commands (`dev`, `build`, `test`, `lint`) are injected into templates automatically.
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
- ## Output example
65
+ ### What comes out:
76
66
 
77
67
  ```
78
68
  my-project/
79
- β”œβ”€β”€ AGENTS.md ← AI agent protocol
69
+ β”œβ”€β”€ AGENTS.md πŸ€– AI agent protocol (they finally behave)
80
70
  β”œβ”€β”€ docs/
81
- β”‚ β”œβ”€β”€ CONTEXT.md ← Domain language & glossary
82
- β”‚ β”œβ”€β”€ README.md ← Documentation index
83
- β”‚ β”œβ”€β”€ tutorials/ ← Step-by-step learning
84
- β”‚ β”œβ”€β”€ guides/ ← How-to guides
85
- β”‚ β”œβ”€β”€ reference/ ← Technical reference
86
- β”‚ β”œβ”€β”€ explanation/ ← Architecture & ADRs
87
- β”‚ β”œβ”€β”€ product/ ← Overview & roadmap
88
- β”‚ β”œβ”€β”€ operations/ ← Runbooks & monitoring
89
- β”‚ β”œβ”€β”€ DESIGN.md ← Design system tokens
90
- β”‚ └── adr/ ← Architecture Decision Records
91
- β”œβ”€β”€ .agents/ ← Skills & agent configs
92
- β”œβ”€β”€ .github/workflows/ ← CI/CD for docs
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
- ## Why this exists
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
- Most projects have **no documentation structure**. When you add AI agents to the mix, they need a shared vocabulary (`CONTEXT.md`), operating rules (`AGENTS.md`), and a consistent organization system (DiΓ‘taxis).
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
- This CLI scaffolds all of that in one command, so your team and your AI agents speak the same language from day one.
125
+ ## πŸ€– Why your AI agents will love you
102
126
 
103
- ## Built for
127
+ AI agents without context are expensive guesswork machines. `agent-docs` gives them:
104
128
 
105
- - **Developers** who want professional docs without starting from zero
106
- - **AI agents** that need structured context to work effectively
107
- - **Teams** that follow DiΓ‘taxis (Tutorials / How-to / Reference / Explanation)
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
- ## Requirements
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
- ## License
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
- MIT β€” [github.com/damenordev/doc-projects](https://github.com/damenordev/doc-projects)
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 pkg = JSON.parse(packageJsonContent);
219
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
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 = pkg.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("v0.1.0")}
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 selectedModules = await p.multiselect({
491
- message: `${icons.package} M\xF3dulos a incluir ${pc2.dim("(espacio para seleccionar)")}`,
492
- options: DOC_MODULES.map((mod) => ({
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(selectedModules)) {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damenor/agent-docs",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI para generar documentaciΓ³n profesional para proyectos con agentes AI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,12 +11,6 @@
11
11
  "dist",
12
12
  "templates"
13
13
  ],
14
- "scripts": {
15
- "dev": "tsup --watch",
16
- "build": "tsup",
17
- "start": "node dist/index.js",
18
- "typecheck": "tsc --noEmit"
19
- },
20
14
  "engines": {
21
15
  "node": ">=18.0.0"
22
16
  },
@@ -44,10 +38,16 @@
44
38
  "license": "MIT",
45
39
  "repository": {
46
40
  "type": "git",
47
- "url": "git+https://github.com/damenordev/doc-projects.git"
41
+ "url": "git+https://github.com/damenordev/agent-docs.git"
48
42
  },
49
- "homepage": "https://github.com/damenordev/doc-projects#readme",
43
+ "homepage": "https://github.com/damenordev/agent-docs#readme",
50
44
  "bugs": {
51
- "url": "https://github.com/damenordev/doc-projects/issues"
45
+ "url": "https://github.com/damenordev/agent-docs/issues"
46
+ },
47
+ "scripts": {
48
+ "dev": "tsup --watch",
49
+ "build": "tsup",
50
+ "start": "node dist/index.js",
51
+ "typecheck": "tsc --noEmit"
52
52
  }
53
- }
53
+ }