claude-code-autoconfig 1.0.104 → 1.0.106

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.
Files changed (2) hide show
  1. package/bin/cli.js +19 -14
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -294,6 +294,20 @@ cp .claude/migration/${timestamp}/settings.json .claude/settings.json
294
294
  }
295
295
  }
296
296
 
297
+ // Detect upgrade vs fresh install (must run BEFORE copying files)
298
+ const isUpgrade = (() => {
299
+ // Indicator 1: CLAUDE.md has autoconfig marker
300
+ const claudeMdPath = path.join(cwd, 'CLAUDE.md');
301
+ if (fs.existsSync(claudeMdPath)) {
302
+ const content = fs.readFileSync(claudeMdPath, 'utf8');
303
+ if (content.includes('AUTO-GENERATED BY /autoconfig')) return true;
304
+ }
305
+ // Indicator 2: docs HTML exists (unique autoconfig artifact)
306
+ const docsPath = path.join(claudeDest, 'docs', 'autoconfig.docs.html');
307
+ if (fs.existsSync(docsPath)) return true;
308
+ return false;
309
+ })();
310
+
297
311
  // Step 3: Copy minimal bootstrap (commands/, docs/, agents/, feedback/, hooks/)
298
312
  const commandsSrc = path.join(packageDir, '.claude', 'commands');
299
313
  const docsSrc = path.join(packageDir, '.claude', 'docs');
@@ -301,12 +315,16 @@ const agentsSrc = path.join(packageDir, '.claude', 'agents');
301
315
  const feedbackSrc = path.join(packageDir, '.claude', 'feedback');
302
316
  const hooksSrc = path.join(packageDir, '.claude', 'hooks');
303
317
 
318
+ // Files that exist in the dev repo but should never be installed to user projects
319
+ const DEV_ONLY_FILES = ['publish.md', 'gls.md'];
320
+
304
321
  function copyDir(src, dest) {
305
322
  fs.mkdirSync(dest, { recursive: true });
306
323
  const entries = fs.readdirSync(src, { withFileTypes: true });
307
324
 
308
325
  for (const entry of entries) {
309
326
  if (isReservedName(entry.name)) continue;
327
+ if (DEV_ONLY_FILES.includes(entry.name)) continue;
310
328
 
311
329
  const srcPath = path.join(src, entry.name);
312
330
  const destPath = path.join(dest, entry.name);
@@ -324,6 +342,7 @@ function copyDirIfMissing(src, dest) {
324
342
  const entries = fs.readdirSync(src, { withFileTypes: true });
325
343
  for (const entry of entries) {
326
344
  if (isReservedName(entry.name)) continue;
345
+ if (DEV_ONLY_FILES.includes(entry.name)) continue;
327
346
  const srcPath = path.join(src, entry.name);
328
347
  const destPath = path.join(dest, entry.name);
329
348
  if (entry.isDirectory()) {
@@ -385,20 +404,6 @@ if (fs.existsSync(settingsSrc) && (forceMode || !fs.existsSync(settingsDest))) {
385
404
 
386
405
  console.log('\x1b[32m%s\x1b[0m', '✅ Prepared /autoconfig command');
387
406
 
388
- // Detect upgrade vs fresh install
389
- const isUpgrade = (() => {
390
- // Indicator 1: CLAUDE.md has autoconfig marker
391
- const claudeMdPath = path.join(cwd, 'CLAUDE.md');
392
- if (fs.existsSync(claudeMdPath)) {
393
- const content = fs.readFileSync(claudeMdPath, 'utf8');
394
- if (content.includes('AUTO-GENERATED BY /autoconfig')) return true;
395
- }
396
- // Indicator 2: docs HTML exists (unique autoconfig artifact)
397
- const docsPath = path.join(claudeDest, 'docs', 'autoconfig.docs.html');
398
- if (fs.existsSync(docsPath)) return true;
399
- return false;
400
- })();
401
-
402
407
  // Pre-mark all bundled updates as applied when the @applied block is empty.
403
408
  // On fresh installs, /autoconfig handles their content (e.g., debug methodology in MEMORY.md).
404
409
  // On upgrades from pre-update-system versions, these updates are already baked in.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.104",
3
+ "version": "1.0.106",
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",