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

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 (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -37
  3. package/bin/claude-commands +307 -65
  4. package/commands/active/xarchitecture.md +393 -0
  5. package/commands/active/xconfig.md +127 -0
  6. package/commands/active/xcontinue.md +92 -0
  7. package/commands/active/xdebug.md +130 -0
  8. package/commands/active/xdocs.md +178 -0
  9. package/commands/active/xexplore.md +94 -0
  10. package/commands/active/xgit.md +149 -0
  11. package/commands/active/xpipeline.md +152 -0
  12. package/commands/active/xquality.md +96 -0
  13. package/commands/active/xrefactor.md +198 -0
  14. package/commands/active/xrelease.md +142 -0
  15. package/commands/active/xsecurity.md +92 -0
  16. package/commands/active/xspec.md +174 -0
  17. package/commands/active/xtdd.md +151 -0
  18. package/commands/active/xtest.md +89 -0
  19. package/commands/active/xverify.md +80 -0
  20. package/commands/experiments/xact.md +742 -0
  21. package/commands/experiments/xanalytics.md +113 -0
  22. package/commands/experiments/xanalyze.md +70 -0
  23. package/commands/experiments/xapi.md +161 -0
  24. package/commands/experiments/xatomic.md +112 -0
  25. package/commands/experiments/xaws.md +85 -0
  26. package/commands/experiments/xcicd.md +337 -0
  27. package/commands/experiments/xcommit.md +122 -0
  28. package/commands/experiments/xcompliance.md +182 -0
  29. package/commands/experiments/xconstraints.md +89 -0
  30. package/commands/experiments/xcoverage.md +90 -0
  31. package/commands/experiments/xdb.md +102 -0
  32. package/commands/experiments/xdesign.md +121 -0
  33. package/commands/experiments/xdevcontainer.md +238 -0
  34. package/commands/experiments/xevaluate.md +111 -0
  35. package/commands/experiments/xfootnote.md +12 -0
  36. package/commands/experiments/xgenerate.md +117 -0
  37. package/commands/experiments/xgovernance.md +149 -0
  38. package/commands/experiments/xgreen.md +66 -0
  39. package/commands/experiments/xiac.md +118 -0
  40. package/commands/experiments/xincident.md +137 -0
  41. package/commands/experiments/xinfra.md +115 -0
  42. package/commands/experiments/xknowledge.md +115 -0
  43. package/commands/experiments/xmaturity.md +120 -0
  44. package/commands/experiments/xmetrics.md +118 -0
  45. package/commands/experiments/xmonitoring.md +128 -0
  46. package/commands/experiments/xnew.md +903 -0
  47. package/commands/experiments/xobservable.md +114 -0
  48. package/commands/experiments/xoidc.md +165 -0
  49. package/commands/experiments/xoptimize.md +115 -0
  50. package/commands/experiments/xperformance.md +112 -0
  51. package/commands/experiments/xplanning.md +131 -0
  52. package/commands/experiments/xpolicy.md +115 -0
  53. package/commands/experiments/xproduct.md +98 -0
  54. package/commands/experiments/xreadiness.md +75 -0
  55. package/commands/experiments/xred.md +55 -0
  56. package/commands/experiments/xrisk.md +128 -0
  57. package/commands/experiments/xrules.md +124 -0
  58. package/commands/experiments/xsandbox.md +120 -0
  59. package/commands/experiments/xscan.md +102 -0
  60. package/commands/experiments/xsetup.md +123 -0
  61. package/commands/experiments/xtemplate.md +116 -0
  62. package/commands/experiments/xtrace.md +212 -0
  63. package/commands/experiments/xux.md +171 -0
  64. package/commands/experiments/xvalidate.md +104 -0
  65. package/commands/experiments/xworkflow.md +113 -0
  66. package/hooks/.smellrc.example.json +19 -0
  67. package/hooks/README.md +263 -0
  68. package/hooks/check-commit-signing.py +127 -0
  69. package/hooks/check-complexity.py +38 -0
  70. package/hooks/check-security.py +37 -0
  71. package/hooks/claude-wrapper.sh +29 -0
  72. package/hooks/config.py +110 -0
  73. package/hooks/file-logger.sh +100 -0
  74. package/hooks/lib/argument-parser.sh +427 -0
  75. package/hooks/lib/config-constants.sh +230 -0
  76. package/hooks/lib/context-manager.sh +560 -0
  77. package/hooks/lib/error-handler.sh +423 -0
  78. package/hooks/lib/execution-engine.sh +444 -0
  79. package/hooks/lib/execution-results.sh +113 -0
  80. package/hooks/lib/execution-simulation.sh +114 -0
  81. package/hooks/lib/field-validators.sh +104 -0
  82. package/hooks/lib/file-utils.sh +398 -0
  83. package/hooks/lib/subagent-discovery.sh +468 -0
  84. package/hooks/lib/subagent-validator.sh +407 -0
  85. package/hooks/lib/validation-reporter.sh +134 -0
  86. package/hooks/on-error-debug.sh +226 -0
  87. package/hooks/pre-commit-quality.sh +204 -0
  88. package/hooks/pre-commit-test-runner.sh +132 -0
  89. package/hooks/pre-write-security.sh +115 -0
  90. package/hooks/prevent-credential-exposure.sh +279 -0
  91. package/hooks/security_bandit.py +177 -0
  92. package/hooks/security_checks.py +97 -0
  93. package/hooks/security_secrets.py +81 -0
  94. package/hooks/security_trojan.py +61 -0
  95. package/hooks/settings.example.json +52 -0
  96. package/hooks/smell_checks.py +238 -0
  97. package/hooks/smell_javascript.py +231 -0
  98. package/hooks/smell_python.py +110 -0
  99. package/hooks/smell_ruff.py +70 -0
  100. package/hooks/smell_types.py +72 -0
  101. package/hooks/subagent-trigger-simple.sh +202 -0
  102. package/hooks/subagent-trigger.sh +253 -0
  103. package/hooks/suppression.py +82 -0
  104. package/hooks/tab-color.sh +70 -0
  105. package/hooks/verify-before-edit.sh +135 -0
  106. package/lib/backup-restore-command.js +140 -0
  107. package/lib/base/base-command.js +252 -0
  108. package/lib/base/command-result.js +184 -0
  109. package/lib/config/constants.js +255 -0
  110. package/lib/config.js +48 -6
  111. package/lib/configure-command.js +428 -0
  112. package/lib/dependency-validator.js +64 -5
  113. package/lib/hook-installer-core.js +2 -2
  114. package/lib/installation-instruction-generator.js +213 -495
  115. package/lib/installer.js +134 -56
  116. package/lib/oidc-command.js +740 -0
  117. package/lib/services/backup-list-service.js +226 -0
  118. package/lib/services/backup-service.js +230 -0
  119. package/lib/services/command-installer-service.js +217 -0
  120. package/lib/services/logger-service.js +201 -0
  121. package/lib/services/package-manager-service.js +319 -0
  122. package/lib/services/platform-instruction-service.js +294 -0
  123. package/lib/services/recovery-instruction-service.js +348 -0
  124. package/lib/services/restore-service.js +221 -0
  125. package/lib/setup-command.js +359 -0
  126. package/lib/setup-wizard.js +155 -262
  127. package/lib/uninstall-command.js +100 -0
  128. package/lib/utils/claude-path-config.js +184 -0
  129. package/lib/utils/file-system-utils.js +152 -0
  130. package/lib/utils.js +8 -4
  131. package/lib/verify-command.js +430 -0
  132. package/package.json +7 -3
  133. package/scripts/postinstall.js +172 -157
  134. package/subagents/debug-specialist.md +7 -0
  135. package/templates/README.md +115 -0
  136. package/templates/basic-settings.json +30 -0
  137. package/templates/comprehensive-settings.json +57 -0
  138. package/templates/global-claude.md +344 -0
  139. package/templates/hybrid-hook-config.yaml +132 -0
  140. package/templates/security-focused-settings.json +62 -0
  141. package/templates/subagent-hooks.yaml +188 -0
  142. package/lib/package-manager-service.js +0 -270
  143. package/subagents/debug-context.md +0 -197
@@ -0,0 +1,344 @@
1
+ # Global CLAUDE.md Template
2
+
3
+ > **Installation**: Copy this file to `~/.claude/CLAUDE.md` to apply these standards to all your projects.
4
+ >
5
+ > ```bash
6
+ > cp templates/global-claude.md ~/.claude/CLAUDE.md
7
+ > ```
8
+
9
+ ---
10
+
11
+ # Universal Development Protocol
12
+
13
+ This file governs all development work. Follow it automatically.
14
+
15
+ ---
16
+
17
+ ## PHASE 1: PREFLIGHT (Before Any Implementation)
18
+
19
+ ### 1.1 Clarifying Questions — MANDATORY
20
+
21
+ **STOP. Do not write code yet.**
22
+
23
+ Present clarifying questions for ANY ambiguous aspect:
24
+
25
+ ```
26
+ ### Before I proceed, I need to understand:
27
+
28
+ **[Category]:**
29
+ - [ ] **Option A**: [description] ← Recommended: [reason]
30
+ - [ ] **Option B**: [description]
31
+
32
+ Please respond with your choices.
33
+ ```
34
+
35
+ Cover as needed: architecture, data layer, auth, API style, testing approach, deployment target.
36
+
37
+ **Do not proceed until the user responds.**
38
+
39
+ ### 1.2 Beads Task Check
40
+
41
+ ```bash
42
+ bd ready --json
43
+ ```
44
+
45
+ - If a task exists for this work → reference it, update status to `in_progress`
46
+ - If no task exists → create one before implementing:
47
+
48
+ ```bash
49
+ bd create "TITLE" -t TYPE -p PRIORITY -d "DESCRIPTION with acceptance criteria" --json
50
+ ```
51
+
52
+ ### 1.3 Context Detection
53
+
54
+ Identify: What language? What framework? What's already in the codebase?
55
+
56
+ Adapt standards to match existing patterns unless explicitly asked to refactor.
57
+
58
+ ---
59
+
60
+ ## PHASE 2: IMPLEMENTATION STANDARDS
61
+
62
+ Apply these gates to ALL code. Non-negotiable.
63
+
64
+ ### 2.1 Code Structure
65
+
66
+ | Rule | Limit |
67
+ |------|-------|
68
+ | Function length | ≤20 lines |
69
+ | Class length | ≤250 lines |
70
+ | Nesting depth | ≤3 levels |
71
+ | Cyclomatic complexity | ≤10 per function |
72
+
73
+ **Fix with:** Extract Method, Extract Class, guard clauses, early returns.
74
+
75
+ ### 2.2 Security — Never Compromise
76
+
77
+ - [ ] **No hardcoded secrets** — use environment variables
78
+ - [ ] **Parameterized SQL** — never string interpolation
79
+ - [ ] **Validate all inputs** — type, range, format
80
+ - [ ] **Encode outputs** — HTML escape, JSON encode
81
+ - [ ] **Generic error messages** — no stack traces, no internal paths
82
+ - [ ] **Timing-safe comparisons** — for tokens and passwords
83
+ - [ ] **Bcrypt/Argon2** — for password hashing
84
+
85
+ ### 2.3 Testing
86
+
87
+ | Scope | Coverage |
88
+ |-------|----------|
89
+ | Overall | ≥80% |
90
+ | Critical paths (auth, payments, security) | 100% |
91
+
92
+ Include:
93
+ - Unit tests for isolated logic
94
+ - Integration tests for component interactions
95
+ - Edge cases: empty, null, boundaries, errors
96
+
97
+ **Never delete passing tests. Never skip tests to ship faster.**
98
+
99
+ ### 2.4 Performance
100
+
101
+ - [ ] No N+1 queries — use eager loading
102
+ - [ ] Paginate all list endpoints
103
+ - [ ] API response target: <200ms
104
+ - [ ] Use appropriate data structures (dict for lookup, set for membership)
105
+
106
+ ### 2.5 Documentation
107
+
108
+ - [ ] Docstrings on all public functions (params, returns, raises)
109
+ - [ ] Inline comments explain **why**, not what
110
+ - [ ] Keep docs current with code
111
+
112
+ ### 2.6 Naming
113
+
114
+ - Functions: `verb_noun()` — `calculate_total()`, `validate_email()`
115
+ - Booleans: `is_`, `has_`, `can_`, `should_`
116
+ - Classes: Nouns — `OrderProcessor`, `UserRepository`
117
+ - No abbreviations, no single letters (except `i`, `j` in loops)
118
+
119
+ ### 2.7 Verification Before Action
120
+
121
+ Before referencing any URL, file path, account ID, asset, or external identifier:
122
+
123
+ - [ ] **Search the repo first** — grep/glob for the actual value before using it
124
+ - [ ] **Never fabricate** — do not guess URLs, IDs, or resource paths
125
+ - [ ] **Ask if not found** — if a reference can't be verified in the repo, ask the user
126
+ - [ ] **Read config files** — for external services (analytics, cloud providers), read project config files rather than assuming identifiers
127
+
128
+ ### 2.8 Zero-Error Test Policy
129
+
130
+ After any code change:
131
+
132
+ - [ ] **Run the full test suite** — not a subset
133
+ - [ ] **All tests must pass** — zero errors, including pre-existing failures
134
+ - [ ] **Do not mark complete** until the suite is fully green
135
+ - [ ] **Flag, don't skip** — if pre-existing tests fail, fix them or explicitly flag them to the user
136
+
137
+ ### 2.9 Platform-Specific Formatting
138
+
139
+ When generating content for external platforms:
140
+
141
+ - [ ] **LinkedIn** — plain text only; no markdown, no code blocks
142
+ - [ ] **Slack** — use Slack mrkdwn: bold = `*text*`, italic = `_text_`, code = `` `text` ``
143
+ - [ ] **GitHub** — standard GitHub-flavored markdown
144
+ - [ ] **HTML emails** — inline styles only; no external CSS references
145
+ - [ ] **Ask if unspecified** — if the target platform is not stated, ask before generating
146
+
147
+ ---
148
+
149
+ ## PHASE 3: BOOTSTRAP & DEVEX (When Applicable)
150
+
151
+ If the task involves setup, installation, or onboarding:
152
+
153
+ ### Poka-Yoke Principles
154
+
155
+ - [ ] **Single entry point** — one command to set up everything
156
+ - [ ] **Idempotent** — safe to run multiple times
157
+ - [ ] **Detect existing state** — skip what's already done
158
+ - [ ] **Validate prerequisites** — with actionable remediation messages
159
+ - [ ] **Platform detection** — handle macOS/Linux/Windows differences
160
+ - [ ] **Progress feedback** — show what's happening
161
+ - [ ] **Fail fast** — clear errors, not silent failures
162
+
163
+ ---
164
+
165
+ ## PHASE 4: COMPLETION CHECKLIST
166
+
167
+ Before finishing ANY response that includes code:
168
+
169
+ - [ ] Tests included or mentioned?
170
+ - [ ] Security checklist passed?
171
+ - [ ] Functions under 20 lines?
172
+ - [ ] Task to close? → `bd close ID --reason "..."`
173
+ - [ ] New issues discovered? → Create Beads tasks for them
174
+ - [ ] Commit ready? → `type(scope): description [bd-xxx]`
175
+
176
+ ---
177
+
178
+ ## PHASE 5: CI/CD VERIFICATION
179
+
180
+ Before declaring work complete:
181
+
182
+ - [ ] Would `lint` pass?
183
+ - [ ] Would `test` pass?
184
+ - [ ] Would `build` pass?
185
+
186
+ If uncertain, remind user to run locally or in CI before merging.
187
+
188
+ ---
189
+
190
+ ## PHASE 6: SESSION END
191
+
192
+ When the user indicates they're done, or before a long pause:
193
+
194
+ ### Remind the user:
195
+
196
+ 1. **Sync Beads:** `bd sync`
197
+ 2. **Commit work:** `git add . && git commit -m "type(scope): description [bd-xxx]"`
198
+ 3. **Push:** `git push`
199
+ 4. **PR if ready:** Create with task IDs in description
200
+
201
+ ### Provide:
202
+
203
+ - Summary of what was accomplished
204
+ - List of open Beads tasks
205
+ - Suggested next task or action
206
+
207
+ ---
208
+
209
+ ## FAILURE PROTOCOL
210
+
211
+ ### Three Strikes Rule
212
+
213
+ If the same test/build fails **3 times in a row**:
214
+
215
+ 1. **STOP** — do not keep trying the same approach
216
+ 2. **Revert** — `git checkout .` or restore last working state
217
+ 3. **Create HANDOFF.md:**
218
+
219
+ ```markdown
220
+ # HANDOFF
221
+
222
+ ## What Was Attempted
223
+ [Description of the goal]
224
+
225
+ ## What Failed
226
+ [Specific error or failure]
227
+
228
+ ## Attempts Made
229
+ 1. [First approach and result]
230
+ 2. [Second approach and result]
231
+ 3. [Third approach and result]
232
+
233
+ ## Reproduction Steps
234
+ [How to reproduce the failure]
235
+
236
+ ## Suggested Next Steps
237
+ [What to try differently]
238
+
239
+ ## Relevant Files
240
+ [List of files involved]
241
+ ```
242
+
243
+ 4. **Create Beads task** for the blocker if one doesn't exist
244
+
245
+ ### Scope Overflow
246
+
247
+ If a single task would require >400 lines changed:
248
+ - Stop
249
+ - Propose a smaller "tracer bullet" slice
250
+ - Break into multiple Beads tasks
251
+
252
+ ---
253
+
254
+ ## RALPH WIGGUM LOOPS
255
+
256
+ For autonomous work spanning multiple iterations:
257
+
258
+ ### When to Suggest Ralph
259
+
260
+ - Large implementation tasks with clear acceptance criteria
261
+ - Batch operations (refactoring, test coverage, migrations)
262
+ - Tasks with objective completion signals (tests pass, lint clean)
263
+
264
+ ### Format
265
+
266
+ ```bash
267
+ caffeinate -i /ralph-loop "PROMPT" \
268
+ --max-iterations 20 \
269
+ --completion-promise "COMPLETE"
270
+ ```
271
+
272
+ ### Prompt Should Include
273
+
274
+ - Clear acceptance criteria
275
+ - What to do if stuck
276
+ - The completion signal to output
277
+
278
+ ### In Ralph Loops
279
+
280
+ - Check for previous user answers before re-asking questions
281
+ - Output `<promise>AWAITING_INPUT</promise>` if questions are unanswered
282
+ - Track iteration count, be aware of token costs
283
+
284
+ ---
285
+
286
+ ## BEADS QUICK REFERENCE
287
+
288
+ ```bash
289
+ # See what's ready to work on
290
+ bd ready --json
291
+
292
+ # Create a task
293
+ bd create "Title" -t task -p 1 -d "Description" -l "labels" --json
294
+
295
+ # Start work
296
+ bd update ID --status in_progress
297
+
298
+ # Add dependency (B blocks A)
299
+ bd dep add A B --type blocks
300
+
301
+ # Link discovered issue
302
+ bd dep add NEW PARENT --type discovered-from
303
+
304
+ # Complete task
305
+ bd close ID --reason "Completed"
306
+
307
+ # Sync with git
308
+ bd sync
309
+ ```
310
+
311
+ ### Task Types
312
+ `epic`, `feature`, `bug`, `task`, `chore`
313
+
314
+ ### Priorities
315
+ `0` Critical, `1` High, `2` Medium, `3` Low, `4` Backlog
316
+
317
+ ---
318
+
319
+ ## COMMIT FORMAT
320
+
321
+ ```
322
+ type(scope): description [bd-xxx]
323
+
324
+ body (optional)
325
+ ```
326
+
327
+ **Types:** `feat`, `fix`, `refactor`, `test`, `docs`, `chore`
328
+
329
+ **Examples:**
330
+ ```
331
+ feat(auth): implement JWT refresh tokens [bd-a1b2]
332
+ fix(api): prevent N+1 query in orders list [bd-f14c]
333
+ test(users): add integration tests for registration [bd-3e7a]
334
+ ```
335
+
336
+ ---
337
+
338
+ ## THE ONE THING
339
+
340
+ If you remember nothing else:
341
+
342
+ > **Ask questions first. Create Beads tasks. Follow the checklists. Sync before ending.**
343
+
344
+ Everything else flows from that.
@@ -0,0 +1,132 @@
1
+ # Hybrid Hook Configuration for Claude Code
2
+ #
3
+ # This configuration demonstrates the hybrid approach: lightweight trigger scripts
4
+ # that delegate complex logic to AI subagents. This approach provides the best
5
+ # balance of immediate response and intelligent analysis.
6
+ #
7
+ # Place relevant sections in your Claude Code settings.json file.
8
+
9
+ ##################################
10
+ # Claude Code Settings.json Configuration
11
+ ##################################
12
+
13
+ # Copy sections below into your ~/.claude/settings.json file:
14
+
15
+ hooks_configuration:
16
+ PreToolUse:
17
+ - matcher: "Edit|Write|MultiEdit"
18
+ hooks:
19
+ - command: "~/.claude/hooks/pre-write-security.sh"
20
+ blocking: true
21
+ description: "Security analysis via security-auditor subagent"
22
+ timeout: 10000
23
+
24
+ PostToolUse:
25
+ - matcher: "Edit|Write|MultiEdit"
26
+ hooks:
27
+ - command: "~/.claude/hooks/file-logger.sh"
28
+ blocking: false
29
+ description: "Log file modifications"
30
+
31
+ # NOTE: There is no "OnError" hook event in Claude Code's schema.
32
+ # Valid hook events: PreToolUse, PostToolUse, Notification, Stop,
33
+ # SubagentStop, UserPromptSubmit, PreCompact, SessionStart, SessionEnd.
34
+ # Use on-error-debug.sh via manual invocation or PostToolUse instead.
35
+
36
+ custom:
37
+ pre-commit:
38
+ command: "~/.claude/hooks/pre-commit-quality.sh"
39
+ description: "Quality checks via style-enforcer subagent"
40
+ blocking: true
41
+
42
+ manual-security:
43
+ command: "~/.claude/hooks/subagent-trigger-simple.sh security-auditor manual"
44
+ description: "Manual security audit"
45
+
46
+ ##################################
47
+ # Trigger Script to Subagent Mapping
48
+ ##################################
49
+ # Reference for which trigger scripts delegate to which subagents:
50
+
51
+ trigger_mappings:
52
+ pre-write-security.sh:
53
+ delegates_to: "security-auditor"
54
+ purpose: "Scan for security vulnerabilities before file modifications"
55
+ context_includes: ["tool", "file", "user", "timestamp"]
56
+
57
+ pre-commit-quality.sh:
58
+ delegates_to: "style-enforcer"
59
+ purpose: "Code quality validation before git commits"
60
+ context_includes: ["staged_files", "git_info", "file_types"]
61
+
62
+ on-error-debug.sh:
63
+ delegates_to: "debug-specialist"
64
+ purpose: "Automatic debugging assistance when errors occur"
65
+ context_includes: ["error_info", "system_context", "diagnostics"]
66
+
67
+ subagent-trigger-simple.sh:
68
+ delegates_to: "any (specified as argument)"
69
+ purpose: "General-purpose lightweight subagent trigger"
70
+ context_includes: ["subagent", "event", "environment", "project"]
71
+
72
+ ##################################
73
+ # Available Subagents for Delegation
74
+ ##################################
75
+ # These subagents can be invoked by the trigger scripts:
76
+
77
+ available_subagents:
78
+ security-auditor:
79
+ specialization: "Security vulnerability detection and prevention"
80
+ best_for: ["credential_exposure", "injection_attacks", "access_control"]
81
+ trigger_events: ["pre_write", "pre_commit", "manual"]
82
+
83
+ style-enforcer:
84
+ specialization: "Code quality, formatting, and style consistency"
85
+ best_for: ["formatting", "imports", "documentation", "best_practices"]
86
+ trigger_events: ["pre_commit", "post_write", "manual"]
87
+
88
+ debug-specialist:
89
+ specialization: "Error analysis and troubleshooting"
90
+ best_for: ["error_analysis", "root_cause", "performance_issues"]
91
+ trigger_events: ["on_error", "manual"]
92
+
93
+ test-writer:
94
+ specialization: "Test case generation and validation"
95
+ best_for: ["test_coverage", "test_generation", "mocking"]
96
+ trigger_events: ["post_write", "pre_test", "manual"]
97
+
98
+ ##################################
99
+ # Usage Examples
100
+ ##################################
101
+
102
+ # Manual subagent invocation:
103
+ manual_usage:
104
+ - "~/.claude/hooks/subagent-trigger-simple.sh security-auditor pre_write"
105
+ - "~/.claude/hooks/subagent-trigger-simple.sh style-enforcer pre_commit 'Check Python files'"
106
+ - "~/.claude/hooks/subagent-trigger-simple.sh debug-specialist on_error 'ImportError'"
107
+
108
+ # Event-driven automatic invocation:
109
+ automatic_usage:
110
+ - "Edit/Write operations automatically trigger security analysis"
111
+ - "Git operations can trigger quality checks"
112
+ - "Errors automatically engage debugging assistance"
113
+
114
+ ##################################
115
+ # Migration from Complex to Hybrid
116
+ ##################################
117
+
118
+ migration_benefits:
119
+ before: "253-line complex bash orchestration script"
120
+ after: "4 lightweight trigger scripts (30-100 lines each)"
121
+ improvements:
122
+ - "Simplified maintenance and debugging"
123
+ - "AI-driven complex logic instead of bash complexity"
124
+ - "Better error handling and user feedback"
125
+ - "Modular trigger scripts for specific use cases"
126
+ - "Preserved shared utilities in hooks/lib/"
127
+
128
+ # To migrate:
129
+ # 1. Replace complex hooks with appropriate trigger scripts
130
+ # 2. Update Claude Code settings.json with new hook commands
131
+ # 3. Test triggers with manual invocation
132
+ # 4. Verify subagent delegation works correctly
@@ -0,0 +1,62 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(*)",
5
+ "Edit(*.md)",
6
+ "Edit(*.txt)",
7
+ "Edit(*.json)",
8
+ "Edit(*.yml)",
9
+ "Edit(*.yaml)",
10
+ "Bash(git *)",
11
+ "Bash(npm run *)",
12
+ "Bash(python -m *)",
13
+ "Bash(node *)",
14
+ "Glob(*)",
15
+ "Grep(*)"
16
+ ],
17
+ "deny": [
18
+ "Bash(curl *)",
19
+ "Bash(wget *)",
20
+ "Bash(ssh *)",
21
+ "Bash(sudo *)",
22
+ "Bash(rm -rf *)",
23
+ "Bash(*production*)",
24
+ "Bash(*admin*)",
25
+ "Edit(/etc/*)",
26
+ "Edit(/root/*)",
27
+ "Edit(~/.ssh/*)",
28
+ "Read(/etc/passwd)",
29
+ "Read(/etc/shadow)",
30
+ "Read(~/.aws/*)",
31
+ "Read(~/.ssh/id_*)"
32
+ ]
33
+ },
34
+ "hooks": {
35
+ "PreToolUse": [
36
+ {
37
+ "matcher": "Edit|Write|MultiEdit",
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "~/.claude/hooks/prevent-credential-exposure.sh",
42
+ "blocking": true,
43
+ "timeout": 10000
44
+ },
45
+ {
46
+ "type": "command",
47
+ "command": "~/.claude/hooks/verify-before-edit.sh",
48
+ "blocking": false,
49
+ "timeout": 5000
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ },
55
+ "env": {
56
+ "DISABLE_TELEMETRY": "1",
57
+ "ANTHROPIC_LOG": "error"
58
+ },
59
+ "includeCoAuthoredBy": false,
60
+ "cleanupPeriodDays": 7,
61
+ "enableAllProjectMcpServers": false
62
+ }