|
1 | 1 | { |
| 2 | + "version": 1, |
2 | 3 | "hooks": { |
3 | 4 | "sessionStart": [ |
4 | 5 | { |
5 | | - "command": "node .cursor/hooks/session-start.js", |
6 | | - "event": "sessionStart", |
7 | | - "description": "Display Salesforce project context: detected org, scratch orgs, CLI version" |
8 | | - } |
9 | | - ], |
10 | | - "sessionEnd": [ |
| 6 | + "command": "node scripts/hooks/session-start.js", |
| 7 | + "timeout": 15 |
| 8 | + }, |
11 | 9 | { |
12 | | - "command": "node .cursor/hooks/session-end.js", |
13 | | - "event": "sessionEnd", |
14 | | - "description": "Persist session state and evaluate patterns" |
| 10 | + "command": "node scripts/hooks/check-platform-docs-age.js", |
| 11 | + "timeout": 5 |
15 | 12 | } |
16 | 13 | ], |
17 | 14 | "beforeShellExecution": [ |
18 | 15 | { |
19 | 16 | "command": "npx block-no-verify@1.1.2", |
20 | | - "event": "beforeShellExecution", |
21 | | - "description": "Block git hook-bypass flag to protect pre-commit, commit-msg, and pre-push hooks from being skipped" |
| 17 | + "failClosed": true |
22 | 18 | }, |
23 | 19 | { |
24 | | - "command": "node .cursor/hooks/before-shell-execution.js", |
25 | | - "event": "beforeShellExecution", |
26 | | - "description": "Validate SF CLI commands, SFDX deprecation warnings, git push reminder" |
27 | | - } |
28 | | - ], |
29 | | - "afterShellExecution": [ |
| 20 | + "command": "node scripts/hooks/pre-tool-use.js", |
| 21 | + "timeout": 10 |
| 22 | + }, |
30 | 23 | { |
31 | | - "command": "node .cursor/hooks/after-shell-execution.js", |
32 | | - "event": "afterShellExecution", |
33 | | - "description": "PR URL logging, build/deploy completion notice" |
34 | | - } |
35 | | - ], |
36 | | - "afterFileEdit": [ |
| 24 | + "command": "node scripts/hooks/sfdx-validate.js", |
| 25 | + "timeout": 10 |
| 26 | + }, |
37 | 27 | { |
38 | | - "command": "node .cursor/hooks/after-file-edit.js", |
39 | | - "event": "afterFileEdit", |
40 | | - "description": "Quality gate, governor checks, console.log warning, auto-format" |
41 | | - } |
42 | | - ], |
43 | | - "beforeReadFile": [ |
| 28 | + "command": "node scripts/hooks/pre-bash-git-push-reminder.js", |
| 29 | + "timeout": 5 |
| 30 | + }, |
44 | 31 | { |
45 | | - "command": "node .cursor/hooks/before-read-file.js", |
46 | | - "event": "beforeReadFile", |
47 | | - "description": "Warn when reading sensitive files (.env, .key, .pem)" |
48 | | - } |
49 | | - ], |
50 | | - "beforeSubmitPrompt": [ |
| 32 | + "command": "node scripts/hooks/sfdx-scanner-check.js", |
| 33 | + "timeout": 45 |
| 34 | + }, |
51 | 35 | { |
52 | | - "command": "node .cursor/hooks/before-submit-prompt.js", |
53 | | - "event": "beforeSubmitPrompt", |
54 | | - "description": "Detect secrets in prompts (sk-, ghp_, AKIA patterns)" |
| 36 | + "command": "node scripts/hooks/pre-bash-tmux-reminder.js", |
| 37 | + "timeout": 5 |
55 | 38 | } |
56 | 39 | ], |
57 | | - "subagentStart": [ |
| 40 | + "preToolUse": [ |
| 41 | + { |
| 42 | + "command": "node scripts/hooks/mcp-health-check.js", |
| 43 | + "failClosed": true |
| 44 | + }, |
| 45 | + { |
| 46 | + "command": "bash scripts/hooks/learning-observe.sh", |
| 47 | + "timeout": 10 |
| 48 | + }, |
58 | 49 | { |
59 | | - "command": "node .cursor/hooks/subagent-start.js", |
60 | | - "event": "subagentStart", |
61 | | - "description": "Log agent spawning for observability" |
| 50 | + "command": "node scripts/hooks/doc-file-warning.js", |
| 51 | + "timeout": 5, |
| 52 | + "matcher": "Write" |
| 53 | + }, |
| 54 | + { |
| 55 | + "command": "node scripts/hooks/suggest-compact.js", |
| 56 | + "timeout": 5, |
| 57 | + "matcher": "Write" |
62 | 58 | } |
63 | 59 | ], |
64 | | - "subagentStop": [ |
| 60 | + "postToolUse": [ |
65 | 61 | { |
66 | | - "command": "node .cursor/hooks/subagent-stop.js", |
67 | | - "event": "subagentStop", |
68 | | - "description": "Log agent completion" |
| 62 | + "command": "bash scripts/hooks/learning-observe.sh", |
| 63 | + "timeout": 10 |
69 | 64 | } |
70 | 65 | ], |
71 | | - "afterTabFileEdit": [ |
| 66 | + "afterFileEdit": [ |
72 | 67 | { |
73 | | - "command": "node .cursor/hooks/after-tab-file-edit.js", |
74 | | - "event": "afterTabFileEdit", |
75 | | - "description": "Auto-format Tab edits" |
| 68 | + "command": "node scripts/hooks/post-write.js", |
| 69 | + "timeout": 10 |
| 70 | + }, |
| 71 | + { |
| 72 | + "command": "node scripts/hooks/quality-gate.js", |
| 73 | + "timeout": 15 |
| 74 | + }, |
| 75 | + { |
| 76 | + "command": "node scripts/hooks/governor-check.js", |
| 77 | + "timeout": 10 |
| 78 | + }, |
| 79 | + { |
| 80 | + "command": "node scripts/hooks/post-edit-console-warn.js", |
| 81 | + "timeout": 10 |
| 82 | + }, |
| 83 | + { |
| 84 | + "command": "node scripts/hooks/post-edit-format.js", |
| 85 | + "timeout": 15 |
| 86 | + }, |
| 87 | + { |
| 88 | + "command": "node scripts/hooks/post-edit-typecheck.js", |
| 89 | + "timeout": 30 |
76 | 90 | } |
77 | 91 | ], |
78 | | - "beforeMCPExecution": [ |
| 92 | + "afterShellExecution": [ |
| 93 | + { |
| 94 | + "command": "node scripts/hooks/post-bash-build-complete.js", |
| 95 | + "timeout": 10 |
| 96 | + }, |
79 | 97 | { |
80 | | - "command": "node .cursor/hooks/before-mcp-execution.js", |
81 | | - "event": "beforeMCPExecution", |
82 | | - "description": "Log MCP server/tool invocations for observability" |
| 98 | + "command": "node scripts/hooks/post-bash-pr-created.js", |
| 99 | + "timeout": 10 |
83 | 100 | } |
84 | 101 | ], |
85 | | - "afterMCPExecution": [ |
| 102 | + "postToolUseFailure": [ |
86 | 103 | { |
87 | | - "command": "node .cursor/hooks/after-mcp-execution.js", |
88 | | - "event": "afterMCPExecution", |
89 | | - "description": "Log MCP result status (OK/FAILED) for observability" |
| 104 | + "command": "node scripts/hooks/mcp-health-check.js", |
| 105 | + "failClosed": true |
90 | 106 | } |
91 | 107 | ], |
92 | 108 | "preCompact": [ |
93 | 109 | { |
94 | | - "command": "node .cursor/hooks/pre-compact.js", |
95 | | - "event": "preCompact", |
96 | | - "description": "Save state before context compaction" |
| 110 | + "command": "node scripts/hooks/pre-compact.js", |
| 111 | + "timeout": 10 |
97 | 112 | } |
98 | 113 | ], |
99 | 114 | "stop": [ |
100 | 115 | { |
101 | | - "command": "node .cursor/hooks/stop.js", |
102 | | - "event": "stop", |
103 | | - "description": "Console.log audit, session summary, cost tracking" |
| 116 | + "command": "node scripts/hooks/stop-hook.js", |
| 117 | + "timeout": 10, |
| 118 | + "loop_limit": 3 |
| 119 | + }, |
| 120 | + { |
| 121 | + "command": "node scripts/hooks/check-console-log.js", |
| 122 | + "timeout": 10, |
| 123 | + "loop_limit": 3 |
| 124 | + }, |
| 125 | + { |
| 126 | + "command": "node scripts/hooks/session-end.js", |
| 127 | + "timeout": 15, |
| 128 | + "loop_limit": 3 |
| 129 | + }, |
| 130 | + { |
| 131 | + "command": "node scripts/hooks/cost-tracker.js", |
| 132 | + "timeout": 10, |
| 133 | + "loop_limit": 3 |
| 134 | + }, |
| 135 | + { |
| 136 | + "command": "node scripts/hooks/evaluate-session.js", |
| 137 | + "timeout": 10, |
| 138 | + "loop_limit": 3 |
| 139 | + } |
| 140 | + ], |
| 141 | + "sessionEnd": [ |
| 142 | + { |
| 143 | + "command": "node scripts/hooks/session-end-marker.js", |
| 144 | + "timeout": 10 |
104 | 145 | } |
105 | 146 | ] |
106 | 147 | } |
|
0 commit comments