@paulduvall/claude-dev-toolkit 0.0.1-alpha.2 → 0.0.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +44 -6
  2. package/commands/active/xarchitecture.md +393 -0
  3. package/commands/active/xconfig.md +127 -0
  4. package/commands/active/xdebug.md +130 -0
  5. package/commands/active/xdocs.md +178 -0
  6. package/commands/active/xgit.md +149 -0
  7. package/commands/active/xpipeline.md +152 -0
  8. package/commands/active/xquality.md +96 -0
  9. package/commands/active/xrefactor.md +198 -0
  10. package/commands/active/xrelease.md +142 -0
  11. package/commands/active/xsecurity.md +92 -0
  12. package/commands/active/xspec.md +174 -0
  13. package/commands/active/xtdd.md +151 -0
  14. package/commands/active/xtest.md +89 -0
  15. package/commands/experiments/xact.md +742 -0
  16. package/commands/experiments/xanalytics.md +113 -0
  17. package/commands/experiments/xanalyze.md +70 -0
  18. package/commands/experiments/xapi.md +161 -0
  19. package/commands/experiments/xatomic.md +112 -0
  20. package/commands/experiments/xaws.md +85 -0
  21. package/commands/experiments/xcicd.md +337 -0
  22. package/commands/experiments/xcommit.md +122 -0
  23. package/commands/experiments/xcompliance.md +182 -0
  24. package/commands/experiments/xconstraints.md +89 -0
  25. package/commands/experiments/xcoverage.md +90 -0
  26. package/commands/experiments/xdb.md +102 -0
  27. package/commands/experiments/xdesign.md +121 -0
  28. package/commands/experiments/xevaluate.md +111 -0
  29. package/commands/experiments/xfootnote.md +12 -0
  30. package/commands/experiments/xgenerate.md +117 -0
  31. package/commands/experiments/xgovernance.md +149 -0
  32. package/commands/experiments/xgreen.md +66 -0
  33. package/commands/experiments/xiac.md +118 -0
  34. package/commands/experiments/xincident.md +137 -0
  35. package/commands/experiments/xinfra.md +115 -0
  36. package/commands/experiments/xknowledge.md +115 -0
  37. package/commands/experiments/xmaturity.md +120 -0
  38. package/commands/experiments/xmetrics.md +118 -0
  39. package/commands/experiments/xmonitoring.md +128 -0
  40. package/commands/experiments/xnew.md +898 -0
  41. package/commands/experiments/xobservable.md +114 -0
  42. package/commands/experiments/xoidc.md +165 -0
  43. package/commands/experiments/xoptimize.md +115 -0
  44. package/commands/experiments/xperformance.md +112 -0
  45. package/commands/experiments/xplanning.md +131 -0
  46. package/commands/experiments/xpolicy.md +115 -0
  47. package/commands/experiments/xproduct.md +98 -0
  48. package/commands/experiments/xreadiness.md +75 -0
  49. package/commands/experiments/xred.md +55 -0
  50. package/commands/experiments/xrisk.md +128 -0
  51. package/commands/experiments/xrules.md +124 -0
  52. package/commands/experiments/xsandbox.md +120 -0
  53. package/commands/experiments/xscan.md +102 -0
  54. package/commands/experiments/xsetup.md +123 -0
  55. package/commands/experiments/xtemplate.md +116 -0
  56. package/commands/experiments/xtrace.md +212 -0
  57. package/commands/experiments/xux.md +171 -0
  58. package/commands/experiments/xvalidate.md +104 -0
  59. package/commands/experiments/xworkflow.md +113 -0
  60. package/hooks/README.md +231 -0
  61. package/hooks/file-logger.sh +98 -0
  62. package/hooks/lib/argument-parser.sh +422 -0
  63. package/hooks/lib/config-constants.sh +230 -0
  64. package/hooks/lib/context-manager.sh +549 -0
  65. package/hooks/lib/error-handler.sh +412 -0
  66. package/hooks/lib/execution-engine.sh +627 -0
  67. package/hooks/lib/file-utils.sh +375 -0
  68. package/hooks/lib/subagent-discovery.sh +465 -0
  69. package/hooks/lib/subagent-validator.sh +597 -0
  70. package/hooks/on-error-debug.sh +221 -0
  71. package/hooks/pre-commit-quality.sh +204 -0
  72. package/hooks/pre-write-security.sh +107 -0
  73. package/hooks/prevent-credential-exposure.sh +265 -0
  74. package/hooks/subagent-trigger-simple.sh +193 -0
  75. package/hooks/subagent-trigger.sh +253 -0
  76. package/lib/hook-installer-core.js +2 -2
  77. package/package.json +3 -1
  78. package/templates/README.md +100 -0
  79. package/templates/basic-settings.json +30 -0
  80. package/templates/comprehensive-settings.json +206 -0
  81. package/templates/hybrid-hook-config.yaml +133 -0
  82. package/templates/security-focused-settings.json +62 -0
  83. package/templates/subagent-hooks.yaml +188 -0
@@ -0,0 +1,221 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Claude Code Hook: Error Handling Trigger
5
+ #
6
+ # Purpose: Lightweight trigger for automatic debugging assistance on errors
7
+ # Trigger: OnError events or manual invocation during debugging sessions
8
+ # Approach: Capture error context and delegate to debug-specialist subagent
9
+ #
10
+ # This hook provides immediate debugging help by gathering error context
11
+ # and connecting users with the debug-specialist subagent.
12
+
13
+ ##################################
14
+ # Load Shared Libraries
15
+ ##################################
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ LIB_DIR="$SCRIPT_DIR/lib"
18
+
19
+ # Load essential modules for error context gathering
20
+ source "$LIB_DIR/config-constants.sh"
21
+ source "$LIB_DIR/context-manager.sh"
22
+ source "$LIB_DIR/error-handler.sh"
23
+ source "$LIB_DIR/file-utils.sh"
24
+
25
+ ##################################
26
+ # Error Context Gathering
27
+ ##################################
28
+ gather_error_context() {
29
+ local error_type="${1:-unknown}"
30
+ local error_message="${2:-No error message provided}"
31
+ local failed_command="${3:-unknown}"
32
+
33
+ log_info "Gathering error context for debugging assistance"
34
+
35
+ # Capture comprehensive error context
36
+ local context_data
37
+ context_data=$(cat <<EOF
38
+ {
39
+ "trigger": "on_error_debug",
40
+ "error_info": {
41
+ "type": "$error_type",
42
+ "message": "$error_message",
43
+ "failed_command": "$failed_command",
44
+ "timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
45
+ },
46
+ "environment": {
47
+ "tool": "${CLAUDE_TOOL:-unknown}",
48
+ "file": "${CLAUDE_FILE:-none}",
49
+ "working_directory": "$(pwd)",
50
+ "user": "$USER",
51
+ "shell": "${SHELL##*/}",
52
+ "session_id": "${CLAUDE_SESSION_ID:-$$}"
53
+ },
54
+ "project_context": {
55
+ "git_branch": "$(git branch --show-current 2>/dev/null || echo 'not-in-git')",
56
+ "git_status": "$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ') modified files",
57
+ "recent_files": $(find . -maxdepth 2 -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.go" -o -name "*.java" -o -name "*.md" | head -5 | jq -R -s 'split("\n")[:-1]')
58
+ },
59
+ "system_context": {
60
+ "os": "$(uname -s)",
61
+ "hostname": "$(hostname)",
62
+ "processes": "$(ps aux | wc -l | tr -d ' ') running processes"
63
+ }
64
+ }
65
+ EOF
66
+ )
67
+
68
+ echo "$context_data"
69
+ }
70
+
71
+ ##################################
72
+ # System Diagnostics
73
+ ##################################
74
+ gather_diagnostic_info() {
75
+ local diagnostic_info=""
76
+
77
+ # Check recent error logs if available
78
+ if [[ -f "$LOG_FILE" ]]; then
79
+ local recent_errors
80
+ recent_errors=$(tail -20 "$LOG_FILE" 2>/dev/null | grep -i error || echo "No recent errors in log")
81
+ diagnostic_info+="\nRecent log errors:\n$recent_errors"
82
+ fi
83
+
84
+ # Check system resources
85
+ if command -v df >/dev/null; then
86
+ local disk_usage
87
+ disk_usage=$(df -h . | tail -1 | awk '{print "Disk: " $4 " available"}')
88
+ diagnostic_info+="\n\nSystem resources:\n$disk_usage"
89
+ fi
90
+
91
+ # Check for common environment issues
92
+ if [[ -f "package.json" ]] && command -v npm >/dev/null; then
93
+ diagnostic_info+="\nNode.js project detected"
94
+ diagnostic_info+="\nNPM version: $(npm --version 2>/dev/null || echo 'npm not available')"
95
+ fi
96
+
97
+ if [[ -f "requirements.txt" ]] && command -v python >/dev/null; then
98
+ diagnostic_info+="\nPython project detected"
99
+ diagnostic_info+="\nPython version: $(python --version 2>/dev/null || echo 'python not available')"
100
+ fi
101
+
102
+ echo "$diagnostic_info"
103
+ }
104
+
105
+ ##################################
106
+ # Subagent Delegation
107
+ ##################################
108
+ delegate_to_debug_subagent() {
109
+ local context="$1"
110
+ local diagnostics="$2"
111
+ local error_message="$3"
112
+
113
+ log_info "Delegating error analysis to debug-specialist subagent"
114
+
115
+ echo "🐛 ERROR DETECTED: Automatic debugging assistance activated"
116
+ echo ""
117
+ echo "Error Details:"
118
+ echo " Message: $error_message"
119
+ echo " Tool: ${CLAUDE_TOOL:-unknown}"
120
+ echo " File: ${CLAUDE_FILE:-none}"
121
+ echo " Time: $(date)"
122
+ echo ""
123
+
124
+ if [[ -n "$diagnostics" ]]; then
125
+ echo "System Diagnostics:"
126
+ echo "$diagnostics"
127
+ echo ""
128
+ fi
129
+
130
+ echo "Context for debug-specialist subagent:"
131
+ echo "$context" | jq . 2>/dev/null || echo "$context"
132
+ echo ""
133
+ echo "🔍 DEBUG REQUEST:"
134
+ echo "Please analyze the error above and provide:"
135
+ echo "- Root cause analysis"
136
+ echo "- Step-by-step troubleshooting approach"
137
+ echo "- Specific commands or fixes to try"
138
+ echo "- Prevention strategies for similar issues"
139
+ echo ""
140
+ echo "Type your analysis or questions about this error."
141
+ }
142
+
143
+ ##################################
144
+ # Quick Error Classification
145
+ ##################################
146
+ classify_error() {
147
+ local error_message="$1"
148
+ local error_type="general"
149
+
150
+ # Basic error pattern matching for better context
151
+ case "$error_message" in
152
+ *"permission denied"*|*"Permission denied"*)
153
+ error_type="permission_error"
154
+ ;;
155
+ *"command not found"*|*"Command not found"*)
156
+ error_type="command_not_found"
157
+ ;;
158
+ *"No such file"*|*"cannot find"*)
159
+ error_type="file_not_found"
160
+ ;;
161
+ *"syntax error"*|*"Syntax error"*)
162
+ error_type="syntax_error"
163
+ ;;
164
+ *"connection"*|*"network"*|*"timeout"*)
165
+ error_type="network_error"
166
+ ;;
167
+ *"import"*|*"module"*|*"package"*)
168
+ error_type="dependency_error"
169
+ ;;
170
+ *)
171
+ error_type="general_error"
172
+ ;;
173
+ esac
174
+
175
+ echo "$error_type"
176
+ }
177
+
178
+ ##################################
179
+ # Main Hook Logic
180
+ ##################################
181
+ main() {
182
+ # Initialize error handling (ironic for an error hook, but important!)
183
+ initialize_error_handling || {
184
+ echo "ERROR: Failed to initialize error handling in error hook" >&2
185
+ exit 1
186
+ }
187
+
188
+ local error_message="${1:-Unknown error occurred}"
189
+ local failed_command="${2:-unknown}"
190
+
191
+ log_info "Error hook triggered: $error_message"
192
+
193
+ # Classify the error type
194
+ local error_type
195
+ error_type=$(classify_error "$error_message")
196
+
197
+ # Gather comprehensive error context
198
+ local context
199
+ context=$(gather_error_context "$error_type" "$error_message" "$failed_command")
200
+
201
+ # Gather additional diagnostic information
202
+ local diagnostics
203
+ diagnostics=$(gather_diagnostic_info)
204
+
205
+ # Delegate to debug-specialist subagent
206
+ delegate_to_debug_subagent "$context" "$diagnostics" "$error_message"
207
+
208
+ log_info "Debug delegation completed for error: $error_type"
209
+ }
210
+
211
+ ##################################
212
+ # Execute Hook
213
+ ##################################
214
+ # Handle both direct invocation and error trap scenarios
215
+ if [[ "${1:-}" == "--trap" ]]; then
216
+ # Called from an error trap
217
+ main "Script error at line ${2:-unknown}" "${3:-unknown command}"
218
+ else
219
+ # Called directly with error information
220
+ main "$@"
221
+ fi
@@ -0,0 +1,204 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Claude Code Hook: Pre-Commit Quality Check
5
+ #
6
+ # Purpose: Lightweight trigger for code quality validation before git commits
7
+ # Trigger: Custom hook for pre-commit operations
8
+ # Approach: Quick validation with style-enforcer subagent delegation
9
+ #
10
+ # This hook ensures code quality by leveraging AI analysis rather than
11
+ # running multiple linting tools manually.
12
+
13
+ ##################################
14
+ # Load Shared Libraries
15
+ ##################################
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ LIB_DIR="$SCRIPT_DIR/lib"
18
+
19
+ # Load essential modules for lightweight operation
20
+ source "$LIB_DIR/config-constants.sh"
21
+ source "$LIB_DIR/context-manager.sh"
22
+ source "$LIB_DIR/error-handler.sh"
23
+ source "$LIB_DIR/file-utils.sh"
24
+
25
+ ##################################
26
+ # Git Context Analysis
27
+ ##################################
28
+ analyze_staged_changes() {
29
+ log_info "Analyzing staged changes for quality check"
30
+
31
+ # Check if we're in a git repository
32
+ if ! git rev-parse --git-dir >/dev/null 2>&1; then
33
+ log_debug "Not in a git repository, skipping pre-commit quality check"
34
+ return 0
35
+ fi
36
+
37
+ # Get staged files
38
+ local staged_files
39
+ staged_files=$(git diff --cached --name-only 2>/dev/null || echo "")
40
+
41
+ if [[ -z "$staged_files" ]]; then
42
+ log_info "No staged changes found, skipping quality check"
43
+ return 0
44
+ fi
45
+
46
+ echo "$staged_files"
47
+ }
48
+
49
+ ##################################
50
+ # Quality Context Gathering
51
+ ##################################
52
+ gather_quality_context() {
53
+ local staged_files="$1"
54
+
55
+ # Create context for quality analysis
56
+ local context_data
57
+ context_data=$(cat <<EOF
58
+ {
59
+ "trigger": "pre_commit_quality",
60
+ "staged_files": [$(echo "$staged_files" | sed 's/.*/"&"/' | paste -sd ',' -)],
61
+ "git_info": {
62
+ "branch": "$(git branch --show-current 2>/dev/null || echo 'unknown')",
63
+ "commit_hash": "$(git rev-parse HEAD 2>/dev/null || echo 'initial')",
64
+ "status": "$(git status --porcelain --cached | wc -l | tr -d ' ') files staged"
65
+ },
66
+ "project_info": {
67
+ "working_directory": "$(pwd)",
68
+ "user": "$USER",
69
+ "timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
70
+ },
71
+ "file_analysis": {
72
+ "total_files": $(echo "$staged_files" | wc -l | tr -d ' '),
73
+ "file_types": $(echo "$staged_files" | sed 's/.*\.//' | sort | uniq -c | jq -R -s 'split("\n")[:-1] | map(split(" ")[-1]) | unique')
74
+ }
75
+ }
76
+ EOF
77
+ )
78
+
79
+ echo "$context_data"
80
+ }
81
+
82
+ ##################################
83
+ # Subagent Delegation
84
+ ##################################
85
+ delegate_to_quality_subagent() {
86
+ local context="$1"
87
+ local staged_files="$2"
88
+
89
+ log_info "Delegating quality analysis to style-enforcer subagent"
90
+
91
+ echo "📊 QUALITY CHECK: Analyzing staged changes before commit"
92
+ echo ""
93
+ echo "Staged files for analysis:"
94
+ echo "$staged_files" | sed 's/^/ - /'
95
+ echo ""
96
+ echo "Context for style-enforcer subagent:"
97
+ echo "$context" | jq . 2>/dev/null || echo "$context"
98
+ echo ""
99
+ echo "Please analyze the staged changes for:"
100
+ echo "- Code formatting and style consistency"
101
+ echo "- Import organization and unused imports"
102
+ echo "- Type annotations and documentation"
103
+ echo "- Best practices and code patterns"
104
+ echo "- Performance considerations"
105
+ echo ""
106
+ echo "Provide specific feedback or type 'approved' if quality standards are met."
107
+ }
108
+
109
+ ##################################
110
+ # Quick File Validation
111
+ ##################################
112
+ validate_basic_file_integrity() {
113
+ local staged_files="$1"
114
+
115
+ log_debug "Performing basic file integrity checks"
116
+
117
+ # Check for common issues that can be caught quickly
118
+ local issues=()
119
+
120
+ while IFS= read -r file; do
121
+ [[ -z "$file" ]] && continue
122
+
123
+ # Skip non-existent files (deletions)
124
+ [[ ! -f "$file" ]] && continue
125
+
126
+ # Check for basic syntax issues in common file types
127
+ case "$file" in
128
+ *.json)
129
+ if ! jq . "$file" >/dev/null 2>&1; then
130
+ issues+=("Invalid JSON syntax: $file")
131
+ fi
132
+ ;;
133
+ *.yml|*.yaml)
134
+ if command -v yq >/dev/null && ! yq . "$file" >/dev/null 2>&1; then
135
+ issues+=("Invalid YAML syntax: $file")
136
+ fi
137
+ ;;
138
+ *.sh)
139
+ if ! bash -n "$file" 2>/dev/null; then
140
+ issues+=("Invalid shell syntax: $file")
141
+ fi
142
+ ;;
143
+ esac
144
+
145
+ # Check for potential credential patterns (quick scan)
146
+ if grep -qE "(password|api_key|secret|token)\s*[:=]\s*['\"][^'\"]+['\"]" "$file" 2>/dev/null; then
147
+ issues+=("Potential credential exposure: $file")
148
+ fi
149
+
150
+ done <<< "$staged_files"
151
+
152
+ # Report immediate issues
153
+ if [[ ${#issues[@]} -gt 0 ]]; then
154
+ echo "⚠️ IMMEDIATE ISSUES FOUND:"
155
+ printf '%s\n' "${issues[@]}" | sed 's/^/ - /'
156
+ echo ""
157
+ echo "Please fix these issues before committing."
158
+ return 1
159
+ fi
160
+
161
+ return 0
162
+ }
163
+
164
+ ##################################
165
+ # Main Hook Logic
166
+ ##################################
167
+ main() {
168
+ # Initialize error handling
169
+ initialize_error_handling || {
170
+ echo "ERROR: Failed to initialize error handling" >&2
171
+ exit 1
172
+ }
173
+
174
+ log_info "Pre-commit quality check initiated"
175
+
176
+ # Analyze what's being committed
177
+ local staged_files
178
+ staged_files=$(analyze_staged_changes)
179
+
180
+ # Exit early if no staged changes
181
+ if [[ -z "$staged_files" ]]; then
182
+ exit 0
183
+ fi
184
+
185
+ # Perform quick validation checks
186
+ if ! validate_basic_file_integrity "$staged_files"; then
187
+ log_error "Basic file integrity checks failed"
188
+ exit 1
189
+ fi
190
+
191
+ # Gather context for subagent analysis
192
+ local context
193
+ context=$(gather_quality_context "$staged_files")
194
+
195
+ # Delegate to quality subagent for comprehensive analysis
196
+ delegate_to_quality_subagent "$context" "$staged_files"
197
+
198
+ log_info "Quality check delegation completed"
199
+ }
200
+
201
+ ##################################
202
+ # Execute Hook
203
+ ##################################
204
+ main "$@"
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Claude Code Hook: Pre-Write Security Check
5
+ #
6
+ # Purpose: Lightweight trigger for security scanning before file modifications
7
+ # Trigger: PreToolUse for Edit, Write, MultiEdit tools
8
+ # Approach: Gather context and delegate complex logic to security-auditor subagent
9
+ #
10
+ # This hook provides immediate security feedback by leveraging AI reasoning
11
+ # rather than complex bash pattern matching.
12
+
13
+ ##################################
14
+ # Load Shared Libraries
15
+ ##################################
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ LIB_DIR="$SCRIPT_DIR/lib"
18
+
19
+ # Load only essential modules for lightweight operation
20
+ source "$LIB_DIR/config-constants.sh"
21
+ source "$LIB_DIR/context-manager.sh"
22
+ source "$LIB_DIR/error-handler.sh"
23
+
24
+ ##################################
25
+ # Simple Context Gathering
26
+ ##################################
27
+ gather_security_context() {
28
+ local tool="${CLAUDE_TOOL:-unknown}"
29
+ local file="${CLAUDE_FILE:-none}"
30
+
31
+ log_info "Pre-write security check triggered for: $tool on $file"
32
+
33
+ # Create lightweight context for subagent
34
+ local context_data
35
+ context_data=$(cat <<EOF
36
+ {
37
+ "trigger": "pre_write_security",
38
+ "tool": "$tool",
39
+ "file": "$file",
40
+ "timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
41
+ "user": "$USER",
42
+ "working_directory": "$(pwd)",
43
+ "git_branch": "$(git branch --show-current 2>/dev/null || echo 'not-in-git')",
44
+ "session_id": "${CLAUDE_SESSION_ID:-$$}"
45
+ }
46
+ EOF
47
+ )
48
+
49
+ echo "$context_data"
50
+ }
51
+
52
+ ##################################
53
+ # Subagent Delegation
54
+ ##################################
55
+ delegate_to_security_subagent() {
56
+ local context="$1"
57
+
58
+ # Log the delegation
59
+ log_info "Delegating security analysis to security-auditor subagent"
60
+
61
+ # In the hybrid approach, we provide context and let Claude Code
62
+ # handle the subagent execution through its native mechanisms
63
+ echo "🔒 SECURITY CHECK: Analyzing $CLAUDE_TOOL operation on $CLAUDE_FILE"
64
+ echo ""
65
+ echo "Context for security-auditor subagent:"
66
+ echo "$context" | jq . 2>/dev/null || echo "$context"
67
+ echo ""
68
+ echo "Please review the operation above for:"
69
+ echo "- Credential exposure (API keys, passwords, tokens)"
70
+ echo "- Security vulnerabilities (SQL injection, XSS, etc.)"
71
+ echo "- Sensitive data handling"
72
+ echo "- Access control issues"
73
+ echo ""
74
+ echo "Type 'continue' if the operation is secure, or provide specific security concerns."
75
+ }
76
+
77
+ ##################################
78
+ # Main Hook Logic
79
+ ##################################
80
+ main() {
81
+ # Initialize error handling
82
+ initialize_error_handling || {
83
+ echo "ERROR: Failed to initialize error handling" >&2
84
+ exit 1
85
+ }
86
+
87
+ # Gather context for security analysis
88
+ local context
89
+ context=$(gather_security_context)
90
+
91
+ # Check if this is a security-relevant operation
92
+ case "${CLAUDE_TOOL:-}" in
93
+ Edit|Write|MultiEdit)
94
+ log_debug "Security-relevant tool detected: $CLAUDE_TOOL"
95
+ delegate_to_security_subagent "$context"
96
+ ;;
97
+ *)
98
+ log_debug "Non-security-relevant tool: ${CLAUDE_TOOL:-unknown}"
99
+ exit 0
100
+ ;;
101
+ esac
102
+ }
103
+
104
+ ##################################
105
+ # Execute Hook
106
+ ##################################
107
+ main "$@"