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/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
- ## Existing setup — READ BEFORE WRITING
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 (exists — append only)
24
+ ### CLAUDE.md EXISTS — append only, never rewrite, never remove
19
25
  {{CLAUDE_MD_CONTENT}}
20
26
  {{else}}
21
- CLAUDE.md: does not exist (create it)
27
+ CLAUDE.md does not exist (create it)
22
28
  {{/if}}
23
29
 
24
30
  {{#if HAS_MCP_JSON}}
25
- ### .mcp.json (exists — merge only)
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: create only if services evidenced above
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 (exists — merge only)
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: create only if hooks warranted
50
+ settings.json → does not exist (create only if hooks are warranted)
36
51
  {{/if}}
37
52
 
38
- Skills: {{SKILLS_LIST}} | Commands: {{COMMANDS_LIST}} | Workflows: {{WORKFLOWS_LIST}} | .github: {{HAS_GITHUB_DIR}}
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
- ## Rules
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
- ## Output — one line per file, nothing else
47
- Created: ✅ [path] — [why]
48
- Updated: [path] — [what added]
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]
@@ -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
- - Remove only related content. Never delete entire files.
26
- - Files must remain valid after edit (JSON stays valid, etc.)
27
- - If not found: say so and stop.
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 only what the changes demand.
3
+ Project changed since last setup. Update ONLY what the changes demand.
4
4
 
5
- ## Changes
6
- ### Added
5
+ ## Changes since last setup
6
+
7
+ ### Added files
7
8
  {{ADDED_FILES}}
8
- ### Modified
9
+
10
+ ### Modified files
9
11
  {{MODIFIED_FILES}}
10
- ### Deleted
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
- ## Rules
33
- - Surgical edits only. Don't rewrite files. Don't update unchanged things.
34
- - If unsure about a change's implication: flag it, don't guess.
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
- ## Outputone line per file
37
- Updated: [path] — triggered by: [which change and why]
38
- Skipped: [path] [why no implication]
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]