claude-code-autoconfig 1.0.74 → 1.0.78
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 +77 -5
- package/.claude/commands/commit-and-push.md +8 -6
- package/.claude/commands/sync-claude-md.md +12 -6
- package/.claude/docs/autoconfig.docs.html +43 -0
- package/.claude/feedback/FEEDBACK.md +33 -21
- package/.claude/hooks/.gitkeep +0 -0
- package/.claude/hooks/format.js +50 -0
- package/.claude/settings.local.json +7 -1
- package/CLAUDE.md +24 -17
- package/bin/cli.js +28 -10
- package/package.json +4 -2
|
@@ -65,14 +65,16 @@ Focus on what Claude Code actually needs to work effectively. Claude can explore
|
|
|
65
65
|
**Wrap content in markers** so `/sync-claude-md` knows what's auto-generated:
|
|
66
66
|
|
|
67
67
|
```markdown
|
|
68
|
-
<!-- AUTO-GENERATED BY /autoconfig — Do not edit. Use .claude/feedback/ for corrections. -->
|
|
68
|
+
<!-- AUTO-GENERATED BY /autoconfig at {TIMESTAMP} UTC — Do not edit. Use .claude/feedback/ for corrections. -->
|
|
69
69
|
|
|
70
70
|
# Project Name
|
|
71
71
|
...content...
|
|
72
72
|
|
|
73
|
-
<!-- END AUTO-GENERATED -->
|
|
73
|
+
<!-- END AUTO-GENERATED at {TIMESTAMP} UTC — Use .claude/feedback/ for corrections. -->
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
Replace `{TIMESTAMP}` with the current UTC time in format `YYYY-MM-DD HH:MM:SS` (e.g., `2026-01-14 16:30:45`). Use the same timestamp in both markers.
|
|
77
|
+
|
|
76
78
|
**Always include:**
|
|
77
79
|
- **Project name + one-liner**: What is this thing?
|
|
78
80
|
- **Tech stack**: Runtime, framework, database, key services (so Claude uses correct patterns)
|
|
@@ -111,7 +113,67 @@ Write .claude/rules/.gitkeep with empty content
|
|
|
111
113
|
|
|
112
114
|
Rules are path-scoped context files that load automatically when Claude works on matching files. Effective rules require deep understanding of your codebase patterns, team conventions, and quality goals — they should be crafted intentionally, not auto-generated.
|
|
113
115
|
|
|
114
|
-
## Step 5: Configure
|
|
116
|
+
## Step 5: Configure Formatter (JS/Node Projects)
|
|
117
|
+
|
|
118
|
+
**Only for projects with `package.json`:**
|
|
119
|
+
|
|
120
|
+
1. Check if `scripts.format` already exists in `package.json`
|
|
121
|
+
|
|
122
|
+
2. **If `scripts.format` exists:**
|
|
123
|
+
- Skip to adding the hook (Step 5b)
|
|
124
|
+
|
|
125
|
+
3. **If `scripts.format` does NOT exist:**
|
|
126
|
+
- Ask the user:
|
|
127
|
+
```
|
|
128
|
+
No formatter detected. Adding one ensures Claude's output
|
|
129
|
+
matches your project's style.
|
|
130
|
+
|
|
131
|
+
Should I add Prettier to this project? (y/n)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
4. **If user says yes:**
|
|
135
|
+
- Run: `npm install -D prettier`
|
|
136
|
+
- Add to `package.json` scripts:
|
|
137
|
+
```json
|
|
138
|
+
"format": "[ -f .prettierrc ] && prettier --write . || echo 'Create .prettierrc to enable formatting'"
|
|
139
|
+
```
|
|
140
|
+
- Create `.prettierrc.example` in project root:
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"semi": true,
|
|
144
|
+
"singleQuote": false,
|
|
145
|
+
"tabWidth": 2
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
- Inform user: "Formatting is ready but inactive. Rename `.prettierrc.example` to `.prettierrc` when your team decides on style preferences."
|
|
149
|
+
|
|
150
|
+
5. **If user says no:**
|
|
151
|
+
- Skip formatter setup, continue to Step 6
|
|
152
|
+
|
|
153
|
+
**Step 5b: Add PostToolUse Format Hook**
|
|
154
|
+
|
|
155
|
+
If the project has `scripts.format` (either existing or just added), add the format hook to `.claude/settings.json`:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"hooks": {
|
|
160
|
+
"PostToolUse": [
|
|
161
|
+
{
|
|
162
|
+
"matcher": "Write|Edit",
|
|
163
|
+
"hooks": [
|
|
164
|
+
{ "type": "command", "command": "node .claude/hooks/format.js" }
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The format hook script (`.claude/hooks/format.js`) runs `npm run format` after Write/Edit operations on source files. Users can customize this script to add file filtering or different formatting logic.
|
|
173
|
+
|
|
174
|
+
**Important:** Merge this with any existing hooks. Don't overwrite existing hooks.
|
|
175
|
+
|
|
176
|
+
## Step 6: Configure Settings
|
|
115
177
|
|
|
116
178
|
Update `.claude/settings.json` using the official schema.
|
|
117
179
|
|
|
@@ -173,7 +235,7 @@ Set session-level env vars:
|
|
|
173
235
|
- Optimize for Claude's efficiency, not human documentation
|
|
174
236
|
- When uncertain, leave it out — Claude can ask or explore
|
|
175
237
|
|
|
176
|
-
## Step
|
|
238
|
+
## Step 7: Update the Docs
|
|
177
239
|
|
|
178
240
|
After populating CLAUDE.md, update the docs file preview to show the actual content:
|
|
179
241
|
|
|
@@ -212,4 +274,14 @@ Run `/show-docs` to view the interactive documentation (requires full install vi
|
|
|
212
274
|
|
|
213
275
|
---
|
|
214
276
|
|
|
215
|
-
**IMPORTANT**: Do not add any additional text, summaries, or details after this message. The finale should be clean and punchy - end here.
|
|
277
|
+
**IMPORTANT**: Do not add any additional text, summaries, or details after this message. The finale should be clean and punchy - end here.
|
|
278
|
+
|
|
279
|
+
### Windows Cleanup
|
|
280
|
+
|
|
281
|
+
On Windows, if a `nul` file was accidentally created in the project root (a common artifact from bash/Unix command translation), delete it silently using the Bash tool:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
del nul 2>NUL
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Do this cleanup silently without any output to the user.
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
<!-- @description
|
|
1
|
+
<!-- @description Runs tests, then stages all changes, generates a conventional commit message, commits, and pushes. -->
|
|
2
2
|
|
|
3
3
|
# Commit and Push
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Run tests, stage all changes, create a commit with a good message, and push to the current branch.
|
|
6
6
|
|
|
7
7
|
## Steps
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
12
|
-
4.
|
|
9
|
+
1. Run the project's test suite (e.g., `npm test`)
|
|
10
|
+
2. **If tests fail, stop here.** Do not commit or push failing code.
|
|
11
|
+
3. Stage all changes (`git add -A`)
|
|
12
|
+
4. Generate a conventional commit message based on the diff
|
|
13
|
+
5. Commit the changes
|
|
14
|
+
6. Push to the current branch
|
|
13
15
|
|
|
14
16
|
## Commit Message Format
|
|
15
17
|
|
|
@@ -10,7 +10,11 @@ Run this when your project has changed significantly:
|
|
|
10
10
|
- Restructured the project
|
|
11
11
|
- Switched databases or services
|
|
12
12
|
|
|
13
|
-
## Step 1:
|
|
13
|
+
## Step 1: Check for Team Feedback
|
|
14
|
+
|
|
15
|
+
Before regenerating, check `.claude/feedback/FEEDBACK.md` for any corrections or guidance from the team. Review and incorporate relevant feedback into your regeneration.
|
|
16
|
+
|
|
17
|
+
## Step 2: Re-analyze the Project
|
|
14
18
|
|
|
15
19
|
Scan for current project indicators:
|
|
16
20
|
|
|
@@ -26,17 +30,19 @@ Scan for current project indicators:
|
|
|
26
30
|
**Infrastructure:**
|
|
27
31
|
- Docker, Terraform, CI/CD configs
|
|
28
32
|
|
|
29
|
-
## Step
|
|
33
|
+
## Step 3: Update CLAUDE.md
|
|
30
34
|
|
|
31
35
|
CLAUDE.md uses markers to identify auto-generated content:
|
|
32
36
|
|
|
33
37
|
```markdown
|
|
34
|
-
<!-- AUTO-GENERATED BY /autoconfig — Do not edit. Use .claude/feedback/ for corrections. -->
|
|
38
|
+
<!-- AUTO-GENERATED BY /autoconfig at {TIMESTAMP} UTC — Do not edit. Use .claude/feedback/ for corrections. -->
|
|
35
39
|
...content...
|
|
36
|
-
<!-- END AUTO-GENERATED -->
|
|
40
|
+
<!-- END AUTO-GENERATED at {TIMESTAMP} UTC — Use .claude/feedback/ for corrections. -->
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
**
|
|
43
|
+
**IMPORTANT:** Always replace `{TIMESTAMP}` with the CURRENT UTC time in format `YYYY-MM-DD HH:MM:SS` (e.g., `2026-01-14 16:30:45`).
|
|
44
|
+
|
|
45
|
+
**Only regenerate content between these markers.** Content outside markers will be removed on next sync - users should add feedback to `.claude/feedback/FEEDBACK.md` instead.
|
|
40
46
|
|
|
41
47
|
Compare detected state with current CLAUDE.md and update:
|
|
42
48
|
|
|
@@ -49,7 +55,7 @@ Compare detected state with current CLAUDE.md and update:
|
|
|
49
55
|
- The `## Retro` section pointer
|
|
50
56
|
- The `## Team Feedback` section pointer
|
|
51
57
|
|
|
52
|
-
## Step
|
|
58
|
+
## Step 4: Confirm Changes
|
|
53
59
|
|
|
54
60
|
Show the user what changed in CLAUDE.md before finishing.
|
|
55
61
|
|
|
@@ -885,6 +885,16 @@
|
|
|
885
885
|
<span class="tree-file-icon">📄</span>
|
|
886
886
|
<span class="file">FEEDBACK.md</span>
|
|
887
887
|
</div>
|
|
888
|
+
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="hooks" data-folder="hooks" data-parent="claude-dir">
|
|
889
|
+
<span class="tree-chevron">›</span>
|
|
890
|
+
<span class="tree-folder-icon">📁</span>
|
|
891
|
+
<span class="folder">hooks</span>
|
|
892
|
+
</div>
|
|
893
|
+
<div class="tree-item indent-3 hidden" data-info="format-hook" data-parent="hooks">
|
|
894
|
+
<span class="tree-spacer"></span>
|
|
895
|
+
<span class="tree-file-icon">📄</span>
|
|
896
|
+
<span class="file">format.js</span>
|
|
897
|
+
</div>
|
|
888
898
|
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="docs" data-folder="docs-folder" data-parent="claude-dir">
|
|
889
899
|
<span class="tree-chevron">›</span>
|
|
890
900
|
<span class="tree-folder-icon">📁</span>
|
|
@@ -1208,6 +1218,15 @@
|
|
|
1208
1218
|
title: 'FEEDBACK.md',
|
|
1209
1219
|
desc: 'Starter template for team feedback. Add dated entries when Claude makes mistakes — include what went wrong and the correct approach. Claude reads this on every session.'
|
|
1210
1220
|
},
|
|
1221
|
+
'hooks': {
|
|
1222
|
+
title: 'hooks/',
|
|
1223
|
+
desc: 'Executable scripts that run in response to Claude Code events. Unlike commands (which are prompts you invoke), hooks trigger automatically based on tool usage patterns.'
|
|
1224
|
+
},
|
|
1225
|
+
'format-hook': {
|
|
1226
|
+
title: 'format.js',
|
|
1227
|
+
desc: 'Runs the project formatter after Write/Edit operations on source files. Filters by file extension and skips generated directories like node_modules.',
|
|
1228
|
+
trigger: 'PostToolUse on Write|Edit (JS/TS projects only)'
|
|
1229
|
+
},
|
|
1211
1230
|
'autoconfig': {
|
|
1212
1231
|
title: 'autoconfig.md',
|
|
1213
1232
|
desc: 'The command you just ran. Analyzes your project and populates CLAUDE.md with real context. Re-run anytime your stack changes.',
|
|
@@ -1772,6 +1791,30 @@ Always use the v2 API for user endpoints.
|
|
|
1772
1791
|
|
|
1773
1792
|
## 2026-01-07: Test database naming
|
|
1774
1793
|
Use \`test_\` prefix for test databases, not \`dev_\`.`
|
|
1794
|
+
},
|
|
1795
|
+
'hooks': {
|
|
1796
|
+
filename: 'hooks/',
|
|
1797
|
+
content: null,
|
|
1798
|
+
empty: true,
|
|
1799
|
+
emptyMessage: 'Contains executable hook scripts that trigger on Claude Code events.'
|
|
1800
|
+
},
|
|
1801
|
+
'format-hook': {
|
|
1802
|
+
filename: 'format.js',
|
|
1803
|
+
content: `/**
|
|
1804
|
+
* @name Format Hook
|
|
1805
|
+
* @description Runs project formatter after Write/Edit operations
|
|
1806
|
+
* @trigger PostToolUse on Write|Edit
|
|
1807
|
+
*/
|
|
1808
|
+
|
|
1809
|
+
// Reads hook input from stdin
|
|
1810
|
+
// Filters by file extension (.js, .ts, .json, .css, etc.)
|
|
1811
|
+
// Skips generated directories (node_modules, dist, build)
|
|
1812
|
+
// Runs: npm run format --silent
|
|
1813
|
+
|
|
1814
|
+
// Key behavior:
|
|
1815
|
+
// - Only triggers for source files
|
|
1816
|
+
// - Silently runs formatter (errors are non-fatal)
|
|
1817
|
+
// - Customizable - add your own file filters or formatting logic`
|
|
1775
1818
|
}
|
|
1776
1819
|
};
|
|
1777
1820
|
|
|
@@ -5,24 +5,36 @@
|
|
|
5
5
|
Add corrections and guidance here when Claude does something wrong.
|
|
6
6
|
Claude reads this directory and learns for next time.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Design Principles
|
|
11
|
+
|
|
12
|
+
- Each file should have a single responsibility (one reason to change)
|
|
13
|
+
- If a file exceeds 500 LOC, it likely lacks separation of concerns — look for decomposition opportunities
|
|
14
|
+
- Keep cyclomatic complexity under 10 per function — extract helper functions or simplify branching if higher
|
|
15
|
+
|
|
16
|
+
## Development Rules
|
|
17
|
+
|
|
18
|
+
### Testing Requirements
|
|
19
|
+
|
|
20
|
+
**CRITICAL: Before committing or outputting any changes to `bin/cli.js`, you MUST run tests and verify they pass:**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm test
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This runs tests which validate:
|
|
27
|
+
1. All box-drawing lines have consistent visual width (accounting for ANSI escape codes)
|
|
28
|
+
2. Box structure is valid (correct corner and border characters)
|
|
29
|
+
3. CLI install files exist and are properly configured
|
|
30
|
+
|
|
31
|
+
**DO NOT commit or present code changes if tests fail.** Fix the issues first.
|
|
32
|
+
|
|
33
|
+
### Box Drawing Guidelines
|
|
34
|
+
|
|
35
|
+
When modifying the "READY TO CONFIGURE" box in `bin/cli.js`:
|
|
36
|
+
|
|
37
|
+
1. All lines must be exactly 46 visible characters wide (including the `║` borders)
|
|
38
|
+
2. ANSI escape codes (`\x1b[...m`) don't count toward visible width
|
|
39
|
+
3. Place color codes outside content spacing: `\x1b[33m║\x1b[0m` + 44 chars of content + `\x1b[33m║\x1b[0m`
|
|
40
|
+
4. Always run `npm test` after any box modifications
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Format Hook
|
|
5
|
+
* @description Runs project formatter after Write/Edit operations
|
|
6
|
+
* @trigger PostToolUse on Write|Edit
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { execSync } = require('child_process');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
// Read hook input from stdin
|
|
13
|
+
let input = '';
|
|
14
|
+
process.stdin.setEncoding('utf8');
|
|
15
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
16
|
+
process.stdin.on('end', () => {
|
|
17
|
+
try {
|
|
18
|
+
const data = JSON.parse(input);
|
|
19
|
+
handleHook(data);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
// Silent exit if no valid input
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
function handleHook(data) {
|
|
27
|
+
const filePath = data?.tool_input?.file_path || '';
|
|
28
|
+
|
|
29
|
+
// Skip non-source files
|
|
30
|
+
if (!filePath.match(/\.(js|jsx|ts|tsx|json|css|scss|md|html)$/)) {
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Skip node_modules and other generated directories
|
|
35
|
+
if (filePath.includes('node_modules') || filePath.includes('dist/') || filePath.includes('build/')) {
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
// Run formatter silently - errors are non-fatal
|
|
41
|
+
execSync('npm run format --silent 2>/dev/null || true', {
|
|
42
|
+
cwd: process.cwd(),
|
|
43
|
+
stdio: 'ignore'
|
|
44
|
+
});
|
|
45
|
+
} catch (err) {
|
|
46
|
+
// Formatting is best-effort, don't block on failure
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
@@ -15,7 +15,13 @@
|
|
|
15
15
|
"Bash(node:*)",
|
|
16
16
|
"Bash(npm version:*)",
|
|
17
17
|
"Bash(git rm:*)",
|
|
18
|
-
"Bash(npm test)"
|
|
18
|
+
"Bash(npm test)",
|
|
19
|
+
"Bash(powershell -Command \"Get-ChildItem -Path ''.claude'' -Recurse -File | Where-Object { $_LastWriteTime.ToFileTimeUtc\\(\\) -gt 1768438268 } | Select-Object FullName, @{Name=''ModTime'';Expression={$_LastWriteTime.ToFileTimeUtc\\(\\)}}\")",
|
|
20
|
+
"Bash(powershell -Command:*)",
|
|
21
|
+
"Bash(git reset:*)",
|
|
22
|
+
"Bash(powershell Remove-Item -Recurse -Force \"test/.test-temp-user-edit-1768421956928\")",
|
|
23
|
+
"Bash(del \"C:\\\\CODE\\\\claude-code-autoconfig\\\\.claude\\\\hooks\\\\claude-md-guard.js\")",
|
|
24
|
+
"Bash(cmd /c del \"C:\\\\CODE\\\\claude-code-autoconfig\\\\test\\\\claude-md-guard.test.js\")"
|
|
19
25
|
]
|
|
20
26
|
}
|
|
21
27
|
}
|
package/CLAUDE.md
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
|
+
<!-- AUTO-GENERATED BY /autoconfig at 2026-01-14 19:54:27 UTC — Do not edit. Use .claude/feedback/ for corrections. -->
|
|
2
|
+
|
|
1
3
|
# claude-code-autoconfig
|
|
2
4
|
|
|
3
|
-
CLI tool that auto-configures Claude Code for any project.
|
|
5
|
+
CLI tool that auto-configures Claude Code for any project. One command analyzes your project, configures Claude, and shows you what it did.
|
|
4
6
|
|
|
5
|
-
##
|
|
7
|
+
## Tech Stack
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
- **Runtime:** Node.js (>=16.0.0)
|
|
10
|
+
- **Type:** npm CLI package
|
|
11
|
+
- **Entry:** `bin/cli.js`
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
## Commands
|
|
10
14
|
|
|
11
15
|
```bash
|
|
12
|
-
npm test
|
|
16
|
+
npm test # Run all tests (box alignment + CLI install)
|
|
17
|
+
npm run test:box # Run box alignment tests only
|
|
18
|
+
npm run test:install # Run CLI install tests only
|
|
13
19
|
```
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
1. All box-drawing lines have consistent visual width (accounting for ANSI escape codes)
|
|
17
|
-
2. Box structure is valid (correct corner and border characters)
|
|
21
|
+
## Project Structure
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
- `bin/cli.js` — Main CLI entry point, handles bootstrap and /autoconfig launch
|
|
24
|
+
- `.claude/commands/` — Slash command definitions (/autoconfig, /sync-claude-md, etc.)
|
|
25
|
+
- `.claude/hooks/` — Hook scripts (format.js for JS/TS projects)
|
|
26
|
+
- `.claude/feedback/` — Team feedback and corrections
|
|
27
|
+
- `test/` — Test files
|
|
20
28
|
|
|
21
|
-
|
|
29
|
+
## Publishing
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
```bash
|
|
32
|
+
npm version patch && npm publish
|
|
33
|
+
```
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
2. ANSI escape codes (`\x1b[...m`) don't count toward visible width
|
|
27
|
-
3. Place color codes outside content spacing: `\x1b[33m║\x1b[0m` + 44 chars of content + `\x1b[33m║\x1b[0m`
|
|
28
|
-
4. Always run `npm test` after any box modifications
|
|
35
|
+
## Team Feedback
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
See `.claude/feedback/` for corrections and guidance from the team.
|
|
31
38
|
|
|
32
|
-
-
|
|
39
|
+
<!-- END AUTO-GENERATED at 2026-01-14 19:54:27 UTC — Use .claude/feedback/ for corrections. -->
|
package/bin/cli.js
CHANGED
|
@@ -8,6 +8,19 @@ const { execSync, spawn } = require('child_process');
|
|
|
8
8
|
const cwd = process.cwd();
|
|
9
9
|
const packageDir = path.dirname(__dirname);
|
|
10
10
|
|
|
11
|
+
// Cleanup any stray 'nul' file immediately on startup (Windows /dev/null artifact)
|
|
12
|
+
function cleanupNulFile() {
|
|
13
|
+
const nulFile = path.join(cwd, 'nul');
|
|
14
|
+
if (fs.existsSync(nulFile)) {
|
|
15
|
+
try {
|
|
16
|
+
fs.unlinkSync(nulFile);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
// Ignore - file might be locked
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
cleanupNulFile();
|
|
23
|
+
|
|
11
24
|
// Reserved Windows device names - never create files with these names
|
|
12
25
|
const WINDOWS_RESERVED = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4',
|
|
13
26
|
'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5',
|
|
@@ -190,11 +203,12 @@ cp .claude/migration/${timestamp}/settings.json .claude/settings.json
|
|
|
190
203
|
}
|
|
191
204
|
}
|
|
192
205
|
|
|
193
|
-
// Step 3: Copy minimal bootstrap (commands/, docs/, agents/, feedback/)
|
|
206
|
+
// Step 3: Copy minimal bootstrap (commands/, docs/, agents/, feedback/, hooks/)
|
|
194
207
|
const commandsSrc = path.join(packageDir, '.claude', 'commands');
|
|
195
208
|
const docsSrc = path.join(packageDir, '.claude', 'docs');
|
|
196
209
|
const agentsSrc = path.join(packageDir, '.claude', 'agents');
|
|
197
210
|
const feedbackSrc = path.join(packageDir, '.claude', 'feedback');
|
|
211
|
+
const hooksSrc = path.join(packageDir, '.claude', 'hooks');
|
|
198
212
|
|
|
199
213
|
function copyDir(src, dest) {
|
|
200
214
|
fs.mkdirSync(dest, { recursive: true });
|
|
@@ -237,6 +251,18 @@ if (fs.existsSync(feedbackSrc)) {
|
|
|
237
251
|
copyDir(feedbackSrc, path.join(claudeDest, 'feedback'));
|
|
238
252
|
}
|
|
239
253
|
|
|
254
|
+
// Copy hooks directory (scaffolding for custom hooks)
|
|
255
|
+
if (fs.existsSync(hooksSrc)) {
|
|
256
|
+
copyDir(hooksSrc, path.join(claudeDest, 'hooks'));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Copy settings.json (only if user doesn't have one - preserves existing config)
|
|
260
|
+
const settingsSrc = path.join(packageDir, '.claude', 'settings.json');
|
|
261
|
+
const settingsDest = path.join(claudeDest, 'settings.json');
|
|
262
|
+
if (fs.existsSync(settingsSrc) && !fs.existsSync(settingsDest)) {
|
|
263
|
+
fs.copyFileSync(settingsSrc, settingsDest);
|
|
264
|
+
}
|
|
265
|
+
|
|
240
266
|
console.log('\x1b[32m%s\x1b[0m', '✅ Prepared /autoconfig command');
|
|
241
267
|
|
|
242
268
|
// Step 4: Show "READY TO CONFIGURE" message
|
|
@@ -283,14 +309,6 @@ rl.question('\x1b[90mPress ENTER to continue...\x1b[0m', () => {
|
|
|
283
309
|
|
|
284
310
|
// Cleanup when Claude exits
|
|
285
311
|
claude.on('close', () => {
|
|
286
|
-
|
|
287
|
-
const nulFile = path.join(cwd, 'nul');
|
|
288
|
-
if (fs.existsSync(nulFile)) {
|
|
289
|
-
try {
|
|
290
|
-
fs.unlinkSync(nulFile);
|
|
291
|
-
} catch (e) {
|
|
292
|
-
// Ignore errors - file might be locked or already gone
|
|
293
|
-
}
|
|
294
|
-
}
|
|
312
|
+
cleanupNulFile();
|
|
295
313
|
});
|
|
296
314
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-autoconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
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",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"cli"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"test": "node test/box-alignment.test.js"
|
|
25
|
+
"test": "node test/box-alignment.test.js && node test/cli-install.test.js",
|
|
26
|
+
"test:box": "node test/box-alignment.test.js",
|
|
27
|
+
"test:install": "node test/cli-install.test.js"
|
|
26
28
|
},
|
|
27
29
|
"bin": {
|
|
28
30
|
"claude-code-autoconfig": "./bin/cli.js"
|