claude-code-autoconfig 1.0.101 → 1.0.103
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.
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
<!-- @description Manages and installs updates to Claude Code configuration. -->
|
|
2
|
-
|
|
3
|
-
<!-- @applied
|
|
4
|
-
-->
|
|
5
|
-
|
|
6
|
-
# Autoconfig Update
|
|
7
|
-
|
|
8
|
-
Check for and install pending updates to your Claude Code configuration.
|
|
9
|
-
|
|
10
|
-
**Style guideline**: Work silently through Steps 1-3. Do not narrate internal steps, implementation details, or progress messages (e.g., "Let me check...", "The @applied block is empty..."). The first output the user sees should be the formatted summary in Step 4 (or the "up to date" message).
|
|
11
|
-
|
|
12
|
-
## Step 1: Pull Latest Updates
|
|
13
|
-
|
|
14
|
-
Run this command via Bash to pull new update files from the latest package:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npx claude-code-autoconfig@latest --pull-updates
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
This copies any new update `.md` files into `.claude/updates/` and refreshes this command file (preserving the `@applied` block above).
|
|
21
|
-
|
|
22
|
-
After the command completes, check `.claude/updates/` directory. If it doesn't exist or is empty, output:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
No new updates available. You're up to date.
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Then stop — do not continue to further steps.
|
|
29
|
-
|
|
30
|
-
## Step 2: Parse Update Files
|
|
31
|
-
|
|
32
|
-
Read all `.md` files in `.claude/updates/` matching the pattern `NNN-*.md` (e.g., `001-debug-methodology.md`).
|
|
33
|
-
|
|
34
|
-
For each file, extract metadata from the HTML comment headers at the top:
|
|
35
|
-
|
|
36
|
-
| Header | Pattern | Required |
|
|
37
|
-
|--------|---------|----------|
|
|
38
|
-
| `@title` | `<!-- @title (.+?) -->` | Yes |
|
|
39
|
-
| `@type` | `<!-- @type (.+?) -->` | Yes |
|
|
40
|
-
| `@description` | `<!-- @description (.+?) -->` | Yes |
|
|
41
|
-
| `@files` | `<!-- @files (.+?) -->` | Yes |
|
|
42
|
-
|
|
43
|
-
Extract the numeric ID from the filename prefix (e.g., `001` from `001-debug-methodology.md`).
|
|
44
|
-
|
|
45
|
-
Skip any files that are malformed (missing required headers) with a warning.
|
|
46
|
-
|
|
47
|
-
## Step 3: Filter Already Applied
|
|
48
|
-
|
|
49
|
-
Parse the `<!-- @applied -->` block in THIS file (`.claude/commands/autoconfig-update.md`) to get the list of already-applied update IDs. Extract the three-digit ID from the start of each line.
|
|
50
|
-
|
|
51
|
-
Filter out any updates whose ID appears in the applied list. If no pending updates remain, output:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
All updates are already installed. You're up to date.
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Then stop.
|
|
58
|
-
|
|
59
|
-
## Step 4: Display Summary
|
|
60
|
-
|
|
61
|
-
**Important**: Do NOT narrate your internal steps (e.g., "The @applied block is empty" or "Let me check..."). Go straight to the formatted output below. The user doesn't need to see implementation details.
|
|
62
|
-
|
|
63
|
-
Output the pending updates using this exact format. Use `═` horizontal dividers only (no vertical borders — they render poorly in Claude Code). Render the dividers and header in **yellow** (ANSI `\x1b[33m`) to visually match the CLI's yellow "READY TO UPDATE" box and distinguish this from regular Claude output:
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
════════════════════════════════════════════
|
|
67
|
-
Updates available ({count})
|
|
68
|
-
════════════════════════════════════════════
|
|
69
|
-
|
|
70
|
-
001 ─ Debug Methodology
|
|
71
|
-
002 ─ Some other feature
|
|
72
|
-
|
|
73
|
-
════════════════════════════════════════════
|
|
74
|
-
[1] Install all [2] Review each
|
|
75
|
-
════════════════════════════════════════════
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Replace `{count}` with the number of pending updates. List each update with its ID and title. Wait for the user to respond with 1 or 2.
|
|
79
|
-
|
|
80
|
-
## Step 5a: Install All (User picked 1)
|
|
81
|
-
|
|
82
|
-
For each pending update (in ID order):
|
|
83
|
-
1. Read the update `.md` file body (everything below the metadata comments)
|
|
84
|
-
2. Follow the instructions in the body to apply the update
|
|
85
|
-
3. After successful application, append to the `@applied` block in THIS file:
|
|
86
|
-
```
|
|
87
|
-
{id} - {title}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
After all updates are applied, go to Step 6.
|
|
91
|
-
|
|
92
|
-
## Step 5b: Review Each (User picked 2)
|
|
93
|
-
|
|
94
|
-
For each pending update (in ID order), display using horizontal dividers only (no vertical borders — they render poorly in Claude Code):
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
════════════════════════════════════════════
|
|
98
|
-
UPDATE {n} of {total} {type}
|
|
99
|
-
════════════════════════════════════════════
|
|
100
|
-
|
|
101
|
-
{title}
|
|
102
|
-
|
|
103
|
-
{description}
|
|
104
|
-
|
|
105
|
-
Files: {comma-separated list of files touched}
|
|
106
|
-
|
|
107
|
-
════════════════════════════════════════════
|
|
108
|
-
[y] Install [s] Skip [a] Install all remaining
|
|
109
|
-
════════════════════════════════════════════
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Rendering rules:**
|
|
113
|
-
- Use `═` horizontal dividers only — no `║ ╔ ╗ ╠ ╣ ╚ ╝` vertical/corner characters
|
|
114
|
-
- Content lines are free-flowing (no padding or alignment needed)
|
|
115
|
-
- `{n}` is the position in the pending list (1, 2, 3...), `{total}` is count of pending
|
|
116
|
-
|
|
117
|
-
**User actions:**
|
|
118
|
-
- `y` → Apply this update (follow body instructions), append to `@applied`, show next
|
|
119
|
-
- `s` → Skip this update (do NOT add to `@applied` — it will appear again next run)
|
|
120
|
-
- `a` → Apply this update AND all remaining updates without further prompts
|
|
121
|
-
|
|
122
|
-
After all updates are reviewed, go to Step 6.
|
|
123
|
-
|
|
124
|
-
## Step 6: Summary and Cleanup
|
|
125
|
-
|
|
126
|
-
Show a summary of what happened:
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
✅ Installed: 001, 003
|
|
130
|
-
⏭️ Skipped: 002
|
|
131
|
-
|
|
132
|
-
Run /autoconfig-update again anytime to install skipped updates.
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
If all were installed:
|
|
136
|
-
```
|
|
137
|
-
✅ All updates installed.
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Then delete the `.claude/updates/` directory (it's ephemeral — updates are tracked in the @applied block above).
|
|
141
|
-
|
|
142
|
-
If the user installed any updates that modified `.claude/commands/autoconfig.md`, suggest:
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
Run /sync-claude-md to apply these changes to your current project's CLAUDE.md.
|
|
146
|
-
```
|
|
1
|
+
<!-- @description Manages and installs updates to Claude Code configuration. -->
|
|
2
|
+
|
|
3
|
+
<!-- @applied
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# Autoconfig Update
|
|
7
|
+
|
|
8
|
+
Check for and install pending updates to your Claude Code configuration.
|
|
9
|
+
|
|
10
|
+
**Style guideline**: Work silently through Steps 1-3. Do not narrate internal steps, implementation details, or progress messages (e.g., "Let me check...", "The @applied block is empty..."). The first output the user sees should be the formatted summary in Step 4 (or the "up to date" message).
|
|
11
|
+
|
|
12
|
+
## Step 1: Pull Latest Updates
|
|
13
|
+
|
|
14
|
+
Run this command via Bash to pull new update files from the latest package:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx claude-code-autoconfig@latest --pull-updates
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This copies any new update `.md` files into `.claude/updates/` and refreshes this command file (preserving the `@applied` block above).
|
|
21
|
+
|
|
22
|
+
After the command completes, check `.claude/updates/` directory. If it doesn't exist or is empty, output:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
No new updates available. You're up to date.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then stop — do not continue to further steps.
|
|
29
|
+
|
|
30
|
+
## Step 2: Parse Update Files
|
|
31
|
+
|
|
32
|
+
Read all `.md` files in `.claude/updates/` matching the pattern `NNN-*.md` (e.g., `001-debug-methodology.md`).
|
|
33
|
+
|
|
34
|
+
For each file, extract metadata from the HTML comment headers at the top:
|
|
35
|
+
|
|
36
|
+
| Header | Pattern | Required |
|
|
37
|
+
|--------|---------|----------|
|
|
38
|
+
| `@title` | `<!-- @title (.+?) -->` | Yes |
|
|
39
|
+
| `@type` | `<!-- @type (.+?) -->` | Yes |
|
|
40
|
+
| `@description` | `<!-- @description (.+?) -->` | Yes |
|
|
41
|
+
| `@files` | `<!-- @files (.+?) -->` | Yes |
|
|
42
|
+
|
|
43
|
+
Extract the numeric ID from the filename prefix (e.g., `001` from `001-debug-methodology.md`).
|
|
44
|
+
|
|
45
|
+
Skip any files that are malformed (missing required headers) with a warning.
|
|
46
|
+
|
|
47
|
+
## Step 3: Filter Already Applied
|
|
48
|
+
|
|
49
|
+
Parse the `<!-- @applied -->` block in THIS file (`.claude/commands/autoconfig-update.md`) to get the list of already-applied update IDs. Extract the three-digit ID from the start of each line.
|
|
50
|
+
|
|
51
|
+
Filter out any updates whose ID appears in the applied list. If no pending updates remain, output:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
All updates are already installed. You're up to date.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then stop.
|
|
58
|
+
|
|
59
|
+
## Step 4: Display Summary
|
|
60
|
+
|
|
61
|
+
**Important**: Do NOT narrate your internal steps (e.g., "The @applied block is empty" or "Let me check..."). Go straight to the formatted output below. The user doesn't need to see implementation details.
|
|
62
|
+
|
|
63
|
+
Output the pending updates using this exact format. Use `═` horizontal dividers only (no vertical borders — they render poorly in Claude Code). Render the dividers and header in **yellow** (ANSI `\x1b[33m`) to visually match the CLI's yellow "READY TO UPDATE" box and distinguish this from regular Claude output:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
════════════════════════════════════════════
|
|
67
|
+
Updates available ({count})
|
|
68
|
+
════════════════════════════════════════════
|
|
69
|
+
|
|
70
|
+
001 ─ Debug Methodology
|
|
71
|
+
002 ─ Some other feature
|
|
72
|
+
|
|
73
|
+
════════════════════════════════════════════
|
|
74
|
+
[1] Install all [2] Review each
|
|
75
|
+
════════════════════════════════════════════
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Replace `{count}` with the number of pending updates. List each update with its ID and title. Wait for the user to respond with 1 or 2.
|
|
79
|
+
|
|
80
|
+
## Step 5a: Install All (User picked 1)
|
|
81
|
+
|
|
82
|
+
For each pending update (in ID order):
|
|
83
|
+
1. Read the update `.md` file body (everything below the metadata comments)
|
|
84
|
+
2. Follow the instructions in the body to apply the update
|
|
85
|
+
3. After successful application, append to the `@applied` block in THIS file:
|
|
86
|
+
```
|
|
87
|
+
{id} - {title}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
After all updates are applied, go to Step 6.
|
|
91
|
+
|
|
92
|
+
## Step 5b: Review Each (User picked 2)
|
|
93
|
+
|
|
94
|
+
For each pending update (in ID order), display using horizontal dividers only (no vertical borders — they render poorly in Claude Code):
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
════════════════════════════════════════════
|
|
98
|
+
UPDATE {n} of {total} {type}
|
|
99
|
+
════════════════════════════════════════════
|
|
100
|
+
|
|
101
|
+
{title}
|
|
102
|
+
|
|
103
|
+
{description}
|
|
104
|
+
|
|
105
|
+
Files: {comma-separated list of files touched}
|
|
106
|
+
|
|
107
|
+
════════════════════════════════════════════
|
|
108
|
+
[y] Install [s] Skip [a] Install all remaining
|
|
109
|
+
════════════════════════════════════════════
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Rendering rules:**
|
|
113
|
+
- Use `═` horizontal dividers only — no `║ ╔ ╗ ╠ ╣ ╚ ╝` vertical/corner characters
|
|
114
|
+
- Content lines are free-flowing (no padding or alignment needed)
|
|
115
|
+
- `{n}` is the position in the pending list (1, 2, 3...), `{total}` is count of pending
|
|
116
|
+
|
|
117
|
+
**User actions:**
|
|
118
|
+
- `y` → Apply this update (follow body instructions), append to `@applied`, show next
|
|
119
|
+
- `s` → Skip this update (do NOT add to `@applied` — it will appear again next run)
|
|
120
|
+
- `a` → Apply this update AND all remaining updates without further prompts
|
|
121
|
+
|
|
122
|
+
After all updates are reviewed, go to Step 6.
|
|
123
|
+
|
|
124
|
+
## Step 6: Summary and Cleanup
|
|
125
|
+
|
|
126
|
+
Show a summary of what happened:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
✅ Installed: 001, 003
|
|
130
|
+
⏭️ Skipped: 002
|
|
131
|
+
|
|
132
|
+
Run /autoconfig-update again anytime to install skipped updates.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If all were installed:
|
|
136
|
+
```
|
|
137
|
+
✅ All updates installed.
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Then delete the `.claude/updates/` directory (it's ephemeral — updates are tracked in the @applied block above).
|
|
141
|
+
|
|
142
|
+
If the user installed any updates that modified `.claude/commands/autoconfig.md`, suggest:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
Run /sync-claude-md to apply these changes to your current project's CLAUDE.md.
|
|
146
|
+
```
|
|
@@ -114,7 +114,7 @@ Replace `{TIMESTAMP}` with the current UTC time in format `YYYY-MM-DD HH:MM:SS`
|
|
|
114
114
|
|
|
115
115
|
**Always include:**
|
|
116
116
|
- **Project name + one-liner**: What is this thing?
|
|
117
|
-
- **Tech stack**:
|
|
117
|
+
- **Tech stack**: One to two lines max. Only mention choices Claude wouldn't guess from config files alone (e.g., "Firebase Auth via WEB_OAUTH" is worth including; "React 18 with TypeScript" is not — Claude sees that in `package.json`). Do NOT list individual dependencies, testing libraries, or build tools that appear in `package.json`/`requirements.txt` — Claude reads those files directly.
|
|
118
118
|
- **Commands**: How to run, test, build, deploy — Claude needs these to execute tasks
|
|
119
119
|
- **Non-obvious conventions**: Multi-schema databases, monorepo structure, unusual patterns Claude wouldn't infer
|
|
120
120
|
|
|
@@ -135,13 +135,15 @@ Place this section near the top (after Tech Stack, before Commands) since versio
|
|
|
135
135
|
|
|
136
136
|
**Include if relevant:**
|
|
137
137
|
- **Deployment flow**: If non-standard or involves multiple steps
|
|
138
|
-
- **Key architectural decisions**: Only
|
|
138
|
+
- **Key architectural decisions**: Only when the project has non-standard module boundaries (e.g., Chrome extension background/content split, microservice routing, multi-entrypoint builds). For standard single-entrypoint apps (Next.js, Express, Django), skip it — Claude can infer the architecture from the file structure.
|
|
139
139
|
|
|
140
140
|
**Skip these — Claude can discover them:**
|
|
141
141
|
- Detailed project structure trees (Claude can run `ls` or `tree`)
|
|
142
142
|
- Exhaustive route/endpoint lists (Claude can grep)
|
|
143
143
|
- File-by-file descriptions (Claude can read files)
|
|
144
144
|
- Database model lists (Claude can read schema files)
|
|
145
|
+
- Individual dependency names or versions (Claude reads `package.json`/`requirements.txt` directly)
|
|
146
|
+
- Standard framework patterns (e.g., "uses app router" for Next.js — Claude sees `app/` directory)
|
|
145
147
|
|
|
146
148
|
**Keep it tight.** A 30-line CLAUDE.md that hits the essentials beats a 200-line doc Claude has to parse every session.
|
|
147
149
|
|
|
@@ -295,7 +297,9 @@ Claude Code has a persistent auto memory file (`MEMORY.md`) that loads into the
|
|
|
295
297
|
|
|
296
298
|
The file lives at `~/.claude/projects/{encoded-project-path}/memory/MEMORY.md` where the project path is encoded by replacing path separators with dashes and removing colons (e.g., `C:\CODE\my-project` becomes `C--CODE-my-project`).
|
|
297
299
|
|
|
298
|
-
**
|
|
300
|
+
**Before writing, read MEMORY.md first.** If a `## Debugging` section (or similar heading like `## Debugging — Evidence Before Solutions`) already exists, **skip this step entirely** — never duplicate or overwrite user-curated memory content.
|
|
301
|
+
|
|
302
|
+
**Only if no debugging section exists**, write this content (append if file already exists, create if it doesn't):
|
|
299
303
|
|
|
300
304
|
```markdown
|
|
301
305
|
## Debugging — Evidence Before Solutions
|
|
@@ -305,7 +309,7 @@ NEVER guess the root cause and jump to coding a fix. Ask yourself: is the cause
|
|
|
305
309
|
3. Only then propose and implement a fix
|
|
306
310
|
```
|
|
307
311
|
|
|
308
|
-
**Important**: Use the Write tool (or Edit to append). Do not skip this step — it ensures Claude investigates root causes before making changes in every future session.
|
|
312
|
+
**Important**: Use the Write tool (or Edit to append). Do not skip this step on first-time setup — it ensures Claude investigates root causes before making changes in every future session. But never overwrite existing user content in MEMORY.md.
|
|
309
313
|
|
|
310
314
|
## Step 8: Update the Docs
|
|
311
315
|
|
|
@@ -56,9 +56,15 @@ CLAUDE.md uses markers to identify auto-generated content:
|
|
|
56
56
|
Compare detected state with current CLAUDE.md and update:
|
|
57
57
|
|
|
58
58
|
1. **Project name** — if changed
|
|
59
|
-
2. **Tech stack** —
|
|
59
|
+
2. **Tech stack** — One to two lines max. Only mention choices Claude wouldn't guess from config files alone. Do NOT list individual dependencies, testing libraries, or build tools that appear in `package.json`/`requirements.txt` — Claude reads those directly.
|
|
60
60
|
3. **Commands** — new/changed npm scripts, build commands
|
|
61
61
|
4. **Conventions** — if project structure changed
|
|
62
|
+
5. **Architecture** — Only include when the project has non-standard module boundaries (e.g., Chrome extension background/content split, microservice routing, multi-entrypoint builds). For standard single-entrypoint apps, skip it.
|
|
63
|
+
|
|
64
|
+
**Skip these — Claude can discover them:**
|
|
65
|
+
- Detailed project structure trees, route/endpoint lists, file-by-file descriptions
|
|
66
|
+
- Database model lists, individual dependency names or versions
|
|
67
|
+
- Standard framework patterns (e.g., "uses app router" for Next.js)
|
|
62
68
|
|
|
63
69
|
**Always include within markers:**
|
|
64
70
|
- The `## Retro` section pointer
|
|
@@ -72,4 +78,5 @@ Show the user what changed in CLAUDE.md before finishing.
|
|
|
72
78
|
|
|
73
79
|
- **Respect markers**: Only regenerate content between AUTO-GENERATED markers
|
|
74
80
|
- **Be conservative**: Only update sections that actually changed
|
|
75
|
-
- **Keep it tight**: CLAUDE.md
|
|
81
|
+
- **Keep it tight**: A 30-line CLAUDE.md that hits the essentials beats a 200-line doc Claude has to parse every session
|
|
82
|
+
- **No boilerplate**: If Claude can infer it from scanning `package.json` or config files, don't put it in CLAUDE.md
|
|
@@ -17,13 +17,13 @@ The file lives at `~/.claude/projects/{encoded-project-path}/memory/MEMORY.md` w
|
|
|
17
17
|
|
|
18
18
|
```markdown
|
|
19
19
|
## Debugging — Evidence Before Solutions
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
|
|
21
|
+
**Never guess.** Before writing any fix, ask: do I have a stack trace, compile error, or type error that points directly to the problem?
|
|
22
|
+
|
|
23
|
+
- **Yes** → Fix it directly.
|
|
24
|
+
- **No** → Stop. Add logging first, get real runtime data, confirm the cause, *then* fix.
|
|
25
|
+
|
|
26
|
+
"I read the code and I think I see the issue" is a guess, not evidence.
|
|
27
27
|
|
|
28
28
|
**Circuit breaker — going in circles**: If the user reports your fix didn't solve the problem, STOP coding immediately. Add logging. No second guesses. Making another code change for the same symptom without new runtime evidence is going in circles.
|
|
29
29
|
```
|
package/bin/cli.js
CHANGED
|
@@ -342,9 +342,15 @@ if (fs.existsSync(commandsSrc)) {
|
|
|
342
342
|
process.exit(1);
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
// Copy docs (
|
|
345
|
+
// Copy docs (only .html files — skip internal planning docs)
|
|
346
346
|
if (fs.existsSync(docsSrc)) {
|
|
347
|
-
|
|
347
|
+
const docsDestDir = path.join(claudeDest, 'docs');
|
|
348
|
+
fs.mkdirSync(docsDestDir, { recursive: true });
|
|
349
|
+
for (const file of fs.readdirSync(docsSrc)) {
|
|
350
|
+
if (file.endsWith('.html')) {
|
|
351
|
+
fs.copyFileSync(path.join(docsSrc, file), path.join(docsDestDir, file));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
348
354
|
}
|
|
349
355
|
|
|
350
356
|
// Copy agents if exists
|
|
@@ -393,6 +399,34 @@ const isUpgrade = (() => {
|
|
|
393
399
|
return false;
|
|
394
400
|
})();
|
|
395
401
|
|
|
402
|
+
// On fresh install, pre-mark all bundled updates as applied.
|
|
403
|
+
// The /autoconfig command already handles their content (e.g., debug methodology in MEMORY.md),
|
|
404
|
+
// so they shouldn't appear as "new" when the user later upgrades.
|
|
405
|
+
if (!isUpgrade) {
|
|
406
|
+
const userCmdPath = path.join(claudeDest, 'commands', 'autoconfig-update.md');
|
|
407
|
+
const packageUpdatesDir = path.join(packageDir, '.claude', 'updates');
|
|
408
|
+
if (fs.existsSync(userCmdPath) && fs.existsSync(packageUpdatesDir)) {
|
|
409
|
+
const updateFiles = fs.readdirSync(packageUpdatesDir)
|
|
410
|
+
.filter(f => f.endsWith('.md') && /^\d{3}-/.test(f))
|
|
411
|
+
.sort();
|
|
412
|
+
if (updateFiles.length > 0) {
|
|
413
|
+
const appliedLines = updateFiles.map(file => {
|
|
414
|
+
const id = file.match(/^(\d{3})-/)[1];
|
|
415
|
+
const content = fs.readFileSync(path.join(packageUpdatesDir, file), 'utf8');
|
|
416
|
+
const titleMatch = content.match(/<!-- @title (.+?) -->/);
|
|
417
|
+
const title = titleMatch ? titleMatch[1] : file.replace(/^\d{3}-/, '').replace(/\.md$/, '');
|
|
418
|
+
return `${id} - ${title}`;
|
|
419
|
+
});
|
|
420
|
+
const cmdContent = fs.readFileSync(userCmdPath, 'utf8');
|
|
421
|
+
const updated = cmdContent.replace(
|
|
422
|
+
/<!-- @applied\r?\n-->/,
|
|
423
|
+
`<!-- @applied\n${appliedLines.join('\n')}\n-->`
|
|
424
|
+
);
|
|
425
|
+
fs.writeFileSync(userCmdPath, updated);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
396
430
|
const launchCommand = isUpgrade ? '/autoconfig-update' : '/autoconfig';
|
|
397
431
|
|
|
398
432
|
// 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.103",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"!.claude/settings.local.json",
|
|
37
37
|
"!.claude/commands/publish.md",
|
|
38
38
|
"!.claude/commands/gls.md",
|
|
39
|
-
"!.claude/
|
|
39
|
+
"!.claude/plans",
|
|
40
40
|
"CLAUDE.md"
|
|
41
41
|
],
|
|
42
42
|
"engines": {
|