claude-setup 1.1.1 → 1.1.3
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 +96 -45
- package/dist/builder.js +226 -32
- package/dist/collect.js +40 -5
- package/dist/commands/add.js +10 -7
- package/dist/commands/doctor.d.ts +5 -1
- package/dist/commands/doctor.js +5 -1
- package/dist/commands/init.d.ts +3 -1
- package/dist/commands/init.js +40 -9
- package/dist/commands/remove.js +2 -1
- package/dist/commands/status.js +123 -11
- package/dist/commands/sync.d.ts +3 -1
- package/dist/commands/sync.js +65 -10
- package/dist/config.d.ts +14 -0
- package/dist/config.js +89 -3
- package/dist/doctor.d.ts +1 -1
- package/dist/doctor.js +320 -23
- package/dist/index.js +31 -9
- package/dist/manifest.js +12 -0
- package/dist/os.d.ts +25 -0
- package/dist/os.js +52 -0
- package/dist/output.d.ts +18 -0
- package/dist/output.js +40 -0
- package/dist/state.js +5 -1
- package/package.json +1 -1
- package/templates/add.md +8 -4
- package/templates/init.md +81 -17
- package/templates/remove.md +31 -5
- package/templates/sync.md +28 -13
package/templates/init.md
CHANGED
|
@@ -12,38 +12,102 @@ Set up this project for Claude Code. Reason from what you see. Don't ask questio
|
|
|
12
12
|
{{SOURCE_CONTEXT}}
|
|
13
13
|
{{/if}}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
{{#if HAS_SKIPPED}}
|
|
16
|
+
## Files skipped (too large or filtered)
|
|
17
|
+
|
|
18
|
+
{{SKIPPED_LIST}}
|
|
19
|
+
{{/if}}
|
|
20
|
+
|
|
21
|
+
## Existing setup — READ EVERY LINE BEFORE TOUCHING ANYTHING
|
|
16
22
|
|
|
17
23
|
{{#if HAS_CLAUDE_MD}}
|
|
18
|
-
### CLAUDE.md
|
|
24
|
+
### CLAUDE.md — EXISTS — append only, never rewrite, never remove
|
|
19
25
|
{{CLAUDE_MD_CONTENT}}
|
|
20
26
|
{{else}}
|
|
21
|
-
CLAUDE.md
|
|
27
|
+
CLAUDE.md → does not exist (create it)
|
|
22
28
|
{{/if}}
|
|
23
29
|
|
|
24
30
|
{{#if HAS_MCP_JSON}}
|
|
25
|
-
### .mcp.json
|
|
31
|
+
### .mcp.json — EXISTS — merge only, never remove existing entries
|
|
26
32
|
{{MCP_JSON_CONTENT}}
|
|
33
|
+
|
|
34
|
+
OS detected: {{DETECTED_OS}}. Use correct MCP command format:
|
|
35
|
+
- Windows: `{ "command": "cmd", "args": ["/c", "npx", "<package>"] }`
|
|
36
|
+
- macOS/Linux: `{ "command": "npx", "args": ["<package>"] }`
|
|
27
37
|
{{else}}
|
|
28
|
-
.mcp.json
|
|
38
|
+
.mcp.json → does not exist (create only if you find evidence of external services)
|
|
29
39
|
{{/if}}
|
|
30
40
|
|
|
31
41
|
{{#if HAS_SETTINGS}}
|
|
32
|
-
### settings.json
|
|
42
|
+
### .claude/settings.json — EXISTS — merge only, never remove existing hooks
|
|
33
43
|
{{SETTINGS_CONTENT}}
|
|
44
|
+
|
|
45
|
+
Hook shell format for {{DETECTED_OS}}:
|
|
46
|
+
- Windows: `{ "command": "cmd", "args": ["/c", "<command>"] }`
|
|
47
|
+
- macOS/Linux: `{ "command": "bash", "args": ["-c", "<command>"] }`
|
|
48
|
+
- Bash quoting rule: never use bare `"` inside `-c "..."` — use `\x22` instead
|
|
34
49
|
{{else}}
|
|
35
|
-
settings.json
|
|
50
|
+
settings.json → does not exist (create only if hooks are warranted)
|
|
36
51
|
{{/if}}
|
|
37
52
|
|
|
38
|
-
Skills:
|
|
53
|
+
Skills installed: {{SKILLS_LIST}}
|
|
54
|
+
Commands installed: {{COMMANDS_LIST}}
|
|
55
|
+
Workflows installed: {{WORKFLOWS_LIST}}
|
|
56
|
+
.github/ exists: {{HAS_GITHUB_DIR}}
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Your job
|
|
61
|
+
|
|
62
|
+
Read the files above. Figure out the project from what you see — language, runtime,
|
|
63
|
+
dependencies, structure, conventions. Do not assume anything not visible in the files.
|
|
64
|
+
|
|
65
|
+
Then write the Claude Code setup for THIS specific project.
|
|
66
|
+
|
|
67
|
+
### CLAUDE.md
|
|
68
|
+
Always write or update. Make it specific: reference actual file paths, actual patterns,
|
|
69
|
+
actual conventions from the code. Generic advice belongs in docs, not here.
|
|
70
|
+
If it exists: read it above first. Add only what is genuinely missing. Never remove.
|
|
71
|
+
|
|
72
|
+
### .mcp.json
|
|
73
|
+
Only if you found evidence of external services in the config files, dependencies,
|
|
74
|
+
or environment template. No evidence = no server.
|
|
75
|
+
If it exists: add to it. Never remove existing entries. Produce valid JSON.
|
|
76
|
+
Use OS-correct command format (see above).
|
|
77
|
+
|
|
78
|
+
### .claude/settings.json
|
|
79
|
+
Only if hooks genuinely earn their cost for this specific project.
|
|
80
|
+
Every hook adds overhead on every Claude Code action.
|
|
81
|
+
If it exists: add to it. Never remove existing hooks.
|
|
82
|
+
Use OS-correct shell format (see above).
|
|
83
|
+
|
|
84
|
+
### .claude/skills/
|
|
85
|
+
Only for patterns that recur across this codebase and benefit from automatic loading.
|
|
86
|
+
Use `applies-when` frontmatter so skills load only when relevant.
|
|
87
|
+
If a similar skill already exists: extend it.
|
|
88
|
+
|
|
89
|
+
### .github/workflows/
|
|
90
|
+
Only if .github/ exists ({{HAS_GITHUB_DIR}}).
|
|
91
|
+
Only workflows warranted by what you found.
|
|
92
|
+
If workflows already exist: do not touch them.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Absolute rules
|
|
97
|
+
|
|
98
|
+
1. You have the full content of every existing Claude config file above.
|
|
99
|
+
Read it before writing. Never write blind.
|
|
100
|
+
2. Append and merge only. Never rewrite a file in full. Never remove existing content.
|
|
101
|
+
3. Write only what is evidenced by the project files. No evidence = skip it.
|
|
102
|
+
4. Every line in CLAUDE.md must reference something you actually saw.
|
|
103
|
+
No generic boilerplate. No advice identical for every project.
|
|
104
|
+
5. MCP servers, skills, and hooks add cost on every Claude Code session.
|
|
105
|
+
Only add them if they clearly earn their keep for THIS project.
|
|
106
|
+
|
|
107
|
+
---
|
|
39
108
|
|
|
40
|
-
##
|
|
41
|
-
1. Read existing content above before writing. Never write blind.
|
|
42
|
-
2. Append/merge only. Never rewrite or remove.
|
|
43
|
-
3. Every line must trace to something in the project. No generic boilerplate.
|
|
44
|
-
4. MCP/skills/hooks cost tokens every session. Only add if clearly earned.
|
|
109
|
+
## Output format — one line per file, nothing else
|
|
45
110
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Skipped: ⏭ [path] — [why not needed]
|
|
111
|
+
Created: ✅ [path] — [one clause: what you saw that justified it]
|
|
112
|
+
Updated: ✅ [path] — [one clause: what was added]
|
|
113
|
+
Skipped: ⏭ [path] — [one clause: why not needed]
|
package/templates/remove.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Remove from setup: "{{USER_INPUT}}"
|
|
4
4
|
|
|
5
|
-
## Current setup
|
|
5
|
+
## Current setup — read everything before touching any file
|
|
6
6
|
|
|
7
7
|
{{#if HAS_CLAUDE_MD}}
|
|
8
8
|
### CLAUDE.md
|
|
@@ -21,11 +21,37 @@ Remove from setup: "{{USER_INPUT}}"
|
|
|
21
21
|
|
|
22
22
|
Skills: {{SKILLS_LIST}} | Commands: {{COMMANDS_LIST}} | Workflows: {{WORKFLOWS_LIST}}
|
|
23
23
|
|
|
24
|
+
## IMPORTANT: Scan the filesystem directly — do NOT rely on manifest history
|
|
25
|
+
|
|
26
|
+
The manifest is a historical record, not a reliable source of what exists now.
|
|
27
|
+
Claude Code can create, modify, or delete files outside the CLI at any time.
|
|
28
|
+
|
|
29
|
+
Before removing anything, scan these locations directly:
|
|
30
|
+
- Skills : `.claude/skills/*/SKILL.md`, `.claude/skills/*.md`, `.claude/skills/**/*.md`
|
|
31
|
+
- Commands : `.claude/commands/*.md` (exclude stack-*.md)
|
|
32
|
+
- MCP : read `.mcp.json` directly
|
|
33
|
+
- Hooks : read `.claude/settings.json` directly
|
|
34
|
+
- CLAUDE.md: read the file directly
|
|
35
|
+
|
|
36
|
+
Before deleting, list every reference found and confirm scope:
|
|
37
|
+
```
|
|
38
|
+
Planning to remove:
|
|
39
|
+
[path/entry] — [what it is]
|
|
40
|
+
|
|
41
|
+
Dangling references that will break:
|
|
42
|
+
[path] — still references [thing being removed]
|
|
43
|
+
```
|
|
44
|
+
|
|
24
45
|
## Rules
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
46
|
+
- Find everything related to the removal request across ALL files — scan the filesystem, not just the data shown above.
|
|
47
|
+
- Remove surgically — section by section, key by key.
|
|
48
|
+
- Never delete an entire file. Remove only the relevant section.
|
|
49
|
+
- Never remove content unrelated to the request.
|
|
50
|
+
- After every edit, the file MUST remain valid (JSON stays valid JSON, etc.)
|
|
51
|
+
- If not found anywhere: say so and stop.
|
|
52
|
+
- Check for dangling references: if removing an MCP server, check if any hook or skill references its env vars.
|
|
28
53
|
|
|
29
54
|
## Output — one line per file
|
|
30
|
-
Removed: ✅ [path] — [what removed]
|
|
55
|
+
Removed: ✅ [path] — [what was removed]
|
|
31
56
|
Not found: ⏭ [path] — not referenced
|
|
57
|
+
Dangling: ⚠️ [path] — still references [removed thing]
|
package/templates/sync.md
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<!-- claude-setup sync {{DATE}} | last: {{LAST_RUN_DATE}} -->
|
|
2
2
|
|
|
3
|
-
Project changed since last setup. Update
|
|
3
|
+
Project changed since last setup. Update ONLY what the changes demand.
|
|
4
4
|
|
|
5
|
-
## Changes
|
|
6
|
-
|
|
5
|
+
## Changes since last setup
|
|
6
|
+
|
|
7
|
+
### Added files
|
|
7
8
|
{{ADDED_FILES}}
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
### Modified files
|
|
9
11
|
{{MODIFIED_FILES}}
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
### Deleted files
|
|
11
14
|
{{DELETED_FILES}}
|
|
12
15
|
|
|
13
|
-
## Current setup
|
|
16
|
+
## Current setup — read before touching
|
|
14
17
|
|
|
15
18
|
{{#if HAS_CLAUDE_MD}}
|
|
16
19
|
### CLAUDE.md
|
|
@@ -29,11 +32,23 @@ Project changed since last setup. Update only what the changes demand.
|
|
|
29
32
|
|
|
30
33
|
Skills: {{SKILLS_LIST}} | Commands: {{COMMANDS_LIST}}
|
|
31
34
|
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
## Your job
|
|
36
|
+
|
|
37
|
+
For EACH changed file: does this change have any implication for the Claude Code setup?
|
|
38
|
+
|
|
39
|
+
Reason about the signal:
|
|
40
|
+
- New dependency → new MCP server needed? New hook justified?
|
|
41
|
+
- New docker-compose service → new MCP entry? Env vars changed?
|
|
42
|
+
- Source file added/removed → CLAUDE.md paths stale? Skill still applies?
|
|
43
|
+
- Config deleted → remove its MCP/hook reference if it was the only evidence?
|
|
44
|
+
|
|
45
|
+
Update ONLY what the change demands.
|
|
46
|
+
Do NOT update things that did not change.
|
|
47
|
+
Do NOT rewrite files — surgical edits only.
|
|
48
|
+
If unsure about a change's implication: flag it, don't guess.
|
|
49
|
+
|
|
50
|
+
## Output — one line per file, nothing else
|
|
35
51
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Flagged: ⚠️ [needs developer decision]
|
|
52
|
+
Updated: ✅ [path] — triggered by: [which changed file and why]
|
|
53
|
+
Skipped: ⏭ [path] — [why this change has no setup implication]
|
|
54
|
+
Flagged: ⚠️ [something that needs the developer's decision]
|