#!/usr/bin/env bash # Stop hook: remind the agent to run /handoff if PROGRESS.md / PLAN.md / today's # history file look stale. Informational only — never blocks. set -e today=$(date +%Y-%m-%d) msg="" if [ ! -f PROGRESS.md ]; then msg="${msg}\n- PROGRESS.md missing"; fi if [ ! -f PLAN.md ]; then msg="${msg}\n- PLAN.md missing"; fi if ! ls "docs/history/${today}_"*.md >/dev/null 2>&1; then msg="${msg}\n- 오늘 날짜의 history 파일이 없습니다 (${today})" fi if [ -n "$msg" ]; then jq -n --arg m "작업 종료 전 확인:${msg}\n→ /handoff 실행 권장" '{ hookSpecificOutput: { hookEventName: "Stop", additionalContext: $m } }' fi