@claude-code-mastery/starter-kit 1.1.0 → 1.2.0

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.
@@ -74,7 +74,13 @@ project/
74
74
  2. **Run the batch scaffold script** — this replaces all individual file creation with a single command:
75
75
 
76
76
  ```bash
77
- bash "$(pwd)/scripts/scaffold-clean.sh" "$PROJECT_PATH" "$PROJECT_NAME" "$(pwd)"
77
+ # Resolve the kit source: npm global install takes priority over CWD
78
+ if [ -f ~/.claude/starter-kit-source-path ]; then
79
+ KIT=$(cat ~/.claude/starter-kit-source-path)
80
+ else
81
+ KIT="$(pwd)"
82
+ fi
83
+ bash "$KIT/scripts/scaffold-clean.sh" "$PROJECT_PATH" "$PROJECT_NAME" "$KIT"
78
84
  ```
79
85
 
80
86
  The script handles ALL of the following in one execution (~100ms) with a progress indicator:
@@ -394,7 +394,7 @@ When creating a Go project, the CLAUDE.md MUST include these Go-specific rules:
394
394
  8. Create `Dockerfile` (multi-stage with scratch, using template above)
395
395
  9. Create `.golangci.yml` (using template above)
396
396
  10. Create Go-specific `CLAUDE.md` (with Go rules above + universal security rules)
397
- 11. Copy `.claude/` contents from starter kit only commands with `scope: project` in frontmatter (skills, hooks, settings.json copied in full)
397
+ 11. **If NOT using npm global install** (`~/.claude/starter-kit-source-path` does not exist): Copy `.claude/` contents from starter kit - only commands with `scope: project` in frontmatter (skills, hooks, settings.json copied in full). **If npm global install is active**: skip this step - commands/skills/hooks already live in `~/.claude/` globally.
398
398
  12. Create `project-docs/` templates (ARCHITECTURE.md, INFRASTRUCTURE.md, DECISIONS.md)
399
399
  13. Create `.env`, `.env.example`, `.gitignore` (Go-specific), `.dockerignore`
400
400
  14. Create `CLAUDE.local.md` template
@@ -81,13 +81,22 @@ Based on answers, scaffold the project.
81
81
  **If the resolved choices exactly match the default profile** (fullstack + next + mongo + tailwind + docker + pnpm), use the batch scaffold script for maximum speed:
82
82
 
83
83
  ```bash
84
- bash "$(pwd)/scripts/scaffold-default.sh" "$PROJECT_PATH" "$PROJECT_NAME" "$(pwd)"
84
+ # Resolve the kit source: npm global install takes priority over CWD
85
+ if [ -f ~/.claude/starter-kit-source-path ]; then
86
+ KIT=$(cat ~/.claude/starter-kit-source-path)
87
+ else
88
+ KIT="$(pwd)"
89
+ fi
90
+ bash "$KIT/scripts/scaffold-default.sh" "$PROJECT_PATH" "$PROJECT_NAME" "$KIT"
85
91
  ```
86
92
 
87
93
  The script handles ALL of the following in one execution with progress indicators:
88
- - Creates all directories (src/, .claude/, project-docs/, tests/, scripts/, .github/)
89
- - Copies project-scoped commands, all skills, and all hooks
90
- - Writes settings.json (full 9-hook config)
94
+ - Creates all directories (src/, project-docs/, tests/, scripts/, .github/)
95
+ - For clone users: copies project-scoped commands, all skills, and all hooks into the project's .claude/
96
+ - For npm users: skips local .claude/ copy (commands/skills/hooks already live globally in ~/.claude/)
97
+ - Writes settings.json (10-hook config) for clone users only
98
+ - Installs StrictDB (npm package) + query system
99
+ - Creates Next.js app structure (layout, page, API health route, instrumentation)
91
100
  - Installs StrictDB (npm package) + query system
92
101
  - Creates Next.js app structure (layout, page, API health route, instrumentation)
93
102
  - Creates TypeScript, Next.js, Tailwind, PostCSS, Vitest, Playwright configs
