@damenor/agent-docs 0.1.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.
Files changed (44) hide show
  1. package/README.md +115 -0
  2. package/dist/index.js +568 -0
  3. package/package.json +53 -0
  4. package/templates/base/AGENTS.md +177 -0
  5. package/templates/base/CHANGELOG.md +86 -0
  6. package/templates/base/README.md +110 -0
  7. package/templates/base/docs/CONTEXT.md +111 -0
  8. package/templates/base/docs/README.md +131 -0
  9. package/templates/base/docs/adr/TEMPLATE.md +83 -0
  10. package/templates/modules/agents/.agents/agents/doc-designer.md +56 -0
  11. package/templates/modules/agents/.agents/agents/doc-maintainer.md +54 -0
  12. package/templates/modules/agents/.agents/agents/doc-reviewer.md +80 -0
  13. package/templates/modules/agents/.agents/agents/doc-writer.md +66 -0
  14. package/templates/modules/agents/.agents/agents/reviewer.md +138 -0
  15. package/templates/modules/agents/.agents/skills/doc-design/SKILL.md +359 -0
  16. package/templates/modules/agents/.agents/skills/doc-design/references/design-system-format.md +550 -0
  17. package/templates/modules/agents/.agents/skills/doc-maintain/SKILL.md +345 -0
  18. package/templates/modules/agents/.agents/skills/doc-maintain/references/triggers.md +311 -0
  19. package/templates/modules/agents/.agents/skills/doc-review/SKILL.md +324 -0
  20. package/templates/modules/agents/.agents/skills/doc-review/references/health-checklist.md +290 -0
  21. package/templates/modules/agents/.agents/skills/doc-scaffold/SKILL.md +277 -0
  22. package/templates/modules/agents/.agents/skills/doc-scaffold/references/diataxis-quick-ref.md +149 -0
  23. package/templates/modules/agents/.agents/skills/doc-write/SKILL.md +414 -0
  24. package/templates/modules/agents/.agents/skills/doc-write/references/adr-format.md +194 -0
  25. package/templates/modules/agents/.agents/skills/doc-write/references/diataxis-patterns.md +351 -0
  26. package/templates/modules/ci/.github/workflows/docs-check.yml +94 -0
  27. package/templates/modules/design/docs/DESIGN.md +253 -0
  28. package/templates/modules/explanation/docs/explanation/agent-flow.md +15 -0
  29. package/templates/modules/explanation/docs/explanation/architecture.md +138 -0
  30. package/templates/modules/guides/docs/guides/deployment.md +189 -0
  31. package/templates/modules/guides/docs/guides/runbooks/TEMPLATE.md +86 -0
  32. package/templates/modules/guides/docs/guides/troubleshooting.md +65 -0
  33. package/templates/modules/operations/docs/operations/README.md +115 -0
  34. package/templates/modules/product/docs/product/overview.md +90 -0
  35. package/templates/modules/product/docs/roadmap.md +80 -0
  36. package/templates/modules/reference/docs/reference/api.md +131 -0
  37. package/templates/modules/reference/docs/reference/code-style.md +275 -0
  38. package/templates/modules/reference/docs/reference/configuration.md +117 -0
  39. package/templates/modules/reference/docs/reference/infrastructure.md +191 -0
  40. package/templates/modules/tutorials/docs/tutorials/environment-setup.md +212 -0
  41. package/templates/modules/tutorials/docs/tutorials/first-task.md +246 -0
  42. package/templates/modules/tutorials/docs/tutorials/quick-start.md +146 -0
  43. package/templates/shared/.editorconfig +20 -0
  44. package/templates/shared/.markdownlint.json +14 -0
