claude-code-autoconfig 1.0.97 → 1.0.99

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/README.md CHANGED
@@ -85,7 +85,6 @@ Autoconfig is **self-configuring**. Run `/autoconfig` and Claude:
85
85
  | CLAUDE.md introspection | Yes | Yes |
86
86
  | Slash commands | Yes | Yes |
87
87
  | MEMORY.md | Yes | Yes |
88
- | Update system | Yes | Yes |
89
88
  | Auto-format hook | Yes | Coming soon |
90
89
  | Optimized permissions | Yes | Coming soon |
91
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
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,6 +36,7 @@
36
36
  "!.claude/settings.local.json",
37
37
  "!.claude/commands/publish.md",
38
38
  "!.claude/commands/gls.md",
39
+ "!.claude/docs/multi-stack-parity-plan.md",
39
40
  "CLAUDE.md"
40
41
  ],
41
42
  "engines": {
@@ -1,205 +0,0 @@
1
- # Multi-Stack Parity: Python & .NET Support
2
-
3
- > Design document for expanding claude-code-autoconfig beyond JS/TS.
4
- > Upload this into a Claude Code session to resume implementation.
5
-
6
- ## Background
7
-
8
- claude-code-autoconfig detects 8 language stacks during `/autoconfig` but only provides full end-to-end support (formatter, settings, hooks, permissions) for JS/TS. Python and .NET projects get correct CLAUDE.md generation, but everything else is JS-oriented: npm-specific permission patterns, a format hook that only handles JS files, and Prettier-only formatter setup.
9
-
10
- **Current version:** 1.0.96 (as of 2026-02-09)
11
-
12
- ## What "Full Support" Means Per Stack
13
-
14
- | Feature | JS/TS (current) | Python (needed) | .NET (needed) |
15
- |---------|-----------------|-----------------|---------------|
16
- | CLAUDE.md generation | Yes | Yes (already works) | Yes (already works) |
17
- | Formatter detection | Prettier | black, ruff | dotnet format (built-in) |
18
- | Formatter install offer | `npm install -D prettier` | `pip install black` | N/A (SDK includes it) |
19
- | Format hook (Write/Edit) | `npm run format` on `.js/.ts/.css/etc` | `ruff format {file}` or `black {file}` on `.py` | `dotnet format` on `.cs/.fs/.vb` |
20
- | Allow patterns | `Bash(npm run test:*)`, `Bash(npm run build)`, etc. | `Bash(pytest)`, `Bash(pip install *)`, etc. | `Bash(dotnet test)`, `Bash(dotnet build)`, etc. |
21
- | Deny patterns | `Edit(./node_modules/**)`, `Edit(./dist/**)` | `Edit(./venv/**)`, `Edit(./__pycache__/**)` | `Edit(./bin/**)`, `Edit(./obj/**)` |
22
- | Env vars | `NODE_ENV: development` | `PYTHONDONTWRITEBYTECODE: 1` | `DOTNET_CLI_TELEMETRY_OPTOUT: 1` |
23
-
24
- ## Current Architecture
25
-
26
- Understanding the architecture is critical before choosing an approach.
27
-
28
- ### How the system works today
29
-
30
- 1. **`bin/cli.js`** — Dumb file copier. Downloads the npm package, copies `.claude/` directory structure into the user's project. Zero project analysis. No stack detection.
31
-
32
- 2. **`.claude/commands/autoconfig.md`** — Natural-language instruction file that Claude interprets at runtime. Claude follows these steps to analyze the project and generate configuration. This is where all the intelligence lives. It's non-deterministic — Claude interprets the instructions, not code.
33
-
34
- 3. **`.claude/hooks/format.js`** — Actual Node.js code executed as a PostToolUse hook. Receives JSON on stdin describing what file was edited, checks extension, runs `npm run format`. This IS deterministic code.
35
-
36
- 4. **`.claude/settings.json`** — Static template copied as-is by cli.js. Currently contains JS-specific `Bash(npm run *)` allow patterns hardcoded in the template.
37
-
38
- ### The intelligence split
39
-
40
- | Component | Intelligence | Deterministic? |
41
- |-----------|-------------|----------------|
42
- | `cli.js` | None — copies files | Yes |
43
- | `autoconfig.md` | Full — Claude analyzes project | No |
44
- | `format.js` | Partial — checks file extensions | Yes |
45
- | `settings.json` | None — static template | Yes |
46
-
47
- ## The Factory Pattern Question
48
-
49
- ### Problem
50
-
51
- The original plan was:
52
- 1. Ship a generic `settings.json` template (no stack-specific patterns)
53
- 2. Rely on `/autoconfig` (Claude interpreting markdown) to dynamically add the right allow/deny patterns
54
-
55
- This means `settings.json` correctness depends on Claude's interpretation of markdown instructions — which is **non-deterministic**. Claude might add slightly different patterns each run, or miss some entirely.
56
-
57
- ### Option A: Keep cli.js Dumb (Current Plan)
58
-
59
- ```
60
- cli.js → copies generic settings.json → /autoconfig → Claude adds stack-specific patterns
61
- ```
62
-
63
- **Pros:**
64
- - Minimal change to cli.js architecture
65
- - format.js handles multi-stack detection cleanly at runtime (strategy pattern by file extension)
66
- - Keeps all intelligence in one place (/autoconfig)
67
-
68
- **Cons:**
69
- - settings.json correctness depends on Claude's interpretation
70
- - Non-deterministic — may vary between runs
71
- - If user doesn't run /autoconfig, they get generic settings with no stack-specific permissions
72
-
73
- ### Option B: Make cli.js Stack-Aware (Factory Pattern)
74
-
75
- ```
76
- cli.js → detects stack → generates stack-specific settings.json → /autoconfig → Claude fine-tunes
77
- ```
78
-
79
- cli.js would:
80
- 1. Check for `package.json` → JS stack
81
- 2. Check for `requirements.txt`/`pyproject.toml` → Python stack
82
- 3. Check for `*.csproj`/`*.sln` → .NET stack
83
- 4. Select or generate the appropriate settings.json with correct allow/deny/env patterns
84
-
85
- **Pros:**
86
- - Deterministic — correct permissions from first install, before /autoconfig runs
87
- - Users who skip /autoconfig still get stack-appropriate settings
88
- - Testable — can unit test the stack detection and template selection
89
-
90
- **Cons:**
91
- - cli.js becomes smarter (more complexity in the bootstrapper)
92
- - Need to maintain stack detection logic in TWO places (cli.js AND autoconfig.md)
93
- - Could use template files (`settings.js.json`, `settings.python.json`, `settings.dotnet.json`) or a builder function
94
-
95
- ### Option C: Hybrid — cli.js Detects, Merges at Runtime
96
-
97
- ```
98
- cli.js → detects stack → writes .claude/.stack marker → copies generic settings.json
99
- /autoconfig → reads .stack marker → applies deterministic stack config
100
- format.js → reads .stack marker OR detects by file extension
101
- ```
102
-
103
- A small `.claude/.stack` file (e.g., `{"stack": "python", "detectedAt": "2026-02-09"}`) gives all components a deterministic signal without duplicating detection logic.
104
-
105
- **Pros:**
106
- - cli.js stays mostly dumb (just writes a small marker)
107
- - /autoconfig has a deterministic signal to work from
108
- - Detection logic lives in one place (cli.js), consumers just read the marker
109
- - Can be overridden by the user
110
-
111
- **Cons:**
112
- - Adds a new file to the .claude/ directory
113
- - Marker could become stale if project stack changes
114
-
115
- ## Files That Need Changes (Any Approach)
116
-
117
- ### `.claude/hooks/format.js`
118
-
119
- Refactor to detect file type by extension and run appropriate formatter. This is clean regardless of which architecture option is chosen — runtime file extension detection is the right approach for the hook.
120
-
121
- ```javascript
122
- const STACKS = {
123
- js: {
124
- extensions: /\.(js|jsx|ts|tsx|json|css|scss|md|html)$/,
125
- skipDirs: ['node_modules', 'dist/', 'build/'],
126
- format: (filePath, cwd) => {
127
- execSync('npm run format --silent || true', { cwd, stdio: 'ignore' });
128
- }
129
- },
130
- python: {
131
- extensions: /\.(py|pyi)$/,
132
- skipDirs: ['venv/', '.venv/', '__pycache__/', '.egg-info/'],
133
- format: (filePath, cwd) => {
134
- try { execSync(`ruff format "${filePath}"`, { cwd, stdio: 'ignore' }); }
135
- catch { try { execSync(`black "${filePath}"`, { cwd, stdio: 'ignore' }); } catch {} }
136
- }
137
- },
138
- dotnet: {
139
- extensions: /\.(cs|fs|vb)$/,
140
- skipDirs: ['bin/', 'obj/'],
141
- format: (filePath, cwd) => {
142
- execSync('dotnet format || true', { cwd, stdio: 'ignore' });
143
- }
144
- }
145
- };
146
- ```
147
-
148
- ### `.claude/commands/autoconfig.md` — Steps 5 and 6
149
-
150
- **Step 5** needs sub-steps per stack:
151
- - 5a: Detect stack from project markers
152
- - 5b: JS/TS formatter (existing Prettier logic, unchanged)
153
- - 5c: Python formatter (detect black/ruff, offer install)
154
- - 5d: .NET formatter (dotnet format, built-in)
155
- - 5e: Add PostToolUse hook (same for all — format.js handles detection)
156
-
157
- **Step 6** needs stack-conditional tables for deny/allow/env patterns.
158
-
159
- ### `.claude/settings.json`
160
-
161
- Current template has JS-specific `Bash(npm run *)` patterns hardcoded. Needs to either:
162
- - **Option A**: Become generic (remove npm patterns, let /autoconfig add them)
163
- - **Option B**: Be replaced by stack-specific templates selected by cli.js
164
- - **Option C**: Stay generic, with cli.js writing a `.stack` marker for /autoconfig
165
-
166
- ### `test/cli-install.test.js`
167
-
168
- Add multi-stack test sections:
169
- - format.js handles Python file extensions (`.py`, `.pyi`)
170
- - format.js handles .NET file extensions (`.cs`, `.fs`, `.vb`)
171
- - format.js has Python skip dirs (`venv/`, `__pycache__/`)
172
- - format.js has .NET skip dirs (`bin/`, `obj/`)
173
- - format.js runs ruff/black for Python
174
- - format.js runs dotnet format for .NET
175
-
176
- ## Stack-Specific Details
177
-
178
- ### Python Considerations
179
- - `pip install black` may need a virtual environment — should check if venv is active
180
- - Some projects use `python3`/`pip3` vs `python`/`pip`
181
- - `ruff` is faster and gaining adoption but `black` is the established standard
182
- - `pyproject.toml` can contain deps in `[project.dependencies]` or `[tool.poetry.dependencies]`
183
-
184
- ### .NET Considerations
185
- - `dotnet format` requires the .NET SDK (not just runtime)
186
- - `*.csproj` files may be in subdirectories (solution structure)
187
- - `dotnet format` formats the whole project (no practical single-file mode)
188
-
189
- ### Mixed-Stack Projects
190
- - A repo with both `package.json` and `requirements.txt` (JS frontend + Python backend)
191
- - Per-file extension detection in format.js handles this naturally
192
- - For settings.json, should include patterns for ALL detected stacks, not just primary
193
-
194
- ## Decision Needed
195
-
196
- Before implementing, decide on the architecture:
197
- - **Option A**: Keep cli.js dumb, trust /autoconfig (simpler, less reliable)
198
- - **Option B**: Factory pattern in cli.js (more reliable, more complex)
199
- - **Option C**: Hybrid with .stack marker (balanced)
200
-
201
- Recommendation: **Option B or C** — deterministic stack-appropriate settings from first install is a better user experience than relying on Claude's interpretation of markdown instructions.
202
-
203
- ## Work Already Completed (Revert Before Starting)
204
-
205
- A multi-stack `format.js` was written but reverted since we paused to think about architecture. The code is in this doc above as reference. No other files were modified.