@@ -415,7 +415,7 @@ When creating a Python project, the CLAUDE.md MUST include these Python-specific
415
415
  10. Create `Makefile` with dev, test, lint, format, run targets
416
416
  11. Create `Dockerfile` (multi-stage with python:3.12-slim)
417
417
  12. Create Python-specific CLAUDE.md (with Python rules + universal security rules)
418
- 13. Copy `.claude/` contents from starter kit only commands with `scope: project` in frontmatter (skills, hooks, settings.json copied in full)
418
+ 13. **If NOT using npm global install** (`~/.claude/starter-kit-source-path` does not exist): Copy `.claude/` contents from starter kit - only commands with `scope: project` in frontmatter (skills, hooks, settings.json copied in full). **If npm global install is active**: skip this step - commands/skills/hooks already live in `~/.claude/` globally.
419
419
  14. Create `project-docs/` templates (ARCHITECTURE.md, INFRASTRUCTURE.md, DECISIONS.md)
420
420
  15. Create `.env`, `.env.example`, `.gitignore` (Python-specific), `.dockerignore`
421
421
  16. Create `CLAUDE.local.md` template
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-code-mastery/starter-kit",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Production-ready Claude Code starter kit — commands, hooks, skills, and agents for AI-assisted development",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -14,6 +14,18 @@ PROJECT_NAME="$2"
14
14
  STARTER_KIT="$3"
15
15
  REGISTRY="${HOME}/.claude/starter-kit-projects.json"
16
16
 
17
+ # ── Global install detection ───────────────────────────────────────────────────
18
+ # npm users: copyPackageFiles flattens .claude/* into ~/.claude/starter-kit/ directly,
19
+ # so commands are at $STARTER_KIT/commands/ (no extra .claude/ level).
20
+ # Clone users: content lives under $STARTER_KIT/.claude/.
21
+ if [ -f "${HOME}/.claude/starter-kit-source-path" ]; then
22
+ GLOBAL_INSTALLED=true
23
+ CLAUDE_DIR="$STARTER_KIT"
24
+ else
25
+ GLOBAL_INSTALLED=false
26
+ CLAUDE_DIR="$STARTER_KIT/.claude"
27
+ fi
28
+
17
29
  # ── Validation ─────────────────────────────────────────────────────────────────
18
30
  if [ -d "$PROJECT_PATH" ]; then
19
31
  echo "ERROR: Directory already exists: $PROJECT_PATH"
@@ -21,7 +33,7 @@ if [ -d "$PROJECT_PATH" ]; then
21
33
  exit 1
22
34
  fi
23
35
 
24
- if [ ! -d "$STARTER_KIT/.claude/commands" ]; then
36
+ if [ ! -d "$CLAUDE_DIR/commands" ]; then
25
37
  echo "ERROR: Starter kit not found at: $STARTER_KIT"
26
38
  exit 1
27
39
  fi
@@ -75,40 +87,42 @@ echo ""
75
87
 
76
88
  # ── Step 1: Create directories ─────────────────────────────────────────────────
77
89
  progress "Creating directory structure..."
78
- mkdir -p "$PROJECT_PATH"/.claude/{commands,skills,agents,hooks}
90
+ if [ "$GLOBAL_INSTALLED" = "false" ]; then
91
+ mkdir -p "$PROJECT_PATH"/.claude/{commands,skills,agents,hooks}
92
+ fi
79
93
  mkdir -p "$PROJECT_PATH"/project-docs
80
94
  mkdir -p "$PROJECT_PATH"/tests
81
95
 