@@ -0,0 +1,359 @@
1
+ ---
2
+ name: doc-design
3
+ description: >
4
+ Crea y mantiene la documentación del sistema de diseño (DESIGN.md).
5
+ Extrae tokens reales del código (CSS vars, Tailwind config, theme files),
6
+ genera documentación estructurada con YAML frontmatter para colores,
7
+ tipografía, espaciado, bordes, elevación y componentes.
8
+ TRIGGER: Cuando el usuario dice "documentar diseño", "design system",
9
+ "tokens de diseño", "DESIGN.md", "extraer estilos", "auditar estilos",
10
+ o se detectan cambios en archivos de estilos/CSS/theme.
11
+ license: Apache-2.0
12
+ metadata:
13
+ author: damenordev
14
+ version: "1.0"
15
+ ---
16
+
17
+ # doc-design
18
+
19
+ ## Cuándo Usar
20
+
21
+ - **Proyecto nuevo**: Se necesita crear el archivo DESIGN.md con el sistema de diseño
22
+ - **Cambios en UI**: Se modificaron estilos, componentes o tokens de diseño
23
+ - **Extracción de tokens**: Se quiere documentar los valores reales del código (CSS vars, Tailwind config, theme files)
24
+ - **Auditoría de consistencia**: Se detectan inconsistencias en el diseño (colores duplicados, spacing inconsistente)
25
+ - **Post-design-change**: Después de cambios en CSS/theme, actualizar DESIGN.md
26
+
27
+ ## Patrones Críticos
28
+
29
+ ### REGLA #1: DESIGN.md usa frontmatter YAML para tokens estructurados
30
+
31
+ ```yaml
32
+ ---
33
+ created: "2024-01-15"
34
+ status: active
35
+ type: reference
36
+ tags: [design-system, tokens, componentes]
37
+ colors:
38
+ brand:
39
+ primary: "#3B82F6"
40
+ secondary: "#8B5CF6"
41
+ surface:
42
+ background: "#FFFFFF"
43
+ card: "#F9FAFB"
44
+ elevated: "#FFFFFF"
45
+ text:
46
+ primary: "#111827"
47
+ secondary: "#6B7280"
48
+ disabled: "#9CA3AF"
49
+ semantic:
50
+ success: "#10B981"
51
+ warning: "#F59E0B"
52
+ error: "#EF4444"
53
+ info: "#3B82F6"
54
+ typography:
55
+ heading-xl: { font-size: "2rem", font-weight: "700", line-height: "1.2" }
56
+ heading-lg: { font-size: "1.5rem", font-weight: "600", line-height: "1.3" }
57
+ heading-md: { font-size: "1.25rem", font-weight: "600", line-height: "1.4" }
58
+ body-lg: { font-size: "1.125rem", font-weight: "400", line-height: "1.6" }
59
+ body-md: { font-size: "1rem", font-weight: "400", line-height: "1.6" }
60
+ body-sm: { font-size: "0.875rem", font-weight: "400", line-height: "1.5" }
61
+ caption: { font-size: "0.75rem", font-weight: "400", line-height: "1.4" }
62
+ spacing:
63
+ scale: [0, "0.25rem", "0.5rem", "0.75rem", "1rem", "1.5rem", "2rem", "3rem", "4rem", "6rem"]
64
+ tokens: { xs: "0.25rem", sm: "0.5rem", md: "1rem", lg: "1.5rem", xl: "2rem", "2xl": "3rem", "3xl": "4rem" }
65
+ rounded:
66
+ scale: [0, "0.25rem", "0.5rem", "0.75rem", "1rem", "1.5rem", "9999px"]
67
+ tokens: { none: "0", sm: "0.25rem", md: "0.5rem", lg: "0.75rem", xl: "1rem", "2xl": "1.5rem", full: "9999px" }
68
+ elevation:
69
+ tiers:
70
+ flat: "none"
71
+ sm: "0 1px 2px rgba(0,0,0,0.05)"
72
+ md: "0 4px 6px rgba(0,0,0,0.1)"
73
+ lg: "0 10px 15px rgba(0,0,0,0.1)"
74
+ xl: "0 20px 25px rgba(0,0,0,0.15)"
75
+ components:
76
+ button:
77
+ variants: [primary, secondary, outline, ghost, danger]
78
+ sizes: [sm, md, lg]
79
+ base: "font-weight: 600, border-radius: {rounded.md}, padding: {spacing.sm} {spacing.md}"
80
+ card:
81
+ variants: [default, outlined, elevated]
82
+ base: "border-radius: {rounded.lg}, padding: {spacing.lg}, background: {colors.surface.card}"
83
+ input:
84
+ variants: [default, error, disabled]
85
+ sizes: [sm, md, lg]
86
+ base: "border: 1px solid, border-radius: {rounded.md}, padding: {spacing.sm} {spacing.md}"
87
+ responsive:
88
+ breakpoints: { sm: "640px", md: "768px", lg: "1024px", xl: "1280px", "2xl": "1536px" }
89
+ ---
90
+ ```
91
+
92
+ ### REGLA #2: Cada componente referencia tokens con notación `{sección.token}`
93
+
94
+ ```yaml
95
+ components:
96
+ button:
97
+ base: "border-radius: {rounded.md}, padding: {spacing.sm} {spacing.md}"
98
+ # NO: border-radius: 0.5rem, padding: 0.5rem 1rem
99
+ # SÍ: Referenciar tokens para mantener consistencia
100
+ ```
101
+
102
+ ### REGLA #3: Extraer valores REALES del código
103
+
104
+ NUNCA inventar valores. Extraer de:
105
+
106
+ | Fuente | Qué buscar |
107
+ |--------|------------|
108
+ | CSS variables | `:root { --color-primary: ... }` |
109
+ | Tailwind config | `tailwind.config.js` → `theme.extend` |
110
+ | Theme files | `theme.ts`, `theme.json`, `tokens.json` |
111
+ | Styled-components | `Theme` object |
112
+ | Design tokens | Figma API, Style Dictionary |
113
+ | Sass/Less vars | `_variables.scss`, `_variables.less` |
114
+
115
+ ### REGLA #4: Mantener sincronizado con el código
116
+
117
+ ```
118
+ Si cambia el código de estilos → cambiar DESIGN.md
119
+ Si cambia DESIGN.md → cambiar el código de estilos
120
+ ```
121
+
122
+ La sincronización es bidireccional. Usar `doc-review` para verificar.
123
+
124
+ ### REGLA #5: Estructura consistente
125
+
126
+ El YAML frontmatter debe seguir este orden:
127
+ 1. `colors` (brand, surface, text, semantic)
128
+ 2. `typography` (jerarquía completa con tokens)
129
+ 3. `spacing` (escala y tokens nombrados)
130
+ 4. `rounded` (escala de border-radius y tokens)
131
+ 5. `elevation` (tiers de sombra)
132
+ 6. `components` (componentes UI documentados)
133
+ 7. `responsive` (breakpoints)
134
+
135
+ ### REGLA #6: Sección overview en markdown
136
+
137
+ Después del frontmatter, incluir una sección narrativa:
138
+
139
+ ```markdown
140
+ ## Visión General
141
+
142
+ [Filosofía del diseño: 2-3 oraciones sobre los principios guía]
143
+
144
+ ## Uso de Tokens
145
+
146
+ [Cómo referenciar tokens en el código — con ejemplo específico del stack]
147
+ ```
148
+
149
+ ## Flujo del Proceso
150
+
151
+ ### Paso 1: Verificar archivos de diseño existentes
152
+
153
+ ```
154
+ Buscar:
155
+ ├── CSS variables → :root, [data-theme]
156
+ ├── Tailwind → tailwind.config.js/ts, tailwind.config.cjs
157
+ ├── Theme files → theme.ts, theme.json, tokens.json
158
+ ├── Sass/Less → _variables.scss, _variables.less
159
+ ├── Styled-components → Theme provider
160
+ ├── Existing DESIGN.md → NO sobreescribir sin preguntar
161
+ └── Design tool exports → Figma, Sketch, tokens.json
162
+ ```
163
+
164
+ ### Paso 2: Extraer valores actuales
165
+
166
+ ```
167
+ 1. Leer cada archivo de estilos encontrado
168
+ 2. Extraer colores, tipografía, spacing, borders, shadows
169
+ 3. Normalizar formato (hex, rem, px → formato consistente)
170
+ 4. Identificar tokens nombrados vs valores hardcodeados
171
+ 5. Detectar duplicados e inconsistencias
172
+ ```
173
+
174
+ ### Paso 3: Crear/actualizar DESIGN.md
175
+
176
+ ```
177
+ 1. Generar frontmatter YAML con todos los tokens extraídos
178
+ 2. Documentar componentes que existen en el código
179
+ 3. Agregar sección overview en markdown
180
+ 4. Notar gaps e inconsistencias encontrados
181
+ ```
182
+
183
+ ### Paso 4: Agregar overview narrativo
184
+
185
+ ```markdown
186
+ ## Visión General
187
+
188
+ Este sistema de diseño sigue un enfoque basado en tokens donde los valores
189
+ base (colores, spacing, tipografía) se definen como variables y se referencian
190
+ en los componentes. La jerarquía es:
191
+
192
+ 1. **Tokens base**: Valores crudos (colores hex, tamaños rem)
193
+ 2. **Tokens semánticos**: Tokens con propósito ({colors.semantic.error})
194
+ 3. **Tokens de componente**: Valores por defecto de cada componente
195
+
196
+ ## Paleta de Colores
197
+
198
+ [Explicar la lógica de la paleta — no solo listar valores]
199
+
200
+ ## Tipografía
201
+
202
+ [Explicar la jerarquía tipográfica]
203
+
204
+ ## Componentes
205
+
206
+ [Resumen de los componentes documentados y su lógica]
207
+ ```
208
+
209
+ ### Paso 5: Documentar componentes existentes
210
+
211
+ Para cada componente encontrado en el código:
212
+
213
+ ```yaml
214
+ components:
215
+ button:
216
+ variants: [primary, secondary, outline, ghost, danger]
217
+ sizes: [sm, md, lg]
218
+ base: "font-weight: 600, border-radius: {rounded.md}"
219
+ primary:
220
+ bg: "{colors.brand.primary}"
221
+ text: "#FFFFFF"
222
+ hover: "darken 10%"
223
+ secondary:
224
+ bg: "{colors.brand.secondary}"
225
+ text: "#FFFFFF"
226
+ ```
227
+
228
+ ### Paso 6: Notar gaps e inconsistencias
229
+
230
+ ```markdown
231
+ ## Hallazgos
232
+
233
+ ### ⚠️ Inconsistencias detectadas
234
+ - Color `#3b82f6` usado en 3 archivos como hardcoded (debería ser token)
235
+ - Spacing inconsistente en cards: algunos usan 1rem, otros 1.25rem
236
+ - No existe token para el shadow del modal
237
+
238
+ ### 📋 Pendientes
239
+ - Migrar colores hardcodeados a CSS variables
240
+ - Unificar spacing de cards
241
+ - Crear tokens de elevation para modals y tooltips
242
+ ```
243
+
244
+ ## Comandos
245
+
246
+ ### Archivo principal
247
+
248
+ ```
249
+ DESIGN.md — Sistema de diseño del proyecto
250
+ ```
251
+
252
+ ### Verificación post-creación
253
+
254
+ ```
255
+ 1. ¿DESIGN.md tiene frontmatter YAML con todas las secciones? → colors, typography, spacing, rounded, elevation, components
256
+ 2. ¿Los tokens referenciados existen? → {colors.brand.primary} debe estar definido
257
+ 3. ¿Los valores son reales (extraídos del código)? → No inventados
258
+ 4. ¿Hay sección overview en markdown? → Filosofía + uso de tokens
259
+ 5. ¿Se notaron gaps e inconsistencias? → Sección de hallazgos
260
+ ```
261
+
262
+ ## Sincronización con el Código
263
+
264
+ ### Detección de cambios
265
+
266
+ | Archivo cambia | Qué actualizar en DESIGN.md |
267
+ |----------------|----------------------------|
268
+ | CSS variables | Sección `colors`, `spacing`, etc. |
269
+ | Tailwind config | Todas las secciones de tokens |
270
+ | Theme files | Todas las secciones |
271
+ | Componente nuevo | Sección `components` |
272
+ | Breakpoints | Sección `responsive` |
273
+
274
+ ### Formatos por stack
275
+
276
+ | Stack | Fuente de tokens | Formato |
277
+ |-------|-----------------|---------|
278
+ | CSS puro | `:root { --token: value }` | Mapear `--color-primary` → `{colors.brand.primary}` |
279
+ | Tailwind | `theme.extend.colors` | Mapear config directo |
280
+ | Sass | `$color-primary: value` | Mapear variables |
281
+ | Styled-components | `theme.colors.primary` | Mapear theme object |
282
+ | CSS Modules | Compose from variables | Mapear composes |
283
+
284
+ ## Ejemplo Concreto de Extracción
285
+
286
+ ### Input: Proyecto con Tailwind
287
+
288
+ ```javascript
289
+ // tailwind.config.ts encontrado
290
+ module.exports = {
291
+ theme: {
292
+ extend: {
293
+ colors: {
294
+ brand: { DEFAULT: '#3B82F6', dark: '#2563EB', light: '#93C5FD' },
295
+ surface: { DEFAULT: '#FFFFFF', muted: '#F9FAFB' },
296
+ },
297
+ fontFamily: {
298
+ sans: ['Inter', 'system-ui', 'sans-serif'],
299
+ mono: ['JetBrains Mono', 'monospace'],
300
+ },
301
+ borderRadius: { sm: '6px', md: '8px', lg: '12px', xl: '16px', full: '9999px' },
302
+ },
303
+ },
304
+ }
305
+ ```
306
+
307
+ ### Output: DESIGN.md generado
308
+
309
+ ```yaml
310
+ ---
311
+ created: "2026-05-07"
312
+ updated: "2026-05-07"
313
+ status: active
314
+ type: design
315
+ tags: [design-system, tokens, tailwind]
316
+ colors:
317
+ brand:
318
+ primary: "#3B82F6"
319
+ primary-dark: "#2563EB"
320
+ primary-light: "#93C5FD"
321
+ surface:
322
+ background: "#FFFFFF"
323
+ muted: "#F9FAFB"
324
+ text:
325
+ primary: "#111827"
326
+ secondary: "#6B7280"
327
+ semantic:
328
+ error: "#EF4444"
329
+ success: "#10B981"
330
+ typography:
331
+ heading-xl: { fontFamily: "Inter, system-ui, sans-serif", fontSize: "2rem", fontWeight: "700" }
332
+ heading-lg: { fontFamily: "Inter, system-ui, sans-serif", fontSize: "1.5rem", fontWeight: "600" }
333
+ body-md: { fontFamily: "Inter, system-ui, sans-serif", fontSize: "1rem", fontWeight: "400" }
334
+ body-sm: { fontFamily: "Inter, system-ui, sans-serif", fontSize: "0.875rem", fontWeight: "400" }
335
+ code: { fontFamily: "JetBrains Mono, monospace", fontSize: "0.875rem" }
336
+ rounded:
337
+ sm: "6px"
338
+ md: "8px"
339
+ lg: "12px"
340
+ xl: "16px"
341
+ full: "9999px"
342
+ spacing:
343
+ xs: "0.25rem"
344
+ sm: "0.5rem"
345
+ md: "1rem"
346
+ lg: "1.5rem"
347
+ xl: "2rem"
348
+ "2xl": "3rem"
349
+ ---
350
+
351
+ ## Visión General
352
+
353
+ Design system basado en Tailwind CSS con tokens extendidos. ...
354
+ ```
355
+
356
+ ## Recursos
357
+
358
+ - [Design System Format](references/design-system-format.md) — Esquema completo del formato YAML con ejemplos
359
+ - Skills relacionados: `doc-write` (escribir docs), `doc-review` (auditar consistencia), `doc-maintain` (sincronizar cambios)