Files
repo_Claude/.claude/skills/git-recovery/SKILL.md
T
egutierrez d36231d3dc feat: migrar commands a skills
Migra todos los comandos de .claude/commands/ a .claude/skills/ siguiendo
la estructura oficial de Claude Code.

Skills migrados (21 total):
- Configuración: init, init-jupyter, nochanges, create-skill
- Git: git-branch, git-push, git-recovery
- Workspace: sync-repos, list-repos, cleanup-worktrees, import-repo, create-repo
- Issues: create-issue, fix-issue, auto-fix, auto-create, quick-issue,
  issues-status, parallel-issues, execute-parallel, sort-issues

Cada skill tiene:
- Carpeta propia en .claude/skills/<nombre>/
- Archivo SKILL.md con frontmatter avanzado
- disable-model-invocation: true (solo usuario invoca)

Incluye README.md con documentación completa de todos los skills.
2026-03-21 20:29:01 +01:00

2.0 KiB

name, description, argument-hint, disable-model-invocation, user-invocable, allowed-tools
name description argument-hint disable-model-invocation user-invocable allowed-tools
git-recovery Recupera el repositorio de estados inconsistentes (worktrees huérfanos, branches bloqueados)
--aggressive
true true Bash, Read

git-recovery

Recupera el repositorio de estados inconsistentes causados por worktrees huérfanos, branches bloqueados o conflictos git.

Sintaxis

/git-recovery              # Recuperación estándar
/git-recovery --aggressive  # Limpieza agresiva

Cuándo usar

  • Errores "exit status 128" al crear worktrees
  • Git reporta "worktree already exists"
  • Branches que no se pueden eliminar
  • Worktrees huérfanos en git worktree list

Flujo

1. Diagnóstico inicial

git branch --show-current
git status --porcelain

2. Análisis de problemas

git worktree list
git branch --list
git remote -v

3. Limpieza de worktrees huérfanos

git worktree prune -v

Si existe directorio worktrees/:

  • Verificar cada worktree contra git worktree list
  • Eliminar directorios huérfanos

4. Verificar branches bloqueados

Para cada branch issue/* o quick/*:

  • Si está mergeada: git branch -d <branch>
  • Si NO está mergeada: advertir

5. Sincronizar con remoto

git checkout master
git fetch origin
git pull --rebase origin master

6. Modo agresivo (solo con --aggressive)

git remote prune origin -v
git fsck --full
git gc --prune=now
rm -f .git/index.lock  # si existe

7. Verificación final

git status
git worktree list
git branch --list

Patrones de error que activan recovery

  • exit status 128
  • worktree .* already exists
  • reference is not a tree
  • cannot lock ref
  • index.lock

Convenciones

  • No destructivo por defecto
  • Modo agresivo solo con flag explícito
  • Siempre sincroniza con remoto
  • Preserva cambios locales

Reglas

  • NUNCA git reset --hard sin --aggressive
  • NUNCA eliminar branches no mergeadas automáticamente
  • SIEMPRE sincronizar con remoto después de limpieza