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.
Files changed (64) hide show
  1. package/agents/elsabro-orchestrator.md +113 -0
  2. package/commands/elsabro/add-phase.md +17 -0
  3. package/commands/elsabro/add-todo.md +111 -53
  4. package/commands/elsabro/audit-milestone.md +19 -0
  5. package/commands/elsabro/check-todos.md +210 -31
  6. package/commands/elsabro/complete-milestone.md +20 -1
  7. package/commands/elsabro/debug.md +19 -0
  8. package/commands/elsabro/discuss-phase.md +18 -1
  9. package/commands/elsabro/execute.md +511 -58
  10. package/commands/elsabro/insert-phase.md +18 -1
  11. package/commands/elsabro/list-phase-assumptions.md +17 -0
  12. package/commands/elsabro/new-milestone.md +19 -0
  13. package/commands/elsabro/new.md +19 -0
  14. package/commands/elsabro/pause-work.md +19 -0
  15. package/commands/elsabro/plan-milestone-gaps.md +20 -1
  16. package/commands/elsabro/plan.md +264 -36
  17. package/commands/elsabro/progress.md +203 -79
  18. package/commands/elsabro/quick.md +19 -0
  19. package/commands/elsabro/remove-phase.md +17 -0
  20. package/commands/elsabro/research-phase.md +18 -1
  21. package/commands/elsabro/resume-work.md +19 -0
  22. package/commands/elsabro/start.md +399 -98
  23. package/commands/elsabro/verify-work.md +138 -5
  24. package/hooks/confirm-destructive.sh +145 -0
  25. package/hooks/hooks-config.json +81 -0
  26. package/hooks/lint-check.sh +238 -0
  27. package/hooks/post-edit-test.sh +189 -0
  28. package/package.json +3 -2
  29. package/references/SYSTEM_INDEX.md +241 -0
  30. package/references/command-flow.md +352 -0
  31. package/references/enforcement-rules.md +331 -0
  32. package/references/error-contracts-tests.md +1171 -0
  33. package/references/error-contracts.md +3102 -0
  34. package/references/error-handling-instructions.md +26 -12
  35. package/references/parallel-worktrees.md +293 -0
  36. package/references/state-sync.md +381 -0
  37. package/references/task-dispatcher.md +388 -0
  38. package/references/tasks-integration.md +380 -0
  39. package/scripts/setup-parallel-worktrees.sh +319 -0
  40. package/skills/api-microservice.md +765 -0
  41. package/skills/api-setup.md +76 -3
  42. package/skills/auth-setup.md +46 -6
  43. package/skills/chrome-extension.md +584 -0
  44. package/skills/cicd-setup.md +1206 -0
  45. package/skills/cli-tool.md +884 -0
  46. package/skills/database-setup.md +41 -5
  47. package/skills/desktop-app.md +1351 -0
  48. package/skills/expo-app.md +35 -2
  49. package/skills/full-stack-app.md +543 -0
  50. package/skills/memory-update.md +207 -0
  51. package/skills/mobile-app.md +813 -0
  52. package/skills/nextjs-app.md +33 -2
  53. package/skills/payments-setup.md +76 -1
  54. package/skills/review.md +331 -0
  55. package/skills/saas-starter.md +639 -0
  56. package/skills/sentry-setup.md +41 -7
  57. package/skills/techdebt.md +289 -0
  58. package/skills/testing-setup.md +1218 -0
  59. package/skills/tutor.md +219 -0
  60. package/templates/.planning/notes/.gitkeep +0 -0
  61. package/templates/CLAUDE.md.template +48 -0
  62. package/templates/error-handling-config.json +79 -2
  63. package/templates/mistakes.md.template +52 -0
  64. package/templates/patterns.md.template +114 -0
@@ -150,6 +150,119 @@ Para cada story sin dependencias:
150
150
  ```
151
151
  </execution_pattern>
152
152
 
153
+ <error_contracts>
154
+ ## Contratos de Error en Ejecución Paralela
155
+
156
+ **IMPORTAR**: Este agente DEBE seguir `/references/error-contracts.md` para manejo de errores.
157
+
158
+ ### Integración Obligatoria
159
+
160
+ Antes de ejecutar cualquier wave, el orquestador DEBE:
161
+
162
+ 1. **Validar Registry** (ContractRegistryValidator)
163
+ ```javascript
164
+ const validator = new ContractRegistryValidator("./agents");
165
+ const batch = await validator.validateBatch(agentsNeeded);
166
+ if (!batch.canProceed) {
167
+ displayError({
168
+ severity: "CRITICAL",
169
+ message: `${batch.invalid} agentes faltantes`,
170
+ options: ["update", "help", "abort"]
171
+ });
172
+ return;
173
+ }
174
+ ```
175
+
176
+ 2. **Validar Sesión** (ContractSessionValidator)
177
+ ```javascript
178
+ const sessionValidator = new ContractSessionValidator();
179
+ const session = await sessionValidator.load();
180
+ if (!session.success) {
181
+ // Intentar reparar o escalar a usuario
182
+ }
183
+ ```
184
+
185
+ 3. **Iniciar Timeout** (ContractTimeoutHandler)
186
+ ```javascript
187
+ const timeoutHandler = new ContractTimeoutHandler();
188
+ timeoutHandler.startTimeout(waveId, 30 * 60 * 1000);
189
+ ```
190
+
191
+ ### Durante Ejecución Paralela
192
+
193
+ ```
194
+ ┌─────────────────────────────────────────────────────────────────────┐
195
+ │ ERROR HANDLING EN WAVES PARALELAS │
196
+ ├─────────────────────────────────────────────────────────────────────┤
197
+ │ │
198
+ │ Wave N ejecutando: │
199
+ │ ├─ Agent 1 ──→ SUCCESS ──┐ │
200
+ │ ├─ Agent 2 ──→ FAILED ───┼──→ ErrorAggregator.addResult() │
201
+ │ └─ Agent 3 ──→ SUCCESS ──┘ │
202
+ │ ↓ │
203
+ │ ErrorAggregator.aggregate() │
204
+ │ ↓ │
205
+ │ ┌────────────┴────────────┐ │
206
+ │ │ Aplicar Policy (quorum) │ │
207
+ │ └────────────┬────────────┘ │
208
+ │ ↓ │
209
+ │ ┌──────────────────────┴──────────────────────┐ │
210
+ │ │ 2/3 = 66% > 50% │ 1/3 = 33% < 50% │ │
211
+ │ │ → CONTINUE │ → STOP │ │
212
+ │ │ → Notificar warning │ → Escalar a usuario │ │
213
+ │ └──────────────────────┴──────────────────────┘ │
214
+ │ │
215
+ └─────────────────────────────────────────────────────────────────────┘
216
+ ```
217
+
218
+ ### Retry Automático
219
+
220
+ Para errores transitorios (timeout, network):
221
+
222
+ ```javascript
223
+ const retryPolicy = new ContractRetryPolicy({
224
+ maxAttempts: 3,
225
+ baseDelayMs: 1000,
226
+ backoffMultiplier: 2
227
+ });
228
+
229
+ const result = await retryPolicy.executeWithRetry(
230
+ operationId,
231
+ async () => executeAgent(agent),
232
+ { wave: waveId }
233
+ );
234
+ ```
235
+
236
+ ### Notificación al Usuario
237
+
238
+ **INMEDIATA para CRITICAL:**
239
+ ```
240
+ ╔════════════════════════════════════════════════════╗
241
+ ║ 🔴 CRITICAL: Wave 2 Agent Failed ║
242
+ ╠════════════════════════════════════════════════════╣
243
+ ║ Agent: elsabro-verifier ║
244
+ ║ Error: Timeout after 30 minutes ║
245
+ ║ ║
246
+ ║ [r] Retry now [s] Skip [a] Abort ║
247
+ ╚════════════════════════════════════════════════════╝
248
+ ```
249
+
250
+ **AL FINAL para otros:**
251
+ ```
252
+ ╔════════════════════════════════════════════════════╗
253
+ ║ PARALLEL EXECUTION SUMMARY ║
254
+ ╠════════════════════════════════════════════════════╣
255
+ ║ Waves: 3/3 completed ║
256
+ ║ Agents: 8/9 succeeded (89%) ║
257
+ ║ ║
258
+ ║ Errors: ║
259
+ ║ └─ Wave 2: elsabro-qa timeout (retried 2x) ║
260
+ ║ ║
261
+ ║ Status: SUCCESS (quorum met) ║
262
+ ╚════════════════════════════════════════════════════╝
263
+ ```
264
+ </error_contracts>
265
+
153
266
  <conflict_resolution>
154
267
  ## Resolución de Conflictos
155
268
 
@@ -1,10 +1,27 @@
1
1
  ---
2
2
  name: add-phase
3
3
  description: Agregar una nueva fase al final del milestone actual
4
+ sync:
5
+ reads: [".elsabro/state.json"]
6
+ writes: [".elsabro/state.json"]
4
7
  ---
5
8
 
6
9
  # /elsabro:add-phase
7
10
 
11
+ <state_sync>
12
+ ## SINCRONIZACION DE ESTADO
13
+
14
+ **IMPORTAR**: Ver `/references/state-sync.md` para protocolo completo.
15
+
16
+ ### Al Iniciar
17
+ - Leer `.elsabro/state.json`
18
+ - Verificar contexto actual del milestone/phase
19
+
20
+ ### Al Completar
21
+ - Registrar cambio en `history`
22
+ - Actualizar `context` si corresponde
23
+ </state_sync>
24
+
8
25
  <command-name>add-phase</command-name>
9
26
 
10
27
  ## Propósito
@@ -1,6 +1,11 @@
1
1
  ---
2
2
  name: add-todo
3
3
  description: Agregar un item al todo list del proyecto actual
4
+ allowed-tools:
5
+ - TaskCreate
6
+ - TaskList
7
+ - Read
8
+ - AskUserQuestion
4
9
  ---
5
10
 
6
11
  # /elsabro:add-todo
@@ -9,7 +14,7 @@ description: Agregar un item al todo list del proyecto actual
9
14
 
10
15
  ## Propósito
11
16
 
12
- Agregar tareas rápidas al todo list del proyecto. Para items que no merecen ser una fase o story completa.
17
+ Agregar tareas rápidas al todo list del proyecto usando **Claude Code Tasks API** como backend. Para items que no merecen ser una fase o story completa.
13
18
 
14
19
  ## Cuándo Usar
15
20
 
@@ -63,96 +68,149 @@ Agregar tareas rápidas al todo list del proyecto. Para items que no merecen ser
63
68
  | `medium` | Normal (default) |
64
69
  | `low` | Cuando haya tiempo |
65
70
 
66
- ## Almacenamiento
71
+ ---
67
72
 
68
- Todos se guardan en `.planning/TODOS.md`:
73
+ ## Implementación (Tasks API)
69
74
 
70
- ```markdown
71
- # Project TODOs
75
+ <implementation>
76
+ Cuando el usuario ejecuta `/elsabro:add-todo`:
72
77
 
73
- ## Critical 🔴
74
- - [ ] Fix authentication token refresh (#123)
78
+ ### 1. Parse Arguments
75
79
 
76
- ## High Priority 🟠
77
- - [ ] Update React to v18.3 (tech-debt)
78
- - [ ] Add loading states to dashboard (ux)
80
+ ```
81
+ INPUT: /elsabro:add-todo "Fix typo in README" --priority=high --category=docs
82
+ PARSE:
83
+ - description: "Fix typo in README"
84
+ - priority: "high" (default: "medium")
85
+ - category: "docs" (default: "chore")
86
+ - due: null (opcional)
87
+ - milestone: null (opcional)
88
+ ```
79
89
 
80
- ## Medium Priority 🟡
81
- - [ ] Fix typo in README (docs) - Added 2024-01-20
82
- - [ ] Add error boundary (tech-debt)
83
- - [ ] Document API endpoints (docs)
90
+ ### 2. Crear Task
91
+
92
+ ```javascript
93
+ TaskCreate({
94
+ subject: "Fix typo in README",
95
+ description: "User-created TODO: Fix typo in README\n\nCategory: docs\nPriority: high",
96
+ activeForm: "Working on: Fix typo in README",
97
+ metadata: {
98
+ type: "todo",
99
+ priority: "high",
100
+ category: "docs",
101
+ due_date: null,
102
+ milestone_id: null,
103
+ created_by: "user",
104
+ source_command: "add-todo",
105
+ created_at: "ISO-8601 timestamp"
106
+ }
107
+ })
108
+ ```
84
109
 
85
- ## Low Priority ⬜
86
- - [ ] Investigate dark mode (idea)
87
- - [ ] Consider adding PWA support (idea)
110
+ ### 3. Output
88
111
 
89
- ## Completed ✅
90
- - [x] Set up CI pipeline (2024-01-18)
91
- - [x] Add basic tests (2024-01-19)
92
112
  ```
113
+ ✓ TODO added (Task #<ID>)
93
114
 
94
- ## Interactivo
115
+ Subject: Fix typo in README
116
+ Priority: high
117
+ Category: docs
118
+ Due: -
95
119
 
96
- ```bash
97
- /elsabro:add-todo
120
+ View all: /elsabro:check-todos
98
121
  ```
99
122
 
123
+ ### 4. Contar TODOs existentes
124
+
125
+ ```javascript
126
+ // Listar todos los tasks tipo "todo"
127
+ TaskList()
128
+ .filter(t => t.metadata?.type === "todo" && t.status !== "completed")
129
+
130
+ // Mostrar conteo por prioridad
131
+ Total TODOs: 8 (2 high, 4 medium, 2 low)
100
132
  ```
101
- Add new TODO:
133
+ </implementation>
102
134
 
103
- Description: Update error messages
104
- Priority (critical/high/medium/low): high
105
- Category (bug/tech-debt/docs/chore/idea/question): ux
106
- Due date (optional):
135
+ ---
136
+
137
+ ## Modo Interactivo
107
138
 
108
- Added: "Update error messages" [high/ux]
139
+ ```bash
140
+ /elsabro:add-todo
109
141
  ```
110
142
 
143
+ Si no se proporciona descripción, usar AskUserQuestion:
144
+
145
+ ```javascript
146
+ AskUserQuestion({
147
+ questions: [
148
+ {
149
+ question: "What TODO do you want to add?",
150
+ header: "Description",
151
+ options: [
152
+ { label: "Bug fix", description: "Minor bug to fix" },
153
+ { label: "Tech debt", description: "Code improvement" },
154
+ { label: "Documentation", description: "Docs to write" },
155
+ { label: "Other", description: "Custom description" }
156
+ ],
157
+ multiSelect: false
158
+ }
159
+ ]
160
+ })
161
+ ```
162
+
163
+ ---
164
+
111
165
  ## Opciones
112
166
 
113
167
  ```bash
114
168
  --priority, -p # critical/high/medium/low
115
169
  --category, -c # Category tag
116
- --due, -d # Due date
117
- --milestone, -m # Link to milestone
118
- --phase # Link to phase
170
+ --due, -d # Due date (ISO-8601)
171
+ --milestone, -m # Link to milestone ID
172
+ --phase # Link to phase ID
119
173
  ```
120
174
 
121
- ## Quick Add
175
+ ## Quick Add (Batch)
122
176
 
123
- Para agregar múltiples todos rápidamente:
177
+ Para agregar múltiples todos:
124
178
 
125
179
  ```bash
126
180
  /elsabro:add-todo --batch
127
181
  ```
128
182
 
183
+ ```javascript
184
+ // Crear múltiples Tasks en paralelo
185
+ TaskCreate({ subject: "Fix button alignment", metadata: {...} })
186
+ TaskCreate({ subject: "Add form validation", metadata: {...} })
187
+ TaskCreate({ subject: "Update user docs", metadata: {...} })
129
188
  ```
130
- Enter TODOs (one per line, empty to finish):
131
- > Fix button alignment
132
- > Add form validation
133
- > Update user docs
134
- >
135
189
 
136
- Added 3 TODOs (all medium priority)
137
- ```
138
-
139
- ## Output
190
+ ---
140
191
 
192
+ ## Metadata Schema
193
+
194
+ ```json
195
+ {
196
+ "type": "todo",
197
+ "priority": "critical|high|medium|low",
198
+ "category": "bug|tech-debt|docs|chore|idea|question",
199
+ "due_date": "ISO-8601 | null",
200
+ "milestone_id": "M001 | null",
201
+ "phase_id": "P001 | null",
202
+ "created_by": "user|system",
203
+ "source_command": "add-todo",
204
+ "created_at": "ISO-8601"
205
+ }
141
206
  ```
142
- ✓ TODO added
143
207
 
144
- Description: Fix typo in README
145
- Priority: medium
146
- Category: docs
147
- Due: -
148
-
149
- Total TODOs: 8 (2 high, 4 medium, 2 low)
150
-
151
- View all: /elsabro:check-todos
152
- ```
208
+ ---
153
209
 
154
210
  ## Integración
155
211
 
156
212
  - View with `/elsabro:check-todos`
157
213
  - Referenced in `/elsabro:progress`
158
214
  - Can be promoted to phase task with `/elsabro:add-phase`
215
+ - Persists across sessions via Tasks API
216
+ - Supports dependencies with `blocks/blockedBy`
@@ -1,10 +1,29 @@
1
1
  ---
2
2
  name: audit-milestone
3
3
  description: Auditar el estado actual de un milestone - progreso, riesgos y recomendaciones
4
+ sync:
5
+ reads: [".elsabro/state.json"]
6
+ writes: [".elsabro/state.json", ".elsabro/context.md"]
4
7
  ---
5
8
 
6
9
  # /elsabro:audit-milestone
7
10
 
11
+ <state_sync>
12
+ ## SINCRONIZACION DE ESTADO
13
+
14
+ **IMPORTAR**: Ver `/references/state-sync.md` para protocolo completo.
15
+
16
+ ### Al Iniciar
17
+ - Leer `.elsabro/state.json`
18
+ - Verificar si hay flujo en progreso
19
+ - Actualizar `current_flow.command` con este comando
20
+
21
+ ### Al Completar
22
+ - Registrar en `history`
23
+ - Actualizar `context` con informacion del milestone
24
+ - Limpiar `current_flow`
25
+ </state_sync>
26
+
8
27
  <command-name>audit-milestone</command-name>
9
28
 
10
29
  ## Propósito