claude-code-autoconfig 1.0.15 → 1.0.17
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/.claude/commands/autoconfig.md +179 -265
- package/.claude/guide/autoconfig.guide.html +1748 -1869
- package/.claude/settings.json +1 -1
- package/.claude/settings.local.json +1 -7
- package/bin/cli.js +57 -20
- package/package.json +1 -1
package/.claude/settings.json
CHANGED
|
@@ -7,13 +7,7 @@
|
|
|
7
7
|
"Bash(del /q \"C:\\\\CODE\\\\claude-code-autoconfig\\\\.claude\\\\retro\\\\_TEMPLATE.md\")",
|
|
8
8
|
"Bash(git mv:*)",
|
|
9
9
|
"WebFetch(domain:github.com)",
|
|
10
|
-
"
|
|
11
|
-
"Bash(npm link)",
|
|
12
|
-
"Bash(npm pack:*)",
|
|
13
|
-
"Bash(npm login)",
|
|
14
|
-
"Bash(npm login --auth-type=web)",
|
|
15
|
-
"Bash(npm publish:*)",
|
|
16
|
-
"Bash(npm config set:*)"
|
|
10
|
+
"Bash(npm publish:*)"
|
|
17
11
|
]
|
|
18
12
|
}
|
|
19
13
|
}
|
package/bin/cli.js
CHANGED
|
@@ -13,11 +13,43 @@ const WINDOWS_RESERVED = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'C
|
|
|
13
13
|
'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5',
|
|
14
14
|
'LPT6', 'LPT7', 'LPT8', 'LPT9'];
|
|
15
15
|
|
|
16
|
+
// Files/folders installed by autoconfig - don't backup these
|
|
17
|
+
const AUTOCONFIG_FILES = ['commands', 'guide', 'agents', 'migration'];
|
|
18
|
+
|
|
16
19
|
function isReservedName(name) {
|
|
17
20
|
const baseName = name.replace(/\.[^.]*$/, '').toUpperCase();
|
|
18
21
|
return WINDOWS_RESERVED.includes(baseName);
|
|
19
22
|
}
|
|
20
23
|
|
|
24
|
+
function hasUserContent(claudeDir) {
|
|
25
|
+
// Check if .claude/ has any files beyond what autoconfig installs
|
|
26
|
+
if (!fs.existsSync(claudeDir)) return false;
|
|
27
|
+
|
|
28
|
+
const entries = fs.readdirSync(claudeDir);
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
if (!AUTOCONFIG_FILES.includes(entry)) {
|
|
31
|
+
// Found something that's not from autoconfig
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function formatTimestamp() {
|
|
39
|
+
const now = new Date();
|
|
40
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
|
41
|
+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
42
|
+
const month = months[now.getMonth()];
|
|
43
|
+
const day = now.getDate();
|
|
44
|
+
const year = now.getFullYear();
|
|
45
|
+
const hour = now.getHours();
|
|
46
|
+
const min = String(now.getMinutes()).padStart(2, '0');
|
|
47
|
+
const ampm = hour >= 12 ? 'pm' : 'am';
|
|
48
|
+
const hour12 = hour % 12 || 12;
|
|
49
|
+
|
|
50
|
+
return `${month}-${day}-${year}_${hour12}-${min}${ampm}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
21
53
|
console.log('\x1b[36m%s\x1b[0m', '🚀 Claude Code Autoconfig');
|
|
22
54
|
console.log();
|
|
23
55
|
|
|
@@ -54,7 +86,7 @@ if (!isClaudeInstalled()) {
|
|
|
54
86
|
|
|
55
87
|
console.log('\x1b[32m%s\x1b[0m', '✅ Claude Code detected');
|
|
56
88
|
|
|
57
|
-
// Step 2: Backup existing .claude/ if
|
|
89
|
+
// Step 2: Backup existing .claude/ if it has user content
|
|
58
90
|
const claudeDest = path.join(cwd, '.claude');
|
|
59
91
|
const SKIP_BACKUP = ['migration']; // Don't backup the migration folder itself
|
|
60
92
|
let migrationPath = null;
|
|
@@ -65,6 +97,7 @@ function copyDirForBackup(src, dest) {
|
|
|
65
97
|
|
|
66
98
|
for (const entry of entries) {
|
|
67
99
|
if (SKIP_BACKUP.includes(entry.name)) continue;
|
|
100
|
+
if (AUTOCONFIG_FILES.includes(entry.name)) continue; // Skip autoconfig-installed files
|
|
68
101
|
if (isReservedName(entry.name)) continue;
|
|
69
102
|
|
|
70
103
|
const srcPath = path.join(src, entry.name);
|
|
@@ -92,32 +125,33 @@ function collectFiles(dir, prefix = '') {
|
|
|
92
125
|
return files;
|
|
93
126
|
}
|
|
94
127
|
|
|
95
|
-
if (fs.existsSync(claudeDest)) {
|
|
96
|
-
|
|
97
|
-
const
|
|
128
|
+
if (fs.existsSync(claudeDest) && hasUserContent(claudeDest)) {
|
|
129
|
+
const timestamp = formatTimestamp();
|
|
130
|
+
const migrationDir = path.join(claudeDest, 'migration');
|
|
131
|
+
migrationPath = path.join(migrationDir, timestamp);
|
|
98
132
|
|
|
99
|
-
|
|
100
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
101
|
-
const migrationDir = path.join(claudeDest, 'migration');
|
|
102
|
-
migrationPath = path.join(migrationDir, timestamp);
|
|
133
|
+
fs.mkdirSync(migrationPath, { recursive: true });
|
|
103
134
|
|
|
104
|
-
|
|
135
|
+
// Copy user files to backup (excluding autoconfig-installed files)
|
|
136
|
+
const existingEntries = fs.readdirSync(claudeDest).filter(e =>
|
|
137
|
+
e !== 'migration' && !AUTOCONFIG_FILES.includes(e)
|
|
138
|
+
);
|
|
105
139
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const destPath = path.join(migrationPath, entry);
|
|
140
|
+
for (const entry of existingEntries) {
|
|
141
|
+
const srcPath = path.join(claudeDest, entry);
|
|
142
|
+
const destPath = path.join(migrationPath, entry);
|
|
110
143
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
144
|
+
if (fs.statSync(srcPath).isDirectory()) {
|
|
145
|
+
copyDirForBackup(srcPath, destPath);
|
|
146
|
+
} else {
|
|
147
|
+
fs.copyFileSync(srcPath, destPath);
|
|
116
148
|
}
|
|
149
|
+
}
|
|
117
150
|
|
|
118
|
-
|
|
119
|
-
|
|
151
|
+
// Collect backed up files for metadata
|
|
152
|
+
const backedUpFiles = collectFiles(migrationPath);
|
|
120
153
|
|
|
154
|
+
if (backedUpFiles.length > 0) {
|
|
121
155
|
// Write latest.json for the guide
|
|
122
156
|
fs.writeFileSync(path.join(migrationDir, 'latest.json'), JSON.stringify({
|
|
123
157
|
timestamp: timestamp,
|
|
@@ -150,6 +184,9 @@ cp .claude/migration/${timestamp}/settings.json .claude/settings.json
|
|
|
150
184
|
fs.writeFileSync(path.join(migrationPath, 'README.md'), backupReadme);
|
|
151
185
|
|
|
152
186
|
console.log('\x1b[33m%s\x1b[0m', `⚠️ Backed up existing config to .claude/migration/${timestamp}/`);
|
|
187
|
+
} else {
|
|
188
|
+
// No user files to backup, remove the empty migration folder
|
|
189
|
+
fs.rmdirSync(migrationPath, { recursive: true });
|
|
153
190
|
}
|
|
154
191
|
}
|
|
155
192
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-autoconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Intelligent, self-configuring setup for Claude Code. One command analyzes your project, configures Claude, and shows you what it did.",
|
|
5
5
|
"author": "ADAC 1001 <info@adac1001.com>",
|
|
6
6
|
"license": "MIT",
|