@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.
- package/LICENSE +21 -0
- package/README.md +88 -37
- package/bin/claude-commands +307 -65
- package/commands/active/xarchitecture.md +393 -0
- package/commands/active/xconfig.md +127 -0
- package/commands/active/xcontinue.md +92 -0
- package/commands/active/xdebug.md +130 -0
- package/commands/active/xdocs.md +178 -0
- package/commands/active/xexplore.md +94 -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/active/xverify.md +80 -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/xdevcontainer.md +238 -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 +903 -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/.smellrc.example.json +19 -0
- package/hooks/README.md +263 -0
- package/hooks/check-commit-signing.py +127 -0
- package/hooks/check-complexity.py +38 -0
- package/hooks/check-security.py +37 -0
- package/hooks/claude-wrapper.sh +29 -0
- package/hooks/config.py +110 -0
- package/hooks/file-logger.sh +100 -0
- package/hooks/lib/argument-parser.sh +427 -0
- package/hooks/lib/config-constants.sh +230 -0
- package/hooks/lib/context-manager.sh +560 -0
- package/hooks/lib/error-handler.sh +423 -0
- package/hooks/lib/execution-engine.sh +444 -0
- package/hooks/lib/execution-results.sh +113 -0
- package/hooks/lib/execution-simulation.sh +114 -0
- package/hooks/lib/field-validators.sh +104 -0
- package/hooks/lib/file-utils.sh +398 -0
- package/hooks/lib/subagent-discovery.sh +468 -0
- package/hooks/lib/subagent-validator.sh +407 -0
- package/hooks/lib/validation-reporter.sh +134 -0
- package/hooks/on-error-debug.sh +226 -0
- package/hooks/pre-commit-quality.sh +204 -0
- package/hooks/pre-commit-test-runner.sh +132 -0
- package/hooks/pre-write-security.sh +115 -0
- package/hooks/prevent-credential-exposure.sh +279 -0
- package/hooks/security_bandit.py +177 -0
- package/hooks/security_checks.py +97 -0
- package/hooks/security_secrets.py +81 -0
- package/hooks/security_trojan.py +61 -0
- package/hooks/settings.example.json +52 -0
- package/hooks/smell_checks.py +238 -0
- package/hooks/smell_javascript.py +231 -0
- package/hooks/smell_python.py +110 -0
- package/hooks/smell_ruff.py +70 -0
- package/hooks/smell_types.py +72 -0
- package/hooks/subagent-trigger-simple.sh +202 -0
- package/hooks/subagent-trigger.sh +253 -0
- package/hooks/suppression.py +82 -0
- package/hooks/tab-color.sh +70 -0
- package/hooks/verify-before-edit.sh +135 -0
- package/lib/backup-restore-command.js +140 -0
- package/lib/base/base-command.js +252 -0
- package/lib/base/command-result.js +184 -0
- package/lib/config/constants.js +255 -0
- package/lib/config.js +48 -6
- package/lib/configure-command.js +428 -0
- package/lib/dependency-validator.js +64 -5
- package/lib/hook-installer-core.js +2 -2
- package/lib/installation-instruction-generator.js +213 -495
- package/lib/installer.js +134 -56
- package/lib/oidc-command.js +740 -0
- package/lib/services/backup-list-service.js +226 -0
- package/lib/services/backup-service.js +230 -0
- package/lib/services/command-installer-service.js +217 -0
- package/lib/services/logger-service.js +201 -0
- package/lib/services/package-manager-service.js +319 -0
- package/lib/services/platform-instruction-service.js +294 -0
- package/lib/services/recovery-instruction-service.js +348 -0
- package/lib/services/restore-service.js +221 -0
- package/lib/setup-command.js +359 -0
- package/lib/setup-wizard.js +155 -262
- package/lib/uninstall-command.js +100 -0
- package/lib/utils/claude-path-config.js +184 -0
- package/lib/utils/file-system-utils.js +152 -0
- package/lib/utils.js +8 -4
- package/lib/verify-command.js +430 -0
- package/package.json +7 -3
- package/scripts/postinstall.js +172 -157
- package/subagents/debug-specialist.md +7 -0
- package/templates/README.md +115 -0
- package/templates/basic-settings.json +30 -0
- package/templates/comprehensive-settings.json +57 -0
- package/templates/global-claude.md +344 -0
- package/templates/hybrid-hook-config.yaml +132 -0
- package/templates/security-focused-settings.json +62 -0
- package/templates/subagent-hooks.yaml +188 -0
- package/lib/package-manager-service.js +0 -270
- package/subagents/debug-context.md +0 -197
package/scripts/postinstall.js
CHANGED
|
@@ -3,180 +3,195 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
|
-
const { execSync } = require('child_process');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
process.argv.includes('--skip-setup');
|
|
7
|
+
const skipSetup = process.env.CLAUDE_SKIP_SETUP === 'true' ||
|
|
8
|
+
process.argv.includes('--skip-setup');
|
|
11
9
|
|
|
12
|
-
console.log('
|
|
10
|
+
console.log('Setting up Claude Custom Commands...');
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
console.log('✅ Created .claude/commands directory');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!fs.existsSync(hooksDir)) {
|
|
34
|
-
fs.mkdirSync(hooksDir, { recursive: true });
|
|
35
|
-
console.log('✅ Created .claude/hooks directory');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Get package installation directory
|
|
39
|
-
const packageDir = __dirname.replace('/scripts', '');
|
|
40
|
-
|
|
41
|
-
// Check if we should run interactive setup
|
|
42
|
-
if (!skipSetup && process.stdin.isTTY) {
|
|
43
|
-
console.log('\n📋 Starting Interactive Setup Wizard...');
|
|
44
|
-
console.log('(Use --skip-setup or set CLAUDE_SKIP_SETUP=true to skip)\n');
|
|
45
|
-
|
|
46
|
-
const InteractiveSetupWizard = require('../lib/setup-wizard');
|
|
47
|
-
const wizard = new InteractiveSetupWizard(claudeDir);
|
|
48
|
-
|
|
49
|
-
// Validate environment first (REQ-006)
|
|
50
|
-
const envCheck = wizard.validateEnvironment();
|
|
51
|
-
if (!envCheck.valid) {
|
|
52
|
-
console.error('❌ Environment validation failed:', envCheck.message);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Run interactive setup (REQ-007)
|
|
57
|
-
const setupResult = await wizard.runInteractiveSetup();
|
|
58
|
-
|
|
59
|
-
if (setupResult.completed) {
|
|
60
|
-
const config = setupResult.configuration;
|
|
61
|
-
|
|
62
|
-
// Install commands based on selection
|
|
63
|
-
const sourceCommandsDir = path.join(packageDir, 'commands');
|
|
64
|
-
if (fs.existsSync(sourceCommandsDir)) {
|
|
65
|
-
copySelectedCommands(sourceCommandsDir, commandsDir, config);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Install security hooks if selected
|
|
69
|
-
if (config.securityHooks) {
|
|
70
|
-
const sourceHooksDir = path.join(packageDir, 'hooks');
|
|
71
|
-
if (fs.existsSync(sourceHooksDir)) {
|
|
72
|
-
copySelectedHooks(sourceHooksDir, hooksDir, config.selectedHooks || []);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Apply configuration template
|
|
77
|
-
if (config.template) {
|
|
78
|
-
const templateFile = path.join(packageDir, 'templates', `${config.template}-settings.json`);
|
|
79
|
-
const targetFile = path.join(claudeDir, 'settings.json');
|
|
80
|
-
if (fs.existsSync(templateFile)) {
|
|
81
|
-
fs.copyFileSync(templateFile, targetFile);
|
|
82
|
-
console.log(`✅ Applied ${config.template} configuration template`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
// Non-interactive installation - install all commands by default
|
|
88
|
-
console.log('Running non-interactive installation...');
|
|
89
|
-
|
|
90
|
-
const sourceCommandsDir = path.join(packageDir, 'commands');
|
|
91
|
-
if (fs.existsSync(sourceCommandsDir)) {
|
|
92
|
-
copyAllCommands(sourceCommandsDir, commandsDir);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Count installed commands (now in flat structure)
|
|
97
|
-
if (fs.existsSync(commandsDir)) {
|
|
98
|
-
const installedCommands = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md')).length;
|
|
99
|
-
console.log(`\n📦 Installed ${installedCommands} commands`);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
console.log('\n🎉 Installation complete!');
|
|
103
|
-
console.log('\nNext steps:');
|
|
104
|
-
console.log('1. Run: claude-commands list');
|
|
105
|
-
console.log('2. Try: claude-commands --help');
|
|
106
|
-
console.log('3. Configure: claude-commands config');
|
|
107
|
-
console.log('4. Explore commands in Claude Code using /xhelp\n');
|
|
108
|
-
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.error('❌ Installation failed:', error.message);
|
|
111
|
-
process.exit(1);
|
|
112
|
-
}
|
|
12
|
+
// --- Directory helpers ---
|
|
13
|
+
|
|
14
|
+
function ensureDir(dirPath, label) {
|
|
15
|
+
if (fs.existsSync(dirPath)) return;
|
|
16
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
17
|
+
console.log(` Created ${label}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getClaudeDirs() {
|
|
21
|
+
const homeDir = os.homedir();
|
|
22
|
+
const claudeDir = path.join(homeDir, '.claude');
|
|
23
|
+
return {
|
|
24
|
+
claudeDir,
|
|
25
|
+
commandsDir: path.join(claudeDir, 'commands'),
|
|
26
|
+
hooksDir: path.join(claudeDir, 'hooks')
|
|
27
|
+
};
|
|
113
28
|
}
|
|
114
29
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (fs.statSync(
|
|
122
|
-
|
|
123
|
-
fs.mkdirSync(targetPath, { recursive: true });
|
|
124
|
-
}
|
|
125
|
-
copyAllCommands(sourcePath, targetPath);
|
|
30
|
+
// --- Command copying ---
|
|
31
|
+
|
|
32
|
+
function copyCommandsFlat(sourceDir, targetDir) {
|
|
33
|
+
if (!fs.existsSync(sourceDir)) return;
|
|
34
|
+
for (const item of fs.readdirSync(sourceDir)) {
|
|
35
|
+
const src = path.join(sourceDir, item);
|
|
36
|
+
if (fs.statSync(src).isDirectory()) {
|
|
37
|
+
copyCommandsFlat(src, targetDir);
|
|
126
38
|
} else if (item.endsWith('.md')) {
|
|
127
|
-
fs.copyFileSync(
|
|
39
|
+
fs.copyFileSync(src, path.join(targetDir, item));
|
|
40
|
+
console.log(` Installed command: ${item}`);
|
|
128
41
|
}
|
|
129
42
|
}
|
|
130
43
|
}
|
|
131
44
|
|
|
45
|
+
function copyCommandSubdir(sourceDir, subdir, targetDir) {
|
|
46
|
+
const sub = path.join(sourceDir, subdir);
|
|
47
|
+
if (fs.existsSync(sub)) copyCommandsFlat(sub, targetDir);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function shouldCopyActive(type, sets) {
|
|
51
|
+
return type === 'standard' || sets.includes('development');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function shouldCopyExperimental(type, sets) {
|
|
55
|
+
return type === 'full' || sets.includes('experimental');
|
|
56
|
+
}
|
|
57
|
+
|
|
132
58
|
function copySelectedCommands(sourceDir, targetDir, config) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
59
|
+
const type = config.installationType || 'standard';
|
|
60
|
+
if (type === 'full' || !config.commandSets) {
|
|
61
|
+
copyCommandsFlat(sourceDir, targetDir);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const sets = config.commandSets || [];
|
|
65
|
+
if (shouldCopyActive(type, sets)) copyCommandSubdir(sourceDir, 'active', targetDir);
|
|
66
|
+
if (shouldCopyExperimental(type, sets)) copyCommandSubdir(sourceDir, 'experiments', targetDir);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// --- Hook copying ---
|
|
70
|
+
|
|
71
|
+
function copyHookFile(src, dest, label) {
|
|
72
|
+
fs.copyFileSync(src, dest);
|
|
73
|
+
if (label.endsWith('.sh')) fs.chmodSync(dest, '755');
|
|
74
|
+
console.log(` Installed hook: ${label}`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function copyHooksLibDir(sourceDir, targetDir) {
|
|
78
|
+
const libSrc = path.join(sourceDir, 'lib');
|
|
79
|
+
if (!fs.existsSync(libSrc)) return;
|
|
80
|
+
const libDest = path.join(targetDir, 'lib');
|
|
81
|
+
ensureDir(libDest, 'hooks/lib');
|
|
82
|
+
for (const f of fs.readdirSync(libSrc)) {
|
|
83
|
+
const src = path.join(libSrc, f);
|
|
84
|
+
if (fs.statSync(src).isFile()) {
|
|
85
|
+
copyHookFile(src, path.join(libDest, f), `lib/${f}`);
|
|
157
86
|
}
|
|
158
87
|
}
|
|
159
88
|
}
|
|
160
89
|
|
|
161
90
|
function copySelectedHooks(sourceDir, targetDir, selectedHooks) {
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
91
|
+
for (const item of fs.readdirSync(sourceDir)) {
|
|
92
|
+
const src = path.join(sourceDir, item);
|
|
93
|
+
if (fs.statSync(src).isDirectory()) continue;
|
|
94
|
+
const match = selectedHooks.length === 0 || selectedHooks.some(h => item.includes(h));
|
|
95
|
+
if (match) copyHookFile(src, path.join(targetDir, item), item);
|
|
96
|
+
}
|
|
97
|
+
copyHooksLibDir(sourceDir, targetDir);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// --- Template application ---
|
|
101
|
+
|
|
102
|
+
function applyTemplate(packageDir, claudeDir, templateName) {
|
|
103
|
+
const src = path.join(packageDir, 'templates', `${templateName}-settings.json`);
|
|
104
|
+
if (!fs.existsSync(src)) return;
|
|
105
|
+
const dest = path.join(claudeDir, 'settings.json');
|
|
106
|
+
fs.copyFileSync(src, dest);
|
|
107
|
+
console.log(` Applied ${templateName} configuration template`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// --- Interactive setup ---
|
|
111
|
+
|
|
112
|
+
function installFromConfig(packageDir, dirs, config) {
|
|
113
|
+
const cmdSrc = path.join(packageDir, 'commands');
|
|
114
|
+
if (fs.existsSync(cmdSrc)) copySelectedCommands(cmdSrc, dirs.commandsDir, config);
|
|
115
|
+
if (config.securityHooks) {
|
|
116
|
+
const hookSrc = path.join(packageDir, 'hooks');
|
|
117
|
+
if (fs.existsSync(hookSrc)) copySelectedHooks(hookSrc, dirs.hooksDir, config.selectedHooks || []);
|
|
118
|
+
}
|
|
119
|
+
if (config.template) applyTemplate(packageDir, dirs.claudeDir, config.template);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async function runInteractiveInstall(packageDir, dirs) {
|
|
123
|
+
console.log('\nStarting Interactive Setup Wizard...');
|
|
124
|
+
console.log('(Use --skip-setup or set CLAUDE_SKIP_SETUP=true to skip)\n');
|
|
125
|
+
const Wizard = require('../lib/setup-wizard');
|
|
126
|
+
const wizard = new Wizard(dirs.claudeDir);
|
|
127
|
+
const envCheck = wizard.validateEnvironment();
|
|
128
|
+
if (!envCheck.valid) {
|
|
129
|
+
console.error('Environment validation failed:', envCheck.message);
|
|
130
|
+
console.error('\nTroubleshooting:');
|
|
131
|
+
console.error(' - Ensure Node.js >= 18 is installed');
|
|
132
|
+
console.error(' - Check write permissions on ~/.claude/');
|
|
133
|
+
console.error(' - Try: claude-commands setup --dry-run');
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
const result = await wizard.runInteractiveSetup();
|
|
137
|
+
if (!result.completed) return;
|
|
138
|
+
installFromConfig(packageDir, dirs, result.configuration);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// --- Non-interactive setup ---
|
|
142
|
+
|
|
143
|
+
function runNonInteractiveInstall(packageDir, dirs) {
|
|
144
|
+
console.log('Running non-interactive installation...');
|
|
145
|
+
const cmdSrc = path.join(packageDir, 'commands');
|
|
146
|
+
if (fs.existsSync(cmdSrc)) copyCommandsFlat(cmdSrc, dirs.commandsDir);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// --- Main ---
|
|
150
|
+
|
|
151
|
+
function printSummary(commandsDir) {
|
|
152
|
+
if (fs.existsSync(commandsDir)) {
|
|
153
|
+
const count = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md')).length;
|
|
154
|
+
console.log(`\nInstalled ${count} commands`);
|
|
155
|
+
}
|
|
156
|
+
console.log('\nInstallation complete!');
|
|
157
|
+
console.log('\nNext steps:');
|
|
158
|
+
console.log('1. Run: claude-commands list');
|
|
159
|
+
console.log('2. Try: claude-commands --help');
|
|
160
|
+
console.log('3. Configure: claude-commands config');
|
|
161
|
+
console.log('4. Explore commands in Claude Code using /xhelp\n');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function printInstallError(error) {
|
|
165
|
+
console.error('Installation failed:', error.message);
|
|
166
|
+
console.error('\nTroubleshooting:');
|
|
167
|
+
console.error(' - Check write permissions: ls -la ~/.claude/');
|
|
168
|
+
console.error(' - Try manual install: claude-commands install --all');
|
|
169
|
+
console.error(' - Report issues: https://github.com/PaulDuvall/claude-code/issues');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function initDirs() {
|
|
173
|
+
const dirs = getClaudeDirs();
|
|
174
|
+
ensureDir(dirs.claudeDir, '.claude');
|
|
175
|
+
ensureDir(dirs.commandsDir, '.claude/commands');
|
|
176
|
+
ensureDir(dirs.hooksDir, '.claude/hooks');
|
|
177
|
+
return dirs;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function runSetup() {
|
|
181
|
+
try {
|
|
182
|
+
const dirs = initDirs();
|
|
183
|
+
const packageDir = path.dirname(__dirname);
|
|
184
|
+
|
|
185
|
+
if (!skipSetup && process.stdin.isTTY) {
|
|
186
|
+
await runInteractiveInstall(packageDir, dirs);
|
|
187
|
+
} else {
|
|
188
|
+
runNonInteractiveInstall(packageDir, dirs);
|
|
177
189
|
}
|
|
190
|
+
printSummary(dirs.commandsDir);
|
|
191
|
+
} catch (error) {
|
|
192
|
+
printInstallError(error);
|
|
193
|
+
process.exit(1);
|
|
178
194
|
}
|
|
179
195
|
}
|
|
180
196
|
|
|
181
|
-
|
|
182
|
-
runSetup();
|
|
197
|
+
runSetup();
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-specialist
|
|
3
|
+
description: "Specialized debugging assistant with expertise in root cause analysis, error interpretation, and systematic troubleshooting"
|
|
4
|
+
tags: ["debugging", "error-analysis", "troubleshooting", "performance"]
|
|
5
|
+
tools: ["Read", "Bash", "Grep", "Edit", "Glob"]
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# Debug Specialist Sub-Agent
|
|
2
9
|
|
|
3
10
|
## Agent Description
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
### 4. `global-claude.md`
|
|
63
|
+
**Use case**: Universal development standards for all projects
|
|
64
|
+
**Features**:
|
|
65
|
+
- Verification-before-action rules (prevent fabricated references)
|
|
66
|
+
- Zero-error test policy
|
|
67
|
+
- Platform-specific formatting guidelines (LinkedIn, Slack, GitHub, email)
|
|
68
|
+
- Code structure limits (function length, nesting, complexity)
|
|
69
|
+
- Security checklist (no hardcoded secrets, parameterized SQL, input validation)
|
|
70
|
+
- Session management and failure protocols
|
|
71
|
+
|
|
72
|
+
**To use**:
|
|
73
|
+
```bash
|
|
74
|
+
cp templates/global-claude.md ~/.claude/CLAUDE.md
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Configuration Notes
|
|
78
|
+
|
|
79
|
+
### Settings Hierarchy
|
|
80
|
+
Settings are applied in this order (later overrides earlier):
|
|
81
|
+
1. User settings: `~/.claude/settings.json`
|
|
82
|
+
2. Project settings: `.claude/settings.json`
|
|
83
|
+
3. Local settings: `.claude/settings.local.json`
|
|
84
|
+
|
|
85
|
+
### Security Considerations
|
|
86
|
+
- Always review webhook URLs before using
|
|
87
|
+
- Set appropriate file permissions: `chmod 600 ~/.claude/settings.json`
|
|
88
|
+
- Store sensitive settings in environment variables, not directly in JSON
|
|
89
|
+
- Use `.claude/settings.local.json` for personal settings in team projects
|
|
90
|
+
|
|
91
|
+
### Customization
|
|
92
|
+
These templates are starting points. Customize based on your needs:
|
|
93
|
+
- Add/remove allowed tools
|
|
94
|
+
- Adjust timeout values
|
|
95
|
+
- Configure additional hooks
|
|
96
|
+
- Set team-specific environment variables
|
|
97
|
+
|
|
98
|
+
### Validation
|
|
99
|
+
Use the validation script to check your configuration:
|
|
100
|
+
```bash
|
|
101
|
+
./validate-commands.sh --check-settings
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Troubleshooting
|
|
105
|
+
|
|
106
|
+
### Common Issues
|
|
107
|
+
1. **Commands not working**: Check `allowedTools` array includes required tools
|
|
108
|
+
2. **Hooks not running**: Verify executable permissions and file paths
|
|
109
|
+
3. **Timeouts**: Increase timeout values for slow operations
|
|
110
|
+
4. **Permissions errors**: Check file permissions on settings.json and hooks
|
|
111
|
+
|
|
112
|
+
### Getting Help
|
|
113
|
+
- Run `./verify-setup.sh` to diagnose issues
|
|
114
|
+
- Check Claude Code logs: `~/.claude/logs/`
|
|
115
|
+
- Review the main README.md troubleshooting section
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(*)",
|
|
5
|
+
"Read(*)",
|
|
6
|
+
"Edit(*)",
|
|
7
|
+
"Write(*)",
|
|
8
|
+
"Glob(*)",
|
|
9
|
+
"Grep(*)"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"hooks": {
|
|
13
|
+
"PreToolUse": [
|
|
14
|
+
{
|
|
15
|
+
"matcher": "*",
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "echo 'Tool execution logged at $(date)' >> ~/.claude/logs/tool-usage.log"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"env": {
|
|
26
|
+
"DISABLE_TELEMETRY": "1"
|
|
27
|
+
},
|
|
28
|
+
"includeCoAuthoredBy": true,
|
|
29
|
+
"cleanupPeriodDays": 30
|
|
30
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(*)",
|
|
5
|
+
"Read(*)",
|
|
6
|
+
"Edit(*)",
|
|
7
|
+
"Write(*)",
|
|
8
|
+
"Glob(*)",
|
|
9
|
+
"Grep(*)",
|
|
10
|
+
"WebFetch(*)",
|
|
11
|
+
"WebSearch(*)",
|
|
12
|
+
"NotebookEdit(*)"
|
|
13
|
+
],
|
|
14
|
+
"ask": [
|
|
15
|
+
"Bash(sudo *)",
|
|
16
|
+
"Bash(rm -rf *)",
|
|
17
|
+
"Edit(/etc/*)",
|
|
18
|
+
"Read(~/.ssh/*)"
|
|
19
|
+
],
|
|
20
|
+
"deny": [
|
|
21
|
+
"Bash(*production*)",
|
|
22
|
+
"Bash(*admin*)",
|
|
23
|
+
"Read(/etc/shadow)",
|
|
24
|
+
"Edit(/etc/passwd)"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"hooks": {
|
|
28
|
+
"PreToolUse": [
|
|
29
|
+
{
|
|
30
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
31
|
+
"hooks": [
|
|
32
|
+
{
|
|
33
|
+
"type": "command",
|
|
34
|
+
"command": "~/.claude/hooks/prevent-credential-exposure.sh",
|
|
35
|
+
"blocking": true,
|
|
36
|
+
"timeout": 10000
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "~/.claude/hooks/verify-before-edit.sh",
|
|
41
|
+
"blocking": false,
|
|
42
|
+
"timeout": 5000
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"PostToolUse": []
|
|
48
|
+
},
|
|
49
|
+
"env": {
|
|
50
|
+
"DISABLE_TELEMETRY": "1",
|
|
51
|
+
"ANTHROPIC_LOG": "info"
|
|
52
|
+
},
|
|
53
|
+
"includeCoAuthoredBy": true,
|
|
54
|
+
"cleanupPeriodDays": 30,
|
|
55
|
+
"model": "claude-sonnet-4-6",
|
|
56
|
+
"enableAllProjectMcpServers": false
|
|
57
|
+
}
|