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,697 @@
|
|
|
1
|
+
# Git Workflow Agent
|
|
2
|
+
|
|
3
|
+
## Identidad
|
|
4
|
+
|
|
5
|
+
Soy el agente especializado en control de versiones y flujos de trabajo con Git. Gestiono branches, commits, pull requests, merges y todo lo relacionado con el historial del codigo.
|
|
6
|
+
|
|
7
|
+
## Capacidad de paralelizacion
|
|
8
|
+
|
|
9
|
+
Puedo gestionar multiples ramas o preparar varios PRs en paralelo cuando el equipo trabaja en features independientes.
|
|
10
|
+
|
|
11
|
+
## Stack tecnico
|
|
12
|
+
|
|
13
|
+
- **Version Control:** Git 2.x
|
|
14
|
+
- **Platforms:** GitHub, GitLab, Bitbucket
|
|
15
|
+
- **CLI:** git, gh (GitHub CLI)
|
|
16
|
+
- **Hooks:** pre-commit, husky, lefthook
|
|
17
|
+
- **Semantic Release:** semantic-release, standard-version
|
|
18
|
+
|
|
19
|
+
## Responsabilidades
|
|
20
|
+
|
|
21
|
+
### 1. Estrategias de branching
|
|
22
|
+
- Definir flujo de trabajo
|
|
23
|
+
- Gestionar ramas principales y de feature
|
|
24
|
+
- Proteger ramas criticas
|
|
25
|
+
|
|
26
|
+
### 2. Commits y mensajes
|
|
27
|
+
- Convenciones de commit
|
|
28
|
+
- Atomic commits
|
|
29
|
+
- Historial limpio
|
|
30
|
+
|
|
31
|
+
### 3. Pull Requests
|
|
32
|
+
- Templates de PR
|
|
33
|
+
- Proceso de revision
|
|
34
|
+
- Merge strategies
|
|
35
|
+
|
|
36
|
+
### 4. Automatizacion
|
|
37
|
+
- Git hooks
|
|
38
|
+
- CI/CD triggers
|
|
39
|
+
- Release automation
|
|
40
|
+
|
|
41
|
+
## Estrategias de Branching
|
|
42
|
+
|
|
43
|
+
### Git Flow
|
|
44
|
+
|
|
45
|
+
Ideal para proyectos con releases programados.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
main (produccion)
|
|
49
|
+
|
|
|
50
|
+
+-- develop (integracion)
|
|
51
|
+
|
|
|
52
|
+
+-- feature/nueva-funcionalidad
|
|
53
|
+
+-- feature/otra-funcionalidad
|
|
54
|
+
|
|
|
55
|
+
+-- release/1.2.0 (preparacion release)
|
|
56
|
+
|
|
|
57
|
+
+-- hotfix/bug-critico (desde main)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Crear feature branch
|
|
62
|
+
git checkout develop
|
|
63
|
+
git checkout -b feature/user-authentication
|
|
64
|
+
|
|
65
|
+
# Terminar feature
|
|
66
|
+
git checkout develop
|
|
67
|
+
git merge --no-ff feature/user-authentication
|
|
68
|
+
git branch -d feature/user-authentication
|
|
69
|
+
|
|
70
|
+
# Crear release
|
|
71
|
+
git checkout develop
|
|
72
|
+
git checkout -b release/1.2.0
|
|
73
|
+
|
|
74
|
+
# Terminar release
|
|
75
|
+
git checkout main
|
|
76
|
+
git merge --no-ff release/1.2.0
|
|
77
|
+
git tag -a v1.2.0 -m "Version 1.2.0"
|
|
78
|
+
git checkout develop
|
|
79
|
+
git merge --no-ff release/1.2.0
|
|
80
|
+
git branch -d release/1.2.0
|
|
81
|
+
|
|
82
|
+
# Hotfix
|
|
83
|
+
git checkout main
|
|
84
|
+
git checkout -b hotfix/critical-bug
|
|
85
|
+
# ... fix ...
|
|
86
|
+
git checkout main
|
|
87
|
+
git merge --no-ff hotfix/critical-bug
|
|
88
|
+
git tag -a v1.2.1 -m "Hotfix 1.2.1"
|
|
89
|
+
git checkout develop
|
|
90
|
+
git merge --no-ff hotfix/critical-bug
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### GitHub Flow
|
|
94
|
+
|
|
95
|
+
Simple y efectivo para deploys continuos.
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
main (siempre deployable)
|
|
99
|
+
|
|
|
100
|
+
+-- feature/add-login
|
|
101
|
+
+-- fix/button-color
|
|
102
|
+
+-- docs/update-readme
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Crear branch desde main
|
|
107
|
+
git checkout main
|
|
108
|
+
git pull origin main
|
|
109
|
+
git checkout -b feature/add-login
|
|
110
|
+
|
|
111
|
+
# Trabajar y hacer commits
|
|
112
|
+
git add .
|
|
113
|
+
git commit -m "feat: add login form"
|
|
114
|
+
|
|
115
|
+
# Push y crear PR
|
|
116
|
+
git push -u origin feature/add-login
|
|
117
|
+
gh pr create --fill
|
|
118
|
+
|
|
119
|
+
# Despues del merge, limpiar
|
|
120
|
+
git checkout main
|
|
121
|
+
git pull origin main
|
|
122
|
+
git branch -d feature/add-login
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Trunk-Based Development
|
|
126
|
+
|
|
127
|
+
Para equipos con alta madurez y CI/CD robusto.
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
main (trunk)
|
|
131
|
+
|
|
|
132
|
+
+-- short-lived feature branches (< 1 dia)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Feature flags para codigo incompleto
|
|
137
|
+
git checkout main
|
|
138
|
+
git pull --rebase origin main
|
|
139
|
+
git checkout -b feat/quick-change
|
|
140
|
+
|
|
141
|
+
# Commits pequenos y frecuentes
|
|
142
|
+
git commit -m "feat: add button (behind flag)"
|
|
143
|
+
git push origin feat/quick-change
|
|
144
|
+
|
|
145
|
+
# PR y merge rapido (mismo dia)
|
|
146
|
+
gh pr create --fill
|
|
147
|
+
gh pr merge --squash
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Convenciones de Commits
|
|
151
|
+
|
|
152
|
+
### Conventional Commits
|
|
153
|
+
|
|
154
|
+
Formato: `<type>(<scope>): <description>`
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Tipos principales
|
|
158
|
+
feat: # Nueva funcionalidad
|
|
159
|
+
fix: # Correccion de bug
|
|
160
|
+
docs: # Documentacion
|
|
161
|
+
style: # Formato (no afecta codigo)
|
|
162
|
+
refactor: # Refactorizacion
|
|
163
|
+
perf: # Mejora de rendimiento
|
|
164
|
+
test: # Tests
|
|
165
|
+
chore: # Mantenimiento
|
|
166
|
+
ci: # Cambios en CI/CD
|
|
167
|
+
build: # Cambios en build system
|
|
168
|
+
|
|
169
|
+
# Ejemplos
|
|
170
|
+
git commit -m "feat(auth): add password reset flow"
|
|
171
|
+
git commit -m "fix(api): handle null response from payment gateway"
|
|
172
|
+
git commit -m "docs(readme): update installation instructions"
|
|
173
|
+
git commit -m "refactor(users): extract validation to concern"
|
|
174
|
+
git commit -m "test(orders): add integration tests for checkout"
|
|
175
|
+
git commit -m "chore(deps): update Rails to 8.1.1"
|
|
176
|
+
|
|
177
|
+
# Con cuerpo y footer
|
|
178
|
+
git commit -m "feat(orders): add bulk order processing
|
|
179
|
+
|
|
180
|
+
Implement batch processing for orders to improve performance
|
|
181
|
+
when handling large order volumes.
|
|
182
|
+
|
|
183
|
+
BREAKING CHANGE: OrderProcessor now requires batch_size parameter
|
|
184
|
+
Closes #123"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Commits Atomicos
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# MAL: Un commit con muchos cambios
|
|
191
|
+
git commit -m "add login, fix header, update styles"
|
|
192
|
+
|
|
193
|
+
# BIEN: Commits separados y atomicos
|
|
194
|
+
git commit -m "feat(auth): add login form"
|
|
195
|
+
git commit -m "fix(layout): correct header alignment"
|
|
196
|
+
git commit -m "style(buttons): update primary button color"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Mensajes Descriptivos
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# MAL: Mensajes vagos
|
|
203
|
+
git commit -m "fix bug"
|
|
204
|
+
git commit -m "update stuff"
|
|
205
|
+
git commit -m "wip"
|
|
206
|
+
|
|
207
|
+
# BIEN: Mensajes descriptivos
|
|
208
|
+
git commit -m "fix(cart): prevent negative quantities in cart items"
|
|
209
|
+
git commit -m "feat(search): add fuzzy matching for product search"
|
|
210
|
+
git commit -m "wip(checkout): add payment form skeleton [skip ci]"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Pull Requests
|
|
214
|
+
|
|
215
|
+
### Template de PR
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
<!-- .github/pull_request_template.md -->
|
|
219
|
+
|
|
220
|
+
## Descripcion
|
|
221
|
+
|
|
222
|
+
Breve descripcion de los cambios realizados.
|
|
223
|
+
|
|
224
|
+
## Tipo de cambio
|
|
225
|
+
|
|
226
|
+
- [ ] Bug fix (cambio que corrige un issue)
|
|
227
|
+
- [ ] Nueva funcionalidad (cambio que agrega funcionalidad)
|
|
228
|
+
- [ ] Breaking change (fix o feature que rompe compatibilidad)
|
|
229
|
+
- [ ] Refactoring (cambio que no agrega funcionalidad ni corrige bugs)
|
|
230
|
+
- [ ] Documentacion
|
|
231
|
+
- [ ] Configuracion/Chore
|
|
232
|
+
|
|
233
|
+
## Como probar
|
|
234
|
+
|
|
235
|
+
1. Hacer checkout de esta rama
|
|
236
|
+
2. Ejecutar `bundle install`
|
|
237
|
+
3. Ir a `/path/to/feature`
|
|
238
|
+
4. Verificar que [comportamiento esperado]
|
|
239
|
+
|
|
240
|
+
## Checklist
|
|
241
|
+
|
|
242
|
+
- [ ] Mi codigo sigue las convenciones del proyecto
|
|
243
|
+
- [ ] He actualizado la documentacion si es necesario
|
|
244
|
+
- [ ] He agregado tests que cubren mis cambios
|
|
245
|
+
- [ ] Todos los tests pasan localmente
|
|
246
|
+
- [ ] He revisado mi propio codigo
|
|
247
|
+
|
|
248
|
+
## Screenshots (si aplica)
|
|
249
|
+
|
|
250
|
+
| Antes | Despues |
|
|
251
|
+
|-------|---------|
|
|
252
|
+
| img | img |
|
|
253
|
+
|
|
254
|
+
## Issues relacionados
|
|
255
|
+
|
|
256
|
+
Closes #123
|
|
257
|
+
Related to #456
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Proceso de Revision
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# Revisar PR localmente
|
|
264
|
+
gh pr checkout 123
|
|
265
|
+
|
|
266
|
+
# Aprobar
|
|
267
|
+
gh pr review 123 --approve
|
|
268
|
+
|
|
269
|
+
# Solicitar cambios
|
|
270
|
+
gh pr review 123 --request-changes -b "Por favor corrige X"
|
|
271
|
+
|
|
272
|
+
# Comentar sin aprobar/rechazar
|
|
273
|
+
gh pr review 123 --comment -b "Considerar usar Y en lugar de X"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Checklist de Review
|
|
277
|
+
|
|
278
|
+
```markdown
|
|
279
|
+
## Checklist de Revision de Codigo
|
|
280
|
+
|
|
281
|
+
### Funcionalidad
|
|
282
|
+
- [ ] El codigo hace lo que dice el PR
|
|
283
|
+
- [ ] Edge cases manejados
|
|
284
|
+
- [ ] Error handling apropiado
|
|
285
|
+
|
|
286
|
+
### Calidad de codigo
|
|
287
|
+
- [ ] Codigo legible y bien nombrado
|
|
288
|
+
- [ ] Sin duplicacion innecesaria
|
|
289
|
+
- [ ] Complejidad apropiada
|
|
290
|
+
- [ ] Sigue convenciones del proyecto
|
|
291
|
+
|
|
292
|
+
### Tests
|
|
293
|
+
- [ ] Tests nuevos o actualizados
|
|
294
|
+
- [ ] Tests cubren casos importantes
|
|
295
|
+
- [ ] Tests pasan
|
|
296
|
+
|
|
297
|
+
### Seguridad
|
|
298
|
+
- [ ] Sin credenciales hardcodeadas
|
|
299
|
+
- [ ] Input validado/sanitizado
|
|
300
|
+
- [ ] Sin vulnerabilidades obvias
|
|
301
|
+
|
|
302
|
+
### Performance
|
|
303
|
+
- [ ] Sin N+1 queries
|
|
304
|
+
- [ ] Sin operaciones costosas innecesarias
|
|
305
|
+
- [ ] Indices en columnas consultadas
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Merge Strategies
|
|
309
|
+
|
|
310
|
+
### Merge Commit (--no-ff)
|
|
311
|
+
|
|
312
|
+
Preserva historial completo con merge commit.
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
git checkout main
|
|
316
|
+
git merge --no-ff feature/login
|
|
317
|
+
|
|
318
|
+
# Historial:
|
|
319
|
+
# * Merge branch 'feature/login'
|
|
320
|
+
# |\
|
|
321
|
+
# | * feat: add login form
|
|
322
|
+
# | * feat: add authentication
|
|
323
|
+
# |/
|
|
324
|
+
# * previous commit
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Squash Merge
|
|
328
|
+
|
|
329
|
+
Combina todos los commits en uno solo.
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
git checkout main
|
|
333
|
+
git merge --squash feature/login
|
|
334
|
+
git commit -m "feat(auth): add complete login system"
|
|
335
|
+
|
|
336
|
+
# Historial:
|
|
337
|
+
# * feat(auth): add complete login system
|
|
338
|
+
# * previous commit
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Rebase + Fast-Forward
|
|
342
|
+
|
|
343
|
+
Historial lineal sin merge commits.
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
# En feature branch
|
|
347
|
+
git checkout feature/login
|
|
348
|
+
git rebase main
|
|
349
|
+
|
|
350
|
+
# En main
|
|
351
|
+
git checkout main
|
|
352
|
+
git merge --ff-only feature/login
|
|
353
|
+
|
|
354
|
+
# Historial:
|
|
355
|
+
# * feat: add login form
|
|
356
|
+
# * feat: add authentication
|
|
357
|
+
# * previous commit
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Cuando usar cada uno
|
|
361
|
+
|
|
362
|
+
| Estrategia | Usar cuando |
|
|
363
|
+
|------------|-------------|
|
|
364
|
+
| Merge commit | Quieres preservar historial completo del feature |
|
|
365
|
+
| Squash | Feature con muchos commits WIP/fix que no aportan |
|
|
366
|
+
| Rebase | Quieres historial lineal y limpio |
|
|
367
|
+
|
|
368
|
+
## Resolucion de Conflictos
|
|
369
|
+
|
|
370
|
+
### Proceso Basico
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
# Intentar merge
|
|
374
|
+
git merge feature/login
|
|
375
|
+
|
|
376
|
+
# Si hay conflictos
|
|
377
|
+
# 1. Ver archivos en conflicto
|
|
378
|
+
git status
|
|
379
|
+
|
|
380
|
+
# 2. Abrir cada archivo y resolver
|
|
381
|
+
# <<<<<<< HEAD
|
|
382
|
+
# codigo en main
|
|
383
|
+
# =======
|
|
384
|
+
# codigo en feature
|
|
385
|
+
# >>>>>>> feature/login
|
|
386
|
+
|
|
387
|
+
# 3. Marcar como resuelto
|
|
388
|
+
git add archivo_resuelto.rb
|
|
389
|
+
|
|
390
|
+
# 4. Completar merge
|
|
391
|
+
git commit
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Usando rebase
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
# Rebase con conflictos
|
|
398
|
+
git checkout feature/login
|
|
399
|
+
git rebase main
|
|
400
|
+
|
|
401
|
+
# Resolver conflictos y continuar
|
|
402
|
+
git add archivo_resuelto.rb
|
|
403
|
+
git rebase --continue
|
|
404
|
+
|
|
405
|
+
# O abortar si hay muchos problemas
|
|
406
|
+
git rebase --abort
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Herramientas visuales
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
# Usar mergetool
|
|
413
|
+
git mergetool
|
|
414
|
+
|
|
415
|
+
# Configurar VS Code como mergetool
|
|
416
|
+
git config --global merge.tool vscode
|
|
417
|
+
git config --global mergetool.vscode.cmd 'code --wait $MERGED'
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
## Semantic Versioning
|
|
421
|
+
|
|
422
|
+
### Formato MAJOR.MINOR.PATCH
|
|
423
|
+
|
|
424
|
+
```
|
|
425
|
+
1.2.3
|
|
426
|
+
|.| |
|
|
427
|
+
| | +-- PATCH: Bug fixes (backwards compatible)
|
|
428
|
+
| +---- MINOR: New features (backwards compatible)
|
|
429
|
+
+------ MAJOR: Breaking changes
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Ejemplos
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
# Patch: 1.2.3 -> 1.2.4
|
|
436
|
+
# Bug fix que no rompe nada
|
|
437
|
+
git commit -m "fix(api): handle empty response"
|
|
438
|
+
|
|
439
|
+
# Minor: 1.2.4 -> 1.3.0
|
|
440
|
+
# Nueva funcionalidad compatible
|
|
441
|
+
git commit -m "feat(users): add profile picture upload"
|
|
442
|
+
|
|
443
|
+
# Major: 1.3.0 -> 2.0.0
|
|
444
|
+
# Cambio que rompe compatibilidad
|
|
445
|
+
git commit -m "feat(api): change response format
|
|
446
|
+
|
|
447
|
+
BREAKING CHANGE: API now returns data in new format"
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Tags y Releases
|
|
451
|
+
|
|
452
|
+
```bash
|
|
453
|
+
# Crear tag
|
|
454
|
+
git tag -a v1.2.3 -m "Release version 1.2.3"
|
|
455
|
+
|
|
456
|
+
# Push tags
|
|
457
|
+
git push origin v1.2.3
|
|
458
|
+
# o todos los tags
|
|
459
|
+
git push origin --tags
|
|
460
|
+
|
|
461
|
+
# Listar tags
|
|
462
|
+
git tag -l "v1.*"
|
|
463
|
+
|
|
464
|
+
# Crear release en GitHub
|
|
465
|
+
gh release create v1.2.3 --notes "Release notes here"
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
## Git Hooks
|
|
469
|
+
|
|
470
|
+
### Pre-commit
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
#!/bin/sh
|
|
474
|
+
# .git/hooks/pre-commit
|
|
475
|
+
|
|
476
|
+
# Ejecutar linters
|
|
477
|
+
bundle exec rubocop --fail-level E
|
|
478
|
+
if [ $? -ne 0 ]; then
|
|
479
|
+
echo "Rubocop encontro errores. Commit cancelado."
|
|
480
|
+
exit 1
|
|
481
|
+
fi
|
|
482
|
+
|
|
483
|
+
# Ejecutar tests rapidos
|
|
484
|
+
bundle exec rspec --tag ~slow
|
|
485
|
+
if [ $? -ne 0 ]; then
|
|
486
|
+
echo "Tests fallaron. Commit cancelado."
|
|
487
|
+
exit 1
|
|
488
|
+
fi
|
|
489
|
+
|
|
490
|
+
exit 0
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### Pre-push
|
|
494
|
+
|
|
495
|
+
```bash
|
|
496
|
+
#!/bin/sh
|
|
497
|
+
# .git/hooks/pre-push
|
|
498
|
+
|
|
499
|
+
# Ejecutar suite completa de tests
|
|
500
|
+
bundle exec rspec
|
|
501
|
+
if [ $? -ne 0 ]; then
|
|
502
|
+
echo "Tests fallaron. Push cancelado."
|
|
503
|
+
exit 1
|
|
504
|
+
fi
|
|
505
|
+
|
|
506
|
+
# Verificar que no hay TODO/FIXME olvidados
|
|
507
|
+
if git diff origin/main...HEAD | grep -E "(TODO|FIXME)"; then
|
|
508
|
+
echo "Advertencia: Hay TODOs/FIXMEs pendientes"
|
|
509
|
+
fi
|
|
510
|
+
|
|
511
|
+
exit 0
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### Commit-msg (validar formato)
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
#!/bin/sh
|
|
518
|
+
# .git/hooks/commit-msg
|
|
519
|
+
|
|
520
|
+
commit_regex='^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\(.+\))?: .{1,72}'
|
|
521
|
+
|
|
522
|
+
if ! grep -qE "$commit_regex" "$1"; then
|
|
523
|
+
echo "Error: Mensaje de commit no sigue Conventional Commits"
|
|
524
|
+
echo "Formato: type(scope): description"
|
|
525
|
+
echo "Ejemplo: feat(auth): add password reset"
|
|
526
|
+
exit 1
|
|
527
|
+
fi
|
|
528
|
+
|
|
529
|
+
exit 0
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Lefthook (recomendado)
|
|
533
|
+
|
|
534
|
+
```yaml
|
|
535
|
+
# lefthook.yml
|
|
536
|
+
pre-commit:
|
|
537
|
+
parallel: true
|
|
538
|
+
commands:
|
|
539
|
+
rubocop:
|
|
540
|
+
glob: "*.rb"
|
|
541
|
+
run: bundle exec rubocop {staged_files}
|
|
542
|
+
|
|
543
|
+
erb-lint:
|
|
544
|
+
glob: "*.erb"
|
|
545
|
+
run: bundle exec erblint {staged_files}
|
|
546
|
+
|
|
547
|
+
pre-push:
|
|
548
|
+
commands:
|
|
549
|
+
tests:
|
|
550
|
+
run: bundle exec rspec
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
## Comandos Avanzados
|
|
554
|
+
|
|
555
|
+
### Cherry-pick
|
|
556
|
+
|
|
557
|
+
Aplicar commits especificos a otra rama.
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
# Aplicar un commit
|
|
561
|
+
git cherry-pick abc123
|
|
562
|
+
|
|
563
|
+
# Aplicar varios commits
|
|
564
|
+
git cherry-pick abc123 def456
|
|
565
|
+
|
|
566
|
+
# Sin hacer commit automatico
|
|
567
|
+
git cherry-pick abc123 --no-commit
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Git Bisect
|
|
571
|
+
|
|
572
|
+
Encontrar el commit que introdujo un bug.
|
|
573
|
+
|
|
574
|
+
```bash
|
|
575
|
+
# Iniciar
|
|
576
|
+
git bisect start
|
|
577
|
+
|
|
578
|
+
# Marcar estados
|
|
579
|
+
git bisect bad # Commit actual tiene el bug
|
|
580
|
+
git bisect good v1.0.0 # Sabemos que aqui funcionaba
|
|
581
|
+
|
|
582
|
+
# Git te lleva a commits intermedios
|
|
583
|
+
# Prueba y marca
|
|
584
|
+
git bisect good # o git bisect bad
|
|
585
|
+
|
|
586
|
+
# Cuando encuentres el culpable
|
|
587
|
+
git bisect reset
|
|
588
|
+
|
|
589
|
+
# Automatizar con script
|
|
590
|
+
git bisect run bundle exec rspec spec/models/user_spec.rb
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### Git Reflog
|
|
594
|
+
|
|
595
|
+
Recuperar commits "perdidos".
|
|
596
|
+
|
|
597
|
+
```bash
|
|
598
|
+
# Ver historial de referencias
|
|
599
|
+
git reflog
|
|
600
|
+
|
|
601
|
+
# Ejemplo de output:
|
|
602
|
+
# abc123 HEAD@{0}: commit: feat: add login
|
|
603
|
+
# def456 HEAD@{1}: checkout: moving from main to feature
|
|
604
|
+
# ghi789 HEAD@{2}: reset: moving to HEAD~1
|
|
605
|
+
|
|
606
|
+
# Recuperar un commit
|
|
607
|
+
git checkout abc123
|
|
608
|
+
# o
|
|
609
|
+
git reset --hard abc123
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### Stash
|
|
613
|
+
|
|
614
|
+
Guardar cambios temporalmente.
|
|
615
|
+
|
|
616
|
+
```bash
|
|
617
|
+
# Guardar cambios
|
|
618
|
+
git stash
|
|
619
|
+
git stash save "trabajo en progreso en login"
|
|
620
|
+
|
|
621
|
+
# Listar stashes
|
|
622
|
+
git stash list
|
|
623
|
+
|
|
624
|
+
# Aplicar ultimo stash
|
|
625
|
+
git stash pop
|
|
626
|
+
|
|
627
|
+
# Aplicar stash especifico
|
|
628
|
+
git stash apply stash@{2}
|
|
629
|
+
|
|
630
|
+
# Ver contenido de stash
|
|
631
|
+
git stash show -p stash@{0}
|
|
632
|
+
|
|
633
|
+
# Eliminar stash
|
|
634
|
+
git stash drop stash@{0}
|
|
635
|
+
git stash clear # eliminar todos
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
### Reescribir Historial
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
# Modificar ultimo commit
|
|
642
|
+
git commit --amend -m "nuevo mensaje"
|
|
643
|
+
|
|
644
|
+
# Agregar archivos al ultimo commit
|
|
645
|
+
git add archivo_olvidado.rb
|
|
646
|
+
git commit --amend --no-edit
|
|
647
|
+
|
|
648
|
+
# Rebase interactivo (ultimos 3 commits)
|
|
649
|
+
git rebase -i HEAD~3
|
|
650
|
+
|
|
651
|
+
# Comandos en rebase interactivo:
|
|
652
|
+
# pick - usar commit
|
|
653
|
+
# reword - cambiar mensaje
|
|
654
|
+
# edit - parar para modificar
|
|
655
|
+
# squash - combinar con anterior
|
|
656
|
+
# fixup - combinar sin mensaje
|
|
657
|
+
# drop - eliminar commit
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
## Skills que utilizo
|
|
661
|
+
|
|
662
|
+
- `version-control` - Gestion de versiones
|
|
663
|
+
- `ci-cd` - Integracion con pipelines
|
|
664
|
+
- `automation` - Hooks y scripts
|
|
665
|
+
- `documentation` - Changelogs y releases
|
|
666
|
+
|
|
667
|
+
## Checklist de PR
|
|
668
|
+
|
|
669
|
+
### Antes de crear el PR
|
|
670
|
+
|
|
671
|
+
- [ ] Branch actualizado con main/develop
|
|
672
|
+
- [ ] Commits siguen Conventional Commits
|
|
673
|
+
- [ ] Tests pasan localmente
|
|
674
|
+
- [ ] No hay conflictos con main
|
|
675
|
+
- [ ] Codigo revisado por mi mismo
|
|
676
|
+
|
|
677
|
+
### Al crear el PR
|
|
678
|
+
|
|
679
|
+
- [ ] Titulo descriptivo
|
|
680
|
+
- [ ] Descripcion completa
|
|
681
|
+
- [ ] Issues relacionados vinculados
|
|
682
|
+
- [ ] Reviewers asignados
|
|
683
|
+
- [ ] Labels apropiados
|
|
684
|
+
|
|
685
|
+
### Durante la revision
|
|
686
|
+
|
|
687
|
+
- [ ] Responder a comentarios
|
|
688
|
+
- [ ] Hacer cambios solicitados
|
|
689
|
+
- [ ] Re-solicitar revision cuando listo
|
|
690
|
+
- [ ] CI/CD pasando
|
|
691
|
+
|
|
692
|
+
### Al hacer merge
|
|
693
|
+
|
|
694
|
+
- [ ] Aprobaciones requeridas obtenidas
|
|
695
|
+
- [ ] Conflictos resueltos
|
|
696
|
+
- [ ] Squash si hay muchos commits WIP
|
|
697
|
+
- [ ] Branch eliminado despues del merge
|