diff --git a/.claude/hooks/goal_phase_active.sh b/.claude/hooks/goal_phase_active.sh index 5d61fdc..0f8c2a3 100755 --- a/.claude/hooks/goal_phase_active.sh +++ b/.claude/hooks/goal_phase_active.sh @@ -14,6 +14,7 @@ F="$HOME/.claude/goals/${SID}.json" [ -f "$F" ] || exit 0 GOAL=$(jq -r '.goal // ""' "$F" 2>/dev/null) [ -z "$GOAL" ] && exit 0 +CUR=$(jq -r '.phase // ""' "$F" 2>/dev/null) TOOL=$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null) [ -z "$TOOL" ] && exit 0 @@ -23,7 +24,13 @@ case "$TOOL" in Read|Grep|Glob|NotebookRead|WebFetch|WebSearch|ToolSearch) PHASE=investigando ;; 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) PHASE=haciendo ;; Bash) @@ -41,9 +48,11 @@ case "$TOOL" in PHASE=investigando ;; mcp__registry__fn_run) PHASE=haciendo ;; + TodoWrite|ExitPlanMode|EnterPlanMode|Plan) + PHASE=planificando ;; *) - # Herramientas que no representan un cambio de actividad (TodoWrite, - # AskUserQuestion, etc.): no tocar la fase. + # Herramientas que no representan un cambio de actividad (AskUserQuestion, + # etc.): no tocar la fase. exit 0 ;; esac [ -z "$PHASE" ] && exit 0