claude-code-autoconfig 1.0.14 → 1.0.16

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,266 +1,176 @@
1
- <!-- @description The command you just ran. Analyzes your project and populates CLAUDE.md with real context. Re-run anytime your stack changes. -->
2
-
3
- # Autoconfig
4
-
5
- Analyze this project and configure Claude Code with real context.
6
-
7
- ## Step 0: Migrate Existing Configuration
8
-
9
- Check for existing Claude Code configuration and migrate to the new structure.
10
-
11
- ### 0a. AGENTS.md .claude/agents/
12
-
13
- If an `AGENTS.md` file exists (at root or in `.claude/`):
14
- 1. Parse each agent definition (usually separated by headings)
15
- 2. Create individual files in `.claude/agents/` named after the agent (kebab-case)
16
- 3. Each file should contain that agent's prompt/instructions
17
- 4. Delete or rename the original AGENTS.md to AGENTS.md.migrated
18
- 5. Notify: "Migrated X agents from AGENTS.md to .claude/agents/"
19
-
20
- ### 0b. RULES.md → .claude/rules/
21
-
22
- If a `RULES.md` file exists or CLAUDE.md contains a "Rules" section:
23
- 1. Extract rule definitions
24
- 2. Create appropriate rule files in `.claude/rules/` based on path patterns
25
- 3. Notify: "Migrated rules to .claude/rules/"
26
-
27
- ### 0c. Custom Commands → .claude/commands/
28
-
29
- If CLAUDE.md contains custom slash command definitions:
30
- 1. Extract each command definition
31
- 2. Create `.claude/commands/[command-name].md` for each
32
- 3. Notify: "Migrated X custom commands to .claude/commands/"
33
-
34
- ### 0d. Team Feedback .claude/feedback/
35
-
36
- If CLAUDE.md contains **team feedback** (corrections, preferences, warnings):
37
-
38
- **Feedback patterns:**
39
- - Corrections: "Don't use X", "Always use Y instead", "Never do Z"
40
- - Preferences: "We prefer...", "Team convention is...", "Boris's setup uses..."
41
- - Warnings: "Be careful with...", "Watch out for...", "This is deprecated"
42
- - Custom guidance: Learned behavior or team-specific knowledge
43
- - Notes about past mistakes
44
-
45
- **NOT feedback (standard config - will be regenerated):**
46
- - Project name and description
47
- - Tech stack listing
48
- - Build/test/run commands
49
- - File structure descriptions
50
-
51
- **If feedback found:**
52
- 1. Extract feedback sections
53
- 2. Append to `.claude/feedback/FEEDBACK.md` with header:
54
- ```markdown
55
- ## [Date]: Migrated from CLAUDE.md
56
-
57
- [extracted feedback]
58
- ```
59
- 3. Notify: "Migrated team feedback to .claude/feedback/FEEDBACK.md"
60
-
61
- ### 0e. MCP Configs
62
-
63
- If CLAUDE.md mentions MCP servers or tool integrations:
64
- 1. Extract server configurations
65
- 2. Add to `.claude/.mcp.json` in the mcpServers object
66
- 3. Notify: "Migrated MCP config to .claude/.mcp.json"
67
-
68
- ## Step 1: Create Scaffold Files
69
-
70
- Create these files if they don't already exist:
71
-
72
- ### .claude/settings.json
73
- ```json
74
- {
75
- "permissions": {
76
- "allow": [
77
- "Read(./**)",
78
- "Edit(./**)",
79
- "Write(./**)",
80
- "WebSearch",
81
- "WebFetch",
82
- "Bash(npm run dev)",
83
- "Bash(npm run build)",
84
- "Bash(npm run lint)",
85
- "Bash(npm run lint:fix)",
86
- "Bash(npm run typecheck)",
87
- "Bash(npm run test)",
88
- "Bash(npm run test:*)",
89
- "Bash(npm run validate)",
90
- "Bash(git status)",
91
- "Bash(git diff:*)",
92
- "Bash(git add:*)",
93
- "Bash(git commit:*)",
94
- "Bash(git push:*)",
95
- "Bash(git pull)",
96
- "Bash(git checkout:*)",
97
- "Bash(git branch:*)"
98
- ],
99
- "deny": [
100
- "Read(./.env)",
101
- "Read(./.env.*)",
102
- "Read(./secrets/**)",
103
- "Read(./**/credentials.*)",
104
- "Read(./**/*.pem)",
105
- "Read(./**/*.key)",
106
- "Bash(rm -rf:*)",
107
- "Bash(curl:*)",
108
- "Bash(wget:*)"
109
- ]
110
- }
111
- }
112
- ```
113
-
114
- ### .claude/.mcp.json
115
- ```json
116
- {
117
- "mcpServers": {}
118
- }
119
- ```
120
-
121
- ### .claude/feedback/FEEDBACK.md
122
- ```markdown
123
- <!-- @description Team-maintained corrections and guidance for Claude. Add notes here when Claude does something wrong — it learns for next time. This directory persists across /autoconfig runs. -->
124
-
125
- # Team Feedback
126
-
127
- Add corrections and guidance here when Claude does something wrong.
128
- Claude reads this directory and learns for next time.
129
-
130
- ## YYYY-MM-DD: Brief title
131
-
132
- Describe what Claude did wrong and what to do instead.
133
- Keep entries brief and actionable.
134
- ```
135
-
136
- ### .claude/rules/ (empty directory)
137
- Create the directory if it doesn't exist.
138
-
139
- ### CLAUDE.md (template)
140
- If no CLAUDE.md exists, create it with this template:
141
- ```markdown
142
- # Project Name
143
-
144
- > Run `/autoconfig` to populate this based on your project.
145
- ```
146
-
147
- ## Step 2: Detect Environment
148
-
149
- **Operating System:**
150
- Check the platform and note it for command syntax:
151
- - Windows → use `del`, `rmdir`, backslashes, `.cmd`/`.ps1` scripts
152
- - macOS/Linux use `rm`, `mkdir -p`, forward slashes, `.sh` scripts
153
-
154
- Include this in CLAUDE.md so all commands use the correct syntax.
155
-
156
- ## Step 3: Scan the Project
157
-
158
- Look for these indicators to understand the project:
159
-
160
- **Package/Config Files:**
161
- - `package.json` Node.js, npm scripts, dependencies
162
- - `requirements.txt` / `pyproject.toml` / `setup.py` → Python
163
- - `Cargo.toml` Rust
164
- - `go.mod` → Go
165
- - `Gemfile` → Ruby
166
- - `pom.xml` / `build.gradle` Java
167
- - `*.csproj` / `*.sln` .NET
168
- - `composer.json` PHP
169
-
170
- **Framework Indicators:**
171
- - `next.config.*` / `app/` directory → Next.js
172
- - `vite.config.*` → Vite
173
- - `angular.json` → Angular
174
- - `svelte.config.*` Svelte
175
- - `remix.config.*` → Remix
176
- - `nuxt.config.*` Nuxt
177
- - `django` in imports → Django
178
- - `flask` in imports → Flask
179
- - `fastapi` in imports → FastAPI
180
- - `express` in dependencies → Express
181
- - `rails` / `Gemfile` with rails → Rails
182
- - `laravel` → Laravel
183
-
184
- **Testing Frameworks:**
185
- - `jest.config.*` / `@jest` in deps → Jest
186
- - `vitest.config.*` → Vitest
187
- - `pytest.ini` / `conftest.py` → Pytest
188
- - `*_test.go` files → Go testing
189
- - `*_spec.rb` files → RSpec
190
- - `cypress/` or `playwright/` → E2E testing
191
-
192
- **Infrastructure:**
193
- - `Dockerfile` / `docker-compose.*` → Docker
194
- - `*.tf` files → Terraform
195
- - `k8s/` or `kubernetes/` → Kubernetes
196
- - `.github/workflows/` → GitHub Actions
197
- - `serverless.yml` → Serverless Framework
198
-
199
- ## Step 4: Populate CLAUDE.md
200
-
201
- Focus on what Claude Code actually needs to work effectively. Claude can explore the codebase itself — don't document what it can discover.
202
-
203
- **Wrap content in markers** so `/sync-claude-md` knows what's auto-generated:
204
-
205
- ```markdown
206
- <!-- AUTO-GENERATED BY /autoconfig — Do not edit. Use .claude/feedback/ for corrections. -->
207
-
208
- # Project Name
209
- ...content...
210
-
211
- <!-- END AUTO-GENERATED -->
212
- ```
213
-
214
- **Always include:**
215
- - **Project name + one-liner**: What is this thing?
216
- - **Tech stack**: Runtime, framework, database, key services (so Claude uses correct patterns)
217
- - **Commands**: How to run, test, build, deploy — Claude needs these to execute tasks
218
- - **Non-obvious conventions**: Multi-schema databases, monorepo structure, unusual patterns Claude wouldn't infer
219
-
220
- **Include if relevant:**
221
- - **Deployment flow**: If non-standard or involves multiple steps
222
- - **Key architectural decisions**: Only if Claude would make wrong assumptions without them
223
-
224
- **Skip these — Claude can discover them:**
225
- - Detailed project structure trees (Claude can run `ls` or `tree`)
226
- - Exhaustive route/endpoint lists (Claude can grep)
227
- - File-by-file descriptions (Claude can read files)
228
- - Database model lists (Claude can read schema files)
229
-
230
- **Keep it tight.** A 30-line CLAUDE.md that hits the essentials beats a 200-line doc Claude has to parse every session.
231
-
232
- **Always end with:**
233
- ```markdown
234
- ## Team Feedback
235
- See `.claude/feedback/` for corrections and guidance from the team.
236
- ```
237
-
238
- This pointer persists across autoconfig runs and directs Claude to team-maintained content.
239
-
240
- ## Guidelines
241
-
242
- - Replace ALL placeholder content with real values from THIS project
243
- - Delete sections that don't apply — no empty stubs
244
- - Optimize for Claude's efficiency, not human documentation
245
- - When uncertain, leave it out — Claude can ask or explore
246
-
247
- ## Step 5: Update the Guide
248
-
249
- After populating CLAUDE.md, update the guide's file preview to show the actual content:
250
-
251
- 1. Open `.claude/guide/autoconfig.guide.html`
252
- 2. Find the `fileContents` JavaScript object (search for `'claude-md':`)
253
- 3. Replace the `content` value with the actual CLAUDE.md content you just generated
254
- 4. Use template literal syntax and escape any backticks in the content
255
-
256
- This ensures double-clicking CLAUDE.md in the guide shows the real generated content.
257
-
258
- ## After Completion
259
-
260
- Once autoconfig is complete, open the interactive guide in the user's browser:
261
-
262
- - macOS: `open .claude/guide/autoconfig.guide.html`
263
- - Linux: `xdg-open .claude/guide/autoconfig.guide.html`
264
- - Windows: `start .claude/guide/autoconfig.guide.html`
265
-
266
- This shows the user what got installed and how to use it.
1
+ <!-- @description The command you just ran. Analyzes your project and populates CLAUDE.md with real context. Re-run anytime your stack changes. -->
2
+
3
+ # Autoconfig
4
+
5
+ Analyze this project and configure Claude Code with real context.
6
+
7
+ ## Step 1: Detect Environment
8
+
9
+ **Operating System:**
10
+ Check the platform and note it for command syntax:
11
+ - Windowsuse `del`, `rmdir`, backslashes, `.cmd`/`.ps1` scripts
12
+ - macOS/Linux → use `rm`, `mkdir -p`, forward slashes, `.sh` scripts
13
+
14
+ Include this in CLAUDE.md so all commands use the correct syntax.
15
+
16
+ ## Step 2: Scan the Project
17
+
18
+ Look for these indicators to understand the project:
19
+
20
+ **Package/Config Files:**
21
+ - `package.json` → Node.js, npm scripts, dependencies
22
+ - `requirements.txt` / `pyproject.toml` / `setup.py` Python
23
+ - `Cargo.toml` Rust
24
+ - `go.mod` Go
25
+ - `Gemfile` Ruby
26
+ - `pom.xml` / `build.gradle` → Java
27
+ - `*.csproj` / `*.sln` → .NET
28
+ - `composer.json` → PHP
29
+
30
+ **Framework Indicators:**
31
+ - `next.config.*` / `app/` directory → Next.js
32
+ - `vite.config.*` Vite
33
+ - `angular.json` → Angular
34
+ - `svelte.config.*`Svelte
35
+ - `remix.config.*` → Remix
36
+ - `nuxt.config.*` Nuxt
37
+ - `django` in imports → Django
38
+ - `flask` in imports → Flask
39
+ - `fastapi` in imports FastAPI
40
+ - `express` in dependencies Express
41
+ - `rails` / `Gemfile` with rails Rails
42
+ - `laravel` Laravel
43
+
44
+ **Testing Frameworks:**
45
+ - `jest.config.*` / `@jest` in deps Jest
46
+ - `vitest.config.*` Vitest
47
+ - `pytest.ini` / `conftest.py` → Pytest
48
+ - `*_test.go` files → Go testing
49
+ - `*_spec.rb` files → RSpec
50
+ - `cypress/` or `playwright/` → E2E testing
51
+
52
+ **Infrastructure:**
53
+ - `Dockerfile` / `docker-compose.*` Docker
54
+ - `*.tf` files → Terraform
55
+ - `k8s/` or `kubernetes/` → Kubernetes
56
+ - `.github/workflows/` → GitHub Actions
57
+ - `serverless.yml` → Serverless Framework
58
+
59
+ ## Step 3: Populate CLAUDE.md
60
+
61
+ Focus on what Claude Code actually needs to work effectively. Claude can explore the codebase itself — don't document what it can discover.
62
+
63
+ **Wrap content in markers** so `/sync-claude-md` knows what's auto-generated:
64
+
65
+ ```markdown
66
+ <!-- AUTO-GENERATED BY /autoconfig Do not edit. Use .claude/feedback/ for corrections. -->
67
+
68
+ # Project Name
69
+ ...content...
70
+
71
+ <!-- END AUTO-GENERATED -->
72
+ ```
73
+
74
+ **Always include:**
75
+ - **Project name + one-liner**: What is this thing?
76
+ - **Tech stack**: Runtime, framework, database, key services (so Claude uses correct patterns)
77
+ - **Commands**: How to run, test, build, deploy — Claude needs these to execute tasks
78
+ - **Non-obvious conventions**: Multi-schema databases, monorepo structure, unusual patterns Claude wouldn't infer
79
+
80
+ **Include if relevant:**
81
+ - **Deployment flow**: If non-standard or involves multiple steps
82
+ - **Key architectural decisions**: Only if Claude would make wrong assumptions without them
83
+
84
+ **Skip these — Claude can discover them:**
85
+ - Detailed project structure trees (Claude can run `ls` or `tree`)
86
+ - Exhaustive route/endpoint lists (Claude can grep)
87
+ - File-by-file descriptions (Claude can read files)
88
+ - Database model lists (Claude can read schema files)
89
+
90
+ **Keep it tight.** A 30-line CLAUDE.md that hits the essentials beats a 200-line doc Claude has to parse every session.
91
+
92
+ **Always end with:**
93
+ ```markdown
94
+ ## Team Feedback
95
+ See `.claude/feedback/` for corrections and guidance from the team.
96
+ ```
97
+
98
+ This pointer persists across autoconfig runs and directs Claude to team-maintained content.
99
+
100
+ ## Step 4: Create Rules Directory
101
+
102
+ Create an empty `.claude/rules/` directory. Do not create any subdirectories or rule files.
103
+
104
+ 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.
105
+
106
+ ## Step 5: Configure Settings
107
+
108
+ Update `.claude/settings.json` using the official schema.
109
+
110
+ ### Deny Patterns (files Claude shouldn't read/write)
111
+
112
+ Use `Read()` for blocking reads, `Edit()` for blocking writes:
113
+
114
+ **Always deny (security):**
115
+ ```
116
+ Read(./.env)
117
+ Read(./.env.*)
118
+ Read(./secrets/**)
119
+ Edit(./.env)
120
+ Edit(./.env.*)
121
+ ```
122
+
123
+ **Often deny (generated/vendor):**
124
+ ```
125
+ Edit(./node_modules/**)
126
+ Edit(./dist/**)
127
+ Edit(./.git/**)
128
+ ```
129
+
130
+ ### Allow Patterns (auto-approve without prompting)
131
+
132
+ Use `Bash()` patterns with prefix matching:
133
+
134
+ ```
135
+ Bash(npm run test:*)
136
+ Bash(npm run lint:*)
137
+ Bash(npm run build)
138
+ ```
139
+
140
+ ### Environment Variables
141
+
142
+ Set session-level env vars:
143
+
144
+ ```json
145
+ {
146
+ "env": {
147
+ "NODE_ENV": "development"
148
+ }
149
+ }
150
+ ```
151
+
152
+ **Keep it minimal** only include patterns that actually exist in this project.
153
+
154
+ ## Guidelines
155
+
156
+ - Replace ALL placeholder content with real values from THIS project
157
+ - Delete sections that don't apply — no empty stubs
158
+ - Optimize for Claude's efficiency, not human documentation
159
+ - When uncertain, leave it out — Claude can ask or explore
160
+
161
+ ## Step 6: Update the Guide
162
+
163
+ After populating CLAUDE.md, update the guide's file preview to show the actual content:
164
+
165
+ 1. Open `.claude/guide/autoconfig.guide.html`
166
+ 2. Find the `fileContents` JavaScript object (search for `'claude-md':`)
167
+ 3. Replace the `content` value with the actual CLAUDE.md content you just generated
168
+ 4. Use template literal syntax and escape any backticks in the content
169
+
170
+ This ensures double-clicking CLAUDE.md in the guide shows the real generated content.
171
+
172
+ ## After Completion
173
+
174
+ Once autoconfig is complete, prompt the user:
175
+
176
+ **Run `/show-guide` for an interactive walkthrough of your new Claude Code project setup.**