82
- # ── Step 2: Copy 16 project-scoped commands ────────────────────────────────────
83
- progress "Copying 16 project commands..."
84
- for cmd in architecture commit create-api create-e2e diagram help \
85
- optimize-docker progress refactor review security-check \
86
- setup show-user-guide test-plan what-is-my-ai-doing worktree; do
87
- cp "$STARTER_KIT/.claude/commands/${cmd}.md" "$PROJECT_PATH/.claude/commands/"
88
- done
89
-
90
- # ── Step 3: Copy skills, agents, hooks ─────────────────────────────────────────
91
- progress "Copying skills, agents, hooks..."
92
- cp -r "$STARTER_KIT/.claude/skills/code-review" "$PROJECT_PATH/.claude/skills/"
93
- cp -r "$STARTER_KIT/.claude/skills/create-service" "$PROJECT_PATH/.claude/skills/"
94
- cp "$STARTER_KIT/.claude/agents/code-reviewer.md" "$PROJECT_PATH/.claude/agents/"
95
- cp "$STARTER_KIT/.claude/agents/test-writer.md" "$PROJECT_PATH/.claude/agents/"
96
- cp "$STARTER_KIT/.claude/hooks/block-secrets.py" "$PROJECT_PATH/.claude/hooks/"
97
- cp "$STARTER_KIT/.claude/hooks/lint-on-save.sh" "$PROJECT_PATH/.claude/hooks/"
98
- cp "$STARTER_KIT/.claude/hooks/verify-no-secrets.sh" "$PROJECT_PATH/.claude/hooks/"
99
-
100
- # ── Step 4: Write settings.json (clean mode — 3 hooks only) ───────────────────
101
- progress "Writing settings.json..."
102
- cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
96
+ # ── Steps 2-4: Copy Claude infrastructure (clone users only) ──────────────────
97
+ # npm users already have commands/skills/hooks installed globally in ~/.claude/
98
+ if [ "$GLOBAL_INSTALLED" = "false" ]; then
99
+ progress "Copying 16 project commands..."
100
+ for cmd in architecture commit create-api create-e2e diagram help \
101
+ optimize-docker progress refactor review security-check \
102
+ setup show-user-guide test-plan what-is-my-ai-doing worktree; do
103
+ cp "$CLAUDE_DIR/commands/${cmd}.md" "$PROJECT_PATH/.claude/commands/"
104
+ done
105
+
106
+ progress "Copying skills, agents, hooks..."
107
+ cp -r "$CLAUDE_DIR/skills/code-review" "$PROJECT_PATH/.claude/skills/"
108
+ cp -r "$CLAUDE_DIR/skills/create-service" "$PROJECT_PATH/.claude/skills/"
109
+ cp "$CLAUDE_DIR/agents/code-reviewer.md" "$PROJECT_PATH/.claude/agents/"
110
+ cp "$CLAUDE_DIR/agents/test-writer.md" "$PROJECT_PATH/.claude/agents/"
111
+ cp "$CLAUDE_DIR/hooks/block-dangerous-bash.py" "$PROJECT_PATH/.claude/hooks/"
112
+ cp "$CLAUDE_DIR/hooks/lint-on-save.sh" "$PROJECT_PATH/.claude/hooks/"
113
+ cp "$CLAUDE_DIR/hooks/verify-no-secrets.sh" "$PROJECT_PATH/.claude/hooks/"
114
+
115
+ progress "Writing settings.json..."
116
+ cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
103
117
  {
104
118
  "hooks": {
105
119
  "PreToolUse": [
106
120
  {
107
- "matcher": "Read|Edit|Write",
121
+ "matcher": "Bash",
108
122
  "hooks": [
109
123
  {
110
124
  "type": "command",
111
- "command": "python3 .claude/hooks/block-secrets.py"
125
+ "command": "python3 .claude/hooks/block-dangerous-bash.py"
112
126
  }
113
127
  ]
114
128
  }
@@ -137,6 +151,12 @@ cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
137
151
  }
138
152
  }
139
153
  SETTINGS_EOF
154
+ else
155
+ # Skip counts for npm users — 3 steps replaced by one message
156
+ progress "Skipping local .claude/ copy (commands/skills/hooks live globally)"
157
+ progress "Skipping local .claude/ copy (commands/skills/hooks live globally)"
158
+ progress "Skipping local .claude/ copy (commands/skills/hooks live globally)"
159
+ fi
140
160
 
141
161
  # ── Step 4b: Create features.json (empty manifest for clean mode) ─────────────
142
162
  cat > "$PROJECT_PATH/.claude/features.json" << 'FEATURES_EOF'
@@ -15,6 +15,15 @@ PROJECT_NAME="$2"
15
15
  STARTER_KIT="$3"
16
16
  REGISTRY="${HOME}/.claude/starter-kit-projects.json"
17
17
 
18
+ # ── Global install detection ───────────────────────────────────────────────────
19
+ if [ -f "${HOME}/.claude/starter-kit-source-path" ]; then
20
+ GLOBAL_INSTALLED=true
21
+ CLAUDE_DIR="$STARTER_KIT"
22
+ else
23
+ GLOBAL_INSTALLED=false
24
+ CLAUDE_DIR="$STARTER_KIT/.claude"
25
+ fi
26
+
18
27
  # ── Validation ─────────────────────────────────────────────────────────────────
19
28
  if [ -d "$PROJECT_PATH" ]; then
20
29
  echo "ERROR: Directory already exists: $PROJECT_PATH"
@@ -22,7 +31,7 @@ if [ -d "$PROJECT_PATH" ]; then
22
31
  exit 1
23
32
  fi
24
33
 
25
- if [ ! -d "$STARTER_KIT/.claude/commands" ]; then
34
+ if [ ! -d "$CLAUDE_DIR/commands" ]; then
26
35
  echo "ERROR: Starter kit not found at: $STARTER_KIT"
27
36
  exit 1
28
37
  fi
@@ -77,7 +86,9 @@ echo ""
77
86
 
78
87
  # ── Step 1: Create directory structure ─────────────────────────────────────────
79
88
  progress "Creating directory structure..."
80
- mkdir -p "$PROJECT_PATH"/.claude/{commands,skills,agents,hooks}
89
+ if [ "$GLOBAL_INSTALLED" = "false" ]; then
90
+ mkdir -p "$PROJECT_PATH"/.claude/{commands,skills,agents,hooks}
91
+ fi
81
92
  mkdir -p "$PROJECT_PATH"/project-docs
82
93
  mkdir -p "$PROJECT_PATH"/src/app/api/v1/health
83
94
  mkdir -p "$PROJECT_PATH"/src/handlers
@@ -89,46 +100,41 @@ mkdir -p "$PROJECT_PATH"/content
89
100
  mkdir -p "$PROJECT_PATH"/.github/workflows
90
101
  mkdir -p "$PROJECT_PATH"/public
91
102
 
92
- # ── Step 2: Copy 16 project-scoped commands ────────────────────────────────────
93
- progress "Copying 16 project commands..."
94
- for cmd in architecture commit create-api create-e2e diagram help \
95
- optimize-docker progress refactor review security-check \
96
- setup show-user-guide test-plan what-is-my-ai-doing worktree; do
97
- cp "$STARTER_KIT/.claude/commands/${cmd}.md" "$PROJECT_PATH/.claude/commands/"
98
- done
99
-
100
- # ── Step 3: Copy skills, agents, ALL 9 hooks ──────────────────────────────────
101
- progress "Copying skills, agents, 9 hooks..."
102
- cp -r "$STARTER_KIT/.claude/skills/code-review" "$PROJECT_PATH/.claude/skills/"
103
- cp -r "$STARTER_KIT/.claude/skills/create-service" "$PROJECT_PATH/.claude/skills/"
104
- cp "$STARTER_KIT/.claude/agents/code-reviewer.md" "$PROJECT_PATH/.claude/agents/"
105
- cp "$STARTER_KIT/.claude/agents/test-writer.md" "$PROJECT_PATH/.claude/agents/"
106
- for hook in block-secrets.py lint-on-save.sh verify-no-secrets.sh \
107
- check-rybbit.sh check-branch.sh check-ports.sh \
108
- check-e2e.sh check-rulecatch.sh check-env-sync.sh; do
109
- cp "$STARTER_KIT/.claude/hooks/${hook}" "$PROJECT_PATH/.claude/hooks/"
110
- done
111
- chmod +x "$PROJECT_PATH/.claude/hooks/"*.sh 2>/dev/null
112
- chmod +x "$PROJECT_PATH/.claude/hooks/"*.py 2>/dev/null
113
-
114
- # ── Step 4: Write settings.json (full 9-hook config) ──────────────────────────
115
- progress "Writing settings.json (9 hooks)..."
116
- cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
103
+ # ── Steps 2-4: Copy Claude infrastructure (clone users only) ──────────────────
104
+ # npm users already have commands/skills/hooks installed globally in ~/.claude/
105
+ if [ "$GLOBAL_INSTALLED" = "false" ]; then
106
+ progress "Copying 16 project commands..."
107
+ for cmd in architecture commit create-api create-e2e diagram help \
108
+ optimize-docker progress refactor review security-check \
109
+ setup show-user-guide test-plan what-is-my-ai-doing worktree; do
110
+ cp "$CLAUDE_DIR/commands/${cmd}.md" "$PROJECT_PATH/.claude/commands/"
111
+ done
112
+
113
+ progress "Copying skills, agents, 10 hooks..."
114
+ cp -r "$CLAUDE_DIR/skills/code-review" "$PROJECT_PATH/.claude/skills/"
115
+ cp -r "$CLAUDE_DIR/skills/create-service" "$PROJECT_PATH/.claude/skills/"
116
+ cp "$CLAUDE_DIR/agents/code-reviewer.md" "$PROJECT_PATH/.claude/agents/"
117
+ cp "$CLAUDE_DIR/agents/test-writer.md" "$PROJECT_PATH/.claude/agents/"
118
+ for hook in block-dangerous-bash.py check-file-length.py lint-on-save.sh \
119
+ verify-no-secrets.sh check-rybbit.sh check-branch.sh \
120
+ check-ports.sh check-e2e.sh check-rulecatch.sh check-env-sync.sh; do
121
+ cp "$CLAUDE_DIR/hooks/${hook}" "$PROJECT_PATH/.claude/hooks/"
122
+ done
123
+ chmod +x "$PROJECT_PATH/.claude/hooks/"*.sh 2>/dev/null
124
+ chmod +x "$PROJECT_PATH/.claude/hooks/"*.py 2>/dev/null
125
+
126
+ progress "Writing settings.json (10 hooks)..."
127
+ cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
117
128
  {
118
129
  "hooks": {
119
130
  "PreToolUse": [
120
131
  {
121
- "matcher": "Read|Edit|Write",
132
+ "matcher": "Bash",
122
133
  "hooks": [
123
134
  {
124
135
  "type": "command",
125
- "command": "python3 .claude/hooks/block-secrets.py"
126
- }
127
- ]
128
- },
129
- {
130
- "matcher": "Bash",
131
- "hooks": [
136
+ "command": "python3 .claude/hooks/block-dangerous-bash.py"
137
+ },
132
138
  {
133
139
  "type": "command",
134
140
  "command": "bash .claude/hooks/check-rybbit.sh"
@@ -150,8 +156,12 @@ cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
150
156
  ],
151
157
  "PostToolUse": [
152
158
  {
153
- "matcher": "Write",
159
+ "matcher": "Write|Edit",
154
160
  "hooks": [
161
+ {
162
+ "type": "command",
163
+ "command": "python3 .claude/hooks/check-file-length.py"
164
+ },
155
165
  {
156
166
  "type": "command",
157
167
  "command": "bash .claude/hooks/lint-on-save.sh"
@@ -180,6 +190,11 @@ cat > "$PROJECT_PATH/.claude/settings.json" << 'SETTINGS_EOF'
180
190
  }
181
191
  }
182
192
  SETTINGS_EOF
193
+ else
194
+ progress "Skipping local .claude/ copy (commands/skills/hooks live globally)"
195
+ progress "Skipping local .claude/ copy (commands/skills/hooks live globally)"
196
+ progress "Skipping local .claude/ copy (commands/skills/hooks live globally)"
197
+ fi
183
198
 
184
199
  # ── Step 4b: Create features.json (populated manifest) ────────────────────────
185
200
  CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")