feat(statusline): triggers para planificando y puliendo

Los dos estados activos que no tenian disparador ahora se asignan de forma
determinista en el PostToolUse:
- planificando: al usar TodoWrite / ExitPlanMode / EnterPlanMode.
- puliendo: al editar (Edit/Write/MultiEdit/NotebookEdit) cuando la fase actual
  ya era testeando o puliendo, es decir retoques finales sobre algo ya probado.
  Una edicion normal (sin testeo previo) sigue siendo haciendo; volver a testear
  saca de puliendo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 15:31:54 +02:00
parent 3ae472d1f3
commit adfb45015e
+12 -3
View File
@@ -14,6 +14,7 @@ F="$HOME/.claude/goals/${SID}.json"
[ -f "$F" ] || exit 0 [ -f "$F" ] || exit 0
GOAL=$(jq -r '.goal // ""' "$F" 2>/dev/null) GOAL=$(jq -r '.goal // ""' "$F" 2>/dev/null)
[ -z "$GOAL" ] && exit 0 [ -z "$GOAL" ] && exit 0
CUR=$(jq -r '.phase // ""' "$F" 2>/dev/null)
TOOL=$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null) TOOL=$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null)
[ -z "$TOOL" ] && exit 0 [ -z "$TOOL" ] && exit 0
@@ -23,7 +24,13 @@ case "$TOOL" in
Read|Grep|Glob|NotebookRead|WebFetch|WebSearch|ToolSearch) Read|Grep|Glob|NotebookRead|WebFetch|WebSearch|ToolSearch)
PHASE=investigando ;; PHASE=investigando ;;
Edit|Write|MultiEdit|NotebookEdit) Edit|Write|MultiEdit|NotebookEdit)
PHASE=haciendo ;; # Editar tras haber testeado = retoques finales -> puliendo. Si no, es
# implementacion normal -> haciendo.
case "$CUR" in
testeando|puliendo) PHASE=puliendo ;;
*) PHASE=haciendo ;;
esac
;;
Task|Agent|Workflow) Task|Agent|Workflow)
PHASE=haciendo ;; PHASE=haciendo ;;
Bash) Bash)
@@ -41,9 +48,11 @@ case "$TOOL" in
PHASE=investigando ;; PHASE=investigando ;;
mcp__registry__fn_run) mcp__registry__fn_run)
PHASE=haciendo ;; PHASE=haciendo ;;
TodoWrite|ExitPlanMode|EnterPlanMode|Plan)
PHASE=planificando ;;
*) *)
# Herramientas que no representan un cambio de actividad (TodoWrite, # Herramientas que no representan un cambio de actividad (AskUserQuestion,
# AskUserQuestion, etc.): no tocar la fase. # etc.): no tocar la fase.
exit 0 ;; exit 0 ;;
esac esac
[ -z "$PHASE" ] && exit 0 [ -z "$PHASE" ] && exit 0