zugzbot-sdd 1.5.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/AGENTS.md +212 -0
- package/README.md +112 -0
- package/ZUGZ.md +91 -0
- package/agents/aux-handyman.md +36 -0
- package/agents/aux-oracle.md +39 -0
- package/agents/sdd-archiver.md +33 -0
- package/agents/sdd-builder.md +29 -0
- package/agents/sdd-deployer.md +43 -0
- package/agents/sdd-explorer.md +49 -0
- package/agents/sdd-planner.md +59 -0
- package/agents/sdd-tester.md +51 -0
- package/agents/zugzbot.md +84 -0
- package/bin/zugzbot.js +249 -0
- package/bun.lock +259 -0
- package/commands/sdd-archiver.md +11 -0
- package/commands/sdd-builder.md +11 -0
- package/commands/sdd-deployer.md +12 -0
- package/commands/sdd-explorer.md +11 -0
- package/commands/sdd-planner.md +11 -0
- package/commands/sdd-tester.md +12 -0
- package/commands/sdd.md +11 -0
- package/eslint.config.js +51 -0
- package/opencode.json +121 -0
- package/package.json +46 -0
- package/plugin.json +10 -0
- package/plugins/plugin_sdd_core.ts +54 -0
- package/plugins/plugin_tui.tsx +318 -0
- package/sdd +1228 -0
- package/skills/sdd-dependency-cooldown/SKILL.md +40 -0
- package/skills/sdd-tree-generator/SKILL.md +40 -0
- package/skills-lock.json +35 -0
- package/tests/static/dom_structure.test.js +57 -0
- package/tests/static/tag_balance.test.js +74 -0
- package/tests/unit/harness_structure.test.js +65 -0
- package/tools/brain-utils.ts +122 -0
- package/tools/check_dependency_cooldown.ts +134 -0
- package/tools/index.ts +14 -0
- package/tools/sdd_archive_and_commit.ts +207 -0
- package/tools/sdd_bdd_tester.ts +163 -0
- package/tools/sdd_brain_sync.ts +160 -0
- package/tools/sdd_checkpoint.ts +142 -0
- package/tools/sdd_compact_context.ts +122 -0
- package/tools/sdd_generate_tree.ts +64 -0
- package/tools/sdd_install_autoskills.ts +100 -0
- package/tools/sdd_regression_detector.ts +241 -0
- package/tools/sdd_requirement_tracker.ts +236 -0
- package/tools/sdd_secret_scanner.ts +205 -0
- package/tools/sdd_spec_validator.ts +139 -0
- package/tools/sdd_transition.ts +375 -0
- package/tools/sdd_ui_auditor.ts +310 -0
- package/tsconfig.json +28 -0
- package/zugz-models.json +23 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Planificar el requerimiento y realizar encuesta al usuario. Fase 1 del ciclo SDD."
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: minimax-coding-plan/MiniMax-M2.7
|
|
5
|
+
variant: medium
|
|
6
|
+
permission:
|
|
7
|
+
edit: allow
|
|
8
|
+
bash: ask
|
|
9
|
+
lsp: allow
|
|
10
|
+
tools:
|
|
11
|
+
"sdd_transition": allow
|
|
12
|
+
"sdd_brain_sync": allow
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# @sdd-planner
|
|
16
|
+
|
|
17
|
+
## READ
|
|
18
|
+
- `.openspec/diagnostics.md` (si existe)
|
|
19
|
+
- Requerimiento del usuario
|
|
20
|
+
|
|
21
|
+
## DO
|
|
22
|
+
- Analiza el requerimiento
|
|
23
|
+
- Identifica archivos y funciones a modificar (rangos de líneas exactos)
|
|
24
|
+
- **Si hay dudas técnicas**: usa `question` para preguntar al usuario (máx 3-5 preguntas)
|
|
25
|
+
- Detecta si hay funciones duplicadas en múltiples archivos
|
|
26
|
+
|
|
27
|
+
## WRITE
|
|
28
|
+
- `.openspec/changes/<change-name>/specs/spec.md`
|
|
29
|
+
|
|
30
|
+
## FORMAT (spec.md)
|
|
31
|
+
```markdown
|
|
32
|
+
# Plano Técnico de Especificación: [nombre-cambio]
|
|
33
|
+
|
|
34
|
+
## 1. Diagnóstico y Archivos Afectados
|
|
35
|
+
- `ruta/archivo.js` (Líneas X-Y: descripción de lógica actual)
|
|
36
|
+
|
|
37
|
+
## 2. Consenso de Encuesta con el Usuario
|
|
38
|
+
- **Pregunta A**: [Resumen de la duda y decisión adoptada]
|
|
39
|
+
- **Pregunta B**: [Resumen de la duda y decisión adoptada]
|
|
40
|
+
|
|
41
|
+
## 3. Propuesta de Solución y Arquitectura
|
|
42
|
+
- [Un solo párrafo conciso con el enfoque técnico]
|
|
43
|
+
|
|
44
|
+
## 4. Especificaciones BDD (Comportamiento)
|
|
45
|
+
Feature: [Breve descripción]
|
|
46
|
+
Scenario: [Caso de prueba principal]
|
|
47
|
+
Given [Contexto inicial]
|
|
48
|
+
When [Acción que realiza el usuario]
|
|
49
|
+
Then [Resultado final esperado]
|
|
50
|
+
|
|
51
|
+
## 5. Criterios de Aceptación y Calidad (QA)
|
|
52
|
+
- [ ] Criterio 1: El elemento X debe responder de manera Y ante Z.
|
|
53
|
+
- [ ] Criterio 2: El diseño debe incorporar responsive y micro-animaciones fluidas.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## RETURN
|
|
57
|
+
- Resumen: "Spec creado para [nombre]. Archivos: X, Preguntas respondidas: Y"
|
|
58
|
+
- Estado: success / blocked
|
|
59
|
+
- Si blocked: "Necesito respuesta a preguntas: ..."
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Validar el código (linter, auditorías). Fase 3 del ciclo SDD."
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: minimax-coding-plan/MiniMax-M2.7
|
|
5
|
+
variant: medium
|
|
6
|
+
permission:
|
|
7
|
+
edit: allow
|
|
8
|
+
lsp: allow
|
|
9
|
+
tools:
|
|
10
|
+
"sdd_transition": allow
|
|
11
|
+
"sdd_ui_auditor": allow
|
|
12
|
+
"sdd_spec_validator": allow
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# @sdd-tester
|
|
16
|
+
|
|
17
|
+
## READ
|
|
18
|
+
- `.openspec/changes/<change-name>/specs/spec.md`
|
|
19
|
+
- Código implementado
|
|
20
|
+
|
|
21
|
+
## DO
|
|
22
|
+
- Ejecuta linter y validadores estáticos
|
|
23
|
+
- Ejecuta `sdd_ui_auditor` si hay HTML/frontend
|
|
24
|
+
- Autocorrige errores de sintaxis simples (máx 3 intentos)
|
|
25
|
+
|
|
26
|
+
## WRITE
|
|
27
|
+
- `.openspec/changes/<change-name>/validation_report.md`
|
|
28
|
+
|
|
29
|
+
## FORMAT (validation_report.md)
|
|
30
|
+
```markdown
|
|
31
|
+
# Validation Report
|
|
32
|
+
|
|
33
|
+
## Linter
|
|
34
|
+
- Estado: PASÓ / ADVERTENCIAS / ERRORES
|
|
35
|
+
|
|
36
|
+
## UI Auditor
|
|
37
|
+
- Estado: PASÓ / PROBLEMAS
|
|
38
|
+
|
|
39
|
+
## Correcciones
|
|
40
|
+
- [errores autocorregidos]
|
|
41
|
+
|
|
42
|
+
## QA
|
|
43
|
+
- [x] Criterio 1 - [resultado]
|
|
44
|
+
- [ ] Criterio 2 - [resultado]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## RETURN
|
|
48
|
+
- Resumen: "Validación completada. Linter: X, UI: Y, QA: Z"
|
|
49
|
+
- Estado: success / blocked / error
|
|
50
|
+
- Si blocked: "El código tiene problemas que requieren re-implementación"
|
|
51
|
+
- Si error: "Error crítico: ..."
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Orquestador Maestro del ciclo SDD. Maneja el flujo entre agentes y el estado del ciclo."
|
|
3
|
+
mode: primary
|
|
4
|
+
model: minimax-coding-plan/MiniMax-M2.7
|
|
5
|
+
variant: medium
|
|
6
|
+
permission:
|
|
7
|
+
task:
|
|
8
|
+
"sdd-*": allow
|
|
9
|
+
"aux-*": allow
|
|
10
|
+
question: allow
|
|
11
|
+
lsp: allow
|
|
12
|
+
edit:
|
|
13
|
+
"*": deny
|
|
14
|
+
".openspec/sdd-lock.json": allow
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Zugzbot - Orquestador SDD
|
|
18
|
+
|
|
19
|
+
## READ
|
|
20
|
+
- `.openspec/sdd-lock.json`
|
|
21
|
+
|
|
22
|
+
## DO
|
|
23
|
+
|
|
24
|
+
### 1. Gestionar Estado del Ciclo
|
|
25
|
+
- Leer lockfile para saber en qué fase está
|
|
26
|
+
- Actualizar lockfile con `sdd_transition` después de cada fase
|
|
27
|
+
|
|
28
|
+
### 2. Delegar según Fase
|
|
29
|
+
| Fase | Agente | Output | HIL? |
|
|
30
|
+
|------|--------|--------|------|
|
|
31
|
+
| 0 | `@sdd-explorer` | `diagnostics.md` | No |
|
|
32
|
+
| 1 | `@sdd-planner` | `spec.md` | **Sí** (aprobar spec) |
|
|
33
|
+
| 2 | `@sdd-builder` | código | No |
|
|
34
|
+
| 3 | `@sdd-tester` | `validation_report.md` | No |
|
|
35
|
+
| 4 | `@sdd-deployer` | `deployment_report.md` | **Sí** (validar QA) |
|
|
36
|
+
| 5 | `@sdd-archiver` | commit + archivado | No (cierra) |
|
|
37
|
+
|
|
38
|
+
### 3. Manejar Auto-Pilot
|
|
39
|
+
- Si `auto_pilot: true`: F0→F1→F2→F3 van sin pausas
|
|
40
|
+
- **HIL post-F1 y post-F4 son OBLIGATORIOS** aunque auto_pilot esté prendido
|
|
41
|
+
|
|
42
|
+
### 4. Manejar Bloqueos y Errores
|
|
43
|
+
- Si un agente retorna `blocked` o `error`: analizar y decidir próximo paso
|
|
44
|
+
- Si necesita replanificar → volver a F1
|
|
45
|
+
- Si necesita reimplementar → volver a F2
|
|
46
|
+
- Si necesita revalidar → volver a F3
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Flujo
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Usuario pide cambio
|
|
54
|
+
↓
|
|
55
|
+
F0: @sdd-explorer → diagnostics.md
|
|
56
|
+
↓
|
|
57
|
+
F1: @sdd-planner → spec.md
|
|
58
|
+
↓ HIL: usuario aprueba
|
|
59
|
+
F2: @sdd-builder → código
|
|
60
|
+
↓
|
|
61
|
+
F3: @sdd-tester → validation_report.md
|
|
62
|
+
↓
|
|
63
|
+
F4: @sdd-deployer → deployment_report.md
|
|
64
|
+
↓ HIL: usuario valida QA
|
|
65
|
+
F5: @sdd-archiver → commit + archivado
|
|
66
|
+
↓
|
|
67
|
+
Ciclo cerrado
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## RETURN (al usuario)
|
|
73
|
+
- Resumen de estado: "Fase X completada. [resumen]"
|
|
74
|
+
- Siguiente acción: "Esperando tu aprobación para continuar" o "Continuando automáticamente..."
|
|
75
|
+
- Roadmap dinámico basado en `active_phase` del lockfile:
|
|
76
|
+
- [x] F0: Diagnóstico (si phase > 0)
|
|
77
|
+
- [x] F1: Planificación (si phase > 1)
|
|
78
|
+
- [➡️] F2: Construcción (si phase = 2)
|
|
79
|
+
- [x] F2 completada (si phase > 2)
|
|
80
|
+
- [➡️] F3: Validación (si phase = 3)
|
|
81
|
+
- [x] F3 completada (si phase > 3)
|
|
82
|
+
- [➡️] F4: Deploy (si phase = 4)
|
|
83
|
+
- [x] F4 completada (si phase > 4)
|
|
84
|
+
- [➡️] F5: Cierre (si phase = 5)
|
package/bin/zugzbot.js
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "fs"
|
|
4
|
+
import path from "path"
|
|
5
|
+
import { fileURLToPath } from "url"
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
8
|
+
const __dirname = path.dirname(__filename)
|
|
9
|
+
const PKG_ROOT = path.resolve(__dirname, "..")
|
|
10
|
+
|
|
11
|
+
const INSTALL_DIR = process.cwd()
|
|
12
|
+
|
|
13
|
+
const TEMPLATE_OPENCODE_JSON = {
|
|
14
|
+
"$schema": "https://opencode.ai/config.json",
|
|
15
|
+
"lsp": true,
|
|
16
|
+
"permission": {
|
|
17
|
+
"edit": "allow",
|
|
18
|
+
"bash": "allow",
|
|
19
|
+
"lsp": "allow"
|
|
20
|
+
},
|
|
21
|
+
"agent": {
|
|
22
|
+
"zugzbot": {
|
|
23
|
+
"mode": "primary",
|
|
24
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/zugzbot.md}",
|
|
25
|
+
"permission": {
|
|
26
|
+
"task": { "sdd-*": "allow", "aux-*": "allow" },
|
|
27
|
+
"question": "allow",
|
|
28
|
+
"lsp": "allow",
|
|
29
|
+
"edit": { ".openspec/sdd-lock.json": "allow" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"sdd-explorer": {
|
|
33
|
+
"mode": "subagent",
|
|
34
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/sdd-explorer.md}",
|
|
35
|
+
"permission": {
|
|
36
|
+
"bash": "allow",
|
|
37
|
+
"lsp": "allow",
|
|
38
|
+
"tools": { "sdd_transition": "allow", "sdd_generate_tree": "allow" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"sdd-planner": {
|
|
42
|
+
"mode": "subagent",
|
|
43
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/sdd-planner.md}",
|
|
44
|
+
"permission": {
|
|
45
|
+
"edit": "allow",
|
|
46
|
+
"bash": "ask",
|
|
47
|
+
"lsp": "allow",
|
|
48
|
+
"tools": { "sdd_transition": "allow", "sdd_brain_sync": "allow" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"sdd-builder": {
|
|
52
|
+
"mode": "subagent",
|
|
53
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/sdd-builder.md}",
|
|
54
|
+
"permission": {
|
|
55
|
+
"edit": "allow",
|
|
56
|
+
"bash": "allow",
|
|
57
|
+
"lsp": "allow",
|
|
58
|
+
"tools": { "sdd_transition": "allow", "sdd_ui_auditor": "allow" }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"sdd-tester": {
|
|
62
|
+
"mode": "subagent",
|
|
63
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/sdd-tester.md}",
|
|
64
|
+
"permission": {
|
|
65
|
+
"edit": "allow",
|
|
66
|
+
"bash": "allow",
|
|
67
|
+
"lsp": "allow",
|
|
68
|
+
"tools": { "sdd_transition": "allow", "sdd_ui_auditor": "allow", "sdd_spec_validator": "allow" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"sdd-archiver": {
|
|
72
|
+
"mode": "subagent",
|
|
73
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/sdd-archiver.md}",
|
|
74
|
+
"permission": {
|
|
75
|
+
"edit": "allow",
|
|
76
|
+
"bash": "allow",
|
|
77
|
+
"lsp": "allow",
|
|
78
|
+
"tools": { "sdd_archive_and_commit": "allow", "sdd_transition": "allow", "sdd_brain_sync": "allow", "sdd_install_autoskills": "allow" }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"sdd-deployer": {
|
|
82
|
+
"mode": "subagent",
|
|
83
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/sdd-deployer.md}",
|
|
84
|
+
"permission": {
|
|
85
|
+
"bash": "allow",
|
|
86
|
+
"tools": { "sdd_transition": "allow" }
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"aux-handyman": {
|
|
90
|
+
"mode": "subagent",
|
|
91
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/aux-handyman.md}",
|
|
92
|
+
"permission": {
|
|
93
|
+
"edit": "allow",
|
|
94
|
+
"bash": "allow",
|
|
95
|
+
"lsp": "allow"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"aux-oracle": {
|
|
99
|
+
"mode": "subagent",
|
|
100
|
+
"prompt": "{file:./node_modules/zugzbot-sdd/agents/aux-oracle.md}",
|
|
101
|
+
"permission": {
|
|
102
|
+
"edit": "deny",
|
|
103
|
+
"bash": "deny",
|
|
104
|
+
"lsp": "deny"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const TEMPLATE_SDD_LOCK = {
|
|
111
|
+
change_name: "nuevo-cambio",
|
|
112
|
+
active_phase: 0,
|
|
113
|
+
active_subagent: "sdd-explorer",
|
|
114
|
+
status: "idle",
|
|
115
|
+
auto_pilot: false,
|
|
116
|
+
iteration: 0,
|
|
117
|
+
last_updated: "",
|
|
118
|
+
orchestrator_mode: "delegation_only",
|
|
119
|
+
direction: "forward",
|
|
120
|
+
last_successful_phase: 0,
|
|
121
|
+
retry_count: 0,
|
|
122
|
+
corrective_loop_active: false,
|
|
123
|
+
fresh_task: false,
|
|
124
|
+
checkpoints: [],
|
|
125
|
+
tasks: [],
|
|
126
|
+
complexity: "medium",
|
|
127
|
+
last_checkpoint_id: null,
|
|
128
|
+
last_restored_from: null
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const TEMPLATE_TUI_JSON = {
|
|
132
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
133
|
+
"plugin": ["./.opencode/plugins/plugin_tui.tsx"]
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const TEMPLATE_GITIGNORE = `# Zugzbot SDD
|
|
137
|
+
.openspec/sdd-lock.json
|
|
138
|
+
.openspec/checkpoints/
|
|
139
|
+
tui.json
|
|
140
|
+
`
|
|
141
|
+
|
|
142
|
+
const BRAIN_TEMPLATE = `# 🧠 Brain del Proyecto
|
|
143
|
+
|
|
144
|
+
## General
|
|
145
|
+
- Proyecto inicializado con Zugzbot SDD Plugin v1.0.0
|
|
146
|
+
`
|
|
147
|
+
|
|
148
|
+
function green(msg) { console.log(` \x1b[32m✓\x1b[0m ${msg}`) }
|
|
149
|
+
function yellow(msg) { console.log(` \x1b[33m⚠\x1b[0m ${msg}`) }
|
|
150
|
+
function header(msg) { console.log(`\n\x1b[1m${msg}\x1b[0m`) }
|
|
151
|
+
|
|
152
|
+
function init() {
|
|
153
|
+
console.log(`
|
|
154
|
+
╔══════════════════════════════════════════════════════════╗
|
|
155
|
+
║ Zugzbot SDD Plugin v1.0.0 ║
|
|
156
|
+
║ Spec-Driven Development Swarm ║
|
|
157
|
+
╚══════════════════════════════════════════════════════════╝
|
|
158
|
+
`)
|
|
159
|
+
|
|
160
|
+
header("📁 Estructurando proyecto...")
|
|
161
|
+
|
|
162
|
+
fs.mkdirSync(path.join(INSTALL_DIR, ".openspec/changes"), { recursive: true })
|
|
163
|
+
fs.mkdirSync(path.join(INSTALL_DIR, ".opencode/plugins"), { recursive: true })
|
|
164
|
+
green("Directorios creados")
|
|
165
|
+
|
|
166
|
+
header("📝 Creando archivos de configuración...")
|
|
167
|
+
|
|
168
|
+
const opencodePath = path.join(INSTALL_DIR, "opencode.json")
|
|
169
|
+
if (!fs.existsSync(opencodePath)) {
|
|
170
|
+
fs.writeFileSync(opencodePath, JSON.stringify(TEMPLATE_OPENCODE_JSON, null, 2), "utf-8")
|
|
171
|
+
green("opencode.json creado")
|
|
172
|
+
} else {
|
|
173
|
+
yellow("opencode.json ya existe, preservado")
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const tuiPath = path.join(INSTALL_DIR, "tui.json")
|
|
177
|
+
if (!fs.existsSync(tuiPath)) {
|
|
178
|
+
fs.writeFileSync(tuiPath, JSON.stringify(TEMPLATE_TUI_JSON, null, 2), "utf-8")
|
|
179
|
+
green("tui.json creado")
|
|
180
|
+
} else {
|
|
181
|
+
yellow("tui.json ya existe, preservado")
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const sddLockPath = path.join(INSTALL_DIR, ".openspec/sdd-lock.json")
|
|
185
|
+
if (!fs.existsSync(sddLockPath)) {
|
|
186
|
+
fs.writeFileSync(sddLockPath, JSON.stringify(TEMPLATE_SDD_LOCK, null, 2), "utf-8")
|
|
187
|
+
green(".openspec/sdd-lock.json creado")
|
|
188
|
+
} else {
|
|
189
|
+
yellow("sdd-lock.json ya existe, preservado")
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const brainPath = path.join(INSTALL_DIR, ".openspec/brain.md")
|
|
193
|
+
if (!fs.existsSync(brainPath)) {
|
|
194
|
+
fs.writeFileSync(brainPath, BRAIN_TEMPLATE, "utf-8")
|
|
195
|
+
green(".openspec/brain.md creado")
|
|
196
|
+
} else {
|
|
197
|
+
yellow("brain.md ya existe, preservado")
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const gitignorePath = path.join(INSTALL_DIR, ".gitignore")
|
|
201
|
+
if (fs.existsSync(gitignorePath)) {
|
|
202
|
+
const content = fs.readFileSync(gitignorePath, "utf-8")
|
|
203
|
+
if (!content.includes("# Zugzbot SDD")) {
|
|
204
|
+
fs.appendFileSync(gitignorePath, "\n" + TEMPLATE_GITIGNORE, "utf-8")
|
|
205
|
+
green(".gitignore actualizado")
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const sddScriptPath = path.join(PKG_ROOT, "sdd")
|
|
210
|
+
const localSddPath = path.join(INSTALL_DIR, "sdd")
|
|
211
|
+
if (fs.existsSync(sddScriptPath) && !fs.existsSync(localSddPath)) {
|
|
212
|
+
fs.copyFileSync(sddScriptPath, localSddPath)
|
|
213
|
+
fs.chmodSync(localSddPath, 0o755)
|
|
214
|
+
green("Script ./sdd copiado")
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const pluginTuiPath = path.join(PKG_ROOT, "plugins/plugin_tui.tsx")
|
|
218
|
+
const pluginCorePath = path.join(PKG_ROOT, "plugins/plugin_sdd_core.ts")
|
|
219
|
+
const localPluginDir = path.join(INSTALL_DIR, ".opencode/plugins")
|
|
220
|
+
|
|
221
|
+
if (fs.existsSync(pluginTuiPath)) {
|
|
222
|
+
fs.copyFileSync(pluginTuiPath, path.join(localPluginDir, "plugin_tui.tsx"))
|
|
223
|
+
green("plugin_tui.tsx copiado")
|
|
224
|
+
}
|
|
225
|
+
if (fs.existsSync(pluginCorePath)) {
|
|
226
|
+
fs.copyFileSync(pluginCorePath, path.join(localPluginDir, "plugin_sdd_core.ts"))
|
|
227
|
+
green("plugin_sdd_core.ts copiado")
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
console.log(`
|
|
231
|
+
╔══════════════════════════════════════════════════════════╗
|
|
232
|
+
║ ✅ Zugzbot SDD Plugin instalado correctamente! ║
|
|
233
|
+
╚══════════════════════════════════════════════════════════╝
|
|
234
|
+
|
|
235
|
+
Uso: opencode + @zugzbot para iniciar el ciclo SDD
|
|
236
|
+
./sdd status para ver el estado
|
|
237
|
+
|
|
238
|
+
Estructura del proyecto:
|
|
239
|
+
├── opencode.json (configuración de agentes)
|
|
240
|
+
├── tui.json (configuración TUI)
|
|
241
|
+
├── .openspec/ (estado del ciclo SDD)
|
|
242
|
+
│ ├── sdd-lock.json
|
|
243
|
+
│ └── brain.md
|
|
244
|
+
├── .opencode/plugins/ (plugins de opencode)
|
|
245
|
+
└── sdd (comando local)
|
|
246
|
+
`)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
init()
|