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
package/skills/sentry-setup.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sentry-setup
|
|
3
3
|
description: Skill para integrar Sentry (monitoreo de errores) en cualquier proyecto. Usa este skill cuando el usuario quiere detectar errores en producción.
|
|
4
|
+
tags:
|
|
5
|
+
- monitoring
|
|
6
|
+
- error-tracking
|
|
7
|
+
- production
|
|
8
|
+
- debugging
|
|
9
|
+
- observability
|
|
10
|
+
difficulty: intermediate
|
|
11
|
+
estimated_time: 15-30 minutes
|
|
4
12
|
---
|
|
5
13
|
|
|
6
14
|
# Skill: Integrar Sentry
|
|
@@ -15,6 +23,32 @@ Usar cuando el usuario menciona:
|
|
|
15
23
|
- "tracking de errores"
|
|
16
24
|
</when_to_use>
|
|
17
25
|
|
|
26
|
+
<pre_requisites>
|
|
27
|
+
## Pre-requisitos
|
|
28
|
+
|
|
29
|
+
- Node.js 18+ instalado
|
|
30
|
+
- Proyecto existente (Next.js, React, Node.js, o Expo)
|
|
31
|
+
- Cuenta en Sentry (https://sentry.io) - tier gratuito disponible
|
|
32
|
+
- DSN del proyecto de Sentry
|
|
33
|
+
</pre_requisites>
|
|
34
|
+
|
|
35
|
+
<project_structure>
|
|
36
|
+
## Estructura de Archivos Resultante
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
proyecto/
|
|
40
|
+
├── sentry.client.config.ts # Config cliente (Next.js)
|
|
41
|
+
├── sentry.server.config.ts # Config servidor (Next.js)
|
|
42
|
+
├── sentry.edge.config.ts # Config edge runtime (Next.js)
|
|
43
|
+
├── next.config.js # Actualizado con withSentryConfig
|
|
44
|
+
├── .env.local
|
|
45
|
+
│ ├── SENTRY_DSN=...
|
|
46
|
+
│ └── SENTRY_AUTH_TOKEN=...
|
|
47
|
+
└── components/
|
|
48
|
+
└── ErrorBoundary.tsx # Opcional: error boundary
|
|
49
|
+
```
|
|
50
|
+
</project_structure>
|
|
51
|
+
|
|
18
52
|
<before_starting>
|
|
19
53
|
## Investigación Obligatoria
|
|
20
54
|
|
|
@@ -47,8 +81,8 @@ Usar cuando el usuario menciona:
|
|
|
47
81
|
### Next.js
|
|
48
82
|
|
|
49
83
|
```bash
|
|
50
|
-
# 1. Instalar
|
|
51
|
-
npx @sentry/wizard@
|
|
84
|
+
# 1. Instalar Sentry 8.x para Next.js
|
|
85
|
+
npx @sentry/wizard@8 -i nextjs
|
|
52
86
|
|
|
53
87
|
# 2. El wizard crea automáticamente:
|
|
54
88
|
# - sentry.client.config.ts
|
|
@@ -70,8 +104,8 @@ npx expo install @sentry/react-native
|
|
|
70
104
|
### React (Vite/CRA)
|
|
71
105
|
|
|
72
106
|
```bash
|
|
73
|
-
# 1. Instalar
|
|
74
|
-
npm install @sentry/react
|
|
107
|
+
# 1. Instalar Sentry React 8.x
|
|
108
|
+
npm install @sentry/react@^8.0.0
|
|
75
109
|
|
|
76
110
|
# 2. Inicializar en main.tsx/index.tsx
|
|
77
111
|
# VERIFICAR patrón actual con Context7
|
|
@@ -80,8 +114,8 @@ npm install @sentry/react
|
|
|
80
114
|
### Node.js/Express
|
|
81
115
|
|
|
82
116
|
```bash
|
|
83
|
-
# 1. Instalar
|
|
84
|
-
npm install @sentry/node
|
|
117
|
+
# 1. Instalar Sentry Node 8.x
|
|
118
|
+
npm install @sentry/node@^8.0.0
|
|
85
119
|
|
|
86
120
|
# 2. Inicializar al inicio del servidor
|
|
87
121
|
# VERIFICAR patrón actual con Context7
|
|
@@ -189,7 +223,7 @@ Para capturar errores de UI:
|
|
|
189
223
|
|
|
190
224
|
'use client';
|
|
191
225
|
|
|
192
|
-
import * as Sentry from '@sentry/nextjs';
|
|
226
|
+
import * as Sentry from '@sentry/nextjs'; // v8.x
|
|
193
227
|
import { Component, ReactNode } from 'react';
|
|
194
228
|
|
|
195
229
|
interface Props {
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: techdebt
|
|
3
|
+
description: Escaneo de deuda tecnica - codigo duplicado, TODOs, dependencias desactualizadas
|
|
4
|
+
trigger: /elsabro:audit-debt
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Bash
|
|
12
|
+
- Task
|
|
13
|
+
argument-hint: "[path] - directorio a escanear (default: .)"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# ELSABRO: Tech Debt Scanner
|
|
17
|
+
|
|
18
|
+
<objective>
|
|
19
|
+
Escanear el proyecto en busca de deuda tecnica, codigo duplicado, y areas de mejora.
|
|
20
|
+
Generar reporte estructurado compatible con el flujo de planificacion ELSABRO.
|
|
21
|
+
</objective>
|
|
22
|
+
|
|
23
|
+
<task_integration>
|
|
24
|
+
## Integracion con Tasks API
|
|
25
|
+
|
|
26
|
+
Al iniciar escaneo:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
TaskCreate:
|
|
30
|
+
description: "Audit de deuda tecnica: [path]"
|
|
31
|
+
status: in_progress
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Actualizar progreso por categoria escaneada.
|
|
35
|
+
Al finalizar, incluir resumen con health score.
|
|
36
|
+
</task_integration>
|
|
37
|
+
|
|
38
|
+
<triggers>
|
|
39
|
+
## Triggers
|
|
40
|
+
|
|
41
|
+
- `/elsabro:audit-debt` - Escaneo completo del proyecto
|
|
42
|
+
- `/elsabro:audit-debt [path]` - Escaneo de directorio especifico
|
|
43
|
+
- `/elsabro:audit-debt --quick` - Solo issues CRITICAL y HIGH
|
|
44
|
+
- `/elsabro:audit-debt --save` - Guardar reporte en .planning/TECHDEBT.md
|
|
45
|
+
</triggers>
|
|
46
|
+
|
|
47
|
+
<scan_categories>
|
|
48
|
+
## Categorias de Escaneo
|
|
49
|
+
|
|
50
|
+
### 1. Codigo Duplicado
|
|
51
|
+
Buscar patrones repetidos que podrian extraerse:
|
|
52
|
+
- Funciones similares en diferentes archivos
|
|
53
|
+
- Logica copy-paste con pequenas variaciones
|
|
54
|
+
- Componentes que hacen lo mismo con diferentes props
|
|
55
|
+
|
|
56
|
+
### 2. TODOs y FIXMEs
|
|
57
|
+
Buscar comentarios pendientes con contexto:
|
|
58
|
+
```
|
|
59
|
+
grep -r "TODO\|FIXME\|HACK\|XXX" --include="*.ts" --include="*.tsx"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Dependencias Desactualizadas
|
|
63
|
+
```
|
|
64
|
+
npm outdated
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 4. Complejidad Ciclomatica
|
|
68
|
+
- Funciones con mas de 50 lineas
|
|
69
|
+
- Mas de 4 niveles de anidacion
|
|
70
|
+
- Mas de 10 ramas condicionales
|
|
71
|
+
|
|
72
|
+
### 5. Cobertura de Tests
|
|
73
|
+
Si hay tests configurados:
|
|
74
|
+
```
|
|
75
|
+
npm test -- --coverage --silent
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 6. Tipos Debiles (TypeScript)
|
|
79
|
+
- `any` explicitos
|
|
80
|
+
- `as unknown as X` casts
|
|
81
|
+
- `// @ts-ignore` o `// @ts-expect-error`
|
|
82
|
+
|
|
83
|
+
### 7. Console.logs Olvidados
|
|
84
|
+
```
|
|
85
|
+
grep -r "console.log\|console.warn\|console.error" --include="*.ts" --include="*.tsx" src/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 8. Imports No Utilizados
|
|
89
|
+
Detectar via ESLint/TypeScript.
|
|
90
|
+
|
|
91
|
+
### 9. Variables de Entorno
|
|
92
|
+
Verificar que `.env.example` tenga todas las variables necesarias.
|
|
93
|
+
|
|
94
|
+
### 10. Archivos Grandes
|
|
95
|
+
Archivos con mas de 300 lineas que podrian dividirse.
|
|
96
|
+
</scan_categories>
|
|
97
|
+
|
|
98
|
+
<severity_classification>
|
|
99
|
+
## Clasificacion de Severidad
|
|
100
|
+
|
|
101
|
+
Usar clasificacion consistente con ELSABRO:
|
|
102
|
+
|
|
103
|
+
| Severity | Emoji | Criterio |
|
|
104
|
+
|----------|-------|----------|
|
|
105
|
+
| CRITICAL | [CRITICAL] | Vulnerabilidades de seguridad, builds rotos |
|
|
106
|
+
| HIGH | [HIGH] | Major versions atrasados, codigo sin tests criticos |
|
|
107
|
+
| MEDIUM | [MEDIUM] | Minor versions, complejidad alta |
|
|
108
|
+
| LOW | [LOW] | Nitpicks, style issues, patch versions |
|
|
109
|
+
|
|
110
|
+
### Reglas de Clasificacion
|
|
111
|
+
|
|
112
|
+
**CRITICAL:**
|
|
113
|
+
- Vulnerabilidades CVE conocidas
|
|
114
|
+
- Secretos expuestos
|
|
115
|
+
- Memory leaks confirmados
|
|
116
|
+
- Tests principales fallando
|
|
117
|
+
|
|
118
|
+
**HIGH:**
|
|
119
|
+
- Codigo duplicado > 50 lineas
|
|
120
|
+
- Archivos > 500 lineas
|
|
121
|
+
- TODOs con "FIXME" o "URGENT"
|
|
122
|
+
- Dependencias major atrasadas
|
|
123
|
+
|
|
124
|
+
**MEDIUM:**
|
|
125
|
+
- Uso de `any` en TypeScript
|
|
126
|
+
- Funciones > 100 lineas
|
|
127
|
+
- TODOs generales > 30 dias
|
|
128
|
+
- Console.logs en produccion
|
|
129
|
+
|
|
130
|
+
**LOW:**
|
|
131
|
+
- Naming conventions
|
|
132
|
+
- Imports no utilizados
|
|
133
|
+
- Comentarios desactualizados
|
|
134
|
+
- Dependencias patch atrasadas
|
|
135
|
+
</severity_classification>
|
|
136
|
+
|
|
137
|
+
<output_format>
|
|
138
|
+
## Formato de Output
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
# Tech Debt Report - {{PROJECT_NAME}}
|
|
142
|
+
|
|
143
|
+
> Generado: {{DATE}}
|
|
144
|
+
> Path escaneado: {{PATH}}
|
|
145
|
+
|
|
146
|
+
## Resumen Ejecutivo
|
|
147
|
+
|
|
148
|
+
| Categoria | CRITICAL | HIGH | MEDIUM | LOW |
|
|
149
|
+
|-----------|----------|------|--------|-----|
|
|
150
|
+
| Duplicacion | 0 | 2 | 5 | 3 |
|
|
151
|
+
| TODOs | 1 | 4 | 8 | 2 |
|
|
152
|
+
| Dependencias | 0 | 1 | 3 | 12 |
|
|
153
|
+
| Complejidad | 0 | 3 | 7 | 15 |
|
|
154
|
+
| Tests | 2 | 5 | 10 | - |
|
|
155
|
+
| Tipos | 0 | 8 | 15 | 20 |
|
|
156
|
+
|
|
157
|
+
**Total Issues**: 125
|
|
158
|
+
**Health Score**: 72/100
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## [CRITICAL] Issues Criticos (Resolver AHORA)
|
|
163
|
+
|
|
164
|
+
### Vulnerabilidad en lodash@4.17.15
|
|
165
|
+
- **Ubicacion**: package.json
|
|
166
|
+
- **Accion**: `npm update lodash`
|
|
167
|
+
- **CVE**: CVE-2021-23337
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## [HIGH] Issues Altos (Resolver esta semana)
|
|
172
|
+
|
|
173
|
+
### Codigo duplicado: formatDate
|
|
174
|
+
- **Archivos**:
|
|
175
|
+
- src/utils/format.ts:45-67
|
|
176
|
+
- src/helpers/date.ts:12-34
|
|
177
|
+
- **Lineas duplicadas**: 22
|
|
178
|
+
- **Sugerencia**: Crear `src/lib/date-utils.ts`
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## [MEDIUM] Issues Medios (Backlog)
|
|
183
|
+
|
|
184
|
+
### Uso excesivo de `any`
|
|
185
|
+
- **Total**: 15 ocurrencias
|
|
186
|
+
- **Archivos principales**:
|
|
187
|
+
- src/api/client.ts (5)
|
|
188
|
+
- src/utils/helpers.ts (4)
|
|
189
|
+
- **Sugerencia**: Crear tipos especificos
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## [LOW] Issues Menores (Opcional)
|
|
194
|
+
|
|
195
|
+
### Console.logs en codigo
|
|
196
|
+
- **Total**: 8 ocurrencias
|
|
197
|
+
- **Sugerencia**: Usar logger estructurado
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Recomendaciones
|
|
202
|
+
|
|
203
|
+
1. [ ] Crear ticket para resolver vulnerabilidades de seguridad
|
|
204
|
+
2. [ ] Dedicar 20% del sprint a reducir TODOs
|
|
205
|
+
3. [ ] Agregar pre-commit hook para prevenir console.logs
|
|
206
|
+
4. [ ] Configurar ESLint para detectar `any`
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Proximo Escaneo
|
|
211
|
+
|
|
212
|
+
Ejecutar `/elsabro:audit-debt` despues de cada merge a main.
|
|
213
|
+
```
|
|
214
|
+
</output_format>
|
|
215
|
+
|
|
216
|
+
<health_score>
|
|
217
|
+
## Calculo de Health Score
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
Base: 100 puntos
|
|
221
|
+
|
|
222
|
+
Deducciones:
|
|
223
|
+
- CRITICAL: -15 puntos cada uno
|
|
224
|
+
- HIGH: -5 puntos cada uno
|
|
225
|
+
- MEDIUM: -1 punto cada uno
|
|
226
|
+
- LOW: -0.25 puntos cada uno
|
|
227
|
+
|
|
228
|
+
Minimo: 0 puntos
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Interpretacion
|
|
232
|
+
|
|
233
|
+
| Score | Estado | Accion |
|
|
234
|
+
|-------|--------|--------|
|
|
235
|
+
| 90-100 | Excelente | Mantener |
|
|
236
|
+
| 70-89 | Bueno | Monitorear |
|
|
237
|
+
| 50-69 | Aceptable | Planificar mejoras |
|
|
238
|
+
| 30-49 | Preocupante | Priorizar deuda |
|
|
239
|
+
| 0-29 | Critico | Parar features, resolver deuda |
|
|
240
|
+
</health_score>
|
|
241
|
+
|
|
242
|
+
<save_report>
|
|
243
|
+
## Guardar Reporte
|
|
244
|
+
|
|
245
|
+
Con flag `--save`, guardar en `.planning/TECHDEBT.md`:
|
|
246
|
+
|
|
247
|
+
```markdown
|
|
248
|
+
# Tech Debt Tracking
|
|
249
|
+
|
|
250
|
+
## Ultimo Escaneo: {{DATE}}
|
|
251
|
+
|
|
252
|
+
[Contenido del reporte]
|
|
253
|
+
|
|
254
|
+
## Historial de Health Score
|
|
255
|
+
|
|
256
|
+
| Fecha | Score | CRITICAL | HIGH | Notas |
|
|
257
|
+
|-------|-------|----------|------|-------|
|
|
258
|
+
| 2024-01-20 | 72 | 0 | 5 | Post-refactor |
|
|
259
|
+
| 2024-01-15 | 65 | 1 | 8 | Antes de limpieza |
|
|
260
|
+
| 2024-01-10 | 58 | 2 | 12 | Inicial |
|
|
261
|
+
```
|
|
262
|
+
</save_report>
|
|
263
|
+
|
|
264
|
+
<integration_planning>
|
|
265
|
+
## Integracion con Planificacion ELSABRO
|
|
266
|
+
|
|
267
|
+
Ofrecer despues del escaneo:
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
"Encontre {{N}} issues criticos y {{M}} altos.
|
|
271
|
+
|
|
272
|
+
Opciones:
|
|
273
|
+
1. `/elsabro:plan debt-reduction` - Crear plan para resolver deuda
|
|
274
|
+
2. Agregar issues a fase existente
|
|
275
|
+
3. Solo guardar reporte para referencia
|
|
276
|
+
|
|
277
|
+
Que prefieres?"
|
|
278
|
+
```
|
|
279
|
+
</integration_planning>
|
|
280
|
+
|
|
281
|
+
<automatic_scheduling>
|
|
282
|
+
## Programacion Automatica
|
|
283
|
+
|
|
284
|
+
Sugerir al usuario agregar a su workflow:
|
|
285
|
+
- Final de cada sesion de trabajo
|
|
286
|
+
- Antes de cada PR
|
|
287
|
+
- Semanalmente como rutina
|
|
288
|
+
- Post-merge a main
|
|
289
|
+
</automatic_scheduling>
|