diff --git a/.claude/hooks/doc-audit-trigger.sh b/.claude/hooks/doc-audit-trigger.sh new file mode 100755 index 0000000..68691f4 --- /dev/null +++ b/.claude/hooks/doc-audit-trigger.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# PostToolUse hook: detects the documentation audit warning from prek post-commit +# hooks and injects a prompt for Claude to invoke the readme-documentarian agent. +set -euo pipefail + +input=$(cat) + +stdout=$(echo "$input" | python3 -c " +import sys, json +try: + d = json.load(sys.stdin) + resp = d.get('tool_response', {}) + if isinstance(resp, dict): + print(resp.get('stdout', '')) + else: + print(str(resp)) +except Exception: + pass +") + +if echo "$stdout" | grep -q '\[Documentation Audit\].*documentation was not updated'; then + printf '{"additionalContext": "The post-commit documentation audit flagged that code changed but README.md was not updated. Invoke the readme-documentarian agent now to review the recent changes and update the documentation."}\n' +fi diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..345a97b --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "hooks": { + "PostToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": ".claude/hooks/doc-audit-trigger.sh" + } + ] + } + ] + } +}