claude-agent-framework 1.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 +128 -0
- package/bin/claude-framework +3 -0
- package/framework/agents/design-lead.md +240 -0
- package/framework/agents/product-owner.md +179 -0
- package/framework/agents/tech-lead.md +226 -0
- package/framework/commands/ayuda.md +127 -0
- package/framework/commands/a/303/261adir.md +98 -0
- package/framework/commands/backup.md +397 -0
- package/framework/commands/cambiar.md +110 -0
- package/framework/commands/cloud.md +457 -0
- package/framework/commands/code.md +142 -0
- package/framework/commands/debug.md +334 -0
- package/framework/commands/deploy.md +383 -0
- package/framework/commands/deshacer.md +120 -0
- package/framework/commands/estado.md +218 -0
- package/framework/commands/explica.md +227 -0
- package/framework/commands/feature.md +120 -0
- package/framework/commands/git.md +427 -0
- package/framework/commands/historial.md +202 -0
- package/framework/commands/learn.md +408 -0
- package/framework/commands/movil.md +245 -0
- package/framework/commands/nuevo.md +118 -0
- package/framework/commands/plan.md +134 -0
- package/framework/commands/prd.md +113 -0
- package/framework/commands/probar.md +148 -0
- package/framework/commands/revisar.md +208 -0
- package/framework/commands/seeds.md +230 -0
- package/framework/commands/seguridad.md +226 -0
- package/framework/commands/tasks.md +157 -0
- package/framework/skills/architecture/algorithms.md +970 -0
- package/framework/skills/architecture/clean-code.md +1080 -0
- package/framework/skills/architecture/design-patterns.md +1984 -0
- package/framework/skills/architecture/functional-programming.md +972 -0
- package/framework/skills/architecture/solid.md +991 -0
- package/framework/skills/cloud/cloud-aws.md +848 -0
- package/framework/skills/cloud/cloud-azure.md +931 -0
- package/framework/skills/cloud/cloud-gcp.md +848 -0
- package/framework/skills/cloud/message-queues.md +1229 -0
- package/framework/skills/core/accessibility.md +401 -0
- package/framework/skills/core/api.md +474 -0
- package/framework/skills/core/authentication.md +306 -0
- package/framework/skills/core/authorization.md +388 -0
- package/framework/skills/core/background-jobs.md +341 -0
- package/framework/skills/core/caching.md +473 -0
- package/framework/skills/core/code-review.md +341 -0
- package/framework/skills/core/controllers.md +290 -0
- package/framework/skills/core/cua.md +285 -0
- package/framework/skills/core/documentation.md +472 -0
- package/framework/skills/core/file-uploads.md +351 -0
- package/framework/skills/core/hotwire-native.md +296 -0
- package/framework/skills/core/hotwire.md +278 -0
- package/framework/skills/core/i18n.md +334 -0
- package/framework/skills/core/imports-exports.md +750 -0
- package/framework/skills/core/infrastructure.md +337 -0
- package/framework/skills/core/models.md +228 -0
- package/framework/skills/core/notifications.md +672 -0
- package/framework/skills/core/payments.md +581 -0
- package/framework/skills/core/performance.md +361 -0
- package/framework/skills/core/rails-scaffold.md +131 -0
- package/framework/skills/core/search.md +518 -0
- package/framework/skills/core/security.md +565 -0
- package/framework/skills/core/seeds.md +307 -0
- package/framework/skills/core/seo.md +542 -0
- package/framework/skills/core/testing.md +393 -0
- package/framework/skills/core/views.md +260 -0
- package/framework/skills/core/websockets.md +564 -0
- package/framework/skills/data/advanced-sql.md +1204 -0
- package/framework/skills/data/nosql.md +1141 -0
- package/framework/skills/devops/containers-advanced.md +1237 -0
- package/framework/skills/devops/debugging.md +834 -0
- package/framework/skills/devops/git-workflow.md +752 -0
- package/framework/skills/devops/networking.md +932 -0
- package/framework/skills/devops/shell-scripting.md +1132 -0
- package/framework/sub-agents/architecture-patterns-agent.md +1450 -0
- package/framework/sub-agents/cloud-agent.md +677 -0
- package/framework/sub-agents/data.md +504 -0
- package/framework/sub-agents/debugging-agent.md +554 -0
- package/framework/sub-agents/devops.md +483 -0
- package/framework/sub-agents/docs.md +176 -0
- package/framework/sub-agents/frontend-dev.md +349 -0
- package/framework/sub-agents/git-workflow-agent.md +697 -0
- package/framework/sub-agents/integrations.md +630 -0
- package/framework/sub-agents/native-dev.md +434 -0
- package/framework/sub-agents/qa.md +138 -0
- package/framework/sub-agents/rails-dev.md +375 -0
- package/framework/sub-agents/security.md +526 -0
- package/framework/sub-agents/ui.md +437 -0
- package/framework/sub-agents/ux.md +284 -0
- package/framework/templates/api-spec.md +500 -0
- package/framework/templates/component-spec.md +248 -0
- package/framework/templates/feature.json +13 -0
- package/framework/templates/model-spec.md +318 -0
- package/framework/templates/prd-template.md +80 -0
- package/framework/templates/task-plan.md +122 -0
- package/framework/templates/task-user-story.md +52 -0
- package/framework/templates/technical-spec.md +260 -0
- package/framework/templates/user-story.md +95 -0
- package/package.json +42 -0
- package/project-templates/CLAUDE.md +42 -0
- package/project-templates/contexts/architecture.md +25 -0
- package/project-templates/contexts/conventions.md +46 -0
- package/project-templates/contexts/design-system.md +47 -0
- package/project-templates/contexts/requirements.md +38 -0
- package/project-templates/contexts/stack.md +30 -0
- package/project-templates/history/active/models.md +11 -0
- package/project-templates/history/changelog.md +15 -0
- package/project-templates/workspace/.gitkeep +0 -0
- package/src/cli.js +52 -0
- package/src/init.js +104 -0
- package/src/status.js +75 -0
- package/src/update.js +88 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
# Comando: /cloud
|
|
2
|
+
|
|
3
|
+
Despliegue y gestión de aplicaciones en la nube.
|
|
4
|
+
|
|
5
|
+
## Uso
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/cloud [provider] [acción]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Providers soportados
|
|
12
|
+
|
|
13
|
+
| Provider | Descripción | Tier gratuito |
|
|
14
|
+
|----------|-------------|---------------|
|
|
15
|
+
| `fly` | Fly.io (recomendado) | 3 VMs pequeñas gratis |
|
|
16
|
+
| `render` | Render.com | Web service gratis |
|
|
17
|
+
| `railway` | Railway.app | $5 crédito mensual |
|
|
18
|
+
| `aws` | Amazon Web Services | 12 meses free tier |
|
|
19
|
+
| `gcp` | Google Cloud Platform | $300 crédito inicial |
|
|
20
|
+
| `azure` | Microsoft Azure | $200 crédito inicial |
|
|
21
|
+
|
|
22
|
+
## Acciones disponibles
|
|
23
|
+
|
|
24
|
+
| Acción | Descripción |
|
|
25
|
+
|--------|-------------|
|
|
26
|
+
| `setup` | Configura el proyecto para el provider |
|
|
27
|
+
| `deploy` | Despliega la aplicación |
|
|
28
|
+
| `logs` | Muestra logs de producción |
|
|
29
|
+
| `status` | Estado de la aplicación |
|
|
30
|
+
| `scale [n]` | Escala a n instancias |
|
|
31
|
+
| `costs` | Estimación de costos |
|
|
32
|
+
|
|
33
|
+
## Flujo de trabajo
|
|
34
|
+
|
|
35
|
+
### `/cloud` (sin argumentos)
|
|
36
|
+
|
|
37
|
+
Muestra estado actual y opciones disponibles.
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
## Cloud Status
|
|
41
|
+
|
|
42
|
+
### Configuración detectada
|
|
43
|
+
- 🟢 Fly.io (fly.toml encontrado)
|
|
44
|
+
- ⚪ Render (no configurado)
|
|
45
|
+
- ⚪ Railway (no configurado)
|
|
46
|
+
|
|
47
|
+
### Recomendación
|
|
48
|
+
Para este proyecto, recomiendo **Fly.io** porque:
|
|
49
|
+
- Tier gratuito generoso
|
|
50
|
+
- SQLite-friendly (volúmenes persistentes)
|
|
51
|
+
- Deploy simple con CLI
|
|
52
|
+
- Servers en Europa disponibles
|
|
53
|
+
|
|
54
|
+
¿Qué te gustaría hacer?
|
|
55
|
+
1. `/cloud fly deploy` - Desplegar a Fly.io
|
|
56
|
+
2. `/cloud fly logs` - Ver logs
|
|
57
|
+
3. `/cloud render setup` - Configurar Render como alternativa
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `/cloud [provider] setup`
|
|
61
|
+
|
|
62
|
+
Configura el proyecto para el provider seleccionado.
|
|
63
|
+
|
|
64
|
+
#### Fly.io Setup
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Instalar CLI si no está
|
|
68
|
+
curl -L https://fly.io/install.sh | sh
|
|
69
|
+
|
|
70
|
+
# Login
|
|
71
|
+
fly auth login
|
|
72
|
+
|
|
73
|
+
# Crear app
|
|
74
|
+
fly launch --no-deploy
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Genera `fly.toml`:**
|
|
78
|
+
|
|
79
|
+
```toml
|
|
80
|
+
app = "mi-app"
|
|
81
|
+
primary_region = "mad" # Madrid
|
|
82
|
+
|
|
83
|
+
[build]
|
|
84
|
+
|
|
85
|
+
[env]
|
|
86
|
+
RAILS_ENV = "production"
|
|
87
|
+
RAILS_LOG_TO_STDOUT = "true"
|
|
88
|
+
RAILS_SERVE_STATIC_FILES = "true"
|
|
89
|
+
|
|
90
|
+
[http_service]
|
|
91
|
+
internal_port = 3000
|
|
92
|
+
force_https = true
|
|
93
|
+
auto_stop_machines = true
|
|
94
|
+
auto_start_machines = true
|
|
95
|
+
min_machines_running = 0
|
|
96
|
+
|
|
97
|
+
[[vm]]
|
|
98
|
+
memory = "512mb"
|
|
99
|
+
cpu_kind = "shared"
|
|
100
|
+
cpus = 1
|
|
101
|
+
|
|
102
|
+
[mounts]
|
|
103
|
+
source = "data"
|
|
104
|
+
destination = "/rails/storage"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Configura secrets:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
fly secrets set RAILS_MASTER_KEY=$(cat config/master.key)
|
|
111
|
+
fly secrets set SECRET_KEY_BASE=$(rails secret)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Render Setup
|
|
115
|
+
|
|
116
|
+
**Genera `render.yaml`:**
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
services:
|
|
120
|
+
- type: web
|
|
121
|
+
name: mi-app
|
|
122
|
+
runtime: ruby
|
|
123
|
+
buildCommand: |
|
|
124
|
+
bundle install
|
|
125
|
+
bundle exec rails assets:precompile
|
|
126
|
+
bundle exec rails db:migrate
|
|
127
|
+
startCommand: bundle exec puma -C config/puma.rb
|
|
128
|
+
envVars:
|
|
129
|
+
- key: RAILS_ENV
|
|
130
|
+
value: production
|
|
131
|
+
- key: RAILS_MASTER_KEY
|
|
132
|
+
sync: false
|
|
133
|
+
- key: DATABASE_URL
|
|
134
|
+
fromDatabase:
|
|
135
|
+
name: mi-app-db
|
|
136
|
+
property: connectionString
|
|
137
|
+
|
|
138
|
+
databases:
|
|
139
|
+
- name: mi-app-db
|
|
140
|
+
plan: free
|
|
141
|
+
databaseName: mi_app_production
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Railway Setup
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Instalar CLI
|
|
148
|
+
npm i -g @railway/cli
|
|
149
|
+
|
|
150
|
+
# Login y crear proyecto
|
|
151
|
+
railway login
|
|
152
|
+
railway init
|
|
153
|
+
|
|
154
|
+
# Configurar variables
|
|
155
|
+
railway variables set RAILS_ENV=production
|
|
156
|
+
railway variables set RAILS_MASTER_KEY=$(cat config/master.key)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### `/cloud [provider] deploy`
|
|
160
|
+
|
|
161
|
+
Despliega la aplicación al provider.
|
|
162
|
+
|
|
163
|
+
**Pre-checks:**
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
## Pre-deploy Checklist
|
|
167
|
+
|
|
168
|
+
- [ ] Tests pasando
|
|
169
|
+
- [ ] Assets compilan
|
|
170
|
+
- [ ] Migraciones listas
|
|
171
|
+
- [ ] Secrets configurados
|
|
172
|
+
- [ ] .gitignore correcto
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### Deploy a Fly.io
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Deploy
|
|
179
|
+
fly deploy
|
|
180
|
+
|
|
181
|
+
# Ejecutar migraciones
|
|
182
|
+
fly ssh console -C "bin/rails db:migrate"
|
|
183
|
+
|
|
184
|
+
# Verificar
|
|
185
|
+
fly status
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Salida:**
|
|
189
|
+
|
|
190
|
+
```markdown
|
|
191
|
+
## Deploy a Fly.io
|
|
192
|
+
|
|
193
|
+
### Proceso
|
|
194
|
+
```
|
|
195
|
+
📦 Building image...
|
|
196
|
+
→ Using Dockerfile
|
|
197
|
+
→ Build successful
|
|
198
|
+
|
|
199
|
+
🚀 Deploying...
|
|
200
|
+
→ Creating release v5
|
|
201
|
+
→ Updating machines
|
|
202
|
+
→ Waiting for health checks
|
|
203
|
+
|
|
204
|
+
✅ Deploy successful!
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Detalles
|
|
208
|
+
- **URL**: https://mi-app.fly.dev
|
|
209
|
+
- **Region**: Madrid (mad)
|
|
210
|
+
- **Versión**: v5
|
|
211
|
+
- **Tiempo**: 2m 34s
|
|
212
|
+
|
|
213
|
+
### Health Check
|
|
214
|
+
- ✅ HTTP responding
|
|
215
|
+
- ✅ Database connected
|
|
216
|
+
- ✅ Assets serving
|
|
217
|
+
|
|
218
|
+
### Próximos pasos
|
|
219
|
+
- Verificar la app: https://mi-app.fly.dev
|
|
220
|
+
- Ver logs: `/cloud fly logs`
|
|
221
|
+
- Escalar si es necesario: `/cloud fly scale 2`
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `/cloud [provider] logs`
|
|
225
|
+
|
|
226
|
+
Muestra logs de producción.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Fly.io
|
|
230
|
+
fly logs --app mi-app
|
|
231
|
+
|
|
232
|
+
# Render
|
|
233
|
+
# Usar dashboard web
|
|
234
|
+
|
|
235
|
+
# Railway
|
|
236
|
+
railway logs
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Filtros disponibles:**
|
|
240
|
+
|
|
241
|
+
```markdown
|
|
242
|
+
## Logs de Producción
|
|
243
|
+
|
|
244
|
+
### Opciones de filtrado
|
|
245
|
+
- `/cloud fly logs` - Últimos logs en tiempo real
|
|
246
|
+
- `/cloud fly logs --error` - Solo errores
|
|
247
|
+
- `/cloud fly logs --today` - Logs de hoy
|
|
248
|
+
- `/cloud fly logs --search "texto"` - Buscar texto
|
|
249
|
+
|
|
250
|
+
### Logs recientes
|
|
251
|
+
```
|
|
252
|
+
2024-01-15 10:23:45 [info] GET /articles 200 in 45ms
|
|
253
|
+
2024-01-15 10:23:46 [info] GET /articles/1 200 in 32ms
|
|
254
|
+
2024-01-15 10:23:50 [error] NoMethodError in ArticlesController#show
|
|
255
|
+
2024-01-15 10:23:50 [error] undefined method `name' for nil:NilClass
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Errores detectados
|
|
259
|
+
⚠️ 1 error en los últimos 5 minutos
|
|
260
|
+
|
|
261
|
+
¿Quieres que analice el error con `/debug`?
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### `/cloud [provider] status`
|
|
265
|
+
|
|
266
|
+
Muestra estado detallado de la aplicación.
|
|
267
|
+
|
|
268
|
+
```markdown
|
|
269
|
+
## Estado de mi-app en Fly.io
|
|
270
|
+
|
|
271
|
+
### General
|
|
272
|
+
- **Estado**: 🟢 Running
|
|
273
|
+
- **URL**: https://mi-app.fly.dev
|
|
274
|
+
- **Region**: Madrid (mad)
|
|
275
|
+
- **Uptime**: 5 días, 3 horas
|
|
276
|
+
|
|
277
|
+
### Instancias
|
|
278
|
+
| ID | Estado | CPU | Memoria | Region |
|
|
279
|
+
|----|--------|-----|---------|--------|
|
|
280
|
+
| abc123 | running | 2% | 256MB/512MB | mad |
|
|
281
|
+
|
|
282
|
+
### Métricas (últimas 24h)
|
|
283
|
+
- **Requests**: 1,234
|
|
284
|
+
- **Errores**: 2 (0.16%)
|
|
285
|
+
- **Tiempo respuesta**: 45ms avg
|
|
286
|
+
|
|
287
|
+
### Volúmenes
|
|
288
|
+
| Nombre | Tamaño | Usado |
|
|
289
|
+
|--------|--------|-------|
|
|
290
|
+
| data | 1GB | 45MB |
|
|
291
|
+
|
|
292
|
+
### Secrets configurados
|
|
293
|
+
- RAILS_MASTER_KEY ✅
|
|
294
|
+
- SECRET_KEY_BASE ✅
|
|
295
|
+
|
|
296
|
+
### Próximas acciones sugeridas
|
|
297
|
+
- Todo está funcionando correctamente
|
|
298
|
+
- Considera activar auto-scaling si esperas más tráfico
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### `/cloud [provider] scale [n]`
|
|
302
|
+
|
|
303
|
+
Escala la aplicación a n instancias.
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
# Fly.io
|
|
307
|
+
fly scale count 2
|
|
308
|
+
|
|
309
|
+
# Render
|
|
310
|
+
# Usar dashboard (free tier = 1 instancia)
|
|
311
|
+
|
|
312
|
+
# Railway
|
|
313
|
+
# Automático según uso
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Salida:**
|
|
317
|
+
|
|
318
|
+
```markdown
|
|
319
|
+
## Escalado de mi-app
|
|
320
|
+
|
|
321
|
+
### Configuración actual
|
|
322
|
+
- Instancias: 1
|
|
323
|
+
- Memoria por instancia: 512MB
|
|
324
|
+
- CPU: shared
|
|
325
|
+
|
|
326
|
+
### Nuevo estado (después de escalar a 2)
|
|
327
|
+
- Instancias: 2
|
|
328
|
+
- Memoria total: 1GB
|
|
329
|
+
- Regiones: mad (2 instancias)
|
|
330
|
+
|
|
331
|
+
### Impacto en costos
|
|
332
|
+
- Antes: $0/mes (free tier)
|
|
333
|
+
- Después: ~$5/mes (segundo VM no es gratis)
|
|
334
|
+
|
|
335
|
+
⚠️ Esto excederá el tier gratuito de Fly.io.
|
|
336
|
+
|
|
337
|
+
¿Continuar? (s/n)
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### `/cloud [provider] costs`
|
|
341
|
+
|
|
342
|
+
Muestra estimación de costos.
|
|
343
|
+
|
|
344
|
+
```markdown
|
|
345
|
+
## Estimación de Costos - Fly.io
|
|
346
|
+
|
|
347
|
+
### Uso actual
|
|
348
|
+
| Recurso | Cantidad | Precio | Total |
|
|
349
|
+
|---------|----------|--------|-------|
|
|
350
|
+
| VM shared-cpu-1x | 1 | $0 (free) | $0 |
|
|
351
|
+
| Memoria 512MB | 512MB | Incluido | $0 |
|
|
352
|
+
| Volumen | 1GB | $0.15/GB | $0.15 |
|
|
353
|
+
| Bandwidth | 5GB | Incluido | $0 |
|
|
354
|
+
|
|
355
|
+
**Total mensual estimado: $0.15**
|
|
356
|
+
|
|
357
|
+
### Si escalaras a 2 instancias
|
|
358
|
+
| Recurso | Cantidad | Precio | Total |
|
|
359
|
+
|---------|----------|--------|-------|
|
|
360
|
+
| VM shared-cpu-1x | 2 | $1.94/mes | $3.88 |
|
|
361
|
+
| Memoria 512MB | 1GB | Incluido | $0 |
|
|
362
|
+
| Volumen | 1GB | $0.15/GB | $0.15 |
|
|
363
|
+
|
|
364
|
+
**Total mensual estimado: $4.03**
|
|
365
|
+
|
|
366
|
+
### Comparación con otros providers
|
|
367
|
+
|
|
368
|
+
| Provider | Config similar | Costo/mes |
|
|
369
|
+
|----------|---------------|-----------|
|
|
370
|
+
| Fly.io | 1 VM + volumen | $0.15 |
|
|
371
|
+
| Render | Free tier | $0 |
|
|
372
|
+
| Railway | Free tier | $0-5 |
|
|
373
|
+
| Heroku | Eco dyno | $5 |
|
|
374
|
+
| AWS (EC2) | t3.micro | ~$8 |
|
|
375
|
+
|
|
376
|
+
### Recomendación
|
|
377
|
+
Para tu nivel de tráfico actual, el tier gratuito es suficiente.
|
|
378
|
+
Considera escalar cuando tengas >1000 usuarios activos diarios.
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Configuración por provider
|
|
382
|
+
|
|
383
|
+
### Fly.io (Recomendado)
|
|
384
|
+
|
|
385
|
+
**Ventajas:**
|
|
386
|
+
- SQLite funciona bien con volúmenes
|
|
387
|
+
- Deploy rápido
|
|
388
|
+
- CLI excelente
|
|
389
|
+
- Tier gratuito generoso
|
|
390
|
+
|
|
391
|
+
**Dockerfile para Rails:**
|
|
392
|
+
|
|
393
|
+
```dockerfile
|
|
394
|
+
FROM ruby:3.3-slim
|
|
395
|
+
|
|
396
|
+
RUN apt-get update -qq && \
|
|
397
|
+
apt-get install --no-install-recommends -y \
|
|
398
|
+
build-essential libsqlite3-dev nodejs
|
|
399
|
+
|
|
400
|
+
WORKDIR /rails
|
|
401
|
+
|
|
402
|
+
COPY Gemfile Gemfile.lock ./
|
|
403
|
+
RUN bundle install
|
|
404
|
+
|
|
405
|
+
COPY . .
|
|
406
|
+
|
|
407
|
+
RUN bundle exec rails assets:precompile
|
|
408
|
+
|
|
409
|
+
EXPOSE 3000
|
|
410
|
+
CMD ["./bin/rails", "server", "-b", "0.0.0.0"]
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Render.com
|
|
414
|
+
|
|
415
|
+
**Ventajas:**
|
|
416
|
+
- Setup más simple
|
|
417
|
+
- PostgreSQL gratuito
|
|
418
|
+
- Auto-deploy desde GitHub
|
|
419
|
+
|
|
420
|
+
**Limitaciones free tier:**
|
|
421
|
+
- Se apaga después de 15min inactividad
|
|
422
|
+
- Solo 1 instancia
|
|
423
|
+
|
|
424
|
+
### Railway
|
|
425
|
+
|
|
426
|
+
**Ventajas:**
|
|
427
|
+
- UX muy pulido
|
|
428
|
+
- Fácil de usar
|
|
429
|
+
- PostgreSQL incluido
|
|
430
|
+
|
|
431
|
+
**Limitaciones:**
|
|
432
|
+
- $5 crédito mensual
|
|
433
|
+
- Puede no ser suficiente para uso intensivo
|
|
434
|
+
|
|
435
|
+
## Rollback
|
|
436
|
+
|
|
437
|
+
Si algo sale mal:
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
# Fly.io
|
|
441
|
+
fly releases
|
|
442
|
+
fly deploy --image registry.fly.io/mi-app:v4 # versión anterior
|
|
443
|
+
|
|
444
|
+
# Render
|
|
445
|
+
# Desde dashboard, seleccionar deploy anterior
|
|
446
|
+
|
|
447
|
+
# Railway
|
|
448
|
+
railway rollback
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Notas importantes
|
|
452
|
+
|
|
453
|
+
- Siempre tener backup antes de deploy
|
|
454
|
+
- Probar en staging antes de producción
|
|
455
|
+
- Monitorear logs después de cada deploy
|
|
456
|
+
- Configurar alertas para errores
|
|
457
|
+
- Documentar configuración de cada provider
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Comando: /code
|
|
2
|
+
|
|
3
|
+
Ejecuta el plan de implementación de una tarea.
|
|
4
|
+
|
|
5
|
+
## Argumentos
|
|
6
|
+
- `task_path` (requerido): Path de la tarea (ej. features/2025-12-19-143052/tasks/001-crear-comentario)
|
|
7
|
+
|
|
8
|
+
## Flujo de trabajo
|
|
9
|
+
|
|
10
|
+
### Paso 1: Leer el Plan
|
|
11
|
+
|
|
12
|
+
1. Cargar `{task_path}/plan.md`
|
|
13
|
+
2. Si no existe, mostrar error y sugerir `/plan {task_path}` primero
|
|
14
|
+
3. Extraer el feature_id del path
|
|
15
|
+
|
|
16
|
+
### Paso 2: Verificar Dependencias
|
|
17
|
+
|
|
18
|
+
1. Cargar `features/{feature_id}/feature.json`
|
|
19
|
+
2. Verificar que las tareas de las que depende están completadas
|
|
20
|
+
3. Si hay dependencias no completadas, alertar y preguntar si continuar
|
|
21
|
+
|
|
22
|
+
### Paso 3: Implementar
|
|
23
|
+
|
|
24
|
+
1. Seguir los pasos del plan en orden
|
|
25
|
+
2. Para cada paso:
|
|
26
|
+
- Mostrar qué se está haciendo
|
|
27
|
+
- Ejecutar la implementación
|
|
28
|
+
- Validar que funcionó
|
|
29
|
+
3. Invocar sub-agentes según necesidad:
|
|
30
|
+
- `rails-dev` para modelos/controllers/migraciones
|
|
31
|
+
- `frontend-dev` para vistas/Stimulus/Tailwind
|
|
32
|
+
- `qa` para tests
|
|
33
|
+
|
|
34
|
+
### Paso 4: Ejecutar Validaciones
|
|
35
|
+
|
|
36
|
+
Ejecutar los comandos de validación del plan:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Tests
|
|
40
|
+
bundle exec rspec
|
|
41
|
+
|
|
42
|
+
# Linting
|
|
43
|
+
bundle exec standard
|
|
44
|
+
|
|
45
|
+
# ERB linting (si existe)
|
|
46
|
+
bundle exec erblint --lint-all 2>/dev/null || true
|
|
47
|
+
|
|
48
|
+
# Compilar assets (si existe yarn)
|
|
49
|
+
yarn build 2>/dev/null || true
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Paso 5: Actualizar Estado
|
|
53
|
+
|
|
54
|
+
1. Cargar `features/{feature_id}/feature.json`
|
|
55
|
+
2. Encontrar la tarea en el array `tasks`
|
|
56
|
+
3. Cambiar `status` a `"completed"`
|
|
57
|
+
4. Recalcular `progress` del feature:
|
|
58
|
+
```
|
|
59
|
+
progress = (tareas_completadas / total_tareas) * 100
|
|
60
|
+
```
|
|
61
|
+
5. Si todas las tareas están completadas:
|
|
62
|
+
- Cambiar `status` del feature a `"completed"`
|
|
63
|
+
- Cambiar `current_phase` a `"done"`
|
|
64
|
+
6. De lo contrario:
|
|
65
|
+
- Cambiar `status` del feature a `"in_progress"`
|
|
66
|
+
7. Actualizar `updated_at`
|
|
67
|
+
8. Guardar el archivo
|
|
68
|
+
|
|
69
|
+
### Paso 6: Actualizar Historial
|
|
70
|
+
|
|
71
|
+
Agregar entrada a `.claude/history/changelog.md`:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
### {fecha} - Tarea Completada
|
|
75
|
+
|
|
76
|
+
**Feature**: {feature_title}
|
|
77
|
+
**Tarea**: {task_id} - {task_title}
|
|
78
|
+
|
|
79
|
+
Cambios realizados:
|
|
80
|
+
- {lista de archivos creados/modificados}
|
|
81
|
+
|
|
82
|
+
Progreso del feature: {X}% ({N}/{M} tareas)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Report
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Tarea completada: {task_title}
|
|
89
|
+
|
|
90
|
+
Resumen del trabajo:
|
|
91
|
+
- {bullet point 1}
|
|
92
|
+
- {bullet point 2}
|
|
93
|
+
- {bullet point 3}
|
|
94
|
+
|
|
95
|
+
Archivos modificados:
|
|
96
|
+
{git diff --stat output}
|
|
97
|
+
|
|
98
|
+
Validaciones:
|
|
99
|
+
- Tests: {PASS/FAIL}
|
|
100
|
+
- Linting: {PASS/FAIL}
|
|
101
|
+
|
|
102
|
+
Progreso del feature: {X}% ({N}/{M} tareas)
|
|
103
|
+
|
|
104
|
+
{SI hay más tareas pendientes}
|
|
105
|
+
Siguiente paso:
|
|
106
|
+
/plan features/{feature_id}/tasks/{siguiente_tarea}
|
|
107
|
+
|
|
108
|
+
{SI el feature está completo}
|
|
109
|
+
Feature completado! Todas las tareas han sido implementadas.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Manejo de Errores
|
|
113
|
+
|
|
114
|
+
### Si algo falla durante la implementación
|
|
115
|
+
|
|
116
|
+
1. No marcar la tarea como completada
|
|
117
|
+
2. Mostrar el error claramente
|
|
118
|
+
3. Sugerir opciones:
|
|
119
|
+
- Reintentar el paso
|
|
120
|
+
- Modificar el plan
|
|
121
|
+
- Pedir ayuda
|
|
122
|
+
|
|
123
|
+
### Si los tests fallan
|
|
124
|
+
|
|
125
|
+
1. Mostrar qué tests fallaron
|
|
126
|
+
2. Intentar arreglar automáticamente si es posible
|
|
127
|
+
3. Si no se puede arreglar, dejar la tarea como `in_progress`
|
|
128
|
+
|
|
129
|
+
## Integración con el Sistema
|
|
130
|
+
|
|
131
|
+
- Usa los mismos sub-agentes que `/añadir`
|
|
132
|
+
- Actualiza el mismo changelog que el resto del sistema
|
|
133
|
+
- Compatible con `/deshacer` para revertir cambios
|
|
134
|
+
- El progreso se refleja en `/estado`
|
|
135
|
+
|
|
136
|
+
## Consideraciones
|
|
137
|
+
|
|
138
|
+
- Siempre seguir el plan paso a paso
|
|
139
|
+
- No saltarse validaciones
|
|
140
|
+
- Preguntar si algo no está claro en el plan
|
|
141
|
+
- Mantener commits atómicos si es posible
|
|
142
|
+
- Documentar cualquier desviación del plan
|