#!/bin/bash # PostToolUse(Write|Edit): remind to update wiki/log.md and PROGRESS.md # when wiki pages or Output/reports/ADRs are modified json=$(cat) path=$(printf '%s' "$json" | grep -o '"file_path"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*"file_path"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/') if [ -z "$path" ]; then exit 0 fi path_norm=$(printf '%s' "$path" | tr '\\' '/') # Skip the log/index themselves — they ARE the trackers case "$path_norm" in */wiki/log.md|*/wiki/index.md|*/PROGRESS.md|*/PLAN.md) exit 0 ;; esac case "$path_norm" in */wiki/*|*/Output/reports/*|*/Output/guides/*) fname=$(basename "$path_norm") # Minimal JSON — no escaping of special chars needed since message is literal printf '{"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"Reminder: %s 변경됨. wiki/log.md 기록 + PROGRESS.md 갱신 여부 확인."}}\n' "$fname" exit 0 ;; esac exit 0