claude-code-autoconfig 1.0.176 → 1.0.177

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.
@@ -1268,7 +1268,7 @@
1268
1268
  title: '.claude/ Directory',
1269
1269
  desc: 'Commands, rules, settings, and these docs. Keeps configuration organized as your project grows.'
1270
1270
  },
1271
- 'rules': {
1271
+ 'rules': {
1272
1272
  title: 'rules/',
1273
1273
  desc: 'Path-scoped context that loads when Claude works on matching files.'
1274
1274
  },
@@ -1579,7 +1579,7 @@ CRITICAL: A plausible-looking cause from code reading is NOT confirmed evidence.
1579
1579
 
1580
1580
  > Run \`/autoconfig\` to populate this based on your project.`
1581
1581
  },
1582
- 'autoconfig-update': {
1582
+ 'autoconfig-update': {
1583
1583
  filename: 'autoconfig-update.md',
1584
1584
  content: `<!-- @applied
1585
1585
  -->
package/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.177
4
+ - feat: add pre-install diagnostic logging and fix AUTOCONFIG_FILES
5
+
3
6
  ## v1.0.176
4
7
  - fix: add feedback to AUTOCONFIG_FILES to prevent false upgrade detection
5
8
 
@@ -144,6 +147,3 @@
144
147
  ## v1.0.128
145
148
  - fix: show estimated tokens instead of bytes in /recover-context
146
149
 
147
- ## v1.0.127
148
- - feat: SessionStart hook for feedback migration, merge hooks on upgrade
149
-
package/bin/cli.js CHANGED
@@ -27,7 +27,7 @@ const WINDOWS_RESERVED = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'C
27
27
  'LPT6', 'LPT7', 'LPT8', 'LPT9'];
28
28
 
29
29
  // Files/folders installed by autoconfig - don't backup these
30
- const AUTOCONFIG_FILES = ['commands', 'docs', 'agents', 'migration', 'hooks', 'updates', 'scripts', 'rules', 'feedback'];
30
+ const AUTOCONFIG_FILES = ['commands', 'docs', 'agents', 'migration', 'hooks', 'updates', 'scripts', 'rules', 'feedback', 'settings.json', '.mcp.json', '.autoconfig-version'];
31
31
 
32
32
  function isReservedName(name) {
33
33
  const baseName = name.replace(/\.[^.]*$/, '').toUpperCase();
@@ -198,6 +198,32 @@ const claudeDest = path.join(cwd, '.claude');
198
198
  const SKIP_BACKUP = ['migration']; // Don't backup the migration folder itself
199
199
  let migrationPath = null;
200
200
 
201
+ // Diagnostic: log pre-install state
202
+ console.log();
203
+ console.log('\x1b[90m%s\x1b[0m', '── Pre-install state ──');
204
+ console.log('\x1b[90m%s\x1b[0m', ` Working dir: ${cwd}`);
205
+ const claudeMdExists = fs.existsSync(path.join(cwd, 'CLAUDE.md'));
206
+ console.log('\x1b[90m%s\x1b[0m', ` CLAUDE.md: ${claudeMdExists ? 'exists' : 'not found'}`);
207
+ if (claudeMdExists) {
208
+ const claudeMdContent = fs.readFileSync(path.join(cwd, 'CLAUDE.md'), 'utf8');
209
+ const hasMarker = claudeMdContent.includes('AUTO-GENERATED BY /autoconfig');
210
+ console.log('\x1b[90m%s\x1b[0m', ` CLAUDE.md autoconfig marker: ${hasMarker ? 'yes' : 'no'}`);
211
+ }
212
+ if (fs.existsSync(claudeDest)) {
213
+ const entries = fs.readdirSync(claudeDest);
214
+ console.log('\x1b[90m%s\x1b[0m', ` .claude/ exists: yes (${entries.length} entries)`);
215
+ for (const e of entries) {
216
+ const isAutoconfig = AUTOCONFIG_FILES.includes(e);
217
+ console.log('\x1b[90m%s\x1b[0m', ` ${isAutoconfig ? '·' : '▸'} ${e}${isAutoconfig ? '' : ' (user content)'}`);
218
+ }
219
+ const docsHtml = path.join(claudeDest, 'docs', 'autoconfig.docs.html');
220
+ console.log('\x1b[90m%s\x1b[0m', ` autoconfig.docs.html: ${fs.existsSync(docsHtml) ? 'exists' : 'not found'}`);
221
+ } else {
222
+ console.log('\x1b[90m%s\x1b[0m', ' .claude/ exists: no');
223
+ }
224
+ console.log('\x1b[90m%s\x1b[0m', '───────────────────────');
225
+ console.log();
226
+
201
227
  function copyDirForBackup(src, dest) {
202
228
  fs.mkdirSync(dest, { recursive: true });
203
229
  const entries = fs.readdirSync(src, { withFileTypes: true });
@@ -233,6 +259,11 @@ function collectFiles(dir, prefix = '') {
233
259
  }
234
260
 
235
261
  if (fs.existsSync(claudeDest) && hasUserContent(claudeDest)) {
262
+ const userEntries = fs.readdirSync(claudeDest).filter(e =>
263
+ e !== 'migration' && !AUTOCONFIG_FILES.includes(e)
264
+ );
265
+ console.log('\x1b[90m%s\x1b[0m', ` Backup triggered by user content: ${userEntries.join(', ')}`);
266
+
236
267
  const timestamp = formatTimestamp();
237
268
  const migrationDir = path.join(claudeDest, 'migration');
238
269
  migrationPath = path.join(migrationDir, timestamp);
@@ -240,11 +271,7 @@ if (fs.existsSync(claudeDest) && hasUserContent(claudeDest)) {
240
271
  fs.mkdirSync(migrationPath, { recursive: true });
241
272
 
242
273
  // Copy user files to backup (excluding autoconfig-installed files)
243
- const existingEntries = fs.readdirSync(claudeDest).filter(e =>
244
- e !== 'migration' && !AUTOCONFIG_FILES.includes(e)
245
- );
246
-
247
- for (const entry of existingEntries) {
274
+ for (const entry of userEntries) {
248
275
  const srcPath = path.join(claudeDest, entry);
249
276
  const destPath = path.join(migrationPath, entry);
250
277
 
@@ -310,11 +337,18 @@ const isUpgrade = (() => {
310
337
  const claudeMdPath = path.join(cwd, 'CLAUDE.md');
311
338
  if (fs.existsSync(claudeMdPath)) {
312
339
  const content = fs.readFileSync(claudeMdPath, 'utf8');
313
- if (content.includes('AUTO-GENERATED BY /autoconfig')) return true;
340
+ if (content.includes('AUTO-GENERATED BY /autoconfig')) {
341
+ console.log('\x1b[90m%s\x1b[0m', ' Upgrade detected: CLAUDE.md has autoconfig marker');
342
+ return true;
343
+ }
314
344
  }
315
345
  // Indicator 2: docs HTML exists (unique autoconfig artifact)
316
346
  const docsPath = path.join(claudeDest, 'docs', 'autoconfig.docs.html');
317
- if (fs.existsSync(docsPath)) return true;
347
+ if (fs.existsSync(docsPath)) {
348
+ console.log('\x1b[90m%s\x1b[0m', ' Upgrade detected: autoconfig.docs.html exists');
349
+ return true;
350
+ }
351
+ console.log('\x1b[90m%s\x1b[0m', ' Install type: fresh (no previous autoconfig found)');
318
352
  return false;
319
353
  })();
320
354
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.176",
3
+ "version": "1.0.177",
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",