@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.
- package/README.md +44 -6
- package/commands/active/xarchitecture.md +393 -0
- package/commands/active/xconfig.md +127 -0
- package/commands/active/xdebug.md +130 -0
- package/commands/active/xdocs.md +178 -0
- package/commands/active/xgit.md +149 -0
- package/commands/active/xpipeline.md +152 -0
- package/commands/active/xquality.md +96 -0
- package/commands/active/xrefactor.md +198 -0
- package/commands/active/xrelease.md +142 -0
- package/commands/active/xsecurity.md +92 -0
- package/commands/active/xspec.md +174 -0
- package/commands/active/xtdd.md +151 -0
- package/commands/active/xtest.md +89 -0
- package/commands/experiments/xact.md +742 -0
- package/commands/experiments/xanalytics.md +113 -0
- package/commands/experiments/xanalyze.md +70 -0
- package/commands/experiments/xapi.md +161 -0
- package/commands/experiments/xatomic.md +112 -0
- package/commands/experiments/xaws.md +85 -0
- package/commands/experiments/xcicd.md +337 -0
- package/commands/experiments/xcommit.md +122 -0
- package/commands/experiments/xcompliance.md +182 -0
- package/commands/experiments/xconstraints.md +89 -0
- package/commands/experiments/xcoverage.md +90 -0
- package/commands/experiments/xdb.md +102 -0
- package/commands/experiments/xdesign.md +121 -0
- package/commands/experiments/xevaluate.md +111 -0
- package/commands/experiments/xfootnote.md +12 -0
- package/commands/experiments/xgenerate.md +117 -0
- package/commands/experiments/xgovernance.md +149 -0
- package/commands/experiments/xgreen.md +66 -0
- package/commands/experiments/xiac.md +118 -0
- package/commands/experiments/xincident.md +137 -0
- package/commands/experiments/xinfra.md +115 -0
- package/commands/experiments/xknowledge.md +115 -0
- package/commands/experiments/xmaturity.md +120 -0
- package/commands/experiments/xmetrics.md +118 -0
- package/commands/experiments/xmonitoring.md +128 -0
- package/commands/experiments/xnew.md +898 -0
- package/commands/experiments/xobservable.md +114 -0
- package/commands/experiments/xoidc.md +165 -0
- package/commands/experiments/xoptimize.md +115 -0
- package/commands/experiments/xperformance.md +112 -0
- package/commands/experiments/xplanning.md +131 -0
- package/commands/experiments/xpolicy.md +115 -0
- package/commands/experiments/xproduct.md +98 -0
- package/commands/experiments/xreadiness.md +75 -0
- package/commands/experiments/xred.md +55 -0
- package/commands/experiments/xrisk.md +128 -0
- package/commands/experiments/xrules.md +124 -0
- package/commands/experiments/xsandbox.md +120 -0
- package/commands/experiments/xscan.md +102 -0
- package/commands/experiments/xsetup.md +123 -0
- package/commands/experiments/xtemplate.md +116 -0
- package/commands/experiments/xtrace.md +212 -0
- package/commands/experiments/xux.md +171 -0
- package/commands/experiments/xvalidate.md +104 -0
- package/commands/experiments/xworkflow.md +113 -0
- package/hooks/README.md +231 -0
- package/hooks/file-logger.sh +98 -0
- package/hooks/lib/argument-parser.sh +422 -0
- package/hooks/lib/config-constants.sh +230 -0
- package/hooks/lib/context-manager.sh +549 -0
- package/hooks/lib/error-handler.sh +412 -0
- package/hooks/lib/execution-engine.sh +627 -0
- package/hooks/lib/file-utils.sh +375 -0
- package/hooks/lib/subagent-discovery.sh +465 -0
- package/hooks/lib/subagent-validator.sh +597 -0
- package/hooks/on-error-debug.sh +221 -0
- package/hooks/pre-commit-quality.sh +204 -0
- package/hooks/pre-write-security.sh +107 -0
- package/hooks/prevent-credential-exposure.sh +265 -0
- package/hooks/subagent-trigger-simple.sh +193 -0
- package/hooks/subagent-trigger.sh +253 -0
- package/lib/hook-installer-core.js +2 -2
- package/package.json +3 -1
- package/templates/README.md +100 -0
- package/templates/basic-settings.json +30 -0
- package/templates/comprehensive-settings.json +206 -0
- package/templates/hybrid-hook-config.yaml +133 -0
- package/templates/security-focused-settings.json +62 -0
- package/templates/subagent-hooks.yaml +188 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Claude Code Hook: Subagent Event Trigger
|
|
5
|
+
#
|
|
6
|
+
# Purpose: Bridge between Claude Code hooks and subagents, enabling event-driven subagent execution
|
|
7
|
+
# Usage: subagent-trigger.sh [OPTIONS] <subagent-name> [event-type] [additional-context]
|
|
8
|
+
# subagent-trigger.sh [OPTIONS] --event <event-type>
|
|
9
|
+
# Trigger: Can be used in PreToolUse, PostToolUse, or custom hook configurations
|
|
10
|
+
#
|
|
11
|
+
# This hook enables automatic invocation of specialized subagents based on
|
|
12
|
+
# specific events, ensuring the right expertise is applied at the right time.
|
|
13
|
+
|
|
14
|
+
##################################
|
|
15
|
+
# Module Loading
|
|
16
|
+
##################################
|
|
17
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
18
|
+
LIB_DIR="$SCRIPT_DIR/lib"
|
|
19
|
+
|
|
20
|
+
# Source all required modules in dependency order
|
|
21
|
+
source "$LIB_DIR/config-constants.sh"
|
|
22
|
+
source "$LIB_DIR/file-utils.sh"
|
|
23
|
+
source "$LIB_DIR/error-handler.sh"
|
|
24
|
+
source "$LIB_DIR/argument-parser.sh"
|
|
25
|
+
source "$LIB_DIR/subagent-discovery.sh"
|
|
26
|
+
source "$LIB_DIR/subagent-validator.sh"
|
|
27
|
+
source "$LIB_DIR/context-manager.sh"
|
|
28
|
+
source "$LIB_DIR/execution-engine.sh"
|
|
29
|
+
|
|
30
|
+
##################################
|
|
31
|
+
# Initialization
|
|
32
|
+
##################################
|
|
33
|
+
initialize_all_modules() {
|
|
34
|
+
log_debug "Initializing all modules"
|
|
35
|
+
|
|
36
|
+
initialize_error_handling || {
|
|
37
|
+
echo "FATAL: Error handling initialization failed" >&2
|
|
38
|
+
exit $EXIT_GENERAL_ERROR
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
initialize_argument_parser || {
|
|
42
|
+
log_error "Argument parser initialization failed"
|
|
43
|
+
return $EXIT_GENERAL_ERROR
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
initialize_subagent_discovery || {
|
|
47
|
+
log_error "Subagent discovery initialization failed"
|
|
48
|
+
return $EXIT_GENERAL_ERROR
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
initialize_subagent_validator || {
|
|
52
|
+
log_error "Subagent validator initialization failed"
|
|
53
|
+
return $EXIT_GENERAL_ERROR
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
initialize_context_manager || {
|
|
57
|
+
log_error "Context manager initialization failed"
|
|
58
|
+
return $EXIT_GENERAL_ERROR
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
initialize_execution_engine || {
|
|
62
|
+
log_error "Execution engine initialization failed"
|
|
63
|
+
return $EXIT_GENERAL_ERROR
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
log_debug "All modules initialized successfully"
|
|
67
|
+
return $EXIT_SUCCESS
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
##################################
|
|
71
|
+
# Core Workflow Functions
|
|
72
|
+
##################################
|
|
73
|
+
execute_single_subagent() {
|
|
74
|
+
local subagent_name="$1"
|
|
75
|
+
local event_type="$2"
|
|
76
|
+
local additional_context="$3"
|
|
77
|
+
|
|
78
|
+
log_info "Executing single subagent: $subagent_name for event: $event_type"
|
|
79
|
+
|
|
80
|
+
# Find the subagent file
|
|
81
|
+
local subagent_file
|
|
82
|
+
if ! subagent_file=$(find_subagent "$subagent_name"); then
|
|
83
|
+
handle_missing_subagent "$subagent_name"
|
|
84
|
+
return $EXIT_SUBAGENT_NOT_FOUND
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
log_debug "Found subagent file: $subagent_file"
|
|
88
|
+
|
|
89
|
+
# Validate the subagent
|
|
90
|
+
if ! validate_subagent_file "$subagent_file" "strict"; then
|
|
91
|
+
handle_validation_failure "$subagent_name" "file validation failed"
|
|
92
|
+
return $EXIT_VALIDATION_FAILED
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
# Create context file
|
|
96
|
+
if ! create_context_file "$subagent_name" "$event_type"; then
|
|
97
|
+
log_error "Failed to create context file"
|
|
98
|
+
return $EXIT_GENERAL_ERROR
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
local context_file
|
|
102
|
+
context_file=$(get_context_file)
|
|
103
|
+
|
|
104
|
+
# Gather context information
|
|
105
|
+
if ! gather_complete_context "$event_type" "$subagent_name" "$additional_context" "false"; then
|
|
106
|
+
log_error "Failed to gather context"
|
|
107
|
+
cleanup_context_file
|
|
108
|
+
return $EXIT_GENERAL_ERROR
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
# Write context to file
|
|
112
|
+
if ! write_context_to_file "$context_file"; then
|
|
113
|
+
log_error "Failed to write context to file"
|
|
114
|
+
cleanup_context_file
|
|
115
|
+
return $EXIT_GENERAL_ERROR
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
# Determine execution mode and timeout
|
|
119
|
+
local execution_mode timeout
|
|
120
|
+
execution_mode=$(determine_execution_mode "$event_type" "$(get_parsed_execution_mode)")
|
|
121
|
+
timeout=$(get_timeout_for_execution "$event_type" "$subagent_name")
|
|
122
|
+
|
|
123
|
+
# Check for dry run mode
|
|
124
|
+
if is_dry_run; then
|
|
125
|
+
execution_mode="dry-run"
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
# Execute the subagent
|
|
129
|
+
local execution_result
|
|
130
|
+
if ! execute_subagent "$subagent_file" "$context_file" "$execution_mode" "$timeout"; then
|
|
131
|
+
log_error "Subagent execution failed: $subagent_name"
|
|
132
|
+
cleanup_context_file
|
|
133
|
+
return $EXIT_EXECUTION_FAILED
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
# Clean up context file
|
|
137
|
+
cleanup_context_file
|
|
138
|
+
|
|
139
|
+
log_info "Single subagent execution completed successfully: $subagent_name"
|
|
140
|
+
return $EXIT_SUCCESS
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
execute_event_based_subagents() {
|
|
144
|
+
local event_type="$1"
|
|
145
|
+
local additional_context="$2"
|
|
146
|
+
|
|
147
|
+
log_info "Executing event-based subagents for event: $event_type"
|
|
148
|
+
|
|
149
|
+
# Create shared context file for all subagents
|
|
150
|
+
if ! create_context_file "event-$event_type" "$event_type"; then
|
|
151
|
+
log_error "Failed to create context file for event execution"
|
|
152
|
+
return $EXIT_GENERAL_ERROR
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
local context_file
|
|
156
|
+
context_file=$(get_context_file)
|
|
157
|
+
|
|
158
|
+
# Gather context information
|
|
159
|
+
if ! gather_complete_context "$event_type" "event-based" "$additional_context" "false"; then
|
|
160
|
+
log_error "Failed to gather context for event execution"
|
|
161
|
+
cleanup_context_file
|
|
162
|
+
return $EXIT_GENERAL_ERROR
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Write context to file
|
|
166
|
+
if ! write_context_to_file "$context_file"; then
|
|
167
|
+
log_error "Failed to write context to file for event execution"
|
|
168
|
+
cleanup_context_file
|
|
169
|
+
return $EXIT_GENERAL_ERROR
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
# Determine execution mode
|
|
173
|
+
local execution_mode
|
|
174
|
+
execution_mode=$(determine_execution_mode "$event_type" "$(get_parsed_execution_mode)")
|
|
175
|
+
|
|
176
|
+
# Execute all subagents for this event
|
|
177
|
+
local execution_result
|
|
178
|
+
if ! execute_multiple_subagents "$event_type" "$context_file" "$execution_mode"; then
|
|
179
|
+
log_error "Event-based subagent execution failed for event: $event_type"
|
|
180
|
+
cleanup_context_file
|
|
181
|
+
return $EXIT_EXECUTION_FAILED
|
|
182
|
+
fi
|
|
183
|
+
|
|
184
|
+
# Clean up context file
|
|
185
|
+
cleanup_context_file
|
|
186
|
+
|
|
187
|
+
log_info "Event-based subagent execution completed successfully: $event_type"
|
|
188
|
+
return $EXIT_SUCCESS
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
##################################
|
|
192
|
+
# Main Hook Logic
|
|
193
|
+
##################################
|
|
194
|
+
main() {
|
|
195
|
+
# Initialize all modules
|
|
196
|
+
if ! initialize_all_modules; then
|
|
197
|
+
echo "FATAL: Module initialization failed" >&2
|
|
198
|
+
exit $EXIT_GENERAL_ERROR
|
|
199
|
+
fi
|
|
200
|
+
|
|
201
|
+
# Parse arguments
|
|
202
|
+
if ! parse_arguments "$@"; then
|
|
203
|
+
# Error messages already logged by parser
|
|
204
|
+
safe_exit $EXIT_VALIDATION_FAILED
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
# Handle help request
|
|
208
|
+
if is_help_requested; then
|
|
209
|
+
show_usage
|
|
210
|
+
safe_exit $EXIT_SUCCESS
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
# Log parsed arguments in debug mode
|
|
214
|
+
if is_debug_mode; then
|
|
215
|
+
log_parsed_arguments
|
|
216
|
+
fi
|
|
217
|
+
|
|
218
|
+
# Get execution parameters
|
|
219
|
+
local subagent_name event_type additional_context execution_mode
|
|
220
|
+
subagent_name=$(get_parsed_subagent_name)
|
|
221
|
+
event_type=$(get_parsed_event_type)
|
|
222
|
+
additional_context=$(get_parsed_additional_context)
|
|
223
|
+
execution_mode=$(get_parsed_execution_mode)
|
|
224
|
+
|
|
225
|
+
log_info "Starting subagent hook execution"
|
|
226
|
+
log_info "Mode: $execution_mode, Event: $event_type"
|
|
227
|
+
|
|
228
|
+
# Execute based on mode
|
|
229
|
+
local exit_code
|
|
230
|
+
case "$execution_mode" in
|
|
231
|
+
"event-based")
|
|
232
|
+
execute_event_based_subagents "$event_type" "$additional_context"
|
|
233
|
+
exit_code=$?
|
|
234
|
+
;;
|
|
235
|
+
*)
|
|
236
|
+
execute_single_subagent "$subagent_name" "$event_type" "$additional_context"
|
|
237
|
+
exit_code=$?
|
|
238
|
+
;;
|
|
239
|
+
esac
|
|
240
|
+
|
|
241
|
+
if [[ $exit_code -eq $EXIT_SUCCESS ]]; then
|
|
242
|
+
log_info "Subagent hook completed successfully"
|
|
243
|
+
else
|
|
244
|
+
log_error "Subagent hook failed with exit code: $exit_code"
|
|
245
|
+
fi
|
|
246
|
+
|
|
247
|
+
safe_exit $exit_code
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
##################################
|
|
251
|
+
# Execute Main Function
|
|
252
|
+
##################################
|
|
253
|
+
main "$@"
|
|
@@ -320,9 +320,9 @@ class HookInstaller {
|
|
|
320
320
|
*/
|
|
321
321
|
_getPackageVersion() {
|
|
322
322
|
try {
|
|
323
|
-
return require('../package.json').version || '0.0.1-alpha.
|
|
323
|
+
return require('../package.json').version || '0.0.1-alpha.2';
|
|
324
324
|
} catch (error) {
|
|
325
|
-
return '0.0.1-alpha.
|
|
325
|
+
return '0.0.1-alpha.2';
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paulduvall/claude-dev-toolkit",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.4",
|
|
4
4
|
"description": "Custom commands toolkit for Claude Code - streamline your development workflow",
|
|
5
5
|
"author": "Paul Duvall",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"test:subagents": "node tests/test_subagents_command.js",
|
|
43
43
|
"test:subagents-async": "node tests/test_subagents_async.js",
|
|
44
44
|
"test:config": "node tests/test_config_command.js",
|
|
45
|
+
"test:ux-quick-start": "node tests/test_ux_quick_start_guide.js",
|
|
46
|
+
"test:npm-completeness": "node tests/test_npm_package_completeness.js",
|
|
45
47
|
"test:install": "scripts/publishing/test-package-install.sh",
|
|
46
48
|
"test:manual": "scripts/publishing/manual-test-suite.sh",
|
|
47
49
|
"publish:local": "scripts/publishing/setup-local-registry.sh",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Claude Code Settings Templates
|
|
2
|
+
|
|
3
|
+
This directory contains example `settings.json` configurations for different use cases.
|
|
4
|
+
|
|
5
|
+
## Templates Available
|
|
6
|
+
|
|
7
|
+
### 1. `basic-settings.json`
|
|
8
|
+
**Use case**: Simple development setup
|
|
9
|
+
**Features**:
|
|
10
|
+
- Basic tool permissions for custom commands
|
|
11
|
+
- API key helper configuration
|
|
12
|
+
- Standard performance settings
|
|
13
|
+
- Minimal environment variables
|
|
14
|
+
|
|
15
|
+
**To use**:
|
|
16
|
+
```bash
|
|
17
|
+
cp templates/basic-settings.json ~/.claude/settings.json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. `security-focused-settings.json`
|
|
21
|
+
**Use case**: Security-conscious development
|
|
22
|
+
**Features**:
|
|
23
|
+
- All basic features plus:
|
|
24
|
+
- Security hooks enabled (credential exposure prevention)
|
|
25
|
+
- Restrictive tool permissions
|
|
26
|
+
- Security environment variables
|
|
27
|
+
- Slack/Teams webhook integration for alerts
|
|
28
|
+
|
|
29
|
+
**Prerequisites**: Install security hooks first
|
|
30
|
+
```bash
|
|
31
|
+
cp hooks/prevent-credential-exposure.sh ~/.claude/hooks/
|
|
32
|
+
chmod +x ~/.claude/hooks/prevent-credential-exposure.sh
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**To use**:
|
|
36
|
+
```bash
|
|
37
|
+
cp templates/security-focused-settings.json ~/.claude/settings.json
|
|
38
|
+
# Edit SECURITY_WEBHOOK_URL to your actual webhook
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 3. `comprehensive-settings.json`
|
|
42
|
+
**Use case**: Comprehensive development with full governance
|
|
43
|
+
**Features**:
|
|
44
|
+
- All security features plus:
|
|
45
|
+
- Comprehensive audit logging
|
|
46
|
+
- Comprehensive permissions
|
|
47
|
+
- MCP server integration
|
|
48
|
+
- Enhanced performance settings
|
|
49
|
+
- Full monitoring and compliance
|
|
50
|
+
|
|
51
|
+
**Prerequisites**:
|
|
52
|
+
- Install all security hooks
|
|
53
|
+
- Docker Desktop running (for MCP servers)
|
|
54
|
+
- Configure organizational webhooks
|
|
55
|
+
|
|
56
|
+
**To use**:
|
|
57
|
+
```bash
|
|
58
|
+
cp templates/comprehensive-settings.json ~/.claude/settings.json
|
|
59
|
+
# Configure webhooks and organizational settings
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Configuration Notes
|
|
63
|
+
|
|
64
|
+
### Settings Hierarchy
|
|
65
|
+
Settings are applied in this order (later overrides earlier):
|
|
66
|
+
1. User settings: `~/.claude/settings.json`
|
|
67
|
+
2. Project settings: `.claude/settings.json`
|
|
68
|
+
3. Local settings: `.claude/settings.local.json`
|
|
69
|
+
|
|
70
|
+
### Security Considerations
|
|
71
|
+
- Always review webhook URLs before using
|
|
72
|
+
- Set appropriate file permissions: `chmod 600 ~/.claude/settings.json`
|
|
73
|
+
- Store sensitive settings in environment variables, not directly in JSON
|
|
74
|
+
- Use `.claude/settings.local.json` for personal settings in team projects
|
|
75
|
+
|
|
76
|
+
### Customization
|
|
77
|
+
These templates are starting points. Customize based on your needs:
|
|
78
|
+
- Add/remove allowed tools
|
|
79
|
+
- Adjust timeout values
|
|
80
|
+
- Configure additional hooks
|
|
81
|
+
- Set team-specific environment variables
|
|
82
|
+
|
|
83
|
+
### Validation
|
|
84
|
+
Use the validation script to check your configuration:
|
|
85
|
+
```bash
|
|
86
|
+
./validate-commands.sh --check-settings
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Troubleshooting
|
|
90
|
+
|
|
91
|
+
### Common Issues
|
|
92
|
+
1. **Commands not working**: Check `allowedTools` array includes required tools
|
|
93
|
+
2. **Hooks not running**: Verify executable permissions and file paths
|
|
94
|
+
3. **Timeouts**: Increase timeout values for slow operations
|
|
95
|
+
4. **Permissions errors**: Check file permissions on settings.json and hooks
|
|
96
|
+
|
|
97
|
+
### Getting Help
|
|
98
|
+
- Run `./verify-setup.sh` to diagnose issues
|
|
99
|
+
- Check Claude Code logs: `~/.claude/logs/`
|
|
100
|
+
- Review the main README.md troubleshooting section
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"// Basic Claude Code settings.json template": "Copy to ~/.claude/settings.json",
|
|
3
|
+
"// This provides minimal configuration for custom commands to work": "",
|
|
4
|
+
|
|
5
|
+
"allowedTools": [
|
|
6
|
+
"Edit",
|
|
7
|
+
"Bash",
|
|
8
|
+
"Read",
|
|
9
|
+
"Write"
|
|
10
|
+
],
|
|
11
|
+
|
|
12
|
+
"// Basic hooks configuration": "",
|
|
13
|
+
"hooks": {
|
|
14
|
+
"PreToolUse": [],
|
|
15
|
+
"PostToolUse": []
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"// Trust and onboarding settings": "",
|
|
19
|
+
"hasTrustDialogAccepted": true,
|
|
20
|
+
"hasCompletedProjectOnboarding": true,
|
|
21
|
+
|
|
22
|
+
"// Performance optimization": "",
|
|
23
|
+
"parallelTasksCount": 3,
|
|
24
|
+
|
|
25
|
+
"// Optional: Environment variables": "",
|
|
26
|
+
"env": {
|
|
27
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "true",
|
|
28
|
+
"BASH_DEFAULT_TIMEOUT_MS": "120000"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
{
|
|
2
|
+
"// Comprehensive Claude Code settings.json template": "Copy to ~/.claude/settings.json",
|
|
3
|
+
"// Full comprehensive setup with hooks, governance, and monitoring": "",
|
|
4
|
+
|
|
5
|
+
"allowedTools": [
|
|
6
|
+
"Edit",
|
|
7
|
+
"Bash",
|
|
8
|
+
"Read",
|
|
9
|
+
"Write",
|
|
10
|
+
"MultiEdit",
|
|
11
|
+
"Glob",
|
|
12
|
+
"Grep",
|
|
13
|
+
"LS",
|
|
14
|
+
"Task",
|
|
15
|
+
"WebFetch",
|
|
16
|
+
"WebSearch",
|
|
17
|
+
"NotebookEdit",
|
|
18
|
+
"BashOutput",
|
|
19
|
+
"KillBash"
|
|
20
|
+
],
|
|
21
|
+
|
|
22
|
+
"// Comprehensive tools configuration": "",
|
|
23
|
+
"tools": {
|
|
24
|
+
"bash": {
|
|
25
|
+
"defaultTimeout": 300000,
|
|
26
|
+
"maxParallelCommands": 3
|
|
27
|
+
},
|
|
28
|
+
"edit": {
|
|
29
|
+
"autoBackup": true,
|
|
30
|
+
"validateChanges": true
|
|
31
|
+
},
|
|
32
|
+
"web": {
|
|
33
|
+
"allowedDomains": ["github.com", "docs.anthropic.com", "stackoverflow.com"],
|
|
34
|
+
"timeout": 30000
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
"// Trust and onboarding settings": "",
|
|
39
|
+
"hasTrustDialogAccepted": true,
|
|
40
|
+
"hasCompletedProjectOnboarding": true,
|
|
41
|
+
|
|
42
|
+
"// Performance optimization for comprehensive setup": "",
|
|
43
|
+
"parallelTasksCount": 5,
|
|
44
|
+
|
|
45
|
+
"// Comprehensive security hooks with subagent integration": "",
|
|
46
|
+
"hooks": {
|
|
47
|
+
"PreToolUse": [
|
|
48
|
+
{
|
|
49
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
50
|
+
"hooks": [
|
|
51
|
+
{
|
|
52
|
+
"type": "command",
|
|
53
|
+
"command": "~/.claude/hooks/prevent-credential-exposure.sh",
|
|
54
|
+
"blocking": true,
|
|
55
|
+
"timeout": 10000
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"matcher": "Bash",
|
|
61
|
+
"hooks": [
|
|
62
|
+
{
|
|
63
|
+
"type": "command",
|
|
64
|
+
"command": "~/.claude/hooks/audit-bash-commands.sh",
|
|
65
|
+
"blocking": false,
|
|
66
|
+
"timeout": 5000
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"// Subagent integration for security events": "",
|
|
70
|
+
"hooks": [
|
|
71
|
+
{
|
|
72
|
+
"type": "command",
|
|
73
|
+
"command": "~/.claude/hooks/subagent-trigger.sh security-auditor pre_write",
|
|
74
|
+
"blocking": true,
|
|
75
|
+
"timeout": 10000
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "command",
|
|
79
|
+
"command": "~/.claude/hooks/subagent-trigger.sh style-enforcer pre_write",
|
|
80
|
+
"blocking": false,
|
|
81
|
+
"timeout": 5000
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"matcher": "Bash(git commit*)",
|
|
87
|
+
"hooks": [
|
|
88
|
+
{
|
|
89
|
+
"type": "command",
|
|
90
|
+
"command": "~/.claude/hooks/subagent-trigger.sh trunk-guardian pre_commit",
|
|
91
|
+
"blocking": true,
|
|
92
|
+
"timeout": 10000
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"matcher": "Bash(*test*|*spec*)",
|
|
98
|
+
"hooks": [
|
|
99
|
+
{
|
|
100
|
+
"type": "command",
|
|
101
|
+
"command": "~/.claude/hooks/subagent-trigger.sh test-writer pre_test",
|
|
102
|
+
"blocking": false,
|
|
103
|
+
"timeout": 8000
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"PostToolUse": [
|
|
109
|
+
{
|
|
110
|
+
"matcher": "*",
|
|
111
|
+
"hooks": [
|
|
112
|
+
{
|
|
113
|
+
"type": "command",
|
|
114
|
+
"command": "~/.claude/hooks/log-all-operations.sh",
|
|
115
|
+
"blocking": false,
|
|
116
|
+
"timeout": 3000
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
122
|
+
"hooks": [
|
|
123
|
+
{
|
|
124
|
+
"type": "command",
|
|
125
|
+
"command": "~/.claude/hooks/subagent-trigger.sh documentation-curator post_write",
|
|
126
|
+
"blocking": false,
|
|
127
|
+
"timeout": 8000
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"matcher": "Bash(*test*)",
|
|
133
|
+
"hooks": [
|
|
134
|
+
{
|
|
135
|
+
"type": "command",
|
|
136
|
+
"command": "~/.claude/hooks/subagent-trigger.sh performance-guardian post_test",
|
|
137
|
+
"blocking": false,
|
|
138
|
+
"timeout": 10000
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"// Custom error handling hooks with subagents": "",
|
|
144
|
+
"OnError": [
|
|
145
|
+
{
|
|
146
|
+
"hooks": [
|
|
147
|
+
{
|
|
148
|
+
"type": "command",
|
|
149
|
+
"command": "~/.claude/hooks/subagent-trigger.sh debug-specialist on_error",
|
|
150
|
+
"blocking": false,
|
|
151
|
+
"timeout": 15000
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "command",
|
|
155
|
+
"command": "~/.claude/hooks/subagent-trigger.sh rollback-first-responder on_error",
|
|
156
|
+
"blocking": false,
|
|
157
|
+
"timeout": 10000
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
"// Comprehensive environment variables": "",
|
|
165
|
+
"env": {
|
|
166
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "true",
|
|
167
|
+
"BASH_DEFAULT_TIMEOUT_MS": "300000",
|
|
168
|
+
"MCP_TIMEOUT": "60000",
|
|
169
|
+
"SECURITY_WEBHOOK_URL": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
|
|
170
|
+
"CLAUDE_SECURITY_OVERRIDE": "false",
|
|
171
|
+
"ANTHROPIC_LOG": "info",
|
|
172
|
+
"CLAUDE_CODE_ENABLE_TELEMETRY": "0"
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
"// Comprehensive permissions": "",
|
|
176
|
+
"permissions": {
|
|
177
|
+
"allow": [
|
|
178
|
+
"Bash(npm run *)",
|
|
179
|
+
"Bash(python -m *)",
|
|
180
|
+
"Bash(git *)",
|
|
181
|
+
"Bash(docker *)",
|
|
182
|
+
"Bash(kubectl *)",
|
|
183
|
+
"Bash(terraform *)",
|
|
184
|
+
"Edit(*)",
|
|
185
|
+
"Read(*)",
|
|
186
|
+
"Write(*)",
|
|
187
|
+
"MultiEdit(*)"
|
|
188
|
+
],
|
|
189
|
+
"deny": [
|
|
190
|
+
"Bash(curl *://*/admin*)",
|
|
191
|
+
"Bash(wget *://*/admin*)",
|
|
192
|
+
"Bash(ssh *prod*)",
|
|
193
|
+
"Bash(sudo *)",
|
|
194
|
+
"Bash(rm -rf *)",
|
|
195
|
+
"Bash(*production*)"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
"// MCP servers for comprehensive features": "",
|
|
200
|
+
"mcpServers": {
|
|
201
|
+
"puppeteer": {
|
|
202
|
+
"command": "docker",
|
|
203
|
+
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|