ccsetup 1.2.0 ā 1.2.1
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 +93 -24
- package/bin/create-project.js +373 -773
- package/lib/templates/README.md +2 -2
- package/lib/templates/metadata/agents.json +1 -1
- package/package.json +3 -2
- package/template/.claude/settings.json +18 -1
- package/template/.claude/skills/codex-review/SKILL.md +139 -0
- package/template/.claude/skills/secops/SKILL.md +259 -0
- package/template/.codex/skills/codex-review/SKILL.md +139 -0
- package/template/.codex/skills/prd/SKILL.md +343 -0
- package/template/.codex/skills/ralph/SKILL.md +339 -0
- package/template/AGENTS.md +43 -0
- package/template/CLAUDE.md +106 -4
- package/template/docs/codex-setup.md +32 -0
- package/template/hooks/codex-review/index.js +105 -0
- package/template/scripts/codex-review/codex-review.sh +266 -0
- package/template/scripts/ralph/CODEX.md +76 -0
- package/template/scripts/ralph/ralph.sh +32 -9
- package/bin/lib/contextGenerator.js +0 -287
- package/bin/lib/scanner/index.js +0 -28
- package/bin/scan.js +0 -367
- package/lib/aiMergeHelper.js +0 -112
- package/lib/contextGenerator.js +0 -574
- package/lib/contextMerger.js +0 -812
- package/lib/progressReporter.js +0 -88
- package/lib/scanConfig.js +0 -200
- package/lib/scanner/fileAnalyzer.js +0 -605
- package/lib/scanner/index.js +0 -164
- package/lib/scanner/patterns.js +0 -277
- package/lib/scanner/projectDetector.js +0 -147
package/lib/progressReporter.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
class ProgressReporter {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.startTime = Date.now();
|
|
4
|
-
this.filesScanned = 0;
|
|
5
|
-
this.totalFiles = 0;
|
|
6
|
-
this.currentPhase = '';
|
|
7
|
-
this.isVerbose = false;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
start(message = 'Scanning repository...') {
|
|
11
|
-
console.log(`š ${message}`);
|
|
12
|
-
this.startTime = Date.now();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
updateProgress(current, total, phase) {
|
|
16
|
-
this.filesScanned = current;
|
|
17
|
-
this.totalFiles = total;
|
|
18
|
-
this.currentPhase = phase;
|
|
19
|
-
|
|
20
|
-
if (this.isVerbose) {
|
|
21
|
-
const percentage = Math.round((current / total) * 100);
|
|
22
|
-
const progressBar = this.createProgressBar(percentage);
|
|
23
|
-
console.log(` ${phase} ${progressBar} ${percentage}% | ${current}/${total} files`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
createProgressBar(percentage) {
|
|
28
|
-
const filled = Math.round(percentage / 10);
|
|
29
|
-
const empty = 10 - filled;
|
|
30
|
-
return 'ā'.repeat(filled) + 'ā'.repeat(empty);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
phase(phaseName, details = '') {
|
|
34
|
-
const elapsed = ((Date.now() - this.startTime) / 1000).toFixed(1);
|
|
35
|
-
this.currentPhase = phaseName;
|
|
36
|
-
|
|
37
|
-
if (details) {
|
|
38
|
-
console.log(`āāā ${phaseName}... ${details} (${elapsed}s)`);
|
|
39
|
-
} else {
|
|
40
|
-
console.log(`āāā ${phaseName}...`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
phaseComplete(phaseName, result = '') {
|
|
45
|
-
const elapsed = ((Date.now() - this.startTime) / 1000).toFixed(1);
|
|
46
|
-
if (result) {
|
|
47
|
-
console.log(`āāā ${phaseName}... ā (${result})`);
|
|
48
|
-
} else {
|
|
49
|
-
console.log(`āāā ${phaseName}... ā`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
success(message) {
|
|
54
|
-
const duration = ((Date.now() - this.startTime) / 1000).toFixed(1);
|
|
55
|
-
console.log(`āāā ${message} ā (completed in ${duration}s)`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
fail(message) {
|
|
59
|
-
console.log(`āāā ā ${message}`);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
warn(message) {
|
|
63
|
-
console.log(`ā ļø ${message}`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
info(message) {
|
|
67
|
-
console.log(`ā¹ļø ${message}`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
setVerbose(verbose = true) {
|
|
71
|
-
this.isVerbose = verbose;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
getElapsedTime() {
|
|
75
|
-
return ((Date.now() - this.startTime) / 1000).toFixed(1);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
getScanStats() {
|
|
79
|
-
return {
|
|
80
|
-
filesScanned: this.filesScanned,
|
|
81
|
-
totalFiles: this.totalFiles,
|
|
82
|
-
elapsedTime: this.getElapsedTime(),
|
|
83
|
-
currentPhase: this.currentPhase
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
module.exports = ProgressReporter;
|
package/lib/scanConfig.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
class ScanConfigurator {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.presets = {
|
|
4
|
-
full: {
|
|
5
|
-
name: 'Full Scan',
|
|
6
|
-
description: 'Analyze entire repository with comprehensive detection',
|
|
7
|
-
scanOptions: ['dependencies', 'patterns', 'docs', 'config', 'tests'],
|
|
8
|
-
depth: 10,
|
|
9
|
-
ignore: '',
|
|
10
|
-
maxFiles: 5000
|
|
11
|
-
},
|
|
12
|
-
quick: {
|
|
13
|
-
name: 'Quick Scan',
|
|
14
|
-
description: 'Fast scan focusing on common files and patterns',
|
|
15
|
-
scanOptions: ['dependencies', 'patterns'],
|
|
16
|
-
depth: 3,
|
|
17
|
-
ignore: 'test/**,tests/**,__tests__/**,*.test.*,*.spec.*',
|
|
18
|
-
maxFiles: 1000
|
|
19
|
-
},
|
|
20
|
-
minimal: {
|
|
21
|
-
name: 'Minimal Scan',
|
|
22
|
-
description: 'Basic project detection only',
|
|
23
|
-
scanOptions: ['dependencies'],
|
|
24
|
-
depth: 2,
|
|
25
|
-
ignore: 'test/**,tests/**,__tests__/**,node_modules/**,dist/**,build/**',
|
|
26
|
-
maxFiles: 500
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async configure() {
|
|
32
|
-
try {
|
|
33
|
-
const { select } = await import('@inquirer/select');
|
|
34
|
-
|
|
35
|
-
console.log('š Repository Scanner Configuration\n');
|
|
36
|
-
|
|
37
|
-
const scanMode = await select({
|
|
38
|
-
message: 'Choose scan mode:',
|
|
39
|
-
choices: [
|
|
40
|
-
{
|
|
41
|
-
name: `${this.presets.full.name} - ${this.presets.full.description}`,
|
|
42
|
-
value: 'full'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: `${this.presets.quick.name} - ${this.presets.quick.description}`,
|
|
46
|
-
value: 'quick'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: `${this.presets.minimal.name} - ${this.presets.minimal.description}`,
|
|
50
|
-
value: 'minimal'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Custom Scan - Configure what to scan manually',
|
|
54
|
-
value: 'custom'
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
if (scanMode === 'custom') {
|
|
60
|
-
return await this.customConfiguration();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const preset = this.presets[scanMode];
|
|
64
|
-
console.log(`\nā
Selected ${preset.name}`);
|
|
65
|
-
console.log(` Depth: ${preset.depth} levels`);
|
|
66
|
-
console.log(` Max files: ${preset.maxFiles}`);
|
|
67
|
-
if (preset.ignore) {
|
|
68
|
-
console.log(` Ignoring: ${preset.ignore}`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
depth: preset.depth,
|
|
73
|
-
ignore: preset.ignore,
|
|
74
|
-
maxFiles: preset.maxFiles,
|
|
75
|
-
scanOptions: preset.scanOptions
|
|
76
|
-
};
|
|
77
|
-
} catch (error) {
|
|
78
|
-
console.log('ā ļø Interactive configuration not available. Using default settings.');
|
|
79
|
-
return this.getDefaultConfig();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
async customConfiguration() {
|
|
84
|
-
try {
|
|
85
|
-
const { checkbox, input, number } = await import('@inquirer/prompts');
|
|
86
|
-
|
|
87
|
-
const scanOptions = await checkbox({
|
|
88
|
-
message: 'Select what to scan:',
|
|
89
|
-
choices: [
|
|
90
|
-
{ name: 'Dependencies and package files', value: 'dependencies', checked: true },
|
|
91
|
-
{ name: 'Code patterns and architecture', value: 'patterns', checked: true },
|
|
92
|
-
{ name: 'Documentation files', value: 'docs', checked: true },
|
|
93
|
-
{ name: 'Configuration files', value: 'config', checked: true },
|
|
94
|
-
{ name: 'Test files and directories', value: 'tests', checked: false },
|
|
95
|
-
{ name: 'Build and deployment files', value: 'build', checked: false }
|
|
96
|
-
]
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
const depth = await number({
|
|
100
|
-
message: 'Maximum directory depth to scan:',
|
|
101
|
-
default: 5,
|
|
102
|
-
min: 1,
|
|
103
|
-
max: 20
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
const maxFiles = await number({
|
|
107
|
-
message: 'Maximum number of files to analyze:',
|
|
108
|
-
default: 1000,
|
|
109
|
-
min: 100,
|
|
110
|
-
max: 10000
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
const customIgnore = await input({
|
|
114
|
-
message: 'Additional ignore patterns (comma-separated):',
|
|
115
|
-
default: ''
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
console.log('\nā
Custom configuration created');
|
|
119
|
-
console.log(` Scan options: ${scanOptions.join(', ')}`);
|
|
120
|
-
console.log(` Depth: ${depth} levels`);
|
|
121
|
-
console.log(` Max files: ${maxFiles}`);
|
|
122
|
-
if (customIgnore) {
|
|
123
|
-
console.log(` Ignoring: ${customIgnore}`);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
depth,
|
|
128
|
-
ignore: customIgnore,
|
|
129
|
-
maxFiles,
|
|
130
|
-
scanOptions
|
|
131
|
-
};
|
|
132
|
-
} catch (error) {
|
|
133
|
-
console.log('\nā ļø Interactive prompts not available. Using default configuration.');
|
|
134
|
-
return this.getDefaultConfig();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
getDefaultConfig() {
|
|
139
|
-
return {
|
|
140
|
-
depth: 5,
|
|
141
|
-
ignore: '',
|
|
142
|
-
maxFiles: 1000,
|
|
143
|
-
scanOptions: ['dependencies', 'patterns', 'docs', 'config']
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
getPresetConfig(mode) {
|
|
148
|
-
return this.presets[mode] || this.getDefaultConfig();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
validateConfig(config) {
|
|
152
|
-
const errors = [];
|
|
153
|
-
|
|
154
|
-
if (!config.depth || config.depth < 1 || config.depth > 20) {
|
|
155
|
-
errors.push('Depth must be between 1 and 20');
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if (!config.maxFiles || config.maxFiles < 100 || config.maxFiles > 10000) {
|
|
159
|
-
errors.push('Max files must be between 100 and 10000');
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (!Array.isArray(config.scanOptions) || config.scanOptions.length === 0) {
|
|
163
|
-
errors.push('At least one scan option must be selected');
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return {
|
|
167
|
-
isValid: errors.length === 0,
|
|
168
|
-
errors
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
applyConfigToScanner(config, scannerOptions = {}) {
|
|
173
|
-
const validation = this.validateConfig(config);
|
|
174
|
-
if (!validation.isValid) {
|
|
175
|
-
throw new Error(`Invalid configuration: ${validation.errors.join(', ')}`);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return {
|
|
179
|
-
...scannerOptions,
|
|
180
|
-
maxDepth: config.depth,
|
|
181
|
-
maxFiles: config.maxFiles,
|
|
182
|
-
ignorePatterns: config.ignore ? config.ignore.split(',').map(p => p.trim()) : [],
|
|
183
|
-
scanOptions: config.scanOptions
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
showConfigSummary(config) {
|
|
188
|
-
console.log('\nš Scan Configuration Summary:');
|
|
189
|
-
console.log(` Mode: ${config.name || 'Custom'}`);
|
|
190
|
-
console.log(` Max depth: ${config.depth} levels`);
|
|
191
|
-
console.log(` Max files: ${config.maxFiles}`);
|
|
192
|
-
console.log(` Scan options: ${config.scanOptions.join(', ')}`);
|
|
193
|
-
if (config.ignore) {
|
|
194
|
-
console.log(` Ignore patterns: ${config.ignore}`);
|
|
195
|
-
}
|
|
196
|
-
console.log('');
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
module.exports = ScanConfigurator;
|