nextjs-hackathon-stack 0.1.40 → 0.1.42
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/dist/index.js +3 -63
- package/package.json +1 -1
- package/template/.claude/agents/backend.md +54 -0
- package/template/.claude/agents/business-analyst.md +195 -0
- package/template/.claude/agents/code-reviewer.md +76 -0
- package/template/.claude/agents/frontend.md +85 -0
- package/template/.claude/agents/security-researcher.md +54 -0
- package/template/.claude/agents/technical-lead.md +92 -0
- package/template/.claude/agents/test-qa.md +85 -0
- package/template/.claude/rules/architecture.mdc +48 -0
- package/template/.claude/rules/coding-standards.mdc +120 -0
- package/template/.claude/rules/components.mdc +49 -0
- package/template/.claude/rules/data-fetching.mdc +115 -0
- package/template/.claude/rules/forms.mdc +100 -0
- package/template/.claude/rules/general.mdc +54 -0
- package/template/.claude/rules/migrations.mdc +11 -0
- package/template/.claude/rules/nextjs.mdc +71 -0
- package/template/.claude/rules/security.mdc +108 -0
- package/template/.claude/rules/supabase.mdc +70 -0
- package/template/.claude/rules/testing.mdc +136 -0
- package/template/.claude/settings.json +16 -0
- package/template/.claude/skills/build-feature/SKILL.md +198 -0
- package/template/.claude/skills/build-feature/references/server-action-test-template.md +103 -0
- package/template/.claude/skills/create-api-route/SKILL.md +62 -0
- package/template/.claude/skills/discover-feature/SKILL.md +200 -0
- package/template/.claude/skills/memory/SKILL.md +208 -0
- package/template/.claude/skills/review-branch/SKILL.md +43 -0
- package/template/.claude/skills/review-branch/references/review-checklist.md +36 -0
- package/template/.claude/skills/security-audit/SKILL.md +40 -0
- package/template/.claude/skills/security-audit/references/audit-steps.md +41 -0
- package/template/.claude/skills/supabase/SKILL.md +105 -0
- package/template/.claude/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/template/.claude/skills/supabase/references/skill-feedback.md +17 -0
- package/template/.claude/skills/supabase-postgres-best-practices/SKILL.md +65 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
- package/template/.claude/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
- package/template/.cursor/agents/business-analyst.md +197 -0
- package/template/.cursor/agents/technical-lead.md +3 -3
- package/template/.cursor/mcp.json +6 -2
- package/template/.cursor/skills/build-feature/SKILL.md +20 -21
- package/template/.cursor/skills/discover-feature/SKILL.md +118 -29
- package/template/.cursor/skills/supabase/SKILL.md +104 -0
- package/template/.cursor/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/template/.cursor/skills/supabase/references/skill-feedback.md +17 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
- package/template/.cursor/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
- package/template/.mcp.json +16 -0
- package/template/.opencode/agents/backend.md +72 -0
- package/template/.opencode/agents/business-analyst.md +153 -0
- package/template/.opencode/agents/code-reviewer.md +80 -0
- package/template/.opencode/agents/frontend.md +84 -0
- package/template/.opencode/agents/security-researcher.md +58 -0
- package/template/.opencode/agents/technical-lead.md +131 -0
- package/template/.opencode/agents/test-qa.md +103 -0
- package/template/.opencode/memory/architecture-snapshot.md +127 -0
- package/template/.opencode/skills/build-feature/SKILL.md +208 -0
- package/template/.opencode/skills/create-api-route/SKILL.md +63 -0
- package/template/.opencode/skills/discover-feature/SKILL.md +194 -0
- package/template/.opencode/skills/memory/SKILL.md +199 -0
- package/template/.opencode/skills/review-branch/SKILL.md +43 -0
- package/template/.opencode/skills/security-audit/SKILL.md +40 -0
- package/template/.opencode/skills/supabase/SKILL.md +105 -0
- package/template/.opencode/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/template/.opencode/skills/supabase/references/skill-feedback.md +17 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/SKILL.md +65 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__contributing.md +170 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__sections.md +39 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp__template.md +34 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_advanced-full-text-search.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_advanced-jsonb-indexing.md +49 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-idle-timeout.md +46 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-limits.md +44 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-pooling.md +41 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_conn-prepared-statements.md +46 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-batch-inserts.md +54 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-n-plus-one.md +53 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-pagination.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_data-upsert.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-advisory.md +56 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-deadlock-prevention.md +68 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-short-transactions.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_lock-skip-locked.md +54 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-explain-analyze.md +45 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-pg-stat-statements.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_monitor-vacuum-analyze.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-composite-indexes.md +44 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-covering-indexes.md +40 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-index-types.md +48 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-missing-indexes.md +43 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_query-partial-indexes.md +45 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-constraints.md +80 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-data-types.md +46 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-foreign-key-indexes.md +59 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-lowercase-identifiers.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-partitioning.md +55 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_schema-primary-keys.md +61 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-privileges.md +54 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-rls-basics.md +50 -0
- package/template/.opencode/skills/supabase-postgres-best-practices/references/pgbp_security-rls-performance.md +57 -0
- package/template/.requirements/README.md +1 -1
- package/template/AGENTS.md +1 -1
- package/template/CLAUDE.md +1 -1
- package/template/Dockerfile.memory +7 -0
- package/template/README.md +15 -2
- package/template/_gitignore +3 -0
- package/template/docker-compose.yml +28 -0
- package/template/ia-flow.md +341 -0
- package/template/opencode.json +23 -0
- package/template/.cursor/agents/business-intelligence.md +0 -83
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
services:
|
|
2
|
+
memory:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: Dockerfile.memory
|
|
6
|
+
container_name: mcp-memory
|
|
7
|
+
ports:
|
|
8
|
+
- "8000:8000" # Dashboard + REST API
|
|
9
|
+
- "8765:8765" # MCP streamable-http transport
|
|
10
|
+
volumes:
|
|
11
|
+
- ./.memory/chroma:/app/chroma_db
|
|
12
|
+
- ./.memory/backups:/app/backups
|
|
13
|
+
environment:
|
|
14
|
+
MCP_MODE: streamable-http
|
|
15
|
+
MCP_HTTP_PORT: 8000
|
|
16
|
+
MCP_HTTP_HOST: 0.0.0.0
|
|
17
|
+
MCP_SSE_PORT: 8765
|
|
18
|
+
MCP_SSE_HOST: 0.0.0.0
|
|
19
|
+
MCP_ALLOW_ANONYMOUS_ACCESS: "true"
|
|
20
|
+
MEMORY_CHROMA_PATH: /app/chroma_db
|
|
21
|
+
MEMORY_BACKUPS_PATH: /app/backups
|
|
22
|
+
PYTHONUNBUFFERED: "1"
|
|
23
|
+
healthcheck:
|
|
24
|
+
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
|
25
|
+
interval: 30s
|
|
26
|
+
timeout: 10s
|
|
27
|
+
retries: 3
|
|
28
|
+
restart: unless-stopped
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# Cómo trabajar con la IA 🤖
|
|
2
|
+
|
|
3
|
+
> Imagina que la IA es tu ayudante súper inteligente. Pero para que te ayude bien, primero tienes que contarle exactamente qué quieres. Como cuando le pides a alguien que te haga un dibujo: si no le explicas bien, el dibujo no queda como tú querías.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## El flujo principal: de idea a código
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Tu idea → Preguntas → Papel con reglas → ¡Código listo!
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Son dos conversaciones. **Nunca las mezcles** — cuando termines la primera, cierra y abre una nueva.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Conversación 1 — Descubrir qué quieres
|
|
18
|
+
|
|
19
|
+
> *Piensa que le estás contando a un amigo qué quieres construir. El amigo te va a hacer preguntas para entenderte bien.*
|
|
20
|
+
|
|
21
|
+
**Modo**: Agent
|
|
22
|
+
|
|
23
|
+
**Escribe esto:**
|
|
24
|
+
```
|
|
25
|
+
/discover-feature <describe tu idea en palabras normales>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**¿Qué pasa?**
|
|
29
|
+
|
|
30
|
+
1. La IA te hace preguntas: ¿quién lo usa?, ¿qué pasa si algo falla?, ¿quién puede ver qué?
|
|
31
|
+
2. Tú respondes con calma, sin tecnicismos
|
|
32
|
+
3. La IA confirma que entendió bien antes de escribir nada
|
|
33
|
+
4. Escribe un archivo con todas las reglas en `.requirements/<nombre>.md`
|
|
34
|
+
|
|
35
|
+
**Resultado:** un papel con las reglas claras. Como un contrato entre tú y la IA.
|
|
36
|
+
|
|
37
|
+
> ✋ **Cierra esta conversación antes de continuar.**
|
|
38
|
+
|
|
39
|
+
### Ejemplo real — Conversación 1
|
|
40
|
+
|
|
41
|
+
**Tú escribes:**
|
|
42
|
+
```
|
|
43
|
+
/discover-feature Quiero una pantalla donde los usuarios puedan ver y pagar sus facturas pendientes.
|
|
44
|
+
Cada factura tiene número, fecha, monto y estado (pendiente / pagada).
|
|
45
|
+
Al pagar, se descuenta del saldo disponible del usuario.
|
|
46
|
+
Toda la UI en español.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**La IA te pregunta cosas como:**
|
|
50
|
+
- ¿Puede un usuario ver las facturas de otro usuario?
|
|
51
|
+
- ¿Qué pasa si no tiene saldo suficiente para pagar?
|
|
52
|
+
- ¿Las facturas pueden cancelarse o solo pagarse?
|
|
53
|
+
- ¿Cuántas facturas puede tener un usuario? ¿Necesitamos paginación?
|
|
54
|
+
|
|
55
|
+
**Tú respondes:**
|
|
56
|
+
```
|
|
57
|
+
- No, cada usuario solo ve las suyas
|
|
58
|
+
- Si no tiene saldo, mostrar un error en rojo: "Saldo insuficiente"
|
|
59
|
+
- Solo se pueden pagar, no cancelar
|
|
60
|
+
- Máximo 50 por usuario, sin paginación por ahora
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**La IA confirma y escribe:**
|
|
64
|
+
```
|
|
65
|
+
.requirements/facturas.md ✅
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Conversación 2 — Construir
|
|
71
|
+
|
|
72
|
+
> *Ahora le das el papel con las reglas a otro ayudante que sabe programar. Él lee las reglas y construye todo solito.*
|
|
73
|
+
|
|
74
|
+
**Modo**: Agent — conversación nueva y vacía
|
|
75
|
+
|
|
76
|
+
**Escribe esto:**
|
|
77
|
+
```
|
|
78
|
+
/build-feature @.requirements/<nombre>.md
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**¿Qué pasa paso a paso?**
|
|
82
|
+
|
|
83
|
+
| Paso | Qué hace la IA |
|
|
84
|
+
|------|----------------|
|
|
85
|
+
| 1 | Lee las reglas del archivo |
|
|
86
|
+
| 2 | Busca en su memoria cómo está hecho el proyecto |
|
|
87
|
+
| 3 | Te muestra un plan y espera tu aprobación |
|
|
88
|
+
| 4 | Escribe los tests primero (deben fallar) |
|
|
89
|
+
| 5 | Escribe el código hasta que los tests pasen |
|
|
90
|
+
| 6 | Limpia y ordena |
|
|
91
|
+
| 7 | Revisa que no haya errores ni problemas de seguridad |
|
|
92
|
+
| 8 | Guarda lo aprendido en la memoria para la próxima vez |
|
|
93
|
+
|
|
94
|
+
**Resultado:** código completo, probado, revisado. Listo para usar.
|
|
95
|
+
|
|
96
|
+
### Ejemplo real — Conversación 2
|
|
97
|
+
|
|
98
|
+
**Tú abres una conversación nueva y escribes:**
|
|
99
|
+
```
|
|
100
|
+
/build-feature @.requirements/facturas.md
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**La IA te muestra el plan antes de programar:**
|
|
104
|
+
```
|
|
105
|
+
Backend:
|
|
106
|
+
- Nueva tabla `invoices` (id, user_id, number, date, amount, status)
|
|
107
|
+
- RLS: cada usuario solo ve sus facturas
|
|
108
|
+
- Server Action `payInvoice`: valida saldo, actualiza status, descuenta saldo
|
|
109
|
+
- Zod: valida invoice_id, user autenticado
|
|
110
|
+
|
|
111
|
+
Frontend:
|
|
112
|
+
- InvoiceList: tabla con columnas número, fecha, monto, estado
|
|
113
|
+
- PayButton: botón por fila, deshabilitado si ya está pagada
|
|
114
|
+
- Toast de éxito o error después de pagar
|
|
115
|
+
|
|
116
|
+
Tests:
|
|
117
|
+
- payInvoice sin autenticación → error
|
|
118
|
+
- payInvoice con saldo insuficiente → error con mensaje correcto
|
|
119
|
+
- payInvoice exitoso → status cambia a "pagada", saldo decrementado
|
|
120
|
+
- InvoiceList renderiza correctamente con datos
|
|
121
|
+
|
|
122
|
+
¿Apruebas para continuar?
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Tú escribes:** `sí` — y la IA construye todo.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Otros casos de uso
|
|
130
|
+
|
|
131
|
+
### 🐛 Arreglar un bug
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
# Conversación 1: reproducir el error
|
|
135
|
+
@test-qa Reproduce este bug: <describe qué está fallando y dónde>
|
|
136
|
+
|
|
137
|
+
# Conversación 2: arreglarlo
|
|
138
|
+
@backend Fix the failing test in <archivo>
|
|
139
|
+
# o si es visual:
|
|
140
|
+
@frontend Fix the failing test in <archivo>
|
|
141
|
+
|
|
142
|
+
# Conversación 3: revisar
|
|
143
|
+
@code-reviewer Review the changes in src/features/<feature>/
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> La IA primero escribe un test que demuestra el bug, luego lo arregla. Así sabes que el bug está realmente arreglado y no vuelve.
|
|
147
|
+
|
|
148
|
+
**Ejemplo:**
|
|
149
|
+
```
|
|
150
|
+
@test-qa Reproduce este bug: cuando el usuario hace logout y vuelve a entrar,
|
|
151
|
+
la lista de todos aparece vacía aunque sí tiene todos en la base de datos.
|
|
152
|
+
El problema parece estar en src/features/todos/queries/todos.queries.ts
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
La IA escribe un test que falla → luego `@backend` lo arregla → luego `@code-reviewer` revisa.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### 🔧 Refactorizar código
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
# Paso 1: pedir un plan
|
|
163
|
+
@technical-lead Plan refactor for <qué quieres mejorar y por qué>
|
|
164
|
+
|
|
165
|
+
# Paso 2: implementar
|
|
166
|
+
@backend Implement the refactor plan
|
|
167
|
+
# o:
|
|
168
|
+
@frontend Implement the refactor plan
|
|
169
|
+
|
|
170
|
+
# Paso 3: verificar y revisar
|
|
171
|
+
@test-qa Verify all tests still pass
|
|
172
|
+
@code-reviewer Review the refactor changes
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Ejemplo:**
|
|
176
|
+
```
|
|
177
|
+
@technical-lead Plan refactor for src/features/auth/actions/
|
|
178
|
+
Hay demasiada lógica duplicada entre login.action.ts y logout.action.ts.
|
|
179
|
+
Quiero extraer el manejo de errores a una función compartida.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### 🛣️ Crear solo un endpoint de API
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
/create-api-route
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
La IA te pregunta qué necesita el endpoint y lo crea con validación, manejo de errores y tests.
|
|
191
|
+
|
|
192
|
+
**Ejemplo:**
|
|
193
|
+
```
|
|
194
|
+
/create-api-route
|
|
195
|
+
```
|
|
196
|
+
La IA pregunta: *¿qué ruta?, ¿qué método (GET/POST)?, ¿qué recibe?, ¿qué devuelve?, ¿necesita autenticación?*
|
|
197
|
+
|
|
198
|
+
Tú respondes y la IA crea `src/app/api/invoices/route.ts` completo.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### 🔍 Revisar una rama antes de hacer merge
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
/review-branch
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Revisa todo el código del branch: errores, malas prácticas, problemas de seguridad. Solo lee, no cambia nada.
|
|
209
|
+
|
|
210
|
+
**Ejemplo — qué puede reportar:**
|
|
211
|
+
```
|
|
212
|
+
⚠️ src/features/invoices/actions/pay-invoice.action.ts línea 34:
|
|
213
|
+
No se valida que la factura pertenezca al usuario autenticado antes de pagarla.
|
|
214
|
+
Cualquier usuario podría pagar la factura de otro si conoce el ID.
|
|
215
|
+
|
|
216
|
+
✅ Tests cubren todos los criterios de aceptación
|
|
217
|
+
✅ Sin uso de `any` en TypeScript
|
|
218
|
+
✅ Estructura de carpetas sigue la convención features/
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
### 🔒 Auditoría de seguridad
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
/security-audit
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Busca vulnerabilidades en el código: inyecciones, datos sin validar, permisos mal puestos. Solo lee, no cambia nada.
|
|
230
|
+
|
|
231
|
+
**Ejemplo — qué puede encontrar:**
|
|
232
|
+
```
|
|
233
|
+
🔴 CRÍTICO: src/app/api/invoices/route.ts
|
|
234
|
+
El parámetro `userId` viene del body sin validar.
|
|
235
|
+
Un atacante puede pasarle el ID de otro usuario.
|
|
236
|
+
Fix: obtener el userId siempre desde la sesión del servidor, nunca del cliente.
|
|
237
|
+
|
|
238
|
+
🟡 MEDIO: src/features/invoices/components/invoice-list.tsx
|
|
239
|
+
Los montos se muestran sin formatear. Si la DB devuelve null, la app crashea.
|
|
240
|
+
Fix: agregar valor por defecto o validación antes de renderizar.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### 🧠 Buscar algo en la memoria del proyecto
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
/memory recall "cómo se validan los formularios"
|
|
249
|
+
/memory recall "tablas de la base de datos"
|
|
250
|
+
/memory recall "cómo se manejan los errores en las actions"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
La IA busca en su memoria sin tener que leer todos los archivos. Mucho más rápido.
|
|
254
|
+
|
|
255
|
+
**Ejemplo:**
|
|
256
|
+
```
|
|
257
|
+
/memory recall "patrón para crear una server action"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
La IA responde: *"Las server actions usan Zod para validar, devuelven `{ error }` o `{ data }`, y muestran toast con sonner. Ver ejemplo en `src/features/todos/actions/todos.action.ts`."*
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
### 💾 Actualizar la memoria después de cambios grandes
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
/memory sync
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Guarda el estado actual del proyecto en la memoria para que los agentes lo usen en el futuro.
|
|
271
|
+
|
|
272
|
+
Úsalo después de: agregar una feature nueva, cambiar la estructura de carpetas, o modificar la base de datos.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Los agentes — quién hace qué
|
|
277
|
+
|
|
278
|
+
> *Imagina un equipo de personas, cada una experta en algo diferente.*
|
|
279
|
+
|
|
280
|
+
| Agente | Es como... | Úsalo cuando... |
|
|
281
|
+
|--------|-----------|-----------------|
|
|
282
|
+
| `@technical-lead` | El jefe de equipo | No sabes por dónde empezar, o quieres un plan antes de hacer algo grande |
|
|
283
|
+
| `@frontend` | El diseñador que programa | Quieres cambiar algo visual: botones, formularios, páginas |
|
|
284
|
+
| `@backend` | El ingeniero de datos | Quieres cambiar la base de datos, crear una acción del servidor, o manejar permisos |
|
|
285
|
+
| `@test-qa` | El probador | Quieres escribir tests, reproducir un bug, o verificar que todo sigue funcionando |
|
|
286
|
+
| `@business-analyst` | El que hace las preguntas | Tienes una idea vaga y necesitas convertirla en reglas claras antes de programar |
|
|
287
|
+
| `@code-reviewer` | El revisor | Quieres que alguien revise el código antes de hacer merge. No cambia nada, solo opina |
|
|
288
|
+
| `@security-researcher` | El guardián | Quieres asegurarte de que no hay huecos de seguridad. No cambia nada, solo revisa |
|
|
289
|
+
|
|
290
|
+
### Ejemplos de cuándo usar cada agente
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
# Tienes una idea pero no sabes si es viable técnicamente
|
|
294
|
+
@technical-lead ¿Es buena idea guardar los archivos PDF de los usuarios en Supabase Storage
|
|
295
|
+
en lugar de en la base de datos? ¿Cómo lo haríamos?
|
|
296
|
+
|
|
297
|
+
# Quieres cambiar cómo se ve un formulario
|
|
298
|
+
@frontend El formulario de login se ve muy apretado en móvil.
|
|
299
|
+
Quiero más espacio entre campos y el botón más grande.
|
|
300
|
+
|
|
301
|
+
# Quieres agregar una columna a la base de datos
|
|
302
|
+
@backend Necesito agregar la columna `phone` (texto, opcional) a la tabla de usuarios.
|
|
303
|
+
Genera la migración y actualiza el schema.
|
|
304
|
+
|
|
305
|
+
# Quieres saber si tus tests cubren todos los casos
|
|
306
|
+
@test-qa Revisa los tests de src/features/invoices/ y dime qué casos faltan.
|
|
307
|
+
|
|
308
|
+
# Tienes una idea vaga antes de empezar
|
|
309
|
+
@business-analyst Quiero que los usuarios puedan invitar a otras personas a su equipo.
|
|
310
|
+
Ayúdame a definir bien los requisitos antes de programar.
|
|
311
|
+
|
|
312
|
+
# Terminaste una feature y quieres una segunda opinión
|
|
313
|
+
@code-reviewer Revisa los cambios en src/features/invoices/
|
|
314
|
+
|
|
315
|
+
# Vas a lanzar a producción y quieres estar seguro
|
|
316
|
+
@security-researcher Haz una auditoría de src/features/auth/ antes del lanzamiento.
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Regla de oro
|
|
322
|
+
|
|
323
|
+
> **Primero las reglas, después el código.**
|
|
324
|
+
>
|
|
325
|
+
> Si le pides a la IA que programe sin darle las reglas primero, va a adivinar. Y cuando adivina, se equivoca. El archivo `.requirements/<nombre>.md` es el contrato. Sin contrato, no hay código.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Referencia rápida
|
|
330
|
+
|
|
331
|
+
| Quiero... | Modo | Comando |
|
|
332
|
+
|-----------|------|---------|
|
|
333
|
+
| Definir qué construir | Agent | `/discover-feature <descripción>` |
|
|
334
|
+
| Construir una feature | Agent (nueva conversación) | `/build-feature @.requirements/<nombre>.md` |
|
|
335
|
+
| Arreglar un bug | Agent | `@test-qa Reproduce: <descripción>` |
|
|
336
|
+
| Planear un refactor | Agent | `@technical-lead Plan: <descripción>` |
|
|
337
|
+
| Crear un endpoint | Agent | `/create-api-route` |
|
|
338
|
+
| Revisar una rama | Agent | `/review-branch` |
|
|
339
|
+
| Auditar seguridad | Agent | `/security-audit` |
|
|
340
|
+
| Buscar en la memoria | Cualquiera | `/memory recall "<consulta>"` |
|
|
341
|
+
| Sincronizar memoria | Agent | `/memory sync` |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3
|
+
"mcp": {
|
|
4
|
+
"memory": {
|
|
5
|
+
"type": "remote",
|
|
6
|
+
"url": "http://localhost:8765/mcp",
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"timeout": 10000
|
|
9
|
+
},
|
|
10
|
+
"shadcn": {
|
|
11
|
+
"type": "local",
|
|
12
|
+
"command": ["npx", "-y", "shadcn@latest", "mcp"],
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"timeout": 10000
|
|
15
|
+
},
|
|
16
|
+
"supabase": {
|
|
17
|
+
"type": "remote",
|
|
18
|
+
"url": "https://mcp.supabase.com/mcp?features=docs",
|
|
19
|
+
"enabled": true,
|
|
20
|
+
"timeout": 30000
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: business-intelligence
|
|
3
|
-
description: Requirements analyst (readonly). Discovers requirements through questions before defining anything. Triggers: new feature definition, writing requirements, user stories, acceptance criteria, requirements documentation, feature scope clarification.
|
|
4
|
-
model: inherit
|
|
5
|
-
readonly: true
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Business Intelligence Agent
|
|
9
|
-
|
|
10
|
-
## First Step — Load Context via MCP Memory
|
|
11
|
-
|
|
12
|
-
1. Read `package.json` to get the project name (`<project-name>`)
|
|
13
|
-
2. Call `search_memory` with `tags: ["project:<project-name>", "domain:features"]` — existing features and their descriptions, to identify relationships with new requirements
|
|
14
|
-
3. **Fallback**: if the memory service is unavailable or returns no results, read `.cursor/memory/architecture-snapshot.md` directly
|
|
15
|
-
|
|
16
|
-
## Responsibilities
|
|
17
|
-
- Discover requirements through user questions before defining anything
|
|
18
|
-
- Write functional issues describing user-visible behavior
|
|
19
|
-
- Map requirements to functional test cases
|
|
20
|
-
- Validate implementations match acceptance criteria
|
|
21
|
-
- Maintain `.requirements/` documentation
|
|
22
|
-
|
|
23
|
-
**Do NOT create technical tasks — that is the Technical Lead's job.**
|
|
24
|
-
|
|
25
|
-
## Discovery Process
|
|
26
|
-
|
|
27
|
-
Never assume requirements. Always ask first.
|
|
28
|
-
|
|
29
|
-
Complete ALL of these before writing a spec:
|
|
30
|
-
|
|
31
|
-
1. **Problem & audience** — "What problem does this solve? Who experiences it?"
|
|
32
|
-
2. **User flows** — "Walk me through the happy path. What happens on error?"
|
|
33
|
-
3. **Edge cases & constraints** — "What are the limits? What should NOT happen?"
|
|
34
|
-
4. **Field constraints** — "What are the length limits, allowed formats, required vs optional fields?"
|
|
35
|
-
5. **Volume & scale** — "How many records are expected? Do you need search or pagination?"
|
|
36
|
-
6. **File/upload specifics** — (if applicable) "What file types and size limits are allowed?"
|
|
37
|
-
7. **Privacy & access** — "Who can see this data? Is it per-user or shared?"
|
|
38
|
-
8. **Relationship to existing features** — (informed by the snapshot) "Does this link to existing data?"
|
|
39
|
-
9. **Confirm understanding** — Restate what you heard and ask for approval before writing anything
|
|
40
|
-
|
|
41
|
-
**Minimum gate:** Cover at least items 1–3 + any that apply from 4–8 before writing.
|
|
42
|
-
|
|
43
|
-
If the user says "just do it" without answering, document all assumptions explicitly in an `## Assumptions` section at the top of the spec.
|
|
44
|
-
|
|
45
|
-
Only after the user confirms your understanding should you produce a functional issue.
|
|
46
|
-
|
|
47
|
-
## Functional Issue Format
|
|
48
|
-
|
|
49
|
-
```markdown
|
|
50
|
-
## Feature: [Feature Name]
|
|
51
|
-
|
|
52
|
-
### User Story
|
|
53
|
-
As a [user type], I want [goal] so that [reason].
|
|
54
|
-
|
|
55
|
-
### Acceptance Criteria
|
|
56
|
-
- [ ] AC1: When [user does X], they see [Y]
|
|
57
|
-
- [ ] AC2: When [error condition], user sees [message/state]
|
|
58
|
-
- [ ] AC3: [Edge case]: [expected outcome]
|
|
59
|
-
|
|
60
|
-
### Functional Test Cases
|
|
61
|
-
- [ ] TC1 (AC1): User does X → sees Y (happy path)
|
|
62
|
-
- [ ] TC2 (AC2): User triggers error → sees error message
|
|
63
|
-
- [ ] TC3 (AC3): Edge case behavior visible to user
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
**Rules for this format:**
|
|
67
|
-
- Acceptance criteria use plain functional language — no code, no implementation details
|
|
68
|
-
- Test cases describe what the **user sees**, not system internals
|
|
69
|
-
- Every acceptance criterion maps to at least one test case
|
|
70
|
-
- No mention of database tables, API calls, component names, or file paths
|
|
71
|
-
|
|
72
|
-
## Language
|
|
73
|
-
|
|
74
|
-
Write requirements and acceptance criteria in the user's language. However:
|
|
75
|
-
- Acceptance criteria IDs (`AC1`, `AC2`), test case IDs (`TC1`), and technical terms (`ActionResult`, `Server Action`, component names) always remain in English
|
|
76
|
-
- Specify that all code-level text (test `it()` descriptions, variable names, error strings in code) must be written in English — only user-visible strings (UI labels, toast messages, validation messages shown on screen) should be in the target language
|
|
77
|
-
|
|
78
|
-
## Guardrails
|
|
79
|
-
- Always ask questions before writing — never assume
|
|
80
|
-
- Document all requirements in `.requirements/` directory
|
|
81
|
-
- Flag ambiguous requirements — ask rather than guess
|
|
82
|
-
- Functional issues only: user stories, acceptance criteria, visible behavior
|
|
83
|
-
- Hand off to Technical Lead when the functional issue is approved
|