spec-driven-agility 0.4.0 → 0.6.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/README.md +5 -2
- package/package.json +1 -1
- package/src/animation.js +76 -22
- package/src/cli.js +1 -1
- package/src/installer.js +15 -3
- package/templates/skills/sda-build/SKILL.md +1 -1
- package/templates/skills/sda-end/SKILL.md +7 -7
- package/templates/skills/sda-explore/SKILL.md +1 -1
- package/templates/skills/sda-spec/SKILL.md +3 -3
- package/templates/skills/sda-sprint/SKILL.md +4 -4
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Esto crea:
|
|
|
23
23
|
```
|
|
24
24
|
.opencode/commands/sda-*.md ← 5 comandos: /sda-sprint, /sda-explore, /sda-spec, /sda-build, /sda-end
|
|
25
25
|
.opencode/skills/sda-*/SKILL.md ← 5 skills con las reglas y plantillas
|
|
26
|
-
|
|
26
|
+
backlog/ ← backlog de sprints (se llena con /sda-sprint)
|
|
27
27
|
specs/ ← historia de specs viva (la mantiene /sda-end)
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -35,7 +35,10 @@ Después ejecuta `/sda-sprint` en opencode: ahí se define (o se hereda de un sp
|
|
|
35
35
|
sda update
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Re-sincroniza comandos y skills. No toca `
|
|
38
|
+
Re-sincroniza comandos y skills. No toca `backlog/` ni `specs/`.
|
|
39
|
+
|
|
40
|
+
> Si vienes de la 0.5.x o anterior, renombra tu carpeta `Backlog/` a `backlog/` una vez:
|
|
41
|
+
> `git mv Backlog backlog` (en Windows/macOS, si git no lo detecta, usa `git mv Backlog tmp && git mv tmp backlog`).
|
|
39
42
|
|
|
40
43
|
## Comandos
|
|
41
44
|
|
package/package.json
CHANGED
package/src/animation.js
CHANGED
|
@@ -11,35 +11,49 @@ const H = 15;
|
|
|
11
11
|
function buildLevels() {
|
|
12
12
|
const filled = Array.from({ length: H }, () => Array(W).fill(false));
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
// Elipse con rotación para hojas naturales y no simétricas.
|
|
15
|
+
const ell = (cx, cy, rx, ry, on, angle = 0) => {
|
|
16
|
+
const cos = Math.cos(angle);
|
|
17
|
+
const sin = Math.sin(angle);
|
|
15
18
|
for (let y = 0; y < H; y += 1) {
|
|
16
19
|
for (let x = 0; x < W; x += 1) {
|
|
17
|
-
const dx =
|
|
18
|
-
const dy =
|
|
19
|
-
|
|
20
|
+
const dx = x - cx;
|
|
21
|
+
const dy = y - cy;
|
|
22
|
+
const u = dx * cos + dy * sin;
|
|
23
|
+
const v = -dx * sin + dy * cos;
|
|
24
|
+
if ((u / rx) ** 2 + (v / ry) ** 2 <= 1) filled[y][x] = on;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
const dot = (cx, cy, r) => {
|
|
30
|
+
for (let y = Math.floor(cy - r); y <= Math.ceil(cy + r); y += 1) {
|
|
31
|
+
for (let x = Math.floor(cx - r); x <= Math.ceil(cx + r); x += 1) {
|
|
32
|
+
if (x < 0 || x >= W || y < 0 || y >= H) continue;
|
|
33
|
+
if ((x - cx) ** 2 + (y - cy) ** 2 <= r * r) filled[y][x] = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
27
37
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
const stroke = (x0, y0, x1, y1, r) => {
|
|
39
|
+
const steps = 60;
|
|
40
|
+
for (let i = 0; i <= steps; i += 1) {
|
|
41
|
+
const t = i / steps;
|
|
42
|
+
dot(x0 + (x1 - x0) * t, y0 + (y1 - y0) * t, r);
|
|
33
43
|
}
|
|
34
|
-
}
|
|
44
|
+
};
|
|
35
45
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
// Hojas distintas: la derecha es más alta, pequeña e inclinada hacia arriba;
|
|
47
|
+
// la izquierda queda más abajo, más grande y caída hacia fuera.
|
|
48
|
+
ell(20.4, 4, 5.9, 3.4, true, 0.2);
|
|
49
|
+
ell(5.9, 8.4, 6.4, 3.7, true, -0.22);
|
|
50
|
+
|
|
51
|
+
// Tallo largo, ligeramente inclinado, y peciolo de la hoja izquierda.
|
|
52
|
+
stroke(13.4, 12.2, 14.6, 4.8, 1);
|
|
53
|
+
stroke(11.7, 9.4, 13.9, 9.4, 0.55);
|
|
40
54
|
|
|
41
55
|
// Montículo.
|
|
42
|
-
ell(13.5, 17, 12,
|
|
56
|
+
ell(13.5, 17, 12.2, 4.8, true);
|
|
43
57
|
|
|
44
58
|
const isFilled = (x, y) => x >= 0 && x < W && y >= 0 && y < H && filled[y][x];
|
|
45
59
|
const isEdge = (x, y) =>
|
|
@@ -67,7 +81,7 @@ const RESET = '\x1b[0m';
|
|
|
67
81
|
const HIDE = '\x1b[?25l';
|
|
68
82
|
const SHOW = '\x1b[?25h';
|
|
69
83
|
const CLEAR = '\x1b[2K';
|
|
70
|
-
const BLOCK_HEIGHT = H
|
|
84
|
+
const BLOCK_HEIGHT = H; // sprite y panel comparten altura
|
|
71
85
|
|
|
72
86
|
// Verdes oscuros: cuerpo siempre visible (40/34), borde más oscuro (28/22).
|
|
73
87
|
const COLOR = {
|
|
@@ -76,8 +90,40 @@ const COLOR = {
|
|
|
76
90
|
'▓': '\x1b[38;5;34m',
|
|
77
91
|
'█': '\x1b[38;5;40m',
|
|
78
92
|
};
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
|
|
94
|
+
// Paleta del panel, alineada a la derecha de la planta.
|
|
95
|
+
const TITLE_COLOR = '\x1b[1m\x1b[97m';
|
|
96
|
+
const BODY_COLOR = '\x1b[38;5;252m';
|
|
97
|
+
const MUTED_COLOR = '\x1b[38;5;244m';
|
|
98
|
+
const CMD_COLOR = '\x1b[38;5;40m';
|
|
99
|
+
const PROMPT_COLOR = '\x1b[3m\x1b[97m';
|
|
100
|
+
|
|
101
|
+
const PANEL_GAP = ' ';
|
|
102
|
+
const COMMAND_COLUMN = 15;
|
|
103
|
+
|
|
104
|
+
function commandRow(command, description) {
|
|
105
|
+
return [
|
|
106
|
+
{ text: command, color: CMD_COLOR },
|
|
107
|
+
{ text: ' '.repeat(Math.max(2, COMMAND_COLUMN - command.length)), color: '' },
|
|
108
|
+
{ text: description, color: MUTED_COLOR },
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Cada fila del panel corresponde a una fila de la planta.
|
|
113
|
+
const PANEL = {
|
|
114
|
+
0: [{ text: 'Welcome to Spec-Driven Agility', color: TITLE_COLOR }],
|
|
115
|
+
1: [{ text: 'A lightweight spec-driven framework', color: MUTED_COLOR }],
|
|
116
|
+
3: [{ text: 'This setup will configure:', color: BODY_COLOR }],
|
|
117
|
+
4: [{ text: ' • Agent Skills for AI tools', color: MUTED_COLOR }],
|
|
118
|
+
5: [{ text: ' • Workflow commands for /sda-*', color: MUTED_COLOR }],
|
|
119
|
+
7: [{ text: 'Quick start after setup:', color: BODY_COLOR }],
|
|
120
|
+
8: commandRow('/sda-sprint', 'Plan the sprint backlog'),
|
|
121
|
+
9: commandRow('/sda-explore', 'Explore the approach'),
|
|
122
|
+
10: commandRow('/sda-spec', 'Write spec, design & tasks'),
|
|
123
|
+
11: commandRow('/sda-build', 'Implement with e2e TDD'),
|
|
124
|
+
12: commandRow('/sda-end', 'Validate and sync specs'),
|
|
125
|
+
14: [{ text: 'Press Enter to continue...', color: PROMPT_COLOR }],
|
|
126
|
+
};
|
|
81
127
|
|
|
82
128
|
function sleep(ms) {
|
|
83
129
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -104,6 +150,15 @@ function lineFor(y, phase) {
|
|
|
104
150
|
else ch = (x + y + phase) % 2 === 0 ? '█' : '▓';
|
|
105
151
|
out += COLOR[ch] + ch + RESET;
|
|
106
152
|
}
|
|
153
|
+
|
|
154
|
+
const panel = PANEL[y];
|
|
155
|
+
if (panel) {
|
|
156
|
+
out += PANEL_GAP;
|
|
157
|
+
for (const part of panel) {
|
|
158
|
+
out += part.color ? `${part.color}${part.text}${RESET}` : part.text;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
107
162
|
return out;
|
|
108
163
|
}
|
|
109
164
|
|
|
@@ -111,7 +166,6 @@ function drawFrame(stream, phase) {
|
|
|
111
166
|
for (let y = 0; y < H; y += 1) {
|
|
112
167
|
stream.write(`\r${CLEAR}${lineFor(y, phase)}\n`);
|
|
113
168
|
}
|
|
114
|
-
stream.write(`\r${CLEAR}${PROMPT_COLOR}${PROMPT}${RESET}\n`);
|
|
115
169
|
}
|
|
116
170
|
|
|
117
171
|
function erase(stream) {
|
package/src/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ Uso:
|
|
|
18
18
|
|
|
19
19
|
Comandos:
|
|
20
20
|
init [ruta] Instala los comandos /sda-*, las skills y las carpetas
|
|
21
|
-
|
|
21
|
+
backlog/ y specs/. Por defecto usa el directorio actual.
|
|
22
22
|
Usa --no-animation para omitir la intro animada.
|
|
23
23
|
update [ruta] Re-sincroniza comandos y skills. No toca config ni datos.
|
|
24
24
|
version Muestra la versión instalada.
|
package/src/installer.js
CHANGED
|
@@ -52,7 +52,7 @@ function installSkills(targetDir) {
|
|
|
52
52
|
|
|
53
53
|
function scaffoldDirs(targetDir) {
|
|
54
54
|
const created = [];
|
|
55
|
-
for (const name of ['
|
|
55
|
+
for (const name of ['backlog', 'specs']) {
|
|
56
56
|
const dir = path.join(targetDir, name);
|
|
57
57
|
if (fs.existsSync(dir)) continue;
|
|
58
58
|
ensureDir(dir);
|
|
@@ -62,6 +62,12 @@ function scaffoldDirs(targetDir) {
|
|
|
62
62
|
return created;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
function hasLegacyBacklogDir(targetDir) {
|
|
66
|
+
if (!fs.existsSync(targetDir)) return false;
|
|
67
|
+
const entries = fs.readdirSync(targetDir);
|
|
68
|
+
return entries.includes('Backlog') && !entries.includes('backlog');
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
function printHeader(targetDir) {
|
|
66
72
|
console.log('');
|
|
67
73
|
console.log(' Spec-Driven Agility (SDA)');
|
|
@@ -75,14 +81,20 @@ export function runInit(targetDir) {
|
|
|
75
81
|
const commands = installCommands(targetDir);
|
|
76
82
|
const skills = installSkills(targetDir);
|
|
77
83
|
const dirs = scaffoldDirs(targetDir);
|
|
84
|
+
const legacyBacklog = hasLegacyBacklogDir(targetDir);
|
|
78
85
|
|
|
79
86
|
console.log(` ✔ ${commands} comandos en .opencode/commands/`);
|
|
80
87
|
console.log(` ✔ ${skills} skills en .opencode/skills/`);
|
|
81
88
|
console.log(
|
|
82
89
|
dirs.length
|
|
83
90
|
? ` ✔ carpetas: ${dirs.join(', ')}`
|
|
84
|
-
: ' •
|
|
91
|
+
: ' • backlog/ y specs/ ya existían',
|
|
85
92
|
);
|
|
93
|
+
if (legacyBacklog) {
|
|
94
|
+
console.log(
|
|
95
|
+
' ! Detecté Backlog/ de una versión anterior: renómbrala a backlog/ para que los skills la encuentren.',
|
|
96
|
+
);
|
|
97
|
+
}
|
|
86
98
|
console.log('');
|
|
87
99
|
console.log(' Siguiente paso: en opencode, ejecuta /sda-sprint.');
|
|
88
100
|
console.log(' (El framework e2e lo defines o heredas ahí.)');
|
|
@@ -97,6 +109,6 @@ export function runUpdate(targetDir) {
|
|
|
97
109
|
|
|
98
110
|
console.log(` ✔ ${commands} comandos re-sincronizados`);
|
|
99
111
|
console.log(` ✔ ${skills} skills re-sincronizadas`);
|
|
100
|
-
console.log(' •
|
|
112
|
+
console.log(' • backlog/ y specs/ no se tocaron');
|
|
101
113
|
console.log('');
|
|
102
114
|
}
|
|
@@ -11,7 +11,7 @@ Pasos grandes: **una HU = sus escenarios e2e en verde = una entrega**. No se par
|
|
|
11
11
|
|
|
12
12
|
## 1. Revisión
|
|
13
13
|
|
|
14
|
-
- Lee los artefactos de la HU: `
|
|
14
|
+
- Lee los artefactos de la HU: `backlog/<sprint>/HU_NN/{spec,design,tasks}.md`. Son el insumo
|
|
15
15
|
esperado; si no están, pídemelos.
|
|
16
16
|
- Lee el `## Framework e2e` del `Plan.md`: framework, comando y directorio de tests. Si no está,
|
|
17
17
|
avísame y lo decidimos antes de escribir tests.
|
|
@@ -12,11 +12,11 @@ ni código para "hacer pasar": si algo falla, lo reportas y te detienes.
|
|
|
12
12
|
|
|
13
13
|
## 0. Identifica la HU
|
|
14
14
|
|
|
15
|
-
- Localiza `
|
|
15
|
+
- Localiza `backlog/<sprint>/HU_NN/` y su `Plan.md`. Lee `spec.md`, `design.md`, `tasks.md` y el
|
|
16
16
|
`Plan.md` completos.
|
|
17
17
|
- Si el contexto no alcanza, deduce la candidata desde el diff de git y **confírmala conmigo antes
|
|
18
18
|
de tocar nada**.
|
|
19
|
-
- Si el plan vive en `
|
|
19
|
+
- Si el plan vive en `backlog/archive/<sprint>/`, ya estaba completo: no lo desarchives; repórtalo y
|
|
20
20
|
confirma.
|
|
21
21
|
|
|
22
22
|
## 1. Recorre lo implementado
|
|
@@ -108,17 +108,17 @@ archivos/funciones/tests. No reescribas el resto de la HU.
|
|
|
108
108
|
Solo cuando **acabas de marcar la última HU pendiente** del Backlog:
|
|
109
109
|
|
|
110
110
|
- Detente y pregunta (herramienta de preguntas): ¿archivo el sprint en
|
|
111
|
-
`
|
|
111
|
+
`backlog/archive/<sprint>/`? Opciones: archivar o dejarlo en `backlog/<sprint>/`. Nunca archives
|
|
112
112
|
sin confirmación.
|
|
113
113
|
- **No** → no muevas nada; déjalo dicho.
|
|
114
114
|
- **Sí**:
|
|
115
|
-
- Crea `
|
|
116
|
-
- Mueve la carpeta completa `
|
|
115
|
+
- Crea `backlog/archive/` si no existe.
|
|
116
|
+
- Mueve la carpeta completa `backlog/<sprint>/` → `backlog/archive/<sprint>/` (movimiento del
|
|
117
117
|
sistema, no `git mv`; no stagees ni commitees).
|
|
118
118
|
- Si el destino existe, detente y pregunta (no sobrescribas ni fusiones).
|
|
119
119
|
- Verifica rutas y deja constancia.
|
|
120
120
|
- Si queda alguna HU sin marcar, **no preguntes ni archives**: el plan sigue en
|
|
121
|
-
`
|
|
121
|
+
`backlog/<sprint>/`.
|
|
122
122
|
|
|
123
123
|
## 7. Cierra
|
|
124
124
|
|
|
@@ -126,7 +126,7 @@ Mensaje breve y cálido:
|
|
|
126
126
|
|
|
127
127
|
- ✅ `HU_NN` validada, spec sincronizada en `specs/<capability>/spec.md` y HU marcada.
|
|
128
128
|
- Dos o tres datos: qué quedó funcionando, verificaciones en verde, qué falta a mano.
|
|
129
|
-
- Si archivaste, di la ruta nueva. Si no, que el plan sigue en `
|
|
129
|
+
- Si archivaste, di la ruta nueva. Si no, que el plan sigue en `backlog/<sprint>/`.
|
|
130
130
|
- Sugerencia de commit, sin commitear.
|
|
131
131
|
|
|
132
132
|
No cierres con pregunta (la única permitida es la del paso 6).
|
|
@@ -21,7 +21,7 @@ enfoques.
|
|
|
21
21
|
## Lo que SIEMPRE reviso antes de opinar
|
|
22
22
|
|
|
23
23
|
1. **Framework e2e** — lo leo del `## Framework e2e` del `Plan.md` del sprint actual. Si no está,
|
|
24
|
-
busco el bloque en otros `
|
|
24
|
+
busco el bloque en otros `backlog/**/Plan.md` (activos y `archive/`) y lo heredo; si no existe
|
|
25
25
|
ninguno, te aviso y lo decidimos antes de avanzar (nunca exploro sin framework de tests). Lo
|
|
26
26
|
escribo en el `Plan.md` actual si faltaba.
|
|
27
27
|
2. **Historia de specs viva** — la capability que toca la HU. Busco `specs/<capability>/spec.md`;
|
|
@@ -11,7 +11,7 @@ escenarios e2e de `spec.md` son el **contrato de test** que `/sda-build` está o
|
|
|
11
11
|
|
|
12
12
|
## Entrada
|
|
13
13
|
|
|
14
|
-
- La HU del `
|
|
14
|
+
- La HU del `backlog/<sprint>/Plan.md` (ruta o bloque pegado).
|
|
15
15
|
- El enfoque acordado en `/sda-explore`.
|
|
16
16
|
- El `## Framework e2e` del `Plan.md` y la spec viva `specs/<capability>/spec.md` de la capability
|
|
17
17
|
que toca.
|
|
@@ -48,7 +48,7 @@ escenarios e2e de `spec.md` son el **contrato de test** que `/sda-build` está o
|
|
|
48
48
|
|
|
49
49
|
## Ubicación
|
|
50
50
|
|
|
51
|
-
`
|
|
51
|
+
`backlog/<sprint>/HU_NN/` con `spec.md`, `design.md` y `tasks.md`. Numeración según el `## Backlog`
|
|
52
52
|
del plan: `HU1` → `HU_01`. Si no se puede saber, usa el siguiente número libre. Si la carpeta ya
|
|
53
53
|
existe, pregunta antes de sobrescribir.
|
|
54
54
|
|
|
@@ -57,7 +57,7 @@ existe, pregunta antes de sobrescribir.
|
|
|
57
57
|
```markdown
|
|
58
58
|
# HU_NN — <título corto>
|
|
59
59
|
|
|
60
|
-
**Plan:** `
|
|
60
|
+
**Plan:** `backlog/<sprint>/Plan.md` · HU_NN
|
|
61
61
|
**Estado:** 🔲 Planificado
|
|
62
62
|
**Capability:** <ruta de specs, ej. `exports`>
|
|
63
63
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sda-sprint
|
|
3
|
-
description: Crea o actualiza el
|
|
3
|
+
description: Crea o actualiza el backlog de un sprint como historias de usuario verticales. Define o hereda el framework e2e (obligatorio) y lo guarda en el Plan.md. Sin criterios de aceptación ni implementación; eso es /sda-spec.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ Antes de armar el backlog, garantiza que el framework de tests e2e esté definid
|
|
|
20
20
|
contrato de cada HU y no se trabaja sin él.
|
|
21
21
|
|
|
22
22
|
1. **Busca una decisión previa** con un `grep` acotado de `## Framework e2e` en los
|
|
23
|
-
`
|
|
23
|
+
`backlog/**/Plan.md` (sprints activos y `backlog/archive/`). Lee solo ese bloque; no leas los
|
|
24
24
|
planes enteros.
|
|
25
25
|
2. **Si existe**, hereda la más reciente: escribe ese mismo bloque en el nuevo `Plan.md`. No
|
|
26
26
|
preguntes nada.
|
|
@@ -86,8 +86,8 @@ Agrega `Requiere: #N` solo cuando una historia no tiene sentido sin otra.
|
|
|
86
86
|
|
|
87
87
|
Al terminar, ofrece guardar el plan acordado. No lo guardes sin mi OK.
|
|
88
88
|
|
|
89
|
-
- Carpeta: `
|
|
90
|
-
- Si `
|
|
89
|
+
- Carpeta: `backlog/<nombre-descriptivo>/Plan.md` (kebab-case en español, 2–4 palabras, sin acentos).
|
|
90
|
+
- Si `backlog/` no existe, créala con esa grafía.
|
|
91
91
|
- Si la carpeta ya existe, pregunta si actualizo su `Plan.md` o uso otro nombre. Nunca sobrescribas
|
|
92
92
|
sin preguntar.
|
|
93
93
|
- Formato de `Plan.md`:
|