claude-code-autoconfig 1.0.124 → 1.0.126
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 +23 -1
- package/bin/cli.js +42 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- @description The command you just ran. Analyzes your project and populates CLAUDE.md with real context. Re-run anytime your stack changes. -->
|
|
2
|
-
<!-- @version
|
|
2
|
+
<!-- @version 5 -->
|
|
3
3
|
|
|
4
4
|
# Autoconfig
|
|
5
5
|
|
|
@@ -7,6 +7,28 @@ Analyze this project and configure Claude Code with real context.
|
|
|
7
7
|
|
|
8
8
|
**Setup Note**: During autoconfig, prefer Glob/Read/Write tools over Bash commands. This ensures smooth setup without permission prompts. Only use Bash for opening the guide at the end.
|
|
9
9
|
|
|
10
|
+
## Step 0: Migrate FEEDBACK.md to Discoveries (one-time)
|
|
11
|
+
|
|
12
|
+
Read `.claude/feedback/FEEDBACK.md`. If it contains custom content beyond the default template header (sections after the first `---`), and `CLAUDE.md` does NOT already have a `## Discoveries` section:
|
|
13
|
+
|
|
14
|
+
1. Read all custom content from FEEDBACK.md (everything after the first `---` separator)
|
|
15
|
+
2. Append a `## Discoveries` section to the bottom of CLAUDE.md with that content
|
|
16
|
+
3. Reset FEEDBACK.md to the clean template:
|
|
17
|
+
```
|
|
18
|
+
<!-- @description Human-authored corrections and guidance for Claude. Reserved for team feedback only — Claude must not write here. This directory persists across /autoconfig runs. -->
|
|
19
|
+
|
|
20
|
+
# Team Feedback
|
|
21
|
+
|
|
22
|
+
**This file is for human-authored corrections and guidance only.**
|
|
23
|
+
Claude reads this file but must never write to it. When Claude discovers project context, gotchas, or learnings, it should append to the `## Discoveries` section in CLAUDE.md instead.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
4. Tell the user: "Migrated {N} sections from FEEDBACK.md → CLAUDE.md Discoveries"
|
|
29
|
+
|
|
30
|
+
If CLAUDE.md already has `## Discoveries`, or FEEDBACK.md has no custom content, skip this step silently.
|
|
31
|
+
|
|
10
32
|
## Step 1: Detect Environment
|
|
11
33
|
|
|
12
34
|
**Operating System:**
|
package/bin/cli.js
CHANGED
|
@@ -496,6 +496,48 @@ if (isUpgrade && (newCommands.length > 0 || updatedCommands.length > 0)) {
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
+
// Migrate FEEDBACK.md content to CLAUDE.md Discoveries section (one-time, on upgrade)
|
|
500
|
+
if (isUpgrade) {
|
|
501
|
+
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
502
|
+
const feedbackPath = path.join(claudeDest, 'feedback', 'FEEDBACK.md');
|
|
503
|
+
|
|
504
|
+
if (fs.existsSync(claudeMdPath) && fs.existsSync(feedbackPath)) {
|
|
505
|
+
const feedbackContent = fs.readFileSync(feedbackPath, 'utf8');
|
|
506
|
+
|
|
507
|
+
// Extract custom content (everything after the first --- separator following the header)
|
|
508
|
+
const feedbackLines = feedbackContent.split(/\r?\n/);
|
|
509
|
+
let firstSeparatorIdx = -1;
|
|
510
|
+
for (let i = 0; i < feedbackLines.length; i++) {
|
|
511
|
+
if (feedbackLines[i].trim() === '---') {
|
|
512
|
+
firstSeparatorIdx = i;
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (firstSeparatorIdx >= 0) {
|
|
518
|
+
const customContent = feedbackLines.slice(firstSeparatorIdx + 1).join('\n').trim();
|
|
519
|
+
|
|
520
|
+
// Only migrate if there's custom content and it hasn't already been migrated
|
|
521
|
+
const claudeMdContent = fs.readFileSync(claudeMdPath, 'utf8');
|
|
522
|
+
const hasDiscoveries = claudeMdContent.includes('## Discoveries');
|
|
523
|
+
|
|
524
|
+
if (customContent.length > 0 && !hasDiscoveries) {
|
|
525
|
+
// Add Discoveries section to CLAUDE.md
|
|
526
|
+
const discoveriesSection = `\n\n## Discoveries\n<!-- Claude: append project-specific learnings, gotchas, and context below. This section persists across /autoconfig runs. -->\n\n${customContent}\n`;
|
|
527
|
+
fs.writeFileSync(claudeMdPath, claudeMdContent + discoveriesSection);
|
|
528
|
+
|
|
529
|
+
// Reset FEEDBACK.md to clean template
|
|
530
|
+
const cleanTemplate = `<!-- @description Human-authored corrections and guidance for Claude. Reserved for team feedback only — Claude must not write here. This directory persists across /autoconfig runs. -->\n\n# Team Feedback\n\n**This file is for human-authored corrections and guidance only.**\nClaude reads this file but must never write to it. When Claude discovers project context, gotchas, or learnings, it should append to the \`## Discoveries\` section in CLAUDE.md instead.\n\n---\n\n`;
|
|
531
|
+
fs.writeFileSync(feedbackPath, cleanTemplate);
|
|
532
|
+
|
|
533
|
+
// Count migrated sections
|
|
534
|
+
const sectionCount = (customContent.match(/^## /gm) || []).length || 1;
|
|
535
|
+
console.log('\x1b[36m%s\x1b[0m', ` 📋 Migrated ${sectionCount} section${sectionCount > 1 ? 's' : ''} from FEEDBACK.md → CLAUDE.md Discoveries`);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
499
541
|
const launchCommand = isUpgrade ? '/autoconfig-update' : '/autoconfig';
|
|
500
542
|
|
|
501
543
|
// Step 4: Show "READY" message
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-autoconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
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",
|