@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/lib/installer.js
CHANGED
|
@@ -1,68 +1,146 @@
|
|
|
1
|
-
// Installation logic for Claude Dev Toolkit
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
1
|
+
// Enhanced Installation logic for Claude Dev Toolkit - Refactored
|
|
2
|
+
const BaseCommand = require('./base/base-command');
|
|
3
|
+
const CommandInstallerService = require('./services/command-installer-service');
|
|
4
|
+
const BackupService = require('./services/backup-service');
|
|
5
|
+
const FileSystemUtils = require('./utils/file-system-utils');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let installedCount = 0;
|
|
7
|
+
class CommandInstaller extends BaseCommand {
|
|
8
|
+
constructor(config = null) {
|
|
9
|
+
super(config);
|
|
10
|
+
this.installerService = new CommandInstallerService(this.config);
|
|
11
|
+
this.backupService = new BackupService(this.config);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Main install method with enhanced options
|
|
16
|
+
*/
|
|
17
|
+
async install(options = {}) {
|
|
18
|
+
this.logger.step('Installing Claude Custom Commands', { options });
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const startTime = Date.now();
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
// Handle dry-run mode
|
|
24
|
+
if (options['dry-run'] || options.dryRun) {
|
|
25
|
+
return await this.dryRun(options);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Validate installation requirements
|
|
29
|
+
const validation = this.installerService.validateInstallation();
|
|
30
|
+
if (!validation.valid) {
|
|
31
|
+
throw new Error(`Installation validation failed: ${validation.issues.join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Create backup if requested
|
|
35
|
+
if (options.backup) {
|
|
36
|
+
this.logger.step('Creating backup before installation');
|
|
37
|
+
const backupResult = await this.backupService.create(`pre-install-${Date.now()}`);
|
|
38
|
+
this.logger.success(`Backup created: ${backupResult.name}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Install commands using service
|
|
42
|
+
const result = await this.installerService.install(options);
|
|
43
|
+
|
|
44
|
+
// Report results
|
|
45
|
+
const duration = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
25
46
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
const installContext = {
|
|
48
|
+
activeCommands: result.results.active,
|
|
49
|
+
experimentalCommands: result.results.experimental,
|
|
50
|
+
skippedCommands: result.skippedCount,
|
|
51
|
+
totalInstalled: result.installedCount,
|
|
52
|
+
duration: parseFloat(duration)
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
if (result.results.active > 0) {
|
|
56
|
+
this.logger.success(`Installed ${result.results.active} active commands`);
|
|
36
57
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
if (result.results.experimental > 0) {
|
|
59
|
+
this.logger.success(`Installed ${result.results.experimental} experimental commands`);
|
|
60
|
+
}
|
|
61
|
+
if (result.skippedCount > 0) {
|
|
62
|
+
this.logger.warn(`Skipped ${result.skippedCount} commands due to errors`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
this.logger.complete(`Installation complete! ${result.installedCount} commands installed`, installContext);
|
|
43
66
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
path.join(expTarget, file)
|
|
50
|
-
);
|
|
67
|
+
// Performance check
|
|
68
|
+
if (parseFloat(duration) > 30) {
|
|
69
|
+
this.logger.warn('Installation took longer than expected (>30s)', {
|
|
70
|
+
actualDuration: duration,
|
|
71
|
+
expectedMaxDuration: 30
|
|
51
72
|
});
|
|
52
|
-
installedCount += expFiles.length;
|
|
53
|
-
console.log(`✅ Installed ${expFiles.length} experimental commands`);
|
|
54
73
|
}
|
|
74
|
+
|
|
75
|
+
this.logger.info('Next steps:', {
|
|
76
|
+
nextSteps: [
|
|
77
|
+
'Verify: claude-commands verify',
|
|
78
|
+
'List: claude-commands list',
|
|
79
|
+
'Use in Claude Code: /xhelp'
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
success: true,
|
|
85
|
+
installedPath: this.config.commandsDir,
|
|
86
|
+
commandsInstalled: result.installedCount,
|
|
87
|
+
skipped: result.skippedCount,
|
|
88
|
+
duration: duration,
|
|
89
|
+
backupPath: options.backup ? this.config.backupsDir : null
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
} catch (error) {
|
|
93
|
+
return this.handleError(error, options);
|
|
55
94
|
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Dry run mode - show what would be installed
|
|
99
|
+
*/
|
|
100
|
+
async dryRun(options) {
|
|
101
|
+
this.logger.info('DRY RUN MODE - No changes will be made', { options });
|
|
102
|
+
|
|
103
|
+
const preview = this.installerService.getDryRunPreview(options);
|
|
56
104
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
105
|
+
this.logger.info('Would install the following commands:', {
|
|
106
|
+
destination: preview.destination,
|
|
107
|
+
totalCommands: preview.total
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
if (preview.byType.active.length > 0) {
|
|
111
|
+
this.logger.info(`Active Commands (${preview.byType.active.length}):`, {
|
|
112
|
+
activeCommands: preview.byType.active.map(cmd => cmd.file)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (preview.byType.experimental.length > 0) {
|
|
117
|
+
this.logger.info(`Experimental Commands (${preview.byType.experimental.length}):`, {
|
|
118
|
+
experimentalCommands: preview.byType.experimental.map(cmd => cmd.file)
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (options.backup) {
|
|
123
|
+
this.logger.info('Would create backup before installation');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this.logger.success(`Total commands to install: ${preview.total}`, {
|
|
127
|
+
summary: preview.byType,
|
|
128
|
+
dryRun: true
|
|
129
|
+
});
|
|
61
130
|
|
|
62
|
-
return {
|
|
63
|
-
success: true,
|
|
64
|
-
|
|
65
|
-
|
|
131
|
+
return {
|
|
132
|
+
success: true,
|
|
133
|
+
dryRun: true,
|
|
134
|
+
wouldInstall: preview.total,
|
|
135
|
+
details: preview.byType
|
|
66
136
|
};
|
|
67
137
|
}
|
|
68
|
-
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Export as function for backward compatibility
|
|
141
|
+
module.exports = {
|
|
142
|
+
install: async (options = {}) => {
|
|
143
|
+
const installer = new CommandInstaller();
|
|
144
|
+
return installer.install(options);
|
|
145
|
+
}
|
|
146
|
+
};
|