elsabro 2.1.0 → 2.3.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/elsabro-orchestrator.md +113 -0
- package/commands/elsabro/add-phase.md +17 -0
- package/commands/elsabro/add-todo.md +111 -53
- package/commands/elsabro/audit-milestone.md +19 -0
- package/commands/elsabro/check-todos.md +210 -31
- package/commands/elsabro/complete-milestone.md +20 -1
- package/commands/elsabro/debug.md +19 -0
- package/commands/elsabro/discuss-phase.md +18 -1
- package/commands/elsabro/execute.md +511 -58
- package/commands/elsabro/insert-phase.md +18 -1
- package/commands/elsabro/list-phase-assumptions.md +17 -0
- package/commands/elsabro/new-milestone.md +19 -0
- package/commands/elsabro/new.md +19 -0
- package/commands/elsabro/pause-work.md +19 -0
- package/commands/elsabro/plan-milestone-gaps.md +20 -1
- package/commands/elsabro/plan.md +264 -36
- package/commands/elsabro/progress.md +203 -79
- package/commands/elsabro/quick.md +19 -0
- package/commands/elsabro/remove-phase.md +17 -0
- package/commands/elsabro/research-phase.md +18 -1
- package/commands/elsabro/resume-work.md +19 -0
- package/commands/elsabro/start.md +399 -98
- package/commands/elsabro/verify-work.md +138 -5
- package/hooks/confirm-destructive.sh +145 -0
- package/hooks/hooks-config.json +81 -0
- package/hooks/lint-check.sh +238 -0
- package/hooks/post-edit-test.sh +189 -0
- package/package.json +3 -2
- package/references/SYSTEM_INDEX.md +241 -0
- package/references/command-flow.md +352 -0
- package/references/enforcement-rules.md +331 -0
- package/references/error-contracts-tests.md +1171 -0
- package/references/error-contracts.md +3102 -0
- package/references/error-handling-instructions.md +26 -12
- package/references/parallel-worktrees.md +293 -0
- package/references/state-sync.md +381 -0
- package/references/task-dispatcher.md +388 -0
- package/references/tasks-integration.md +380 -0
- package/scripts/setup-parallel-worktrees.sh +319 -0
- package/skills/api-microservice.md +765 -0
- package/skills/api-setup.md +76 -3
- package/skills/auth-setup.md +46 -6
- package/skills/chrome-extension.md +584 -0
- package/skills/cicd-setup.md +1206 -0
- package/skills/cli-tool.md +884 -0
- package/skills/database-setup.md +41 -5
- package/skills/desktop-app.md +1351 -0
- package/skills/expo-app.md +35 -2
- package/skills/full-stack-app.md +543 -0
- package/skills/memory-update.md +207 -0
- package/skills/mobile-app.md +813 -0
- package/skills/nextjs-app.md +33 -2
- package/skills/payments-setup.md +76 -1
- package/skills/review.md +331 -0
- package/skills/saas-starter.md +639 -0
- package/skills/sentry-setup.md +41 -7
- package/skills/techdebt.md +289 -0
- package/skills/testing-setup.md +1218 -0
- package/skills/tutor.md +219 -0
- package/templates/.planning/notes/.gitkeep +0 -0
- package/templates/CLAUDE.md.template +48 -0
- package/templates/error-handling-config.json +79 -2
- package/templates/mistakes.md.template +52 -0
- package/templates/patterns.md.template +114 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# ELSABRO Command Flow & Synchronization
|
|
2
|
+
|
|
3
|
+
## ESTADO COMPARTIDO
|
|
4
|
+
|
|
5
|
+
Los comandos ELSABRO se sincronizan a través de un sistema de estado compartido. Esto permite que cada comando sepa dónde está el usuario en el flujo y qué contexto necesita.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## FLUJO PRINCIPAL
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ /elsabro:start │
|
|
14
|
+
│ (Entry Point - Orquestador) │
|
|
15
|
+
└─────────────────────────┬───────────────────────────────────────────┘
|
|
16
|
+
│
|
|
17
|
+
┌───────────────┼───────────────┬───────────────┐
|
|
18
|
+
▼ ▼ ▼ ▼
|
|
19
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
20
|
+
│ :new │ │ :plan │ │ :debug │ │ :quick │
|
|
21
|
+
│ Proyecto │ │ Feature │ │ Bugs │ │ Rápido │
|
|
22
|
+
│ nuevo │ │ nueva │ │ │ │ │
|
|
23
|
+
└────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
|
|
24
|
+
│ │ │ │
|
|
25
|
+
▼ ▼ ▼ ▼
|
|
26
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
27
|
+
│ :execute │◄───│ :execute │◄───│ :execute │ │
|
|
28
|
+
│ │ │ │ │ │ │
|
|
29
|
+
└────┬─────┘ └────┬─────┘ └────┬─────┘ │
|
|
30
|
+
│ │ │ │
|
|
31
|
+
└───────────────┴───────────────┴───────────────┘
|
|
32
|
+
│
|
|
33
|
+
▼
|
|
34
|
+
┌──────────────┐
|
|
35
|
+
│ :verify-work │
|
|
36
|
+
│ (Siempre) │
|
|
37
|
+
└──────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ARCHIVO DE ESTADO: .elsabro/state.json
|
|
43
|
+
|
|
44
|
+
Cada proyecto ELSABRO mantiene un archivo de estado en `.elsabro/state.json`:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"version": "1.0.0",
|
|
49
|
+
"created_at": "2024-01-15T10:30:00Z",
|
|
50
|
+
"updated_at": "2024-01-15T14:45:00Z",
|
|
51
|
+
|
|
52
|
+
"current_flow": {
|
|
53
|
+
"command": "execute",
|
|
54
|
+
"phase": "implementation",
|
|
55
|
+
"started_at": "2024-01-15T14:30:00Z"
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
"context": {
|
|
59
|
+
"project_type": "fullstack",
|
|
60
|
+
"tech_stack": ["nextjs", "prisma", "postgresql"],
|
|
61
|
+
"current_feature": "auth-system"
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
"history": [
|
|
65
|
+
{
|
|
66
|
+
"command": "start",
|
|
67
|
+
"completed_at": "2024-01-15T10:30:00Z",
|
|
68
|
+
"result": "redirected_to_new"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"command": "new",
|
|
72
|
+
"completed_at": "2024-01-15T11:00:00Z",
|
|
73
|
+
"result": "project_created"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"command": "plan",
|
|
77
|
+
"completed_at": "2024-01-15T12:30:00Z",
|
|
78
|
+
"result": "plan_approved",
|
|
79
|
+
"artifact": ".planning/auth-plan.md"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
|
|
83
|
+
"pending_tasks": [],
|
|
84
|
+
"blocked_on": null
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## SINCRONIZACIÓN ENTRE COMANDOS
|
|
91
|
+
|
|
92
|
+
### Regla 1: Leer Estado Antes de Actuar
|
|
93
|
+
|
|
94
|
+
**OBLIGATORIO**: Todo comando debe leer `.elsabro/state.json` al iniciar.
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// Pseudo-código - cada comando hace esto primero
|
|
98
|
+
const state = readState(".elsabro/state.json");
|
|
99
|
+
|
|
100
|
+
if (!state) {
|
|
101
|
+
// Primera vez - inicializar
|
|
102
|
+
createState();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Verificar si hay flujo en progreso
|
|
106
|
+
if (state.current_flow && state.current_flow.command !== thisCommand) {
|
|
107
|
+
// Advertir al usuario
|
|
108
|
+
warn(`Hay un flujo de ${state.current_flow.command} en progreso`);
|
|
109
|
+
askUser("¿Continuar con ese flujo o iniciar uno nuevo?");
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Regla 2: Actualizar Estado al Cambiar de Fase
|
|
114
|
+
|
|
115
|
+
**OBLIGATORIO**: Actualizar `current_flow` al cambiar de fase o comando.
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
// Al iniciar una fase
|
|
119
|
+
updateState({
|
|
120
|
+
current_flow: {
|
|
121
|
+
command: "execute",
|
|
122
|
+
phase: "exploration",
|
|
123
|
+
started_at: new Date().toISOString()
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Al completar
|
|
128
|
+
updateState({
|
|
129
|
+
current_flow: null,
|
|
130
|
+
history: [...state.history, {
|
|
131
|
+
command: "execute",
|
|
132
|
+
completed_at: new Date().toISOString(),
|
|
133
|
+
result: "success"
|
|
134
|
+
}]
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Regla 3: Pasar Contexto Entre Comandos
|
|
139
|
+
|
|
140
|
+
**OBLIGATORIO**: Los comandos deben preservar y extender el contexto.
|
|
141
|
+
|
|
142
|
+
| De | A | Contexto Pasado |
|
|
143
|
+
|----|---|-----------------|
|
|
144
|
+
| start | new | project_type, user_level |
|
|
145
|
+
| start | plan | existing_codebase_info |
|
|
146
|
+
| new | plan | tech_stack, project_structure |
|
|
147
|
+
| plan | execute | plan_file_path, acceptance_criteria |
|
|
148
|
+
| execute | verify-work | changed_files, test_locations |
|
|
149
|
+
| debug | execute | root_cause, fix_approach |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## PUNTOS DE SINCRONIZACIÓN
|
|
154
|
+
|
|
155
|
+
### Checkpoint 1: Después de start
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"checkpoint": "post_start",
|
|
160
|
+
"data": {
|
|
161
|
+
"user_intent": "create_new_app | add_feature | fix_bug | understand",
|
|
162
|
+
"detected_context": "greenfield | brownfield | continuation",
|
|
163
|
+
"next_command": "new | plan | debug | analyst"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Checkpoint 2: Después de plan
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"checkpoint": "post_plan",
|
|
173
|
+
"data": {
|
|
174
|
+
"plan_file": ".planning/feature-xyz.md",
|
|
175
|
+
"phases": ["setup", "core", "integration", "tests"],
|
|
176
|
+
"estimated_complexity": "low | medium | high",
|
|
177
|
+
"ready_for_execution": true
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Checkpoint 3: Después de execute
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"checkpoint": "post_execute",
|
|
187
|
+
"data": {
|
|
188
|
+
"changed_files": ["src/auth.ts", "src/api/login.ts"],
|
|
189
|
+
"tests_added": ["tests/auth.test.ts"],
|
|
190
|
+
"commits": ["abc123", "def456"],
|
|
191
|
+
"verification_pending": true
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## TRANSICIONES VÁLIDAS
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
start → new ✓ (proyecto nuevo)
|
|
202
|
+
start → plan ✓ (feature en proyecto existente)
|
|
203
|
+
start → debug ✓ (resolver problema)
|
|
204
|
+
start → quick ✓ (tarea simple)
|
|
205
|
+
|
|
206
|
+
new → plan ✓ (siguiente paso natural)
|
|
207
|
+
new → execute ✗ (necesita plan primero)
|
|
208
|
+
|
|
209
|
+
plan → execute ✓ (ejecutar el plan)
|
|
210
|
+
plan → plan ✓ (refinar plan)
|
|
211
|
+
|
|
212
|
+
execute → verify ✓ (verificar trabajo)
|
|
213
|
+
execute → execute ✓ (continuar implementación)
|
|
214
|
+
|
|
215
|
+
verify → execute ✓ (corregir problemas encontrados)
|
|
216
|
+
verify → [done] ✓ (trabajo completado)
|
|
217
|
+
|
|
218
|
+
debug → execute ✓ (aplicar fix)
|
|
219
|
+
debug → plan ✓ (fix complejo necesita plan)
|
|
220
|
+
|
|
221
|
+
quick → verify ✓ (verificar tarea rápida)
|
|
222
|
+
quick → [done] ✓ (tarea completada)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## RECUPERACIÓN DE CONTEXTO
|
|
228
|
+
|
|
229
|
+
### Cuando el Usuario Vuelve
|
|
230
|
+
|
|
231
|
+
Si el usuario vuelve después de una pausa:
|
|
232
|
+
|
|
233
|
+
1. **Leer estado**: `.elsabro/state.json`
|
|
234
|
+
2. **Detectar flujo incompleto**: `current_flow !== null`
|
|
235
|
+
3. **Ofrecer opciones**:
|
|
236
|
+
```
|
|
237
|
+
Veo que estabas en medio de [comando] fase [fase].
|
|
238
|
+
|
|
239
|
+
¿Qué quieres hacer?
|
|
240
|
+
1) Continuar donde lo dejaste
|
|
241
|
+
2) Empezar algo nuevo (esto descartará el progreso)
|
|
242
|
+
3) Ver resumen de lo que falta
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Resume Automático
|
|
246
|
+
|
|
247
|
+
Si `current_flow.phase === "implementation"` y hay archivos modificados sin commit:
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
Detecté cambios sin guardar de tu última sesión:
|
|
251
|
+
- src/auth.ts (modificado)
|
|
252
|
+
- src/api/login.ts (nuevo)
|
|
253
|
+
|
|
254
|
+
¿Quieres que continúe la implementación o prefieres revisar primero?
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## INTEGRACIÓN CON ENFORCEMENT RULES
|
|
260
|
+
|
|
261
|
+
Cada punto de sincronización debe respetar las reglas de `/references/enforcement-rules.md`:
|
|
262
|
+
|
|
263
|
+
1. **TaskCreate** antes de cada transición de comando
|
|
264
|
+
2. **TaskUpdate(in_progress)** antes de ejecutar la lógica
|
|
265
|
+
3. **Parallelism** cuando la transición involucra múltiples operaciones
|
|
266
|
+
4. **TaskUpdate(completed)** y actualizar `state.json` al finalizar
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## COMANDOS QUE MODIFICAN ESTADO
|
|
271
|
+
|
|
272
|
+
| Comando | Lee Estado | Escribe Estado | Crea Artefactos |
|
|
273
|
+
|---------|-----------|----------------|-----------------|
|
|
274
|
+
| start | SÍ | SÍ | NO |
|
|
275
|
+
| new | SÍ | SÍ | SÍ (.elsabro/, estructura) |
|
|
276
|
+
| plan | SÍ | SÍ | SÍ (.planning/*.md) |
|
|
277
|
+
| execute | SÍ | SÍ | SÍ (código, tests) |
|
|
278
|
+
| verify-work | SÍ | SÍ | SÍ (reportes) |
|
|
279
|
+
| debug | SÍ | SÍ | OPCIONAL |
|
|
280
|
+
| quick | SÍ | SÍ | VARIABLE |
|
|
281
|
+
| help | NO | NO | NO |
|
|
282
|
+
| settings | SÍ | SÍ | NO |
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## EJEMPLO COMPLETO: Flujo de Nueva Feature
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Usuario: "Quiero agregar sistema de pagos"
|
|
290
|
+
|
|
291
|
+
1. /elsabro:start
|
|
292
|
+
- Lee state.json → proyecto existente
|
|
293
|
+
- Detecta: brownfield
|
|
294
|
+
- Usuario elige: "Agregar algo"
|
|
295
|
+
- Actualiza state: { user_intent: "add_feature", next: "plan" }
|
|
296
|
+
- Redirige a /elsabro:plan
|
|
297
|
+
|
|
298
|
+
2. /elsabro:plan
|
|
299
|
+
- Lee state.json → sabe que viene de start, es feature nueva
|
|
300
|
+
- TaskCreate("Explorar codebase para payments")
|
|
301
|
+
- Task(haiku) x3 [paralelo] → exploración
|
|
302
|
+
- TaskCreate("Generar plan de payments")
|
|
303
|
+
- Task(opus) x2 → genera plan
|
|
304
|
+
- Guarda .planning/payments-plan.md
|
|
305
|
+
- Actualiza state: { plan_file: "...", ready_for_execution: true }
|
|
306
|
+
- Usuario aprueba → sugiere /elsabro:execute
|
|
307
|
+
|
|
308
|
+
3. /elsabro:execute
|
|
309
|
+
- Lee state.json → sabe el plan, los archivos
|
|
310
|
+
- TaskCreate("Implementar fase 1: setup Stripe")
|
|
311
|
+
- Task(haiku) x3 [paralelo] → exploración
|
|
312
|
+
- Task(opus) x2 [paralelo] → implementación
|
|
313
|
+
- Task(opus) x3 [paralelo] → verificación
|
|
314
|
+
- Actualiza state: { changed_files: [...], commits: [...] }
|
|
315
|
+
- Sugiere /elsabro:verify-work
|
|
316
|
+
|
|
317
|
+
4. /elsabro:verify-work
|
|
318
|
+
- Lee state.json → sabe qué archivos verificar
|
|
319
|
+
- Task(opus) x3 [paralelo] → verificación exhaustiva
|
|
320
|
+
- Actualiza state: { verification: "passed" }
|
|
321
|
+
- DONE
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## ANTI-PATRONES
|
|
327
|
+
|
|
328
|
+
### NO hacer:
|
|
329
|
+
|
|
330
|
+
1. **Ignorar estado existente**
|
|
331
|
+
```
|
|
332
|
+
✗ Empezar fresh sin leer state.json
|
|
333
|
+
✓ Siempre leer y ofrecer continuar si hay flujo
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
2. **Saltar comandos**
|
|
337
|
+
```
|
|
338
|
+
✗ start → execute (sin plan)
|
|
339
|
+
✓ start → plan → execute
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
3. **No actualizar estado**
|
|
343
|
+
```
|
|
344
|
+
✗ Completar comando sin escribir state.json
|
|
345
|
+
✓ Actualizar estado al inicio y fin de cada fase
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
4. **Perder contexto entre comandos**
|
|
349
|
+
```
|
|
350
|
+
✗ Cada comando empieza de cero
|
|
351
|
+
✓ Pasar contexto relevante entre comandos
|
|
352
|
+
```
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# ELSABRO Enforcement Rules
|
|
2
|
+
|
|
3
|
+
## REGLAS NO NEGOCIABLES
|
|
4
|
+
|
|
5
|
+
Estas reglas son **OBLIGATORIAS**. No hay excepciones. No hay "casos especiales". Si no las sigues, estás violando el protocolo ELSABRO.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### 1. TaskCreate ANTES de Acción
|
|
10
|
+
|
|
11
|
+
**PROHIBIDO**: Ejecutar código, modificar archivos, o hacer operaciones sin crear Task primero.
|
|
12
|
+
|
|
13
|
+
**OBLIGATORIO**: Seguir la secuencia completa:
|
|
14
|
+
```
|
|
15
|
+
TaskCreate → TaskUpdate(in_progress) → Task() → TaskUpdate(completed)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Ejemplo correcto:**
|
|
19
|
+
```
|
|
20
|
+
1. TaskCreate("Implementar endpoint de autenticación")
|
|
21
|
+
2. TaskUpdate(id, status: "in_progress")
|
|
22
|
+
3. Task("Implementa el endpoint POST /api/auth/login...")
|
|
23
|
+
4. TaskUpdate(id, status: "completed", result: "...")
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Ejemplo INCORRECTO:**
|
|
27
|
+
```
|
|
28
|
+
# VIOLACIÓN: Ejecutar sin Task
|
|
29
|
+
Edit(file_path: "src/api/auth.ts", ...)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### 2. TaskUpdate(in_progress) ANTES de Task()
|
|
35
|
+
|
|
36
|
+
**PROHIBIDO**: Lanzar `Task()` sin primero marcar la tarea como `in_progress`.
|
|
37
|
+
|
|
38
|
+
**OBLIGATORIO**: Actualizar estado ANTES de ejecutar.
|
|
39
|
+
|
|
40
|
+
**Razón**: El sistema necesita saber qué está en ejecución para coordinación, recuperación de errores, y visibilidad.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
# CORRECTO
|
|
44
|
+
TaskUpdate(id: "task-001", status: "in_progress")
|
|
45
|
+
Task("prompt...")
|
|
46
|
+
|
|
47
|
+
# INCORRECTO - VIOLACIÓN
|
|
48
|
+
Task("prompt...") # Sin TaskUpdate previo
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### 3. Mínimo de Agentes por Fase
|
|
54
|
+
|
|
55
|
+
**PROHIBIDO**: Lanzar menos agentes del mínimo requerido.
|
|
56
|
+
|
|
57
|
+
**OBLIGATORIO**: Respetar los mínimos según la fase:
|
|
58
|
+
|
|
59
|
+
| Fase | Mínimo Agentes | Modelo | Paralelo |
|
|
60
|
+
|------|----------------|--------|----------|
|
|
61
|
+
| Exploración | 3+ | HAIKU | OBLIGATORIO |
|
|
62
|
+
| Implementación | 2+ | OPUS | OBLIGATORIO |
|
|
63
|
+
| Verificación | 3+ | OPUS | OBLIGATORIO |
|
|
64
|
+
|
|
65
|
+
**Ejemplo exploración:**
|
|
66
|
+
```
|
|
67
|
+
# CORRECTO: 3 agentes haiku en paralelo
|
|
68
|
+
Task("Explora estructura de archivos...") # haiku
|
|
69
|
+
Task("Busca patrones existentes...") # haiku
|
|
70
|
+
Task("Identifica dependencias...") # haiku
|
|
71
|
+
|
|
72
|
+
# INCORRECTO - VIOLACIÓN: Solo 1 agente
|
|
73
|
+
Task("Explora todo el proyecto...")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 4. Paralelismo OBLIGATORIO
|
|
79
|
+
|
|
80
|
+
**PROHIBIDO**: Ejecutar secuencialmente cuando se puede paralelizar.
|
|
81
|
+
|
|
82
|
+
**OBLIGATORIO**: Lanzar agentes en paralelo cuando las tareas son independientes.
|
|
83
|
+
|
|
84
|
+
**Regla**: Si las tareas NO dependen del resultado de otra, DEBEN ejecutarse en paralelo.
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
# CORRECTO: Paralelo
|
|
88
|
+
[Task("Analiza módulo A"), Task("Analiza módulo B"), Task("Analiza módulo C")]
|
|
89
|
+
|
|
90
|
+
# INCORRECTO: Secuencial innecesario
|
|
91
|
+
Task("Analiza módulo A")
|
|
92
|
+
# esperar...
|
|
93
|
+
Task("Analiza módulo B")
|
|
94
|
+
# esperar...
|
|
95
|
+
Task("Analiza módulo C")
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### 5. Tasks API como Backend Único
|
|
101
|
+
|
|
102
|
+
**PROHIBIDO**: Usar sistemas de storage duplicados (`.planning/TODOS.md`, archivos custom).
|
|
103
|
+
|
|
104
|
+
**OBLIGATORIO**: Usar Claude Code Tasks API para todo el tracking.
|
|
105
|
+
|
|
106
|
+
**Metadata Schema Estándar:**
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"type": "todo|phase|milestone|work",
|
|
110
|
+
"priority": "critical|high|medium|low",
|
|
111
|
+
"category": "bug|tech-debt|docs|chore|idea|feature",
|
|
112
|
+
"due_date": "ISO-8601 | null",
|
|
113
|
+
"milestone_id": "M001 | null",
|
|
114
|
+
"phase_id": "P001 | null",
|
|
115
|
+
"source_command": "add-todo|plan|execute|etc"
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Ejemplo correcto:**
|
|
120
|
+
```javascript
|
|
121
|
+
// Crear TODO
|
|
122
|
+
TaskCreate({
|
|
123
|
+
subject: "Fix validation bug",
|
|
124
|
+
metadata: { type: "todo", priority: "high", category: "bug" }
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Consultar TODOs
|
|
128
|
+
TaskList().filter(t => t.metadata?.type === "todo");
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Ejemplo INCORRECTO:**
|
|
132
|
+
```javascript
|
|
133
|
+
// VIOLACIÓN: Sistema duplicado
|
|
134
|
+
fs.appendFile('.planning/TODOS.md', '- [ ] Fix validation bug');
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### 6. Modelo Correcto por Fase
|
|
140
|
+
|
|
141
|
+
**PROHIBIDO**: Usar modelos incorrectos para cada fase.
|
|
142
|
+
|
|
143
|
+
**OBLIGATORIO**: Seguir la asignación de modelos:
|
|
144
|
+
|
|
145
|
+
| Fase | Modelo | Razón |
|
|
146
|
+
|------|--------|-------|
|
|
147
|
+
| Exploración rápida | HAIKU | Velocidad, bajo costo |
|
|
148
|
+
| Análisis profundo | SONNET | Balance velocidad/calidad |
|
|
149
|
+
| Implementación | OPUS | Máxima calidad |
|
|
150
|
+
| Verificación crítica | OPUS | Máxima precisión |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## MATRIZ DE COMANDOS
|
|
155
|
+
|
|
156
|
+
### Comandos Core (Workflow Principal)
|
|
157
|
+
|
|
158
|
+
| Comando | TaskCreate | Min Agents | Paralelo | Modelo | State Sync | Notas |
|
|
159
|
+
|---------|-----------|-----------|----------|--------|------------|-------|
|
|
160
|
+
| `start` | **OBLIGATORIO** | 2 | **SÍ** | haiku | **SÍ** | Orquestador - detectar contexto |
|
|
161
|
+
| `plan` | **OBLIGATORIO** | 3+ | **SÍ** | haiku→opus | **SÍ** | Exploración→Planificación |
|
|
162
|
+
| `execute` | **OBLIGATORIO** | 3+ | **SÍ** | haiku→opus→opus | **SÍ** | Exploración→Impl→Verificación |
|
|
163
|
+
| `verify-work` | **OBLIGATORIO** | 3 | **SÍ** | opus | **SÍ** | Verificación exhaustiva |
|
|
164
|
+
| `debug` | **OBLIGATORIO** | 1+ | OPCIONAL | opus | **SÍ** | Diagnóstico profundo |
|
|
165
|
+
| `quick` | **OBLIGATORIO** | 1 | NO | sonnet | **SÍ** | Tarea simple y rápida |
|
|
166
|
+
| `new` | **OBLIGATORIO** | 2 | **SÍ** | haiku | **SÍ** | Setup inicial |
|
|
167
|
+
|
|
168
|
+
### Comandos de Session Management
|
|
169
|
+
|
|
170
|
+
| Comando | TaskCreate | Min Agents | Paralelo | Modelo | State Sync | Notas |
|
|
171
|
+
|---------|-----------|-----------|----------|--------|------------|-------|
|
|
172
|
+
| `pause-work` | **OBLIGATORIO** | 0 | NO | - | **SÍ** | Guardar contexto para retomar |
|
|
173
|
+
| `resume-work` | **OBLIGATORIO** | 1 | NO | haiku | **SÍ** | Retomar contexto guardado |
|
|
174
|
+
| `progress` | NO | 0 | NO | - | **SÍ** (read) | Ver estado actual |
|
|
175
|
+
|
|
176
|
+
### Comandos de Milestone Management
|
|
177
|
+
|
|
178
|
+
| Comando | TaskCreate | Min Agents | Paralelo | Modelo | State Sync | Notas |
|
|
179
|
+
|---------|-----------|-----------|----------|--------|------------|-------|
|
|
180
|
+
| `new-milestone` | **OBLIGATORIO** | 1 | NO | sonnet | **SÍ** | Crear nuevo milestone |
|
|
181
|
+
| `complete-milestone` | **OBLIGATORIO** | 1 | NO | sonnet | **SÍ** | Cerrar milestone |
|
|
182
|
+
| `audit-milestone` | **OBLIGATORIO** | 2 | **SÍ** | haiku→sonnet | **SÍ** | Auditar estado |
|
|
183
|
+
| `plan-milestone-gaps` | **OBLIGATORIO** | 2 | **SÍ** | haiku→opus | **SÍ** | Identificar gaps |
|
|
184
|
+
|
|
185
|
+
### Comandos de Phase Management
|
|
186
|
+
|
|
187
|
+
| Comando | TaskCreate | Min Agents | Paralelo | Modelo | State Sync | Notas |
|
|
188
|
+
|---------|-----------|-----------|----------|--------|------------|-------|
|
|
189
|
+
| `add-phase` | OPCIONAL | 0 | NO | - | **SÍ** | Agregar fase al final |
|
|
190
|
+
| `insert-phase` | OPCIONAL | 0 | NO | - | **SÍ** | Insertar fase en posición |
|
|
191
|
+
| `remove-phase` | OPCIONAL | 0 | NO | - | **SÍ** | Eliminar fase |
|
|
192
|
+
| `discuss-phase` | **OBLIGATORIO** | 1 | NO | sonnet | NO | Discusión interactiva |
|
|
193
|
+
| `research-phase` | **OBLIGATORIO** | 2 | **SÍ** | haiku | **SÍ** | Investigar tecnologías |
|
|
194
|
+
| `list-phase-assumptions` | NO | 0 | NO | - | NO | Listar supuestos |
|
|
195
|
+
|
|
196
|
+
### Comandos de Todo Management
|
|
197
|
+
|
|
198
|
+
| Comando | TaskCreate | Min Agents | Paralelo | Modelo | State Sync | Notas |
|
|
199
|
+
|---------|-----------|-----------|----------|--------|------------|-------|
|
|
200
|
+
| `add-todo` | OPCIONAL | 0 | NO | - | NO | Agregar item |
|
|
201
|
+
| `check-todos` | NO | 0 | NO | - | NO | Ver lista |
|
|
202
|
+
|
|
203
|
+
### Comandos de Utilidad
|
|
204
|
+
|
|
205
|
+
| Comando | TaskCreate | Min Agents | Paralelo | Modelo | State Sync | Notas |
|
|
206
|
+
|---------|-----------|-----------|----------|--------|------------|-------|
|
|
207
|
+
| `help` | NO | 0 | NO | - | NO | Solo información |
|
|
208
|
+
| `settings` | NO | 0 | NO | - | NO | Solo configuración |
|
|
209
|
+
| `set-profile` | NO | 0 | NO | - | NO | Cambiar perfil |
|
|
210
|
+
| `update` | NO | 0 | NO | - | NO | Actualizar ELSABRO |
|
|
211
|
+
| `map-codebase` | **OBLIGATORIO** | 2 | **SÍ** | haiku | NO | Mapear proyecto |
|
|
212
|
+
| `verify` | **OBLIGATORIO** | 1 | NO | sonnet | NO | Verificar feature |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## SECUENCIA OBLIGATORIA POR COMANDO
|
|
217
|
+
|
|
218
|
+
### /elsabro:execute
|
|
219
|
+
```
|
|
220
|
+
1. TaskCreate("Fase exploración")
|
|
221
|
+
2. TaskUpdate(in_progress)
|
|
222
|
+
3. Task(haiku) x3 [paralelo] - Explorar contexto
|
|
223
|
+
4. TaskUpdate(completed)
|
|
224
|
+
|
|
225
|
+
5. TaskCreate("Fase implementación")
|
|
226
|
+
6. TaskUpdate(in_progress)
|
|
227
|
+
7. Task(opus) x2 [paralelo] - Implementar
|
|
228
|
+
8. TaskUpdate(completed)
|
|
229
|
+
|
|
230
|
+
9. TaskCreate("Fase verificación")
|
|
231
|
+
10. TaskUpdate(in_progress)
|
|
232
|
+
11. Task(opus) x3 [paralelo] - Verificar
|
|
233
|
+
12. TaskUpdate(completed)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### /elsabro:plan
|
|
237
|
+
```
|
|
238
|
+
1. TaskCreate("Explorar requerimientos")
|
|
239
|
+
2. TaskUpdate(in_progress)
|
|
240
|
+
3. Task(haiku) x3 [paralelo] - Explorar codebase
|
|
241
|
+
4. TaskUpdate(completed)
|
|
242
|
+
|
|
243
|
+
5. TaskCreate("Generar plan")
|
|
244
|
+
6. TaskUpdate(in_progress)
|
|
245
|
+
7. Task(opus) x2 [paralelo] - Crear plan detallado
|
|
246
|
+
8. TaskUpdate(completed)
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### /elsabro:verify-work
|
|
250
|
+
```
|
|
251
|
+
1. TaskCreate("Verificación exhaustiva")
|
|
252
|
+
2. TaskUpdate(in_progress)
|
|
253
|
+
3. Task(opus) x3 [paralelo]:
|
|
254
|
+
- Verificar funcionalidad
|
|
255
|
+
- Verificar tests
|
|
256
|
+
- Verificar integración
|
|
257
|
+
4. TaskUpdate(completed)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### /elsabro:debug
|
|
261
|
+
```
|
|
262
|
+
1. TaskCreate("Diagnóstico")
|
|
263
|
+
2. TaskUpdate(in_progress)
|
|
264
|
+
3. Task(opus) x1+ - Investigar problema
|
|
265
|
+
4. TaskUpdate(completed)
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### /elsabro:quick
|
|
269
|
+
```
|
|
270
|
+
1. TaskCreate("Tarea rápida")
|
|
271
|
+
2. TaskUpdate(in_progress)
|
|
272
|
+
3. Task(sonnet) x1 - Ejecutar tarea simple
|
|
273
|
+
4. TaskUpdate(completed)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### /elsabro:new
|
|
277
|
+
```
|
|
278
|
+
1. TaskCreate("Setup proyecto")
|
|
279
|
+
2. TaskUpdate(in_progress)
|
|
280
|
+
3. Task(haiku) x2 [paralelo] - Analizar y crear estructura
|
|
281
|
+
4. TaskUpdate(completed)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## VIOLACIONES Y CONSECUENCIAS
|
|
287
|
+
|
|
288
|
+
### Violación Crítica
|
|
289
|
+
- Ejecutar sin TaskCreate
|
|
290
|
+
- Lanzar Task sin TaskUpdate(in_progress)
|
|
291
|
+
- Menos agentes del mínimo
|
|
292
|
+
|
|
293
|
+
**Consecuencia**: Abortar operación. No continuar.
|
|
294
|
+
|
|
295
|
+
### Violación Mayor
|
|
296
|
+
- No paralelizar cuando es posible
|
|
297
|
+
- Modelo incorrecto para la fase
|
|
298
|
+
|
|
299
|
+
**Consecuencia**: Warning. Corregir antes de continuar.
|
|
300
|
+
|
|
301
|
+
### Violación Menor
|
|
302
|
+
- TaskUpdate(completed) sin resultado claro
|
|
303
|
+
|
|
304
|
+
**Consecuencia**: Registrar. Continuar con precaución.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## CHECKLIST DE AUTO-VERIFICACIÓN
|
|
309
|
+
|
|
310
|
+
Antes de cada operación, verifica:
|
|
311
|
+
|
|
312
|
+
- [ ] TaskCreate ejecutado
|
|
313
|
+
- [ ] TaskUpdate(in_progress) ejecutado
|
|
314
|
+
- [ ] Cantidad de agentes >= mínimo requerido
|
|
315
|
+
- [ ] Agentes lanzados en paralelo (si aplica)
|
|
316
|
+
- [ ] Modelo correcto para la fase
|
|
317
|
+
- [ ] TaskUpdate(completed) al finalizar
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## NOTAS FINALES
|
|
322
|
+
|
|
323
|
+
1. **No hay atajos**: Estas reglas existen por razones de rendimiento, coordinación y calidad.
|
|
324
|
+
|
|
325
|
+
2. **Paralelismo = Velocidad**: 3 agentes en paralelo terminan antes que 3 secuenciales.
|
|
326
|
+
|
|
327
|
+
3. **Tasks = Visibilidad**: Sin Tasks, no hay tracking, no hay recuperación de errores.
|
|
328
|
+
|
|
329
|
+
4. **Modelos = Costo/Beneficio**: Haiku para explorar, Opus para implementar. No al revés.
|
|
330
|
+
|
|
331
|
+
5. **Mínimos son mínimos**: Puedes usar MÁS agentes, nunca MENOS.
|