refactor: skills globales — eliminar hardcodes de paths/build tags

- parallel-fix-issues: detecta build tag del proyecto (auto o via BUILD_TAG env/arg),
  usa $(git rev-parse --show-toplevel) para rutas en vez de /home/ubuntu/agents_and_robots
- verify-worktree.sh: acepta BUILD_TAG como env o segundo argumento, auto-detecta con
  //go:build, ejecuta sin -tags si no hay tag configurado
- create-tui: DEVFACTORY_PATH, DEVFACTORY_MODULE y GO_NAMESPACE configurables via env
- init-jupyter: resuelve SKILL_DIR dinamicamente siguiendo el symlink de ~/.claude
- pass-usage: elimina GPG-ID hardcodeado, instruye leer de ~/.password-store/.gpg-id
- settings.json: refresh de formato + effortLevel

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 17:04:34 +02:00
parent 3d77f4a5d2
commit e2a131a6dc
6 changed files with 104 additions and 37 deletions
+44 -12
View File
@@ -84,9 +84,25 @@ Para cada wave, lanzar **Agents en paralelo** (un Agent por issue, todos en el m
El prompt de cada agente debe incluir:
1. **Ruta absoluta del worktree**: `/home/ubuntu/CodeProyects/agents_and_robots/worktrees/<slug>`
2. **Contenido completo del issue** (copiar el markdown entero)
3. **Instrucciones de ejecución** (ver template abajo)
1. **Ruta absoluta del worktree** (calcular con `$(git rev-parse --show-toplevel)/worktrees/<slug>`, o pasar la ruta literal ya resuelta)
2. **Build tag Go** del proyecto (detectar — ver "Detección del build tag" más abajo)
3. **Contenido completo del issue** (copiar el markdown entero)
4. **Instrucciones de ejecución** (ver template abajo)
#### Detección del build tag
Antes de lanzar los agentes, detectar el build tag del proyecto para los comandos `go build`/`go test`:
```bash
# Heurísticas (en orden):
# 1. grep en go files por comentarios //go:build <tag>
# 2. Makefile con -tags <tag>
# 3. README con mención explícita
# Si no se encuentra ninguno, dejar la variable vacía (go build/test sin -tags)
BUILD_TAG=$(grep -rh "//go:build " --include="*.go" . 2>/dev/null | head -1 | sed -E 's|^.*//go:build ([^ ]+).*|\1|' || true)
```
Pasar `BUILD_TAG` al agente. Si está vacío, el agente usa `go build ./...` sin `-tags`.
#### Template de prompt para cada agente
@@ -95,11 +111,19 @@ Eres un agente de desarrollo implementando el issue <NNNN>-<slug>.
## Directorio de trabajo
Worktree: /home/ubuntu/CodeProyects/agents_and_robots/worktrees/<slug>
Worktree: <RUTA_ABSOLUTA_DEL_WORKTREE> # ej: /home/user/proyecto/worktrees/<slug>
Usa SIEMPRE esta ruta como prefijo en paths absolutos.
Variable de conveniencia para comandos:
W=/home/ubuntu/CodeProyects/agents_and_robots/worktrees/<slug>
W=<RUTA_ABSOLUTA_DEL_WORKTREE>
## Build tag Go
BUILD_TAG=<VALOR_DETECTADO_O_VACIO> # ej: fts5, goolm, o vacío
Úsalo solo si está definido:
GO_BUILD="go build ${BUILD_TAG:+-tags $BUILD_TAG} ./..."
GO_TEST="go test ${BUILD_TAG:+-tags $BUILD_TAG} ./..."
## Permisos
@@ -107,7 +131,7 @@ IMPORTANTE: En TODAS tus llamadas al tool Bash, usa el parámetro `dangerouslyDi
Esto es necesario porque estás ejecutando en paralelo con otros agentes y no hay usuario interactivo
para aprobar permisos. Ejemplo:
Bash({ command: "cd $W && go build -tags goolm ./...", dangerouslyDisableSandbox: true })
Bash({ command: "cd $W && $GO_BUILD", dangerouslyDisableSandbox: true })
## Issue a implementar
@@ -125,12 +149,12 @@ Sigue este flujo estrictamente:
- Prefijos: feat:, fix:, test:, docs:, refactor:, chore:
- NO hacer commits WIP ni código a medias
- Compilar frecuentemente:
Bash({ command: "cd $W && go build -tags goolm ./...", dangerouslyDisableSandbox: true })
Bash({ command: "cd $W && $GO_BUILD", dangerouslyDisableSandbox: true })
3. **Tests obligatorios**:
- Escribir tests para todo código nuevo
- Ejecutar:
Bash({ command: "cd $W && go test -tags goolm ./...", dangerouslyDisableSandbox: true })
Bash({ command: "cd $W && $GO_TEST", dangerouslyDisableSandbox: true })
- NO continuar si los tests fallan
4. **Cerrar el issue** — solo mover el archivo, NO tocar README:
@@ -158,11 +182,19 @@ Después de cada wave, verificar TODOS los worktrees completados:
```
El script verifica:
- `go build -tags goolm ./...` — compila sin errores
- `go test -tags goolm ./...` — tests pasan
- `go build ${BUILD_TAG:+-tags $BUILD_TAG} ./...` — compila sin errores
- `go test ${BUILD_TAG:+-tags $BUILD_TAG} ./...` — tests pasan
- Issue movido a `dev/issues/completed/`
- Al menos 1 commit en la branch
El script acepta `BUILD_TAG` como variable de entorno (detectada en Fase 3) o como segundo argumento:
```bash
BUILD_TAG=fts5 .claude/skills/parallel-fix-issues/scripts/verify-worktree.sh worktrees/<slug>
# o
.claude/skills/parallel-fix-issues/scripts/verify-worktree.sh worktrees/<slug> fts5
```
**Si un worktree falla verificación**:
1. Reportar al usuario qué falló
2. Preguntar si quiere: (a) intentar arreglar, (b) excluir ese issue, (c) abortar todo
@@ -184,7 +216,7 @@ El script hace para cada branch:
**Después de cada merge**, re-verificar que master compila:
```bash
go build -tags goolm ./... && go test -tags goolm ./...
go build ${BUILD_TAG:+-tags $BUILD_TAG} ./... && go test ${BUILD_TAG:+-tags $BUILD_TAG} ./...
```
Si falla después de un merge, PARAR e informar — no continuar con más merges.
@@ -243,7 +275,7 @@ Ejecutar: git push
## Notas importantes
- **Siempre compilar con `-tags goolm`**
- **Build tag Go**: detectar del proyecto en Fase 3 (ver "Detección del build tag"). Si el proyecto no usa build tags, omitir `-tags` en todos los comandos
- **Siempre usar `dangerouslyDisableSandbox: true`** en todas las llamadas Bash de los agentes paralelos
- **Nunca hacer push automáticamente** — el usuario decide cuándo pushear
- **Si hay merge conflicts**, parar y pedir intervención manual
@@ -1,13 +1,22 @@
#!/bin/bash
# verify-worktree.sh — Verifica build, tests y cierre de issue en un worktree
#
# Uso: ./verify-worktree.sh <worktree-path>
# Ejemplo: ./verify-worktree.sh worktrees/0026-split-runtime
# Uso: ./verify-worktree.sh <worktree-path> [build-tag]
# Ejemplos:
# ./verify-worktree.sh worktrees/0026-split-runtime fts5
# BUILD_TAG=goolm ./verify-worktree.sh worktrees/0026-split-runtime
# ./verify-worktree.sh worktrees/0026-split-runtime # sin -tags
#
# El build tag se puede pasar como:
# - segundo argumento posicional
# - variable de entorno BUILD_TAG
# - auto-detección via //go:build en los .go del worktree
# - si sigue vacío, ejecuta sin -tags
#
# Checks:
# 1. El worktree existe y tiene commits propios
# 2. go build -tags goolm ./... compila
# 3. go test -tags goolm ./... pasa
# 2. go build ${BUILD_TAG:+-tags $BUILD_TAG} ./... compila
# 3. go test ${BUILD_TAG:+-tags $BUILD_TAG} ./... pasa
# 4. El issue fue movido a completed/
#
# Exit codes:
@@ -22,11 +31,12 @@ set -euo pipefail
if [ $# -lt 1 ]; then
echo "ERROR: se necesita el path del worktree"
echo "Uso: $0 <worktree-path>"
echo "Uso: $0 <worktree-path> [build-tag]"
exit 1
fi
WORKTREE="$1"
BUILD_TAG="${2:-${BUILD_TAG:-}}"
# Resolver path absoluto
if [[ "$WORKTREE" != /* ]]; then
@@ -42,6 +52,25 @@ fi
SLUG="$(basename "$WORKTREE")"
echo "=== Verificando: ${SLUG} ==="
# Auto-detectar build tag si no se pasó
if [ -z "$BUILD_TAG" ]; then
AUTO_TAG=$(grep -rh "^//go:build " --include="*.go" "$WORKTREE" 2>/dev/null \
| sed -E 's|^//go:build ([a-zA-Z0-9_]+).*|\1|' \
| sort -u \
| head -1 || true)
if [ -n "$AUTO_TAG" ]; then
BUILD_TAG="$AUTO_TAG"
echo "INFO: build tag auto-detectado: ${BUILD_TAG}"
else
echo "INFO: sin build tag (go build/test sin -tags)"
fi
fi
TAG_FLAG=""
if [ -n "$BUILD_TAG" ]; then
TAG_FLAG="-tags $BUILD_TAG"
fi
# 1. Verificar commits propios
echo "--- Commits propios ---"
COMMIT_COUNT=$(cd "$WORKTREE" && git log master..HEAD --oneline 2>/dev/null | wc -l)
@@ -54,8 +83,8 @@ cd "$WORKTREE" && git log master..HEAD --oneline
# 2. Build
echo ""
echo "--- Build ---"
if (cd "$WORKTREE" && go build -tags goolm ./... 2>&1); then
echo "--- Build (go build $TAG_FLAG ./...) ---"
if (cd "$WORKTREE" && go build $TAG_FLAG ./... 2>&1); then
echo "OK: build exitoso"
else
echo "FAIL: build falló"
@@ -64,8 +93,8 @@ fi
# 3. Tests
echo ""
echo "--- Tests ---"
if (cd "$WORKTREE" && go test -tags goolm ./... 2>&1); then
echo "--- Tests (go test $TAG_FLAG ./...) ---"
if (cd "$WORKTREE" && go test $TAG_FLAG ./... 2>&1); then
echo "OK: tests pasaron"
else
echo "FAIL: tests fallaron"
@@ -81,7 +110,6 @@ if [ "$COMPLETED_FILES" -gt 0 ]; then
cd "$WORKTREE" && git diff --name-only master -- dev/issues/completed/
else
echo "WARN: no se detectó issue movido a completed/ (verificar manualmente)"
# No es un error fatal — puede que el issue no siga la convención exacta
fi
echo ""