feat: add commit-docs-reminder hook to enforce checklist before commits

Adds a PreToolUse Bash hook that reminds AI agents to verify
status-update-checklist.md before running git commit. Also adds
the corresponding constraint to RULES.md section 3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
olekhondera
2026-02-15 07:44:06 +02:00
parent 432313ebcd
commit d9b2b8ffc8
4 changed files with 45 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Remind Claude to check status-update-checklist before committing
# Event: PreToolUse | Matcher: Bash
# Exit 0 = allow (non-blocking reminder)
INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
if [ -z "$COMMAND" ]; then
exit 0
fi
# Only trigger on git commit commands (not git add, git status, etc.)
if echo "$COMMAND" | grep -qE 'git\s+commit'; then
echo "REMINDER: Before committing, verify that .claude/status-update-checklist.md was followed." >&2
echo "If this commit changes project status, audit findings, or phase progress," >&2
echo "you MUST synchronize: RULES.md, RECOMMENDATIONS.md, README.md, DOCS.md." >&2
echo "If this is a code-only change with no status impact, proceed." >&2
fi
exit 0