mr4/knowledge-graph-preview
0
1{
2 "hooks": {
3 "PostToolUse": [
4 {
5 "matcher": "Bash",
6 "hooks": [
7 {
8 "type": "command",
9 "command": "printf '%s' \"$TOOL_INPUT\" | grep -qE 'git\\s+(commit|merge|cherry-pick|rebase)' && [ -f .understand-anything/config.json ] && grep -q '\"autoUpdate\".*true' .understand-anything/config.json && [ -f .understand-anything/knowledge-graph.json ] && echo \"[understand-anything] Commit detected with auto-update enabled. Read .understand-anything/hooks/auto-update-prompt.md and execute its instructions to incrementally update the knowledge graph.\" || true"
10 }
11 ]
12 }
13 ],
14 "SessionStart": [
15 {
16 "hooks": [
17 {
18 "type": "command",
19 "command": "[ -f .understand-anything/config.json ] && grep -q '\"autoUpdate\".*true' .understand-anything/config.json && [ -f .understand-anything/meta.json ] && [ -f .understand-anything/knowledge-graph.json ] && [ \"$(node -p \"JSON.parse(require('fs').readFileSync('.understand-anything/meta.json','utf8')).gitCommitHash\")\" != \"$(git rev-parse HEAD 2>/dev/null)\" ] && echo \"[understand-anything] Knowledge graph is stale. Read .understand-anything/hooks/auto-update-prompt.md and execute its instructions to update the graph.\" || true"
20 }
21 ]
22 }
23 ]
24 }
25}
26 