swl-ses 3.3.2
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/CLAUDE.md +425 -0
- package/_userland/agentes/.gitkeep +0 -0
- package/_userland/habilidades/.gitkeep +0 -0
- package/agentes/accesibilidad-wcag-swl.md +683 -0
- package/agentes/arquitecto-swl.md +210 -0
- package/agentes/auto-evolucion-swl.md +408 -0
- package/agentes/backend-api-swl.md +442 -0
- package/agentes/backend-node-swl.md +439 -0
- package/agentes/backend-python-swl.md +469 -0
- package/agentes/backend-workers-swl.md +444 -0
- package/agentes/cloud-infra-swl.md +466 -0
- package/agentes/consolidador-swl.md +487 -0
- package/agentes/datos-swl.md +568 -0
- package/agentes/depurador-swl.md +301 -0
- package/agentes/devops-ci-swl.md +352 -0
- package/agentes/disenador-ui-swl.md +546 -0
- package/agentes/documentador-swl.md +323 -0
- package/agentes/frontend-angular-swl.md +603 -0
- package/agentes/frontend-css-swl.md +700 -0
- package/agentes/frontend-react-swl.md +672 -0
- package/agentes/frontend-swl.md +483 -0
- package/agentes/frontend-tailwind-swl.md +808 -0
- package/agentes/implementador-swl.md +235 -0
- package/agentes/investigador-swl.md +274 -0
- package/agentes/investigador-ux-swl.md +482 -0
- package/agentes/migrador-swl.md +389 -0
- package/agentes/mobile-android-swl.md +473 -0
- package/agentes/mobile-cross-swl.md +501 -0
- package/agentes/mobile-ios-swl.md +464 -0
- package/agentes/notificador-swl.md +886 -0
- package/agentes/observabilidad-swl.md +408 -0
- package/agentes/orquestador-swl.md +490 -0
- package/agentes/planificador-swl.md +222 -0
- package/agentes/producto-prd-swl.md +565 -0
- package/agentes/release-manager-swl.md +545 -0
- package/agentes/rendimiento-swl.md +691 -0
- package/agentes/revisor-codigo-swl.md +254 -0
- package/agentes/revisor-seguridad-swl.md +316 -0
- package/agentes/tdd-qa-swl.md +323 -0
- package/agentes/ux-disenador-swl.md +498 -0
- package/bin/swl-ses.js +119 -0
- package/comandos/swl/actualizar.md +117 -0
- package/comandos/swl/aprender.md +348 -0
- package/comandos/swl/auditar-deps.md +390 -0
- package/comandos/swl/autoresearch.md +346 -0
- package/comandos/swl/checkpoint.md +296 -0
- package/comandos/swl/compactar.md +283 -0
- package/comandos/swl/crear-skill.md +609 -0
- package/comandos/swl/discutir-fase.md +230 -0
- package/comandos/swl/ejecutar-fase.md +302 -0
- package/comandos/swl/evolucionar.md +377 -0
- package/comandos/swl/instalar.md +220 -0
- package/comandos/swl/mapear-codebase.md +205 -0
- package/comandos/swl/nuevo-proyecto.md +154 -0
- package/comandos/swl/planear-fase.md +221 -0
- package/comandos/swl/release.md +405 -0
- package/comandos/swl/salud.md +382 -0
- package/comandos/swl/verificar.md +292 -0
- package/habilidades/accesibilidad-a11y/SKILL.md +584 -0
- package/habilidades/angular-avanzado/SKILL.md +491 -0
- package/habilidades/angular-moderno/SKILL.md +326 -0
- package/habilidades/api-rest-diseno/SKILL.md +302 -0
- package/habilidades/api-rest-diseno/recursos/openapi-template.yaml +506 -0
- package/habilidades/aprendizaje-continuo/SKILL.md +369 -0
- package/habilidades/async-python/SKILL.md +474 -0
- package/habilidades/auth-patrones/SKILL.md +488 -0
- package/habilidades/auto-evolucion-protocolo/SKILL.md +376 -0
- package/habilidades/autoresearch/SKILL.md +248 -0
- package/habilidades/autoresearch/recursos/checklist-template.md +191 -0
- package/habilidades/autoresearch/scripts/calcular-score.js +88 -0
- package/habilidades/checklist-calidad/SKILL.md +247 -0
- package/habilidades/checklist-calidad/recursos/quality-report-template.md +148 -0
- package/habilidades/checklist-seguridad/SKILL.md +224 -0
- package/habilidades/checkpoints-verificacion/SKILL.md +309 -0
- package/habilidades/checkpoints-verificacion/recursos/checkpoint-templates.md +360 -0
- package/habilidades/ci-cd-pipelines/SKILL.md +583 -0
- package/habilidades/ci-cd-pipelines/recursos/github-actions-template.yaml +403 -0
- package/habilidades/cloud-aws/SKILL.md +497 -0
- package/habilidades/compactacion-contexto/SKILL.md +201 -0
- package/habilidades/contenedores-docker/SKILL.md +453 -0
- package/habilidades/contenedores-docker/recursos/dockerfile-template.dockerfile +160 -0
- package/habilidades/css-moderno/SKILL.md +463 -0
- package/habilidades/datos-etl/SKILL.md +486 -0
- package/habilidades/dependencias-auditoria/SKILL.md +293 -0
- package/habilidades/deprecacion-migracion/SKILL.md +485 -0
- package/habilidades/design-tokens/SKILL.md +519 -0
- package/habilidades/discutir-fase/SKILL.md +167 -0
- package/habilidades/diseno-responsivo/SKILL.md +326 -0
- package/habilidades/django-experto/SKILL.md +395 -0
- package/habilidades/doc-sync/SKILL.md +259 -0
- package/habilidades/ejecutar-fase/SKILL.md +199 -0
- package/habilidades/estructura-proyecto-claude/SKILL.md +459 -0
- package/habilidades/estructura-proyecto-claude/recursos/claude-md-template.md +261 -0
- package/habilidades/estructura-proyecto-claude/recursos/frontmatter-y-hooks-referencia.md +213 -0
- package/habilidades/estructura-proyecto-claude/recursos/mcp-json-template.json +77 -0
- package/habilidades/estructura-proyecto-claude/recursos/variantes-por-stack.md +177 -0
- package/habilidades/event-driven/SKILL.md +580 -0
- package/habilidades/extractor-de-aprendizajes/SKILL.md +234 -0
- package/habilidades/fastapi-experto/SKILL.md +368 -0
- package/habilidades/frontend-avanzado/SKILL.md +555 -0
- package/habilidades/git-worktrees-paralelo/SKILL.md +246 -0
- package/habilidades/iam-secretos/SKILL.md +511 -0
- package/habilidades/instalar-sistema/SKILL.md +140 -0
- package/habilidades/kubernetes-orquestacion/SKILL.md +549 -0
- package/habilidades/manejo-errores/SKILL.md +512 -0
- package/habilidades/mapear-codebase/SKILL.md +199 -0
- package/habilidades/microservicios/SKILL.md +473 -0
- package/habilidades/mobile-flutter/SKILL.md +566 -0
- package/habilidades/mobile-react-native/SKILL.md +493 -0
- package/habilidades/monitoring-alertas/SKILL.md +447 -0
- package/habilidades/node-experto/SKILL.md +521 -0
- package/habilidades/notificaciones-multicanal/SKILL.md +448 -0
- package/habilidades/notificaciones-multicanal/recursos/config-template.json +115 -0
- package/habilidades/nuevo-proyecto/SKILL.md +183 -0
- package/habilidades/patrones-python/SKILL.md +381 -0
- package/habilidades/performance-baseline/SKILL.md +243 -0
- package/habilidades/planear-fase/SKILL.md +184 -0
- package/habilidades/postgresql-experto/SKILL.md +379 -0
- package/habilidades/react-experto/SKILL.md +434 -0
- package/habilidades/react-optimizacion/SKILL.md +328 -0
- package/habilidades/release-semver/SKILL.md +226 -0
- package/habilidades/release-semver/scripts/generar-changelog.sh +238 -0
- package/habilidades/sql-optimizacion/SKILL.md +314 -0
- package/habilidades/tailwind-experto/SKILL.md +412 -0
- package/habilidades/tdd-workflow/SKILL.md +267 -0
- package/habilidades/testing-python/SKILL.md +350 -0
- package/habilidades/threat-model-lite/SKILL.md +218 -0
- package/habilidades/typescript-avanzado/SKILL.md +454 -0
- package/habilidades/ux-diseno/SKILL.md +488 -0
- package/habilidades/validacion-ci-sistema/SKILL.md +543 -0
- package/habilidades/validacion-ci-sistema/scripts/validar-sistema.sh +286 -0
- package/habilidades/verificar-trabajo/SKILL.md +208 -0
- package/habilidades/wireframes-flujos/SKILL.md +396 -0
- package/habilidades/workflow-claude-code/SKILL.md +359 -0
- package/hooks/calidad-pre-commit.js +578 -0
- package/hooks/escaneo-secretos.js +302 -0
- package/hooks/extraccion-aprendizajes.js +550 -0
- package/hooks/linea-estado.js +249 -0
- package/hooks/monitor-contexto.js +230 -0
- package/hooks/proteccion-rutas.js +249 -0
- package/manifiestos/hooks-config.json +41 -0
- package/manifiestos/modulos.json +318 -0
- package/manifiestos/perfiles.json +189 -0
- package/package.json +45 -0
- package/plantillas/PROJECT.md +122 -0
- package/plantillas/REQUIREMENTS.md +132 -0
- package/plantillas/ROADMAP.md +143 -0
- package/plantillas/STATE.md +109 -0
- package/plantillas/research/ARCHITECTURE.md +220 -0
- package/plantillas/research/FEATURES.md +175 -0
- package/plantillas/research/PITFALLS.md +299 -0
- package/plantillas/research/STACK.md +233 -0
- package/plantillas/research/SUMMARY.md +165 -0
- package/plugin.json +144 -0
- package/reglas/accesibilidad.md +269 -0
- package/reglas/api-diseno.md +400 -0
- package/reglas/arquitectura.md +183 -0
- package/reglas/cloud-infra.md +247 -0
- package/reglas/docs.md +245 -0
- package/reglas/estilo-codigo.md +179 -0
- package/reglas/git-workflow.md +186 -0
- package/reglas/performance.md +195 -0
- package/reglas/pruebas.md +159 -0
- package/reglas/seguridad.md +151 -0
- package/reglas/skills-estandar.md +473 -0
- package/scripts/actualizar.js +51 -0
- package/scripts/desinstalar.js +86 -0
- package/scripts/doctor.js +222 -0
- package/scripts/inicializar.js +89 -0
- package/scripts/instalador.js +333 -0
- package/scripts/lib/detectar-runtime.js +177 -0
- package/scripts/lib/estado.js +112 -0
- package/scripts/lib/hooks-settings.js +283 -0
- package/scripts/lib/manifiestos.js +138 -0
- package/scripts/lib/seguridad.js +160 -0
- package/scripts/publicar.js +209 -0
- package/scripts/validar.js +120 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# CLAUDE.md — [Nombre del Proyecto]
|
|
2
|
+
|
|
3
|
+
> Fuente de verdad del proyecto para Claude Code.
|
|
4
|
+
> Claude lee este archivo al inicio de cada sesion.
|
|
5
|
+
> Actualizar cuando cambien convenciones, stack o arquitectura.
|
|
6
|
+
> Mantener bajo 200 lineas — usar .claude/rules/ para instrucciones extensas.
|
|
7
|
+
> Ultima actualizacion: [YYYY-MM-DD]
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Que es este proyecto
|
|
12
|
+
|
|
13
|
+
[2-3 oraciones describiendo el proposito del proyecto, el problema que resuelve
|
|
14
|
+
y a quien va dirigido. Ser especifico — evitar frases genericas como "sistema
|
|
15
|
+
de gestion empresarial".]
|
|
16
|
+
|
|
17
|
+
**Ejemplo**:
|
|
18
|
+
> API REST para el sistema de facturacion electronica de PyMEs en Mexico.
|
|
19
|
+
> Genera CFDIs 4.0 certificados por el SAT e integra con los PACs Finkok y Diverza.
|
|
20
|
+
> Expone una interfaz REST consumida por el frontend Angular y la app movil React Native.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Stack tecnologico
|
|
25
|
+
|
|
26
|
+
| Capa | Tecnologia | Version |
|
|
27
|
+
|------|-----------|---------|
|
|
28
|
+
| Lenguaje backend | Python | 3.12 |
|
|
29
|
+
| Framework backend | FastAPI | 0.115+ |
|
|
30
|
+
| ORM | SQLAlchemy | 2.0 (async) |
|
|
31
|
+
| Base de datos | PostgreSQL | 16 |
|
|
32
|
+
| Migraciones | Alembic | 1.13+ |
|
|
33
|
+
| Gestor de paquetes | uv | 0.5+ |
|
|
34
|
+
| Lenguaje frontend | TypeScript | 5.4+ |
|
|
35
|
+
| Framework frontend | Angular | 20+ |
|
|
36
|
+
| Estilos | Tailwind CSS | 4.0 |
|
|
37
|
+
| Tests backend | pytest + httpx | - |
|
|
38
|
+
| Tests frontend | Jasmine + Karma | - |
|
|
39
|
+
| CI/CD | GitHub Actions | - |
|
|
40
|
+
| Contenedores | Docker + Compose | - |
|
|
41
|
+
|
|
42
|
+
> Ajustar esta tabla al stack real del proyecto. Eliminar filas que no aplican.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 2. Convenciones de codigo
|
|
47
|
+
|
|
48
|
+
### Python / Backend
|
|
49
|
+
|
|
50
|
+
- **Estilo**: PEP 8 + Ruff para lint y formato. Maximo 88 caracteres por linea.
|
|
51
|
+
- **Type hints**: Obligatorios en toda funcion publica. Sin `Any` sin justificacion.
|
|
52
|
+
- **Docstrings**: Solo en funciones publicas de modulos, clases y endpoints complejos.
|
|
53
|
+
Formato Google Style.
|
|
54
|
+
- **Imports**: Agrupados — stdlib, terceros, locales. Separados por linea en blanco.
|
|
55
|
+
- **Nombres**: `snake_case` para variables y funciones, `PascalCase` para clases.
|
|
56
|
+
|
|
57
|
+
### TypeScript / Frontend
|
|
58
|
+
|
|
59
|
+
- **Framework**: Angular 20+ con signals. Sin NgModules para componentes nuevos.
|
|
60
|
+
- **Directivas de control**: `@if`, `@for`, `@switch`. NUNCA `*ngIf`, `*ngFor`.
|
|
61
|
+
- **Estado**: `signal()` y `computed()` para estado reactivo.
|
|
62
|
+
- **Estilos**: Tailwind CSS. Angular Material SOLO para componentes funcionales.
|
|
63
|
+
- **HTTP**: Siempre tipado. Sin `any` en responses de API.
|
|
64
|
+
|
|
65
|
+
### Naming conventions
|
|
66
|
+
|
|
67
|
+
- Archivos: `kebab-case` para todos los archivos
|
|
68
|
+
- Componentes Angular: `nombre.component.ts`, `nombre.component.html`
|
|
69
|
+
- Services: `nombre.service.ts`
|
|
70
|
+
- Models: `nombre.model.ts`
|
|
71
|
+
- Tests: `nombre.spec.ts` (frontend), `test_nombre.py` (backend)
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 3. Arquitectura
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
src/
|
|
79
|
+
+-- [capa-1]/ # [Descripcion: ej. "Componentes React compartidos"]
|
|
80
|
+
+-- [capa-2]/ # [Descripcion: ej. "Handlers / logica de negocio"]
|
|
81
|
+
+-- [capa-3]/ # [Descripcion: ej. "Utilidades compartidas"]
|
|
82
|
+
+-- [capa-4]/ # [Descripcion: ej. "Modelos de datos y schemas"]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Reglas de arquitectura
|
|
86
|
+
- Services no importan directamente modelos de otros dominios
|
|
87
|
+
- Endpoints no tienen logica de negocio — delegan a services
|
|
88
|
+
- Componentes no hacen llamadas HTTP directamente — usan services
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 4. Seguridad
|
|
93
|
+
|
|
94
|
+
- No secretos en codigo ni logs — usar variables de entorno
|
|
95
|
+
- Validar todos los inputs del usuario en el boundary del sistema
|
|
96
|
+
- Usar queries parametrizadas — NUNCA concatenacion de strings SQL
|
|
97
|
+
- RBAC en todos los endpoints que modifican datos
|
|
98
|
+
- CORS configurado explicitamente — no wildcard `*` en produccion
|
|
99
|
+
- Rate limiting en endpoints publicos
|
|
100
|
+
- Headers de seguridad: HSTS, X-Content-Type-Options, X-Frame-Options
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 5. Testing
|
|
105
|
+
|
|
106
|
+
### Estrategia de tests
|
|
107
|
+
|
|
108
|
+
| Tipo | Framework | Cobertura minima |
|
|
109
|
+
|------|-----------|-----------------|
|
|
110
|
+
| Unit tests backend | pytest | 80% lineas |
|
|
111
|
+
| Integration tests | pytest + httpx | Todos los endpoints |
|
|
112
|
+
| Unit tests frontend | Jasmine + Karma | 70% lineas |
|
|
113
|
+
| E2E tests | Playwright / Cypress | Flujos criticos |
|
|
114
|
+
|
|
115
|
+
### Como correr tests
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Backend — tests completos con cobertura
|
|
119
|
+
pytest tests/ --cov=app --cov-report=html -v
|
|
120
|
+
|
|
121
|
+
# Backend — solo un modulo
|
|
122
|
+
pytest tests/test_facturacion.py -v
|
|
123
|
+
|
|
124
|
+
# Frontend — tests unitarios
|
|
125
|
+
ng test
|
|
126
|
+
|
|
127
|
+
# Frontend — E2E
|
|
128
|
+
ng e2e
|
|
129
|
+
|
|
130
|
+
# Lint y tipo-checking
|
|
131
|
+
ruff check app/ tests/
|
|
132
|
+
mypy app/
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Reglas de testing
|
|
136
|
+
- Todo PR debe incluir tests para codigo nuevo/modificado
|
|
137
|
+
- Tests deben tener assertions reales (no solo verificar que no lanza excepcion)
|
|
138
|
+
- Fixtures compartidas en `conftest.py` / `test-utils.ts`
|
|
139
|
+
- Mock solo para dependencias externas (APIs, email). NUNCA mockear la BD en integration tests.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 6. Git Workflow
|
|
144
|
+
|
|
145
|
+
### Ramas
|
|
146
|
+
- `main` — produccion, protegida
|
|
147
|
+
- `develop` — integracion (si aplica)
|
|
148
|
+
- `feature/descripcion-corta` — features nuevas
|
|
149
|
+
- `fix/descripcion-corta` — bug fixes
|
|
150
|
+
- `chore/descripcion` — mantenimiento
|
|
151
|
+
|
|
152
|
+
### Commits
|
|
153
|
+
Formato Conventional Commits en ingles:
|
|
154
|
+
```
|
|
155
|
+
feat: add CFDI billing endpoint
|
|
156
|
+
fix: correct RFC validation in schema
|
|
157
|
+
chore: update security dependencies
|
|
158
|
+
refactor: extract billing logic to service
|
|
159
|
+
test: add integration tests for auth flow
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Pull Requests
|
|
163
|
+
- Al menos 1 revisor
|
|
164
|
+
- Tests pasando en CI
|
|
165
|
+
- Sin TODO sin ticket asociado
|
|
166
|
+
- Squash merge a main
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 7. Comandos comunes (Workflows)
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# --- Setup inicial ---
|
|
174
|
+
uv sync # Instalar dependencias Python
|
|
175
|
+
npm install # Instalar dependencias frontend
|
|
176
|
+
|
|
177
|
+
# --- Desarrollo ---
|
|
178
|
+
uvicorn app.main:app --reload --port 8000 # Backend dev server
|
|
179
|
+
ng serve --open # Frontend dev server
|
|
180
|
+
|
|
181
|
+
# --- Base de datos ---
|
|
182
|
+
alembic revision --autogenerate -m "desc" # Crear migracion
|
|
183
|
+
alembic upgrade head # Aplicar migraciones
|
|
184
|
+
alembic downgrade -1 # Revertir ultima
|
|
185
|
+
|
|
186
|
+
# --- Testing ---
|
|
187
|
+
pytest tests/ -v # Tests backend
|
|
188
|
+
ng test # Tests frontend
|
|
189
|
+
|
|
190
|
+
# --- Calidad ---
|
|
191
|
+
ruff check app/ tests/ # Lint Python
|
|
192
|
+
ruff format app/ tests/ # Format Python
|
|
193
|
+
mypy app/ # Type checking
|
|
194
|
+
|
|
195
|
+
# --- Docker ---
|
|
196
|
+
docker compose up -d postgres redis # Solo infra
|
|
197
|
+
docker compose up --build # Todo
|
|
198
|
+
docker compose down # Detener
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Reglas anti-error del proyecto
|
|
204
|
+
|
|
205
|
+
> Estas reglas documentan errores que ya ocurrieron en este proyecto.
|
|
206
|
+
> Son la segunda defensa despues de los tests.
|
|
207
|
+
|
|
208
|
+
### Backend
|
|
209
|
+
|
|
210
|
+
- **selectinload OBLIGATORIO**: Toda relacion accedida en serializacion Pydantic
|
|
211
|
+
DEBE tener `selectinload()` en el query. Sin esto -> `MissingGreenlet` en runtime.
|
|
212
|
+
- **Services NO hacen commit**: Solo `db.add()`, `db.flush()`, `db.refresh()`.
|
|
213
|
+
El commit SIEMPRE en el endpoint.
|
|
214
|
+
- **Literal[] en schemas**: Campos con dominio cerrado (`estatus`, `tipo`) DEBEN
|
|
215
|
+
usar `Literal["valor1", "valor2"]`. NUNCA `str` sin restriccion.
|
|
216
|
+
- **RBAC en escritura**: Todos los endpoints POST/PUT/DELETE deben tener
|
|
217
|
+
`_=Depends(require_role([...]))`.
|
|
218
|
+
|
|
219
|
+
### Frontend
|
|
220
|
+
|
|
221
|
+
- **PaginatedResponse**: Todo endpoint paginado parsear con `.pipe(map(r => r.items))`.
|
|
222
|
+
- **track obligatorio en @for**: `@for (item of items; track item.id)`.
|
|
223
|
+
- **takeUntilDestroyed()**: En toda suscripcion larga o polling.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Estructura de archivos
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
[Pegar aqui la estructura de arbol del proyecto, generada con:
|
|
231
|
+
tree -I "node_modules|__pycache__|.git|*.pyc|dist|build" --max-depth=3
|
|
232
|
+
]
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Variables de entorno requeridas
|
|
238
|
+
|
|
239
|
+
Copiar `.env.example` a `.env` y completar antes de ejecutar:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
cp .env.example .env
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Descripcion de cada variable en `.env.example`. Las variables marcadas con `*`
|
|
246
|
+
son obligatorias para correr en desarrollo.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Agentes y skills activos en este proyecto
|
|
251
|
+
|
|
252
|
+
| Tipo | Nombre | Proposito |
|
|
253
|
+
|------|--------|-----------|
|
|
254
|
+
| Skill | [nombre] | [que cubre] |
|
|
255
|
+
| Agente | [nombre] | [cuando se usa] |
|
|
256
|
+
| Comando | `/proyecto:nombre` | [que hace] |
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
*Template generado con `Skill("estructura-proyecto-claude")` el [YYYY-MM-DD].*
|
|
261
|
+
*Mantener actualizado al cierre de cada fase con `consolidador-swl`.*
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Referencia completa: Frontmatter de Skills y Hook Events
|
|
2
|
+
|
|
3
|
+
Fuente: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Frontmatter completo de SKILL.md (12 campos)
|
|
8
|
+
|
|
9
|
+
| Campo | Requerido | Tipo | Descripcion |
|
|
10
|
+
|-------|-----------|------|-------------|
|
|
11
|
+
| `name` | No* | string | Nombre kebab-case, max 64 chars. Se convierte en `/nombre` para invocacion. *Si se omite, usa el nombre del directorio |
|
|
12
|
+
| `description` | Recomendado | string | Max 1024 chars. QUE hace + CUANDO usar. Guia la auto-activacion de Claude |
|
|
13
|
+
| `argument-hint` | Opcional | string | Hint de autocompletado: `[archivo]`, `[issue-num]`, `[file] [format]` |
|
|
14
|
+
| `allowed-tools` | Opcional | array | Tools que Claude puede usar sin pedir permiso cuando la skill esta activa |
|
|
15
|
+
| `paths` | Opcional | array/string | Patrones glob: cargar skill SOLO al trabajar con archivos que coinciden |
|
|
16
|
+
| `context` | Opcional | string | `fork` = ejecutar en subagente aislado con su propia conversacion |
|
|
17
|
+
| `agent` | Opcional | string | Tipo de subagente si `context: fork` (Explore, Plan, general-purpose) |
|
|
18
|
+
| `model` | Opcional | string | Override de modelo para esta skill |
|
|
19
|
+
| `effort` | Opcional | string | Nivel de esfuerzo: `low`, `medium`, `high`, `max` (Opus only) |
|
|
20
|
+
| `shell` | Opcional | string | `bash` o `powershell`. Controla bloques `!comando` embebidos |
|
|
21
|
+
| `disable-model-invocation` | Opcional | boolean | `true` = solo el usuario puede invocar (no auto-trigger). Usar para skills con side-effects como `/deploy` |
|
|
22
|
+
| `user-invocable` | Opcional | boolean | `false` = solo Claude la ve (conocimiento de background). No aparece en menu `/` |
|
|
23
|
+
|
|
24
|
+
### Ejemplo completo
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
---
|
|
28
|
+
name: api-test-generator
|
|
29
|
+
description: >
|
|
30
|
+
Genera tests de integracion para endpoints REST. Auto-activar cuando el usuario
|
|
31
|
+
crea o modifica un endpoint en src/api/. Produce tests con httpx y pytest que
|
|
32
|
+
cubren happy path, validacion de input, auth y error handling.
|
|
33
|
+
argument-hint: "[endpoint-path]"
|
|
34
|
+
allowed-tools: ["Read", "Grep", "Glob", "Write"]
|
|
35
|
+
paths:
|
|
36
|
+
- "src/api/**/*.py"
|
|
37
|
+
- "tests/integration/**/*.py"
|
|
38
|
+
model: claude-sonnet-4-6
|
|
39
|
+
effort: high
|
|
40
|
+
disable-model-invocation: false
|
|
41
|
+
user-invocable: true
|
|
42
|
+
---
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Sustituciones de string disponibles
|
|
46
|
+
|
|
47
|
+
| Variable | Valor |
|
|
48
|
+
|----------|-------|
|
|
49
|
+
| `$ARGUMENTS` | Argumentos pasados al invocar la skill |
|
|
50
|
+
| `$0`, `$1`, `$2`... | Argumentos posicionales |
|
|
51
|
+
| `${CLAUDE_SESSION_ID}` | ID unico de la sesion actual |
|
|
52
|
+
| `${CLAUDE_SKILL_DIR}` | Path absoluto al directorio de la skill |
|
|
53
|
+
| `${env:VAR_NAME}` | Variable de entorno del sistema |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 25 Hook Events oficiales
|
|
58
|
+
|
|
59
|
+
### Ciclo de vida de sesion
|
|
60
|
+
|
|
61
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
62
|
+
|--------|-------------------|----------|-----------|
|
|
63
|
+
| `SessionStart` | Al iniciar o resumir sesion | `startup`, `resume`, `clear`, `compact` | Cargar contexto, setup env |
|
|
64
|
+
| `SessionEnd` | Al terminar sesion | `clear`, `resume`, `logout`, `other` | Cleanup, archivado |
|
|
65
|
+
| `InstructionsLoaded` | CLAUDE.md o rules/ cargados | `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact` | Log que instrucciones se cargaron |
|
|
66
|
+
|
|
67
|
+
### Ejecucion de herramientas
|
|
68
|
+
|
|
69
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
70
|
+
|--------|-------------------|----------|-----------|
|
|
71
|
+
| `PreToolUse` | Antes de ejecutar herramienta | Nombre de tool (Bash, Edit, Read, mcp__*) | Bloquear ops inseguras, validar |
|
|
72
|
+
| `PostToolUse` | Despues de ejecutar herramienta (exito) | Nombre de tool | Auto-lint, format, log |
|
|
73
|
+
| `PostToolUseFailure` | Cuando falla herramienta | Nombre de tool | Notificar, reintentar |
|
|
74
|
+
| `PermissionRequest` | Se muestra dialogo de permiso | Nombre de tool | Auto-aprobar acciones seguras |
|
|
75
|
+
|
|
76
|
+
### Respuesta y control
|
|
77
|
+
|
|
78
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
79
|
+
|--------|-------------------|----------|-----------|
|
|
80
|
+
| `Stop` | Claude termina de responder | Ninguno (siempre se dispara) | Verificar tarea completa |
|
|
81
|
+
| `StopFailure` | Error de API en Stop | `rate_limit`, `authentication_failed`, `billing_error`, `server_error` | Notificar fallos |
|
|
82
|
+
| `UserPromptSubmit` | Usuario envia prompt | Ninguno | Interceptar/enriquecer input |
|
|
83
|
+
|
|
84
|
+
### Compactacion de contexto
|
|
85
|
+
|
|
86
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
87
|
+
|--------|-------------------|----------|-----------|
|
|
88
|
+
| `PreCompact` | Antes de compactar | `manual`, `auto` | Salvar estado critico |
|
|
89
|
+
| `PostCompact` | Despues de compactar | `manual`, `auto` | Re-inyectar contexto |
|
|
90
|
+
|
|
91
|
+
### Subagentes
|
|
92
|
+
|
|
93
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
94
|
+
|--------|-------------------|----------|-----------|
|
|
95
|
+
| `SubagentStart` | Al spawnar subagente | `Explore`, `Plan`, `general-purpose`, nombres custom | Log creacion |
|
|
96
|
+
| `SubagentStop` | Al terminar subagente | Mismos que SubagentStart | Cleanup worktrees |
|
|
97
|
+
| `TeammateIdle` | Miembro de equipo idle | Ninguno | Keep alive, escalar |
|
|
98
|
+
|
|
99
|
+
### Tasks
|
|
100
|
+
|
|
101
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
102
|
+
|--------|-------------------|----------|-----------|
|
|
103
|
+
| `TaskCreated` | Al crear tarea | Ninguno | Log, validar tasks |
|
|
104
|
+
| `TaskCompleted` | Al completar tarea | Ninguno | Notificar, log |
|
|
105
|
+
|
|
106
|
+
### Configuracion y archivos
|
|
107
|
+
|
|
108
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
109
|
+
|--------|-------------------|----------|-----------|
|
|
110
|
+
| `ConfigChange` | Cambio en settings | `user_settings`, `project_settings`, `local_settings`, `policy_settings`, `skills` | Auditar, bloquear no autorizado |
|
|
111
|
+
| `CwdChanged` | Cambio de directorio de trabajo | Ninguno | Recargar direnv, actualizar env |
|
|
112
|
+
| `FileChanged` | Archivo observado cambia | Patron de nombre (`.envrc`, `.env`) | Recargar config, re-lint |
|
|
113
|
+
|
|
114
|
+
### Git worktrees
|
|
115
|
+
|
|
116
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
117
|
+
|--------|-------------------|----------|-----------|
|
|
118
|
+
| `WorktreeCreate` | Git worktree creado | Ninguno | Setup custom |
|
|
119
|
+
| `WorktreeRemove` | Git worktree removido | Ninguno | Cleanup recursos |
|
|
120
|
+
|
|
121
|
+
### MCP
|
|
122
|
+
|
|
123
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
124
|
+
|--------|-------------------|----------|-----------|
|
|
125
|
+
| `Elicitation` | Servidor MCP pide input | Nombre del servidor MCP | Gate user input |
|
|
126
|
+
| `ElicitationResult` | Usuario responde a MCP | Nombre del servidor MCP | Validar/transformar respuesta |
|
|
127
|
+
|
|
128
|
+
### Notificaciones
|
|
129
|
+
|
|
130
|
+
| Evento | Cuando se dispara | Matchers | Uso tipico |
|
|
131
|
+
|--------|-------------------|----------|-----------|
|
|
132
|
+
| `Notification` | Claude espera input | `permission_prompt`, `idle_prompt`, `auth_success` | Alertas desktop, sonidos |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Tipos de handler para hooks
|
|
137
|
+
|
|
138
|
+
| Tipo | Descripcion | Ejemplo |
|
|
139
|
+
|------|-------------|---------|
|
|
140
|
+
| `command` | Ejecuta comando shell | `"command": "node .claude/hooks/lint.js"` |
|
|
141
|
+
| `prompt` | Claude decide que hacer | `"prompt": "Verifica que el archivo..."` |
|
|
142
|
+
| `agent` | Claude con herramientas propias | `"agent": "Analiza y corrige..."` |
|
|
143
|
+
| `http` | POST a endpoint HTTP | `"url": "https://webhook.example.com/hook"` |
|
|
144
|
+
|
|
145
|
+
### Codigos de retorno para hooks command
|
|
146
|
+
|
|
147
|
+
| Codigo | Significado |
|
|
148
|
+
|--------|-------------|
|
|
149
|
+
| `0` | Permitir (allow) |
|
|
150
|
+
| `2` | Bloquear (block) — la operacion no se ejecuta |
|
|
151
|
+
| Otro | Error — Claude decide que hacer |
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Patrones de permisos en settings.json
|
|
156
|
+
|
|
157
|
+
### Patrones comunes de allow
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
"allow": [
|
|
161
|
+
"Bash(git:*)",
|
|
162
|
+
"Bash(npm:*)",
|
|
163
|
+
"Bash(python:*)",
|
|
164
|
+
"Bash(uv:*)",
|
|
165
|
+
"Bash(pytest:*)",
|
|
166
|
+
"Read(**/src/**)",
|
|
167
|
+
"Write(**/src/**)",
|
|
168
|
+
"Read(**/tests/**)",
|
|
169
|
+
"Write(**/tests/**)"
|
|
170
|
+
]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Patrones comunes de deny
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
"deny": [
|
|
177
|
+
"Bash(rm -rf:*)",
|
|
178
|
+
"Bash(curl * | bash:*)",
|
|
179
|
+
"Bash(sudo:*)",
|
|
180
|
+
"Read(**/env:*)",
|
|
181
|
+
"Read(**/.env*)",
|
|
182
|
+
"Write(**/node_modules/**)"
|
|
183
|
+
]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Estructura de plugin.json
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"name": "mi-plugin",
|
|
193
|
+
"version": "1.0.0",
|
|
194
|
+
"description": "Descripcion del plugin",
|
|
195
|
+
"author": "Tu nombre",
|
|
196
|
+
"skills": ["skills/mi-skill"],
|
|
197
|
+
"agents": ["agents/mi-agent.md"],
|
|
198
|
+
"hooks": {
|
|
199
|
+
"PreToolUse": [
|
|
200
|
+
{
|
|
201
|
+
"matcher": "Bash",
|
|
202
|
+
"command": "node hooks/validate.js"
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"mcpServers": {
|
|
207
|
+
"mi-server": {
|
|
208
|
+
"command": "node",
|
|
209
|
+
"args": ["mcp-servers/server.js"]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comentario": "Template de .mcp.json para proyectos Claude-ready. Eliminar los servidores que no se usen. Las variables de entorno con valor vacío deben completarse en .env o exportarse antes de correr claude.",
|
|
3
|
+
"_instrucciones": [
|
|
4
|
+
"1. Copiar este archivo a la raíz del proyecto como .mcp.json",
|
|
5
|
+
"2. Eliminar el bloque _comentario y _instrucciones (no son JSON válido en producción)",
|
|
6
|
+
"3. Configurar las variables de entorno requeridas por cada servidor activo",
|
|
7
|
+
"4. Agregar .mcp.json al repositorio (no contiene secretos — los secretos van en env vars)",
|
|
8
|
+
"5. Agregar a .gitignore cualquier archivo .mcp.local.json con credenciales"
|
|
9
|
+
],
|
|
10
|
+
"mcpServers": {
|
|
11
|
+
"context7": {
|
|
12
|
+
"_descripcion": "Documentación actualizada de librerías. Uso: 'use context7' en el prompt.",
|
|
13
|
+
"command": "npx",
|
|
14
|
+
"args": ["-y", "@upstash/context7-mcp@latest"]
|
|
15
|
+
},
|
|
16
|
+
"github": {
|
|
17
|
+
"_descripcion": "Acceso a GitHub: issues, PRs, repos, commits. Requiere token con permisos repo.",
|
|
18
|
+
"command": "npx",
|
|
19
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
20
|
+
"env": {
|
|
21
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"filesystem": {
|
|
25
|
+
"_descripcion": "Acceso a sistema de archivos fuera del directorio de trabajo. Usar con cuidado.",
|
|
26
|
+
"_activar": "Descomentar solo si se necesita acceso a paths fuera del proyecto",
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": [
|
|
29
|
+
"-y",
|
|
30
|
+
"@modelcontextprotocol/server-filesystem",
|
|
31
|
+
"/ruta/al/directorio/permitido"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"postgres": {
|
|
35
|
+
"_descripcion": "Acceso de solo lectura a PostgreSQL. Útil para explorar esquemas y datos.",
|
|
36
|
+
"_activar": "Descomentar si el proyecto usa PostgreSQL y se requiere introspección de BD",
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
|
39
|
+
"env": {
|
|
40
|
+
"POSTGRES_CONNECTION_STRING": "postgresql://usuario:password@localhost:5432/nombre_bd"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"sqlite": {
|
|
44
|
+
"_descripcion": "Acceso a base de datos SQLite. Alternativa ligera a postgres para proyectos pequeños.",
|
|
45
|
+
"_activar": "Descomentar si el proyecto usa SQLite",
|
|
46
|
+
"command": "npx",
|
|
47
|
+
"args": ["-y", "@modelcontextprotocol/server-sqlite", "--db-path", "./data.db"]
|
|
48
|
+
},
|
|
49
|
+
"brave-search": {
|
|
50
|
+
"_descripcion": "Búsqueda web con Brave Search API. Útil para investigación técnica durante desarrollo.",
|
|
51
|
+
"_activar": "Requiere API key de Brave Search (plan gratuito disponible)",
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
|
|
54
|
+
"env": {
|
|
55
|
+
"BRAVE_API_KEY": ""
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"memory": {
|
|
59
|
+
"_descripcion": "Memoria persistente entre sesiones. Almacena entidades y relaciones en grafo.",
|
|
60
|
+
"_activar": "Útil para proyectos largos donde se quiere persistir contexto entre sesiones",
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"]
|
|
63
|
+
},
|
|
64
|
+
"puppeteer": {
|
|
65
|
+
"_descripcion": "Control de navegador. Útil para testing E2E, scraping o automatización web.",
|
|
66
|
+
"_activar": "Requiere Chrome/Chromium instalado",
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
|
|
69
|
+
},
|
|
70
|
+
"sequential-thinking": {
|
|
71
|
+
"_descripcion": "Herramienta de razonamiento estructurado para problemas complejos.",
|
|
72
|
+
"_activar": "Útil para arquitectura, debugging complejo, decisiones de diseño",
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|