specleap-framework 2.0.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/backend.md +419 -0
- package/.agents/frontend.md +577 -0
- package/.agents/producto.md +516 -0
- package/.commands/adoptar.md +323 -0
- package/.commands/ayuda.md +142 -0
- package/.commands/crear-tickets.md +55 -0
- package/.commands/documentar.md +285 -0
- package/.commands/explicar.md +234 -0
- package/.commands/implementar.md +383 -0
- package/.commands/inicio.md +824 -0
- package/.commands/nuevo/README.md +292 -0
- package/.commands/nuevo/questions-base.yaml +320 -0
- package/.commands/nuevo/responses-example.yaml +53 -0
- package/.commands/planificar.md +253 -0
- package/.commands/refinar.md +306 -0
- package/LICENSE +21 -0
- package/README.md +603 -0
- package/SETUP.md +351 -0
- package/install.sh +152 -0
- package/package.json +60 -0
- package/proyectos/_template/.gitkeep +1 -0
- package/proyectos/_template/ANEXOS.md +21 -0
- package/proyectos/_template/CONTRATO.md +26 -0
- package/proyectos/_template/context/.gitkeep +1 -0
- package/rules/development-rules.md +113 -0
- package/rules/environment-protection.md +97 -0
- package/rules/git-workflow.md +142 -0
- package/rules/session-protocol.md +121 -0
- package/scripts/README.md +129 -0
- package/scripts/analyze-project.sh +826 -0
- package/scripts/create-asana-tasks.sh +133 -0
- package/scripts/detect-project-type.sh +141 -0
- package/scripts/estimate-effort.sh +290 -0
- package/scripts/generate-asana-structure.sh +262 -0
- package/scripts/generate-contract.sh +360 -0
- package/scripts/generate-contrato.sh +555 -0
- package/scripts/install-git-hooks.sh +141 -0
- package/scripts/install-skills.sh +130 -0
- package/scripts/lib/asana-utils.sh +191 -0
- package/scripts/lib/jira-project-utils.sh +222 -0
- package/scripts/lib/questions.json +831 -0
- package/scripts/lib/render-contrato.py +195 -0
- package/scripts/lib/validate.sh +325 -0
- package/scripts/parse-contrato.sh +190 -0
- package/scripts/setup-mcp.sh +654 -0
- package/scripts/test-cuestionario.sh +428 -0
- package/setup.sh +458 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
# Comando: implementar
|
|
2
|
+
|
|
3
|
+
**Sintaxis:** `implementar @plan.md` o `implementar @[TICKET-ID]_backend.md`
|
|
4
|
+
|
|
5
|
+
**Objetivo:** Ejecutar el plan de implementación: crear branch, escribir código, tests, commit, push, PR.
|
|
6
|
+
|
|
7
|
+
**Motor:** Usa `openspec verify` (CLI) para validación de tests.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🌐 Idioma
|
|
12
|
+
|
|
13
|
+
**TODOS los mensajes de feedback deben estar en ESPAÑOL.**
|
|
14
|
+
|
|
15
|
+
Esto incluye:
|
|
16
|
+
- Mensajes de progreso ("Creando branch...", "Ejecutando tests...")
|
|
17
|
+
- Mensajes de error ("❌ Tests fallaron")
|
|
18
|
+
- Mensajes de éxito ("✅ PR creado exitosamente")
|
|
19
|
+
- Preguntas al usuario ("¿Qué prefieres? (A/B/C)")
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ⚠️ ADVERTENCIA
|
|
24
|
+
|
|
25
|
+
Este comando **IMPLEMENTA CÓDIGO REAL**. Antes de ejecutar:
|
|
26
|
+
1. Plan revisado y aprobado
|
|
27
|
+
2. Directorio correcto del proyecto
|
|
28
|
+
3. Git configurado
|
|
29
|
+
4. Tests funcionando
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Flujo
|
|
34
|
+
|
|
35
|
+
### 1. Leer el Plan
|
|
36
|
+
|
|
37
|
+
Lee el archivo de plan:
|
|
38
|
+
```
|
|
39
|
+
proyectos/[proyecto]/specs/[TICKET-ID]_backend.md
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
O usa el nombre corto:
|
|
43
|
+
```
|
|
44
|
+
implementar @plan.md
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### 2. Verificar Alcance del CONTRATO
|
|
50
|
+
|
|
51
|
+
**ANTES de implementar**, verificar si está dentro del CONTRATO.md.
|
|
52
|
+
|
|
53
|
+
**A) Leer CONTRATO.md:**
|
|
54
|
+
```bash
|
|
55
|
+
cat proyectos/[proyecto]/CONTRATO.md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**B) Analizar:**
|
|
59
|
+
- ¿Qué funcionalidad implementa?
|
|
60
|
+
- ¿Está en Módulos/Funcionalidades del CONTRATO?
|
|
61
|
+
- ¿Es mejora o NUEVO?
|
|
62
|
+
|
|
63
|
+
**C) Decisión:**
|
|
64
|
+
|
|
65
|
+
**SI está en CONTRATO:** ✅ Continuar
|
|
66
|
+
|
|
67
|
+
**SI NO está en CONTRATO:**
|
|
68
|
+
```markdown
|
|
69
|
+
⚠️ **ALERTA: Funcionalidad fuera de alcance**
|
|
70
|
+
|
|
71
|
+
Este tarea implementa: [Nombre funcionalidad]
|
|
72
|
+
|
|
73
|
+
NO aparece en CONTRATO.md sección "Módulos" ni "Funcionalidades".
|
|
74
|
+
|
|
75
|
+
**Opciones:**
|
|
76
|
+
A) **Agregar a ANEXOS.md** — Funcionalidad nueva fuera del MVP original
|
|
77
|
+
B) **Rechazar** — Está explícitamente en "Fuera de Alcance"
|
|
78
|
+
C) **Cancelar** — No implementar por ahora
|
|
79
|
+
|
|
80
|
+
¿Qué prefieres? (A/B/C)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Si elige A:** Agregar a ANEXOS.md y continuar
|
|
84
|
+
**Si elige B o C:** Detener implementación
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### 3. Sistema de Validación en 3 Capas
|
|
89
|
+
|
|
90
|
+
**SpecLeap usa 3 capas de validación para garantizar calidad:**
|
|
91
|
+
|
|
92
|
+
**🔹 Capa 1: Git Hook Pre-Commit (Automático)**
|
|
93
|
+
- Se ejecuta ANTES de cada commit
|
|
94
|
+
- Valida: Linters, formatters, syntax
|
|
95
|
+
- Rápido (<5 segundos)
|
|
96
|
+
- Previene commits obviamente malos
|
|
97
|
+
|
|
98
|
+
**🔹 Capa 2: Comando `implementar` (Completo)**
|
|
99
|
+
- Se ejecuta al terminar feature
|
|
100
|
+
- Valida: Tests unitarios + integración + specs
|
|
101
|
+
- Completo (~1-5 minutos)
|
|
102
|
+
- Si pasa: hace commit + push + crea PR
|
|
103
|
+
|
|
104
|
+
**🔹 Capa 3: CodeRabbit en PR (Revisión profunda)**
|
|
105
|
+
- Se ejecuta automáticamente al crear PR
|
|
106
|
+
- Valida: Arquitectura, seguridad, lógica de negocio
|
|
107
|
+
- Profundo (~5-10 minutos)
|
|
108
|
+
- Comenta en el PR con mejoras
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### 4. Identificar Directorio del Proyecto
|
|
113
|
+
|
|
114
|
+
Pregunta dónde está el código:
|
|
115
|
+
```markdown
|
|
116
|
+
¿En qué directorio está el código del proyecto?
|
|
117
|
+
|
|
118
|
+
Ejemplo:
|
|
119
|
+
- `/path/to/app-tienda-backend`
|
|
120
|
+
- `/path/to/app-tienda-frontend`
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 4. Verificar Estado de Git
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cd [directorio-proyecto]
|
|
129
|
+
git status
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Si hay cambios sin commitear:**
|
|
133
|
+
```markdown
|
|
134
|
+
⚠️ Hay cambios sin commitear:
|
|
135
|
+
|
|
136
|
+
[Listar archivos modificados]
|
|
137
|
+
|
|
138
|
+
**Opciones:**
|
|
139
|
+
A) **Commit** — Commitearlo antes de continuar
|
|
140
|
+
B) **Stash** — Guardarlos temporalmente
|
|
141
|
+
C) **Cancelar** — No continuar
|
|
142
|
+
|
|
143
|
+
¿Qué prefieres? (A/B/C)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### 5. Crear Branch
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Determinar nombre
|
|
152
|
+
TICKET_ID="[TASK_GID]"
|
|
153
|
+
BRANCH_TYPE="feat" # o "fix" según el plan
|
|
154
|
+
BRANCH_NAME="$BRANCH_TYPE/$TICKET_ID-[nombre-corto]"
|
|
155
|
+
|
|
156
|
+
# Crear branch
|
|
157
|
+
git checkout -b $BRANCH_NAME
|
|
158
|
+
|
|
159
|
+
echo "✅ Branch creado: $BRANCH_NAME"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### 6. Implementar Paso a Paso
|
|
165
|
+
|
|
166
|
+
El plan tiene tareas numeradas. Ejecutar una por una:
|
|
167
|
+
|
|
168
|
+
**Para cada tarea:**
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
📌 **Tarea [X/N]:** [Descripción]
|
|
172
|
+
|
|
173
|
+
**Archivos a modificar:**
|
|
174
|
+
- [archivo1]
|
|
175
|
+
- [archivo2]
|
|
176
|
+
|
|
177
|
+
**Implementando...**
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Generar código** según el plan (usando contexto del proyecto + standards).
|
|
181
|
+
|
|
182
|
+
**Mostrar diff:**
|
|
183
|
+
```bash
|
|
184
|
+
git diff [archivo]
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```markdown
|
|
188
|
+
**Cambios realizados en [archivo]:**
|
|
189
|
+
|
|
190
|
+
[Mostrar diff con colores]
|
|
191
|
+
|
|
192
|
+
✅ Tarea [X/N] completada.
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### 7. Verificar Tests (Usar CLI)
|
|
198
|
+
|
|
199
|
+
Después de implementar todas las tareas, validar con CLI:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
openspec verify --type unit
|
|
203
|
+
openspec verify --type integration
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Esto ejecuta:
|
|
207
|
+
- Tests unitarios
|
|
208
|
+
- Tests de integración
|
|
209
|
+
- Linters
|
|
210
|
+
- Type checking
|
|
211
|
+
|
|
212
|
+
**Si los tests PASAN:**
|
|
213
|
+
```markdown
|
|
214
|
+
✅ **Tests: PASS**
|
|
215
|
+
|
|
216
|
+
[Mostrar resumen]
|
|
217
|
+
|
|
218
|
+
Continuando...
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Si los tests FALLAN:**
|
|
222
|
+
```markdown
|
|
223
|
+
❌ **Tests: FAIL**
|
|
224
|
+
|
|
225
|
+
[Mostrar errores]
|
|
226
|
+
|
|
227
|
+
**Opciones:**
|
|
228
|
+
A) **Corregir** — Arreglar los errores y volver a verificar
|
|
229
|
+
B) **Commit de todas formas** — (NO recomendado)
|
|
230
|
+
C) **Cancelar** — Deshacer cambios
|
|
231
|
+
|
|
232
|
+
¿Qué prefieres? (A/B/C)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Si elige A, corregir y ejecutar `openspec verify` de nuevo.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### 8. Commit
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Determinar mensaje
|
|
243
|
+
COMMIT_MSG="$BRANCH_TYPE: [descripción corta del tarea]
|
|
244
|
+
|
|
245
|
+
Implementa: $TICKET_ID
|
|
246
|
+
|
|
247
|
+
- [Tarea 1]
|
|
248
|
+
- [Tarea 2]
|
|
249
|
+
- [Tarea 3]
|
|
250
|
+
|
|
251
|
+
Tests: pass"
|
|
252
|
+
|
|
253
|
+
# Commit
|
|
254
|
+
git add .
|
|
255
|
+
git commit -m "$COMMIT_MSG"
|
|
256
|
+
|
|
257
|
+
echo "✅ Commit realizado"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
### 9. Push
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
git push origin $BRANCH_NAME
|
|
266
|
+
|
|
267
|
+
echo "✅ Pusheado a origin/$BRANCH_NAME"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
### 10. Crear Pull Request (Opcional)
|
|
273
|
+
|
|
274
|
+
**Con GitHub CLI (`gh`):**
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
gh pr create \
|
|
278
|
+
--title "[$TICKET_ID] [Título del tarea]" \
|
|
279
|
+
--body "[Descripción del plan + link a Asana]" \
|
|
280
|
+
--base develop \
|
|
281
|
+
--head $BRANCH_NAME
|
|
282
|
+
|
|
283
|
+
echo "✅ PR creado: [URL]"
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Si NO está disponible:**
|
|
287
|
+
|
|
288
|
+
```markdown
|
|
289
|
+
✅ **Cambios pusheados**
|
|
290
|
+
|
|
291
|
+
**Crear PR manualmente:**
|
|
292
|
+
|
|
293
|
+
1. Ve a: https://github.com/[owner]/[repo]/compare/develop...$BRANCH_NAME
|
|
294
|
+
2. Título: [$TICKET_ID] [Título]
|
|
295
|
+
3. Descripción:
|
|
296
|
+
```
|
|
297
|
+
Implementa: $TICKET_ID
|
|
298
|
+
|
|
299
|
+
**Cambios:**
|
|
300
|
+
- [Tarea 1]
|
|
301
|
+
- [Tarea 2]
|
|
302
|
+
- [Tarea 3]
|
|
303
|
+
|
|
304
|
+
**Link Asana:** [URL del tarea]
|
|
305
|
+
|
|
306
|
+
**Tests:** ✅ Pass
|
|
307
|
+
```
|
|
308
|
+
4. Asigna reviewers
|
|
309
|
+
5. Crea PR
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### 11. Actualizar Asana
|
|
315
|
+
|
|
316
|
+
**Si MCP Asana disponible:**
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
# Agregar comentario con link al PR
|
|
320
|
+
openspec asana comment $TICKET_ID "PR creado: [URL]"
|
|
321
|
+
|
|
322
|
+
# Mover a Code Review
|
|
323
|
+
openspec asana transition $TICKET_ID "Code Review"
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Si NO disponible:**
|
|
327
|
+
|
|
328
|
+
```markdown
|
|
329
|
+
**Actualiza Asana manualmente:**
|
|
330
|
+
|
|
331
|
+
1. Abre tarea $TICKET_ID
|
|
332
|
+
2. Agrega comentario: "PR creado: [URL]"
|
|
333
|
+
3. Mueve a estado "Code Review"
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### 12. Confirmar Completado
|
|
339
|
+
|
|
340
|
+
```markdown
|
|
341
|
+
✅ **Implementación completada**
|
|
342
|
+
|
|
343
|
+
**Resumen:**
|
|
344
|
+
- Branch: $BRANCH_NAME
|
|
345
|
+
- Commits: 1
|
|
346
|
+
- Tests: ✅ Pass
|
|
347
|
+
- PR: [URL]
|
|
348
|
+
- Asana: $TICKET_ID → Code Review
|
|
349
|
+
|
|
350
|
+
**Próximos pasos:**
|
|
351
|
+
1. Esperar code review
|
|
352
|
+
2. Hacer ajustes si se requieren
|
|
353
|
+
3. Merge cuando aprueben
|
|
354
|
+
|
|
355
|
+
**Comandos útiles:**
|
|
356
|
+
- Ver PR: `gh pr view`
|
|
357
|
+
- Ver status checks: `gh pr checks`
|
|
358
|
+
- Mergear (cuando aprueben): `gh pr merge`
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Comandos CLI Usados
|
|
364
|
+
|
|
365
|
+
| Comando | Propósito |
|
|
366
|
+
|---------|-----------|
|
|
367
|
+
| `openspec verify --type unit` | Ejecutar tests unitarios |
|
|
368
|
+
| `openspec verify --type integration` | Ejecutar tests de integración |
|
|
369
|
+
| `openspec asana comment <ID> <text>` | Agregar comentario a tarea |
|
|
370
|
+
| `openspec asana transition <ID> <state>` | Cambiar estado de tarea |
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Agentes Relacionados
|
|
375
|
+
|
|
376
|
+
- `.agents/backend.md` — Para implementación backend
|
|
377
|
+
- `.agents/frontend.md` — Para implementación frontend
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Próximo Comando
|
|
382
|
+
|
|
383
|
+
- `/code-review` — Solicitar code review del PR creado (cuando esté listo)
|