elsabro 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/README.md +268 -0
- package/agents/elsabro-analyst.md +176 -0
- package/agents/elsabro-debugger.md +293 -0
- package/agents/elsabro-executor.md +477 -0
- package/agents/elsabro-orchestrator.md +426 -0
- package/agents/elsabro-planner.md +278 -0
- package/agents/elsabro-qa.md +273 -0
- package/agents/elsabro-quick-dev.md +309 -0
- package/agents/elsabro-scrum-master.md +217 -0
- package/agents/elsabro-tech-writer.md +347 -0
- package/agents/elsabro-ux-designer.md +278 -0
- package/agents/elsabro-verifier.md +295 -0
- package/agents/elsabro-yolo-dev.md +322 -0
- package/bin/install.js +497 -0
- package/commands/elsabro/add-phase.md +114 -0
- package/commands/elsabro/add-todo.md +158 -0
- package/commands/elsabro/audit-milestone.md +147 -0
- package/commands/elsabro/check-todos.md +192 -0
- package/commands/elsabro/complete-milestone.md +138 -0
- package/commands/elsabro/debug.md +153 -0
- package/commands/elsabro/discuss-phase.md +160 -0
- package/commands/elsabro/execute.md +299 -0
- package/commands/elsabro/help.md +102 -0
- package/commands/elsabro/insert-phase.md +117 -0
- package/commands/elsabro/list-phase-assumptions.md +129 -0
- package/commands/elsabro/map-codebase.md +108 -0
- package/commands/elsabro/new-milestone.md +128 -0
- package/commands/elsabro/new.md +230 -0
- package/commands/elsabro/pause-work.md +261 -0
- package/commands/elsabro/plan-milestone-gaps.md +129 -0
- package/commands/elsabro/plan.md +272 -0
- package/commands/elsabro/progress.md +187 -0
- package/commands/elsabro/quick.md +99 -0
- package/commands/elsabro/remove-phase.md +136 -0
- package/commands/elsabro/research-phase.md +174 -0
- package/commands/elsabro/resume-work.md +288 -0
- package/commands/elsabro/set-profile.md +216 -0
- package/commands/elsabro/settings.md +185 -0
- package/commands/elsabro/start.md +204 -0
- package/commands/elsabro/update.md +71 -0
- package/commands/elsabro/verify-work.md +269 -0
- package/commands/elsabro/verify.md +207 -0
- package/hooks/dist/.gitkeep +2 -0
- package/package.json +45 -0
- package/references/error-handling-instructions.md +312 -0
- package/references/source-hierarchy.md +150 -0
- package/references/token-optimization.md +225 -0
- package/skills/api-setup.md +315 -0
- package/skills/auth-setup.md +180 -0
- package/skills/database-setup.md +238 -0
- package/skills/expo-app.md +261 -0
- package/skills/nextjs-app.md +206 -0
- package/skills/payments-setup.md +421 -0
- package/skills/sentry-setup.md +295 -0
- package/templates/error-handling-config.json +138 -0
- package/templates/session-state.json +69 -0
- package/templates/starters/.gitkeep +2 -0
- package/workflows/.gitkeep +2 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auth-setup
|
|
3
|
+
description: Skill para implementar autenticación en cualquier proyecto. Usa este skill cuando el usuario quiere login, registro, o manejo de usuarios.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Setup de Autenticación
|
|
7
|
+
|
|
8
|
+
<when_to_use>
|
|
9
|
+
Usar cuando el usuario menciona:
|
|
10
|
+
- "login"
|
|
11
|
+
- "registro"
|
|
12
|
+
- "usuarios"
|
|
13
|
+
- "autenticación"
|
|
14
|
+
- "cuentas"
|
|
15
|
+
- "sesiones"
|
|
16
|
+
- "contraseñas"
|
|
17
|
+
</when_to_use>
|
|
18
|
+
|
|
19
|
+
<before_starting>
|
|
20
|
+
## Investigación Obligatoria
|
|
21
|
+
|
|
22
|
+
**ANTES de implementar, detectar el proyecto y buscar la mejor opción:**
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
1. Detectar tipo de proyecto:
|
|
26
|
+
- Next.js → NextAuth v5
|
|
27
|
+
- Expo → expo-auth-session + Supabase/Firebase
|
|
28
|
+
- Node/Express → Passport o custom JWT
|
|
29
|
+
|
|
30
|
+
2. Buscar en Context7:
|
|
31
|
+
mcp__plugin_context7_context7__resolve-library-id("nextauth")
|
|
32
|
+
mcp__plugin_context7_context7__query-docs(id, "getting started v5")
|
|
33
|
+
|
|
34
|
+
3. Verificar mejores prácticas:
|
|
35
|
+
WebSearch: "authentication [framework] [año] best practices"
|
|
36
|
+
```
|
|
37
|
+
</before_starting>
|
|
38
|
+
|
|
39
|
+
<options_by_project>
|
|
40
|
+
## Opciones por Tipo de Proyecto
|
|
41
|
+
|
|
42
|
+
### Next.js → NextAuth v5
|
|
43
|
+
|
|
44
|
+
**Pros:**
|
|
45
|
+
- Integración nativa con Next.js
|
|
46
|
+
- Múltiples providers (Google, GitHub, Email)
|
|
47
|
+
- Session management automático
|
|
48
|
+
|
|
49
|
+
**Setup:**
|
|
50
|
+
```bash
|
|
51
|
+
npm install next-auth@beta
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Expo/React Native → Supabase Auth
|
|
55
|
+
|
|
56
|
+
**Pros:**
|
|
57
|
+
- SDK para React Native
|
|
58
|
+
- Social login fácil
|
|
59
|
+
- Sincroniza con database
|
|
60
|
+
|
|
61
|
+
**Setup:**
|
|
62
|
+
```bash
|
|
63
|
+
npx expo install @supabase/supabase-js
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### API/Backend → JWT Custom
|
|
67
|
+
|
|
68
|
+
**Pros:**
|
|
69
|
+
- Control total
|
|
70
|
+
- Sin dependencias externas
|
|
71
|
+
- Ligero
|
|
72
|
+
|
|
73
|
+
**Librerías:**
|
|
74
|
+
- `jose` para JWT (mejor que jsonwebtoken)
|
|
75
|
+
- `bcrypt` para passwords
|
|
76
|
+
</options_by_project>
|
|
77
|
+
|
|
78
|
+
<nextauth_setup>
|
|
79
|
+
## Setup NextAuth v5 (Next.js)
|
|
80
|
+
|
|
81
|
+
### Paso 1: Instalar
|
|
82
|
+
```bash
|
|
83
|
+
npm install next-auth@beta
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Paso 2: Crear auth.ts
|
|
87
|
+
```typescript
|
|
88
|
+
// src/lib/auth.ts
|
|
89
|
+
// VERIFICAR patrón actual con Context7
|
|
90
|
+
import NextAuth from "next-auth"
|
|
91
|
+
import Credentials from "next-auth/providers/credentials"
|
|
92
|
+
|
|
93
|
+
export const { handlers, auth, signIn, signOut } = NextAuth({
|
|
94
|
+
providers: [
|
|
95
|
+
Credentials({
|
|
96
|
+
credentials: {
|
|
97
|
+
email: {},
|
|
98
|
+
password: {},
|
|
99
|
+
},
|
|
100
|
+
authorize: async (credentials) => {
|
|
101
|
+
// Verificar contra tu DB
|
|
102
|
+
// IMPLEMENTAR según tu caso
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
],
|
|
106
|
+
})
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Paso 3: Crear route handler
|
|
110
|
+
```typescript
|
|
111
|
+
// src/app/api/auth/[...nextauth]/route.ts
|
|
112
|
+
// VERIFICAR con Context7
|
|
113
|
+
import { handlers } from "@/lib/auth"
|
|
114
|
+
export const { GET, POST } = handlers
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Paso 4: Crear middleware
|
|
118
|
+
```typescript
|
|
119
|
+
// src/middleware.ts
|
|
120
|
+
// VERIFICAR con Context7
|
|
121
|
+
export { auth as middleware } from "@/lib/auth"
|
|
122
|
+
|
|
123
|
+
export const config = {
|
|
124
|
+
matcher: ["/dashboard/:path*", "/api/:path*"],
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
</nextauth_setup>
|
|
128
|
+
|
|
129
|
+
<verification>
|
|
130
|
+
## Verificación
|
|
131
|
+
|
|
132
|
+
### Automática
|
|
133
|
+
```bash
|
|
134
|
+
npm run build
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Manual (para usuario)
|
|
138
|
+
```
|
|
139
|
+
Para ti (Usuario):
|
|
140
|
+
|
|
141
|
+
1. Abre http://localhost:3000/login
|
|
142
|
+
2. Ingresa cualquier email y contraseña
|
|
143
|
+
3. Si implementaste providers (Google, etc), prueba ese botón
|
|
144
|
+
|
|
145
|
+
¿Qué debería pasar?
|
|
146
|
+
- Con credenciales correctas: redirige a /dashboard
|
|
147
|
+
- Con credenciales incorrectas: muestra error
|
|
148
|
+
- Sin sesión: /dashboard redirige a /login
|
|
149
|
+
|
|
150
|
+
¿Funciona como se describe?
|
|
151
|
+
```
|
|
152
|
+
</verification>
|
|
153
|
+
|
|
154
|
+
<common_issues>
|
|
155
|
+
## Problemas Comunes
|
|
156
|
+
|
|
157
|
+
### "NEXTAUTH_SECRET missing"
|
|
158
|
+
- Crear en .env.local: `NEXTAUTH_SECRET=tu-secret-aleatorio`
|
|
159
|
+
- Generar con: `openssl rand -base64 32`
|
|
160
|
+
|
|
161
|
+
### "Callback URL not allowed"
|
|
162
|
+
- Verificar NEXTAUTH_URL en .env
|
|
163
|
+
- Agregar URLs permitidas en config
|
|
164
|
+
|
|
165
|
+
### "Session not persisting"
|
|
166
|
+
- Verificar cookies en devtools
|
|
167
|
+
- Verificar que middleware está configurado
|
|
168
|
+
- Verificar NEXTAUTH_URL es correcto
|
|
169
|
+
</common_issues>
|
|
170
|
+
|
|
171
|
+
<security_checklist>
|
|
172
|
+
## Checklist de Seguridad
|
|
173
|
+
|
|
174
|
+
- [ ] Passwords hasheados con bcrypt
|
|
175
|
+
- [ ] HTTPS en producción
|
|
176
|
+
- [ ] Tokens con expiración
|
|
177
|
+
- [ ] Rate limiting en login
|
|
178
|
+
- [ ] CSRF protection habilitado
|
|
179
|
+
- [ ] Secrets en variables de entorno (no en código)
|
|
180
|
+
</security_checklist>
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-setup
|
|
3
|
+
description: Skill para configurar base de datos en cualquier proyecto. Usa este skill cuando el usuario quiere guardar datos, usuarios, productos, etc.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Setup de Base de Datos
|
|
7
|
+
|
|
8
|
+
<when_to_use>
|
|
9
|
+
Usar cuando el usuario menciona:
|
|
10
|
+
- "guardar datos"
|
|
11
|
+
- "base de datos"
|
|
12
|
+
- "usuarios" (para persistencia)
|
|
13
|
+
- "productos"
|
|
14
|
+
- "almacenar"
|
|
15
|
+
- "database"
|
|
16
|
+
- "Supabase"
|
|
17
|
+
- "PostgreSQL"
|
|
18
|
+
</when_to_use>
|
|
19
|
+
|
|
20
|
+
<before_starting>
|
|
21
|
+
## Investigación Obligatoria
|
|
22
|
+
|
|
23
|
+
**ANTES de configurar, entender las necesidades:**
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
1. Preguntar al usuario:
|
|
27
|
+
- ¿Qué datos necesitas guardar?
|
|
28
|
+
- ¿Cuántos usuarios esperas?
|
|
29
|
+
- ¿Necesitas búsqueda en tiempo real?
|
|
30
|
+
|
|
31
|
+
2. Decidir tipo de DB:
|
|
32
|
+
- Relacional (PostgreSQL) → Datos estructurados
|
|
33
|
+
- NoSQL (MongoDB) → Datos flexibles
|
|
34
|
+
- Serverless (Supabase/PlanetScale) → Sin administración
|
|
35
|
+
|
|
36
|
+
3. Buscar en Context7:
|
|
37
|
+
mcp__plugin_context7_context7__resolve-library-id("prisma")
|
|
38
|
+
mcp__plugin_context7_context7__query-docs(id, "getting started")
|
|
39
|
+
```
|
|
40
|
+
</before_starting>
|
|
41
|
+
|
|
42
|
+
<recommended_stack>
|
|
43
|
+
## Stack Recomendado
|
|
44
|
+
|
|
45
|
+
### Para la mayoría de proyectos:
|
|
46
|
+
|
|
47
|
+
| Necesidad | Solución | Por qué |
|
|
48
|
+
|-----------|----------|---------|
|
|
49
|
+
| ORM | Prisma | Type-safe, migrations fáciles |
|
|
50
|
+
| Database | Supabase (PostgreSQL) | Gratis para empezar, escala |
|
|
51
|
+
| Alternativa | PlanetScale (MySQL) | Serverless, branching |
|
|
52
|
+
</recommended_stack>
|
|
53
|
+
|
|
54
|
+
<prisma_setup>
|
|
55
|
+
## Setup Prisma + Supabase
|
|
56
|
+
|
|
57
|
+
### Paso 1: Instalar Prisma
|
|
58
|
+
```bash
|
|
59
|
+
npm install prisma @prisma/client
|
|
60
|
+
npx prisma init
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Paso 2: Configurar DATABASE_URL
|
|
64
|
+
```bash
|
|
65
|
+
# .env
|
|
66
|
+
DATABASE_URL="postgresql://postgres:[PASSWORD]@[HOST]:5432/postgres"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Para Supabase:
|
|
70
|
+
1. Ir a supabase.com
|
|
71
|
+
2. Crear proyecto
|
|
72
|
+
3. Settings → Database → Connection string
|
|
73
|
+
|
|
74
|
+
### Paso 3: Crear schema
|
|
75
|
+
```prisma
|
|
76
|
+
// prisma/schema.prisma
|
|
77
|
+
// VERIFICAR sintaxis actual con Context7
|
|
78
|
+
|
|
79
|
+
generator client {
|
|
80
|
+
provider = "prisma-client-js"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
datasource db {
|
|
84
|
+
provider = "postgresql"
|
|
85
|
+
url = env("DATABASE_URL")
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
model User {
|
|
89
|
+
id String @id @default(cuid())
|
|
90
|
+
email String @unique
|
|
91
|
+
name String?
|
|
92
|
+
createdAt DateTime @default(now())
|
|
93
|
+
updatedAt DateTime @updatedAt
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Paso 4: Crear migración
|
|
98
|
+
```bash
|
|
99
|
+
npx prisma migrate dev --name init
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Paso 5: Generar client
|
|
103
|
+
```bash
|
|
104
|
+
npx prisma generate
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Paso 6: Usar en código
|
|
108
|
+
```typescript
|
|
109
|
+
// src/lib/db.ts
|
|
110
|
+
// VERIFICAR patrón actual con Context7
|
|
111
|
+
|
|
112
|
+
import { PrismaClient } from '@prisma/client'
|
|
113
|
+
|
|
114
|
+
const globalForPrisma = globalThis as unknown as {
|
|
115
|
+
prisma: PrismaClient | undefined
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const prisma = globalForPrisma.prisma ?? new PrismaClient()
|
|
119
|
+
|
|
120
|
+
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
|
|
121
|
+
```
|
|
122
|
+
</prisma_setup>
|
|
123
|
+
|
|
124
|
+
<supabase_setup>
|
|
125
|
+
## Setup Supabase (Alternativo)
|
|
126
|
+
|
|
127
|
+
Si prefieres usar el SDK de Supabase directamente:
|
|
128
|
+
|
|
129
|
+
### Paso 1: Instalar
|
|
130
|
+
```bash
|
|
131
|
+
npm install @supabase/supabase-js
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Paso 2: Configurar client
|
|
135
|
+
```typescript
|
|
136
|
+
// src/lib/supabase.ts
|
|
137
|
+
// VERIFICAR con Context7
|
|
138
|
+
|
|
139
|
+
import { createClient } from '@supabase/supabase-js'
|
|
140
|
+
|
|
141
|
+
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
|
|
142
|
+
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
|
143
|
+
|
|
144
|
+
export const supabase = createClient(supabaseUrl, supabaseKey)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Paso 3: Variables de entorno
|
|
148
|
+
```bash
|
|
149
|
+
# .env.local
|
|
150
|
+
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
|
|
151
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=xxx
|
|
152
|
+
```
|
|
153
|
+
</supabase_setup>
|
|
154
|
+
|
|
155
|
+
<verification>
|
|
156
|
+
## Verificación
|
|
157
|
+
|
|
158
|
+
### Automática
|
|
159
|
+
```bash
|
|
160
|
+
# Verificar conexión
|
|
161
|
+
npx prisma db pull
|
|
162
|
+
|
|
163
|
+
# Verificar schema
|
|
164
|
+
npx prisma validate
|
|
165
|
+
|
|
166
|
+
# Ver datos (opcional)
|
|
167
|
+
npx prisma studio
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Manual (para usuario)
|
|
171
|
+
```
|
|
172
|
+
Para ti (Usuario):
|
|
173
|
+
|
|
174
|
+
1. Ejecuta: npx prisma studio
|
|
175
|
+
2. Se abre una ventana en tu navegador
|
|
176
|
+
3. Deberías ver las tablas de tu base de datos
|
|
177
|
+
|
|
178
|
+
¿Lo ves?
|
|
179
|
+
- SÍ → La base de datos está conectada
|
|
180
|
+
- NO → Verifica DATABASE_URL en .env
|
|
181
|
+
```
|
|
182
|
+
</verification>
|
|
183
|
+
|
|
184
|
+
<common_patterns>
|
|
185
|
+
## Patrones Comunes
|
|
186
|
+
|
|
187
|
+
### Crear registro
|
|
188
|
+
```typescript
|
|
189
|
+
const user = await prisma.user.create({
|
|
190
|
+
data: {
|
|
191
|
+
email: 'test@example.com',
|
|
192
|
+
name: 'Test User'
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Buscar registros
|
|
198
|
+
```typescript
|
|
199
|
+
const users = await prisma.user.findMany({
|
|
200
|
+
where: {
|
|
201
|
+
email: { contains: '@example.com' }
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Actualizar registro
|
|
207
|
+
```typescript
|
|
208
|
+
const user = await prisma.user.update({
|
|
209
|
+
where: { id: 'xxx' },
|
|
210
|
+
data: { name: 'New Name' }
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Eliminar registro
|
|
215
|
+
```typescript
|
|
216
|
+
await prisma.user.delete({
|
|
217
|
+
where: { id: 'xxx' }
|
|
218
|
+
})
|
|
219
|
+
```
|
|
220
|
+
</common_patterns>
|
|
221
|
+
|
|
222
|
+
<common_issues>
|
|
223
|
+
## Problemas Comunes
|
|
224
|
+
|
|
225
|
+
### "Can't reach database server"
|
|
226
|
+
- Verificar DATABASE_URL
|
|
227
|
+
- Verificar que la DB está corriendo
|
|
228
|
+
- Verificar firewall/whitelist IP en Supabase
|
|
229
|
+
|
|
230
|
+
### "Migration failed"
|
|
231
|
+
- Verificar permisos en la DB
|
|
232
|
+
- Verificar que schema es válido
|
|
233
|
+
- Probar: `npx prisma migrate reset` (BORRA DATOS)
|
|
234
|
+
|
|
235
|
+
### "Prisma Client not generated"
|
|
236
|
+
- Ejecutar: `npx prisma generate`
|
|
237
|
+
- Reiniciar TypeScript server en VS Code
|
|
238
|
+
</common_issues>
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: expo-app
|
|
3
|
+
description: Skill para crear aplicaciones móviles con Expo/React Native. Usa este skill cuando el usuario quiere crear una app para celular (iOS/Android).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Crear App Expo (React Native)
|
|
7
|
+
|
|
8
|
+
<when_to_use>
|
|
9
|
+
Usar cuando el usuario menciona:
|
|
10
|
+
- "app para celular"
|
|
11
|
+
- "app móvil"
|
|
12
|
+
- "iOS"
|
|
13
|
+
- "Android"
|
|
14
|
+
- "React Native"
|
|
15
|
+
- "app nativa"
|
|
16
|
+
- "aplicación móvil"
|
|
17
|
+
</when_to_use>
|
|
18
|
+
|
|
19
|
+
<before_starting>
|
|
20
|
+
## Investigación Obligatoria
|
|
21
|
+
|
|
22
|
+
**ANTES de crear cualquier archivo, verificar versiones actuales:**
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
1. Resolver Expo:
|
|
26
|
+
mcp__plugin_context7_context7__resolve-library-id("expo")
|
|
27
|
+
|
|
28
|
+
2. Buscar setup actual:
|
|
29
|
+
mcp__plugin_context7_context7__query-docs(id, "create expo app getting started")
|
|
30
|
+
|
|
31
|
+
3. Verificar Expo Router:
|
|
32
|
+
mcp__plugin_context7_context7__query-docs(id, "expo router installation")
|
|
33
|
+
|
|
34
|
+
4. Verificar NativeWind (Tailwind for RN):
|
|
35
|
+
mcp__plugin_context7_context7__resolve-library-id("nativewind")
|
|
36
|
+
mcp__plugin_context7_context7__query-docs(id, "installation expo")
|
|
37
|
+
```
|
|
38
|
+
</before_starting>
|
|
39
|
+
|
|
40
|
+
<standard_stack>
|
|
41
|
+
## Stack Estándar (Verificar con Context7)
|
|
42
|
+
|
|
43
|
+
| Tecnología | Propósito | Verificar |
|
|
44
|
+
|------------|-----------|-----------|
|
|
45
|
+
| Expo SDK 52+ | Framework React Native | Context7 |
|
|
46
|
+
| React Native 0.76+ | UI móvil | Context7 |
|
|
47
|
+
| Expo Router | Navegación file-based | Context7 |
|
|
48
|
+
| TypeScript | Type safety | Context7 |
|
|
49
|
+
| NativeWind | Estilos (Tailwind) | Context7 |
|
|
50
|
+
</standard_stack>
|
|
51
|
+
|
|
52
|
+
<project_structure>
|
|
53
|
+
## Estructura de Proyecto
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
my-app/
|
|
57
|
+
├── app/ # Expo Router (file-based routing)
|
|
58
|
+
│ ├── _layout.tsx # Layout raíz
|
|
59
|
+
│ ├── index.tsx # Pantalla de inicio
|
|
60
|
+
│ ├── (tabs)/ # Grupo de tabs
|
|
61
|
+
│ │ ├── _layout.tsx # Tab navigator
|
|
62
|
+
│ │ ├── home.tsx # Tab Home
|
|
63
|
+
│ │ └── profile.tsx # Tab Profile
|
|
64
|
+
│ └── [dynamic]/ # Rutas dinámicas
|
|
65
|
+
├── components/
|
|
66
|
+
│ ├── ui/ # Componentes base
|
|
67
|
+
│ └── [feature]/ # Componentes por feature
|
|
68
|
+
├── lib/ # Utilidades
|
|
69
|
+
├── assets/ # Imágenes, fonts
|
|
70
|
+
├── package.json
|
|
71
|
+
├── app.json # Config de Expo
|
|
72
|
+
├── tsconfig.json
|
|
73
|
+
└── tailwind.config.js
|
|
74
|
+
```
|
|
75
|
+
</project_structure>
|
|
76
|
+
|
|
77
|
+
<setup_steps>
|
|
78
|
+
## Pasos de Setup
|
|
79
|
+
|
|
80
|
+
### Paso 1: Crear proyecto
|
|
81
|
+
```bash
|
|
82
|
+
# Verificar comando actual con Context7 antes de ejecutar
|
|
83
|
+
npx create-expo-app@latest my-app --template tabs
|
|
84
|
+
cd my-app
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Paso 2: Verificar que funciona
|
|
88
|
+
```bash
|
|
89
|
+
npx expo start
|
|
90
|
+
# Escanear QR con Expo Go app o usar simulador
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Paso 3: Agregar NativeWind (Tailwind)
|
|
94
|
+
```bash
|
|
95
|
+
# Verificar instalación actual con Context7
|
|
96
|
+
npm install nativewind tailwindcss
|
|
97
|
+
npx tailwindcss init
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Paso 4: Configurar NativeWind
|
|
101
|
+
```javascript
|
|
102
|
+
// tailwind.config.js - VERIFICAR con Context7
|
|
103
|
+
module.exports = {
|
|
104
|
+
content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"],
|
|
105
|
+
presets: [require("nativewind/preset")],
|
|
106
|
+
theme: {
|
|
107
|
+
extend: {},
|
|
108
|
+
},
|
|
109
|
+
plugins: [],
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Paso 5: Configurar babel
|
|
114
|
+
```javascript
|
|
115
|
+
// babel.config.js - VERIFICAR con Context7
|
|
116
|
+
module.exports = function (api) {
|
|
117
|
+
api.cache(true);
|
|
118
|
+
return {
|
|
119
|
+
presets: [
|
|
120
|
+
["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
|
121
|
+
"nativewind/babel",
|
|
122
|
+
],
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
```
|
|
126
|
+
</setup_steps>
|
|
127
|
+
|
|
128
|
+
<common_patterns>
|
|
129
|
+
## Patrones Comunes (Verificar con Context7)
|
|
130
|
+
|
|
131
|
+
### Layout con Tabs
|
|
132
|
+
```typescript
|
|
133
|
+
// app/(tabs)/_layout.tsx
|
|
134
|
+
// VERIFICAR Expo Router tabs pattern con Context7
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Pantalla con Lista
|
|
138
|
+
```typescript
|
|
139
|
+
// app/[route].tsx
|
|
140
|
+
// VERIFICAR FlatList pattern con Context7
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Navegación Stack
|
|
144
|
+
```typescript
|
|
145
|
+
// app/_layout.tsx
|
|
146
|
+
// VERIFICAR Stack navigation pattern con Context7
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Componente con Estilos NativeWind
|
|
150
|
+
```typescript
|
|
151
|
+
// components/Button.tsx
|
|
152
|
+
// VERIFICAR NativeWind className usage con Context7
|
|
153
|
+
```
|
|
154
|
+
</common_patterns>
|
|
155
|
+
|
|
156
|
+
<verification>
|
|
157
|
+
## Verificación
|
|
158
|
+
|
|
159
|
+
Antes de continuar, confirmar:
|
|
160
|
+
|
|
161
|
+
1. **Metro bundler funciona:**
|
|
162
|
+
```bash
|
|
163
|
+
npx expo start
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
2. **App carga en dispositivo/simulador:**
|
|
167
|
+
- Expo Go app
|
|
168
|
+
- iOS Simulator
|
|
169
|
+
- Android Emulator
|
|
170
|
+
|
|
171
|
+
3. **TypeScript sin errores:**
|
|
172
|
+
```bash
|
|
173
|
+
npx tsc --noEmit
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
4. **Usuario confirma:**
|
|
177
|
+
"¿Puedes ver la app en tu celular/simulador?"
|
|
178
|
+
</verification>
|
|
179
|
+
|
|
180
|
+
<user_testing>
|
|
181
|
+
## Guía de Prueba para Usuario
|
|
182
|
+
|
|
183
|
+
Si la IA no puede verificar algo, dar instrucciones claras:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
Para ti (Usuario):
|
|
187
|
+
|
|
188
|
+
OPCIÓN A - Con tu celular:
|
|
189
|
+
1. Descarga "Expo Go" de la App Store/Play Store
|
|
190
|
+
2. Escanea el código QR que aparece en la terminal
|
|
191
|
+
3. La app debería abrirse en tu celular
|
|
192
|
+
|
|
193
|
+
OPCIÓN B - Con simulador:
|
|
194
|
+
1. Presiona 'i' para iOS Simulator (necesitas Mac)
|
|
195
|
+
2. Presiona 'a' para Android Emulator
|
|
196
|
+
|
|
197
|
+
¿Puedes ver la app?
|
|
198
|
+
- SÍ → Todo funciona, continuamos
|
|
199
|
+
- NO → Dime qué ves y te ayudo
|
|
200
|
+
```
|
|
201
|
+
</user_testing>
|
|
202
|
+
|
|
203
|
+
<common_issues>
|
|
204
|
+
## Problemas Comunes
|
|
205
|
+
|
|
206
|
+
### "Unable to resolve module"
|
|
207
|
+
- Limpiar cache: `npx expo start --clear`
|
|
208
|
+
- Verificar que la dependencia está instalada
|
|
209
|
+
- Verificar imports
|
|
210
|
+
|
|
211
|
+
### "Metro bundler error"
|
|
212
|
+
- Cerrar otras instancias de Metro
|
|
213
|
+
- Limpiar: `npx expo start --clear`
|
|
214
|
+
- Reinstalar node_modules
|
|
215
|
+
|
|
216
|
+
### "App crashes on start"
|
|
217
|
+
- Revisar logs en terminal
|
|
218
|
+
- Verificar que no usas APIs web-only
|
|
219
|
+
- Verificar configuración de babel/metro
|
|
220
|
+
|
|
221
|
+
### "NativeWind styles not working"
|
|
222
|
+
- Verificar babel.config.js
|
|
223
|
+
- Verificar tailwind.config.js content paths
|
|
224
|
+
- Reiniciar Metro con --clear
|
|
225
|
+
|
|
226
|
+
### "Expo Go can't connect"
|
|
227
|
+
- Verificar que estás en la misma red WiFi
|
|
228
|
+
- Probar con tunnel: `npx expo start --tunnel`
|
|
229
|
+
</common_issues>
|
|
230
|
+
|
|
231
|
+
<development_options>
|
|
232
|
+
## Opciones de Desarrollo
|
|
233
|
+
|
|
234
|
+
### Expo Go (Más fácil)
|
|
235
|
+
- Sin necesidad de instalar Xcode/Android Studio
|
|
236
|
+
- Limitado a APIs de Expo
|
|
237
|
+
- Ideal para prototipos
|
|
238
|
+
|
|
239
|
+
### Development Build (Más potente)
|
|
240
|
+
- Necesita Xcode/Android Studio
|
|
241
|
+
- Acceso a cualquier librería nativa
|
|
242
|
+
- Necesario para producción
|
|
243
|
+
|
|
244
|
+
### EAS Build (En la nube)
|
|
245
|
+
- Builds en servidores de Expo
|
|
246
|
+
- Sin necesidad de configurar ambientes locales
|
|
247
|
+
- Costo por builds
|
|
248
|
+
</development_options>
|
|
249
|
+
|
|
250
|
+
<next_steps>
|
|
251
|
+
## Después del Setup
|
|
252
|
+
|
|
253
|
+
Una vez que el proyecto base funciona:
|
|
254
|
+
|
|
255
|
+
1. **Si necesita autenticación:** → @skills/auth-setup.md
|
|
256
|
+
2. **Si necesita base de datos:** → @skills/database-setup.md
|
|
257
|
+
3. **Si necesita notificaciones push:** → Buscar en Context7 "expo notifications"
|
|
258
|
+
4. **Si necesita monitoreo:** → @skills/sentry-setup.md
|
|
259
|
+
|
|
260
|
+
O continuar con `/elsabro:plan` para planificar las features.
|
|
261
|
+
</next_steps>
|