@claude-code-mastery/starter-kit 1.0.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.
- package/.claude/.starter-kit/profiles/clean.md +113 -0
- package/.claude/.starter-kit/profiles/go.md +458 -0
- package/.claude/.starter-kit/profiles/node.md +429 -0
- package/.claude/.starter-kit/profiles/python.md +475 -0
- package/.claude/.starter-kit/shared/analytics-rybbit.md +55 -0
- package/.claude/.starter-kit/shared/claude-md-base.md +93 -0
- package/.claude/.starter-kit/shared/deployment-dokploy.md +158 -0
- package/.claude/.starter-kit/shared/feature-manifest.md +43 -0
- package/.claude/.starter-kit/shared/mcp-and-pooler.md +38 -0
- package/.claude/.starter-kit/shared/mongo-setup.md +20 -0
- package/.claude/.starter-kit/shared/profile-config.md +65 -0
- package/.claude/.starter-kit/shared/seo.md +113 -0
- package/.claude/.starter-kit/shared/sql-setup.md +37 -0
- package/.claude/commands/add-feature.md +349 -0
- package/.claude/commands/add-project-setup.md +156 -0
- package/.claude/commands/architecture.md +27 -0
- package/.claude/commands/commit.md +61 -0
- package/.claude/commands/convert-project-to-starter-kit.md +508 -0
- package/.claude/commands/create-api.md +385 -0
- package/.claude/commands/create-e2e.md +230 -0
- package/.claude/commands/diagram.md +301 -0
- package/.claude/commands/help.md +120 -0
- package/.claude/commands/install-global.md +145 -0
- package/.claude/commands/new-project.md +244 -0
- package/.claude/commands/optimize-docker.md +352 -0
- package/.claude/commands/progress.md +61 -0
- package/.claude/commands/projects-created.md +79 -0
- package/.claude/commands/quickstart.md +105 -0
- package/.claude/commands/refactor.md +267 -0
- package/.claude/commands/remove-project.md +95 -0
- package/.claude/commands/review.md +59 -0
- package/.claude/commands/security-check.md +77 -0
- package/.claude/commands/set-project-profile-default.md +79 -0
- package/.claude/commands/setup.md +337 -0
- package/.claude/commands/show-user-guide.md +58 -0
- package/.claude/commands/starter-kit.md +90 -0
- package/.claude/commands/test-plan.md +118 -0
- package/.claude/commands/update-project.md +413 -0
- package/.claude/commands/what-is-my-ai-doing.md +42 -0
- package/.claude/commands/worktree.md +124 -0
- package/.claude/hooks/block-dangerous-bash.py +55 -0
- package/.claude/hooks/check-branch.sh +116 -0
- package/.claude/hooks/check-e2e.sh +71 -0
- package/.claude/hooks/check-env-sync.sh +41 -0
- package/.claude/hooks/check-file-length.py +47 -0
- package/.claude/hooks/check-ports.sh +59 -0
- package/.claude/hooks/check-rulecatch.sh +33 -0
- package/.claude/hooks/check-rybbit.sh +63 -0
- package/.claude/hooks/lint-on-save.sh +59 -0
- package/.claude/hooks/verify-no-secrets.sh +80 -0
- package/.claude/settings.json +34 -0
- package/.claude/skills/api-conventions/SKILL.md +34 -0
- package/.claude/skills/code-review/SKILL.md +87 -0
- package/.claude/skills/code-review/references/mongodb-checks.md +25 -0
- package/.claude/skills/code-review/references/project-checks.md +38 -0
- package/.claude/skills/create-service/SKILL.md +222 -0
- package/.claude/skills/debugger/SKILL.md +39 -0
- package/.claude/skills/dependency-vetting/SKILL.md +46 -0
- package/.claude/skills/design-review/SKILL.md +50 -0
- package/.claude/skills/mcp-builder/SKILL.md +57 -0
- package/.claude/skills/mongodb-rules/SKILL.md +62 -0
- package/.claude/skills/terminal-tui/SKILL.md +106 -0
- package/.claude/skills/test-writer/SKILL.md +78 -0
- package/LICENSE +21 -0
- package/README.md +2152 -0
- package/bin/cli.js +205 -0
- package/claude-mastery-project.conf +220 -0
- package/global-claude-md/CLAUDE.md +212 -0
- package/global-claude-md/settings.json +3 -0
- package/package.json +81 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Add a capability (MongoDB, Docker, testing, etc.) to an existing project
|
|
3
|
+
scope: starter-kit
|
|
4
|
+
argument-hint: <feature> [--list | --force]
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Add Feature to Existing Project
|
|
9
|
+
|
|
10
|
+
Add capabilities (MongoDB, Docker, testing, etc.) to an existing starter-kit project after scaffolding. Idempotent — safely updates already-installed features to the latest version.
|
|
11
|
+
|
|
12
|
+
**Arguments:** $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Feature Definitions
|
|
17
|
+
|
|
18
|
+
The authoritative table of features that can be added to projects. Both `/add-feature` and `/update-project` reference these definitions.
|
|
19
|
+
|
|
20
|
+
| Feature | Files (from $SOURCE) | Deps | DevDeps | Env Vars | Scripts | CLAUDE.md Rule |
|
|
21
|
+
|---------|---------------------|------|---------|----------|---------|----------------|
|
|
22
|
+
| `mongo` | `scripts/db-query.ts`, `scripts/queries/example-find-user.ts`, `scripts/queries/example-count-docs.ts` | `strictdb@^0.1.0`, `mongodb@^6.5.0` | `tsx@^4.7.0` | `STRICTDB_URI` | `db:query`, `db:query:list` | Rule 3 |
|
|
23
|
+
| `postgres` | `scripts/db-query.ts`, `scripts/queries/example-find-user.ts`, `scripts/queries/example-count-docs.ts` | `strictdb@^0.1.0`, `pg@^8.0.0` | `tsx@^4.7.0` | `STRICTDB_URI` | `db:query`, `db:query:list` | Rule 3 |
|
|
24
|
+
| `docker` | Generated from templates (Dockerfile, docker-compose.yml) | — | — | — | — | Rule 10 |
|
|
25
|
+
| `vitest` | `vitest.config.ts` | — | `vitest@^2.0.0` | — | `test:unit`, `test:unit:watch`, `test:coverage` | — |
|
|
26
|
+
| `playwright` | `playwright.config.ts` | — | `@playwright/test@^1.42.0` | — | `test:e2e`, `test:e2e:ui`, `test:e2e:headed`, `test:e2e:chromium`, `test:e2e:report`, `test:kill-ports` | Rule 4 |
|
|
27
|
+
| `content` | `scripts/build-content.ts`, `scripts/content.config.json` | — | — | — | `content:build`, `content:build:id`, `content:list` | — |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 0 — Resolve Source (Starter Kit)
|
|
32
|
+
|
|
33
|
+
Find the starter kit source directory:
|
|
34
|
+
|
|
35
|
+
1. If CWD has BOTH `claude-mastery-project.conf` AND `.claude/commands/new-project.md` → use CWD as `$SOURCE`
|
|
36
|
+
2. Else read `~/.claude/starter-kit-source-path` → verify it still has both files
|
|
37
|
+
3. Else ask via AskUserQuestion: "Where is the starter kit cloned?" with a text input
|
|
38
|
+
|
|
39
|
+
Store as `$SOURCE`.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 1 — Parse Arguments
|
|
44
|
+
|
|
45
|
+
Parse `$ARGUMENTS` for:
|
|
46
|
+
|
|
47
|
+
- `--list` → display the Feature Definitions table above and exit immediately
|
|
48
|
+
- `--force` → set `$FORCE=true` (skip confirmation prompts)
|
|
49
|
+
- Everything else → feature name(s), space-separated (e.g., `mongo vitest`)
|
|
50
|
+
|
|
51
|
+
**Validate feature names:** Each name must match one of the features in the table above. If unknown: "Unknown feature: `<name>`. Use `/add-feature --list` to see available features."
|
|
52
|
+
|
|
53
|
+
If no feature names and no `--list`: ask via AskUserQuestion:
|
|
54
|
+
"Which feature do you want to add?"
|
|
55
|
+
- **mongo** — StrictDB database driver, query system, connection management
|
|
56
|
+
- **postgres** — StrictDB database driver with parameterized queries, transaction support
|
|
57
|
+
- **vitest** — Unit/integration test framework with coverage
|
|
58
|
+
- **playwright** — E2E browser testing with multi-browser support
|
|
59
|
+
|
|
60
|
+
(Show up to 4 most common; user can type "Other" for docker, content, etc.)
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Step 2 — Select Target
|
|
65
|
+
|
|
66
|
+
1. Read `~/.claude/starter-kit-projects.json`
|
|
67
|
+
- If file doesn't exist or empty → error: "No projects found. Use `/new-project` to create one first."
|
|
68
|
+
|
|
69
|
+
2. **Smart default:** If CWD is inside a registered project directory → offer it first
|
|
70
|
+
|
|
71
|
+
3. Filter to projects whose `path` directory still exists on disk
|
|
72
|
+
|
|
73
|
+
4. Display list with AskUserQuestion:
|
|
74
|
+
- "Which project should receive the feature?"
|
|
75
|
+
- Options: up to 4 most recent projects (by `createdAt`), each showing: `name — language/framework — path`
|
|
76
|
+
- If more than 4: the 4th option should be "Other (type a path)"
|
|
77
|
+
|
|
78
|
+
5. Store selected path as `$TARGET`
|
|
79
|
+
|
|
80
|
+
### Validations (all must pass — stop with clear error if any fail)
|
|
81
|
+
|
|
82
|
+
1. `$TARGET` directory exists → if not: "Directory not found: $TARGET"
|
|
83
|
+
2. `$TARGET` is a git repo → run: `git -C "$TARGET" rev-parse --is-inside-work-tree 2>/dev/null`
|
|
84
|
+
- If not a git repo: "This project must be a git repo."
|
|
85
|
+
3. `$TARGET` is NOT the starter kit itself (compare resolved paths of `$SOURCE` and `$TARGET`)
|
|
86
|
+
- If same: "Cannot add features to the starter kit itself."
|
|
87
|
+
4. `$TARGET` is registered in `~/.claude/starter-kit-projects.json`
|
|
88
|
+
- If not registered: "This project isn't in the registry. Use `/convert-project-to-starter-kit` first."
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 3 — Safety Commit
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cd "$TARGET"
|
|
96
|
+
git status --porcelain
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
- **If uncommitted changes exist** (git status --porcelain has output):
|
|
100
|
+
```bash
|
|
101
|
+
cd "$TARGET" && git add -A && git commit -m "chore: pre-feature snapshot (before /add-feature)"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- **If clean** (no uncommitted changes):
|
|
105
|
+
```bash
|
|
106
|
+
cd "$TARGET" && git commit --allow-empty -m "chore: pre-feature marker (before /add-feature)"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Store the hash: `PRE_FEATURE_HASH=$(git -C "$TARGET" rev-parse HEAD)`
|
|
110
|
+
|
|
111
|
+
**STOP if git fails** (except "nothing to commit" which is fine — treat as clean).
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Step 4 — Read Manifest
|
|
116
|
+
|
|
117
|
+
Read `$TARGET/.claude/features.json`.
|
|
118
|
+
|
|
119
|
+
**If missing:** Create an empty manifest:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"schemaVersion": 1,
|
|
124
|
+
"installedBy": "claude-code-mastery-starter-kit",
|
|
125
|
+
"language": "unknown",
|
|
126
|
+
"features": {}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Write it to `$TARGET/.claude/features.json`.
|
|
131
|
+
|
|
132
|
+
**If exists:** Parse it. For each requested feature, check if it's already installed:
|
|
133
|
+
|
|
134
|
+
- **Already installed, same files:** Ask via AskUserQuestion (unless `$FORCE`):
|
|
135
|
+
"Feature `<name>` is already installed (since <installedAt>). Update to latest version?"
|
|
136
|
+
- Yes, update files (Recommended)
|
|
137
|
+
- No, skip this feature
|
|
138
|
+
|
|
139
|
+
- **Not installed:** Proceed to install
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Step 5 — Preview (unless --force)
|
|
144
|
+
|
|
145
|
+
For each feature to install/update, display:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
=== Feature Preview: <name> ===
|
|
149
|
+
|
|
150
|
+
Files to copy:
|
|
151
|
+
+ scripts/db-query.ts
|
|
152
|
+
+ scripts/queries/example-find-user.ts
|
|
153
|
+
+ scripts/queries/example-count-docs.ts
|
|
154
|
+
|
|
155
|
+
Dependencies to install:
|
|
156
|
+
strictdb@^0.1.0
|
|
157
|
+
mongodb@^6.5.0
|
|
158
|
+
tsx@^4.7.0 (dev)
|
|
159
|
+
|
|
160
|
+
Environment variables to add (.env.example):
|
|
161
|
+
STRICTDB_URI=your_strictdb_connection_string_here
|
|
162
|
+
|
|
163
|
+
Scripts to add (package.json):
|
|
164
|
+
db:query → tsx scripts/db-query.ts
|
|
165
|
+
db:query:list → tsx scripts/db-query.ts --list
|
|
166
|
+
|
|
167
|
+
CLAUDE.md sections:
|
|
168
|
+
Rule 3: Database Access — StrictDB (if missing)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Ask via AskUserQuestion:
|
|
172
|
+
"Proceed with installing <N> feature(s)?"
|
|
173
|
+
- **Yes, install** (Recommended)
|
|
174
|
+
- **No, cancel**
|
|
175
|
+
|
|
176
|
+
If "No, cancel" → stop: "Feature installation cancelled. No changes made."
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Step 6 — Execute
|
|
181
|
+
|
|
182
|
+
For each feature, in order:
|
|
183
|
+
|
|
184
|
+
### 6a. Create directories
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
mkdir -p "$TARGET/$(dirname <each-file>)"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 6b. Copy files
|
|
191
|
+
|
|
192
|
+
For each file in the feature definition:
|
|
193
|
+
- Copy from `$SOURCE/<file>` → `$TARGET/<file>`
|
|
194
|
+
- If file already exists and this is an update → overwrite
|
|
195
|
+
|
|
196
|
+
### 6c. Install dependencies (Node.js projects only)
|
|
197
|
+
|
|
198
|
+
Detect package manager from target project:
|
|
199
|
+
- `pnpm-lock.yaml` exists → `pnpm`
|
|
200
|
+
- `bun.lockb` exists → `bun`
|
|
201
|
+
- Otherwise → `npm`
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
cd "$TARGET"
|
|
205
|
+
# Production deps
|
|
206
|
+
<pkg-manager> add <deps>
|
|
207
|
+
# Dev deps
|
|
208
|
+
<pkg-manager> add -D <devDeps>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Skip if no deps defined for the feature. Skip if deps already in package.json.
|
|
212
|
+
|
|
213
|
+
### 6d. Merge .env.example
|
|
214
|
+
|
|
215
|
+
For each env var in the feature definition:
|
|
216
|
+
1. Read `$TARGET/.env.example` (create if missing)
|
|
217
|
+
2. Check if key name (before `=`) already exists
|
|
218
|
+
3. If missing → append the line with placeholder value
|
|
219
|
+
4. Write back
|
|
220
|
+
|
|
221
|
+
**Env var placeholder values:**
|
|
222
|
+
- `STRICTDB_URI` → `your_strictdb_connection_string_here`
|
|
223
|
+
|
|
224
|
+
### 6e. Merge package.json scripts
|
|
225
|
+
|
|
226
|
+
For each script in the feature definition:
|
|
227
|
+
1. Read `$TARGET/package.json` as JSON
|
|
228
|
+
2. Check if script name already exists in `scripts`
|
|
229
|
+
3. If missing → add it
|
|
230
|
+
4. Write back (preserve formatting)
|
|
231
|
+
|
|
232
|
+
**Script values:**
|
|
233
|
+
- `db:query` → `tsx scripts/db-query.ts`
|
|
234
|
+
- `db:query:list` → `tsx scripts/db-query.ts --list`
|
|
235
|
+
- `test:unit` → `vitest run`
|
|
236
|
+
- `test:unit:watch` → `vitest`
|
|
237
|
+
- `test:coverage` → `vitest run --coverage`
|
|
238
|
+
- `test:e2e` → `pnpm test:kill-ports && playwright test`
|
|
239
|
+
- `test:e2e:ui` → `pnpm test:kill-ports && playwright test --ui`
|
|
240
|
+
- `test:e2e:headed` → `pnpm test:kill-ports && playwright test --headed`
|
|
241
|
+
- `test:e2e:chromium` → `pnpm test:kill-ports && playwright test --project=chromium`
|
|
242
|
+
- `test:e2e:report` → `playwright show-report`
|
|
243
|
+
- `test:kill-ports` → `lsof -ti:4000,4010,4020 | xargs kill -9 2>/dev/null || true`
|
|
244
|
+
- `content:build` → `tsx scripts/build-content.ts`
|
|
245
|
+
- `content:build:id` → `tsx scripts/build-content.ts --id`
|
|
246
|
+
- `content:list` → `tsx scripts/build-content.ts --list`
|
|
247
|
+
|
|
248
|
+
### 6f. Add CLAUDE.md sections (if missing)
|
|
249
|
+
|
|
250
|
+
Check if the relevant CLAUDE.md rule section exists by searching for the header text. If missing, append it.
|
|
251
|
+
|
|
252
|
+
**mongo → Rule 3 header check:** Search for `Database Access` or `StrictDB` in `$TARGET/CLAUDE.md`
|
|
253
|
+
If missing, append the full Rule 3 section from the starter kit's CLAUDE.md.
|
|
254
|
+
|
|
255
|
+
**postgres → Rule 3 header check:** Search for `Database Access` or `StrictDB` in `$TARGET/CLAUDE.md`
|
|
256
|
+
If missing, append the full Rule 3 section from the starter kit's CLAUDE.md.
|
|
257
|
+
|
|
258
|
+
**playwright → Rule 4 header check:** Search for `Testing — Explicit Success Criteria` in `$TARGET/CLAUDE.md`
|
|
259
|
+
If missing, append the full Rule 4 section.
|
|
260
|
+
|
|
261
|
+
### 6g. Special: Docker feature
|
|
262
|
+
|
|
263
|
+
Docker doesn't copy files from source — it generates them based on the target project:
|
|
264
|
+
|
|
265
|
+
1. Detect language from registry or `$TARGET/.claude/features.json`
|
|
266
|
+
2. Generate `Dockerfile` using the appropriate template from the starter kit's `/new-project` command:
|
|
267
|
+
- Node.js → multi-stage with node:20-alpine
|
|
268
|
+
- Go → multi-stage with golang:1.23-alpine → scratch
|
|
269
|
+
- Python → multi-stage with python:3.12-slim
|
|
270
|
+
3. Generate `.dockerignore` if missing
|
|
271
|
+
4. Add docker-related scripts if applicable
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Step 7 — Update Manifest
|
|
276
|
+
|
|
277
|
+
For each installed/updated feature, write to `$TARGET/.claude/features.json`:
|
|
278
|
+
|
|
279
|
+
```json
|
|
280
|
+
{
|
|
281
|
+
"schemaVersion": 1,
|
|
282
|
+
"installedBy": "claude-code-mastery-starter-kit",
|
|
283
|
+
"language": "<from-registry-or-detection>",
|
|
284
|
+
"features": {
|
|
285
|
+
"<feature-name>": {
|
|
286
|
+
"version": "1.0.0",
|
|
287
|
+
"installedAt": "<ISO-timestamp>",
|
|
288
|
+
"updatedAt": "<ISO-timestamp-or-null>",
|
|
289
|
+
"files": [
|
|
290
|
+
"<list-of-files-copied>"
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
- New install: set `installedAt` to now, `updatedAt` to null
|
|
298
|
+
- Update: keep original `installedAt`, set `updatedAt` to now
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Step 8 — Commit + Summary
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
cd "$TARGET"
|
|
306
|
+
git add -A
|
|
307
|
+
git commit -m "feat: add <feature-name(s)> via /add-feature"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Store: `FEATURE_HASH=$(git -C "$TARGET" rev-parse HEAD)`
|
|
311
|
+
|
|
312
|
+
**If nothing to commit** (all files unchanged): skip the commit, note "Already up to date."
|
|
313
|
+
|
|
314
|
+
### Display summary
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
=== Feature Installation Complete ===
|
|
318
|
+
|
|
319
|
+
Target: $TARGET
|
|
320
|
+
Feature(s): <name(s)>
|
|
321
|
+
|
|
322
|
+
Files: N added, N updated
|
|
323
|
+
Dependencies: N installed
|
|
324
|
+
Env vars: N added to .env.example
|
|
325
|
+
Scripts: N added to package.json
|
|
326
|
+
CLAUDE.md: N sections added
|
|
327
|
+
|
|
328
|
+
Pre-feature commit: $PRE_FEATURE_HASH
|
|
329
|
+
Feature commit: $FEATURE_HASH
|
|
330
|
+
|
|
331
|
+
To undo: git revert HEAD
|
|
332
|
+
To review: git diff $PRE_FEATURE_HASH..HEAD
|
|
333
|
+
|
|
334
|
+
Manifest updated: .claude/features.json
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Edge Cases
|
|
340
|
+
|
|
341
|
+
1. **Feature already installed and up to date** — If all files are identical to source, report "Feature `<name>` is already up to date — no changes needed." and skip.
|
|
342
|
+
|
|
343
|
+
2. **No package.json** — If the target has no package.json (e.g., Go or Python project), skip dependency installation and script merging. Still copy files and update manifest.
|
|
344
|
+
|
|
345
|
+
3. **Multiple features at once** — Process each feature sequentially. One commit at the end with all features listed.
|
|
346
|
+
|
|
347
|
+
4. **Go/Python projects requesting mongo** — Copy the query system files but skip npm dependency installation. Note in summary: "Files copied but dependencies not installed (not a Node.js project). Install StrictDB and the MongoDB driver for your language manually."
|
|
348
|
+
|
|
349
|
+
5. **Source file missing** — If a file listed in the feature definition doesn't exist in `$SOURCE`, warn and skip that file. Don't fail the entire operation.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a named project profile interactively
|
|
3
|
+
scope: starter-kit
|
|
4
|
+
allowed-tools: Read, Edit, AskUserQuestion
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Add Project Setup — Interactive Profile Creator
|
|
8
|
+
|
|
9
|
+
Create a named, reusable profile in `claude-mastery-project.conf` through an interactive wizard. The profile can then be used with `/new-project my-app <profile-name>` or set as default with `/set-project-profile-default <profile-name>`.
|
|
10
|
+
|
|
11
|
+
**Arguments:** $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
### 1. Read the config file
|
|
16
|
+
|
|
17
|
+
Read `claude-mastery-project.conf` from the project root. If not found, check `~/.claude/claude-mastery-project.conf`.
|
|
18
|
+
|
|
19
|
+
Extract all existing `[section]` names to prevent duplicates.
|
|
20
|
+
|
|
21
|
+
### 2. Get profile name
|
|
22
|
+
|
|
23
|
+
If $ARGUMENTS provides a name, use it. Otherwise ask:
|
|
24
|
+
|
|
25
|
+
**"What should this profile be called?"**
|
|
26
|
+
|
|
27
|
+
Validate:
|
|
28
|
+
- Lowercase letters, numbers, and hyphens only
|
|
29
|
+
- Cannot be `global` or `clean` (reserved)
|
|
30
|
+
- Cannot match an existing section name (warn and ask to overwrite or pick another)
|
|
31
|
+
- Examples: `my-api`, `dashboard`, `landing-page`, `go-microservice`
|
|
32
|
+
|
|
33
|
+
### 3. Ask questions (sequential, via AskUserQuestion)
|
|
34
|
+
|
|
35
|
+
Skip any question if the answer was provided in $ARGUMENTS as shorthand.
|
|
36
|
+
|
|
37
|
+
#### Q1: Language
|
|
38
|
+
"What language will this project use?"
|
|
39
|
+
- **Node.js / TypeScript** — JavaScript ecosystem (Recommended)
|
|
40
|
+
- **Go** — Systems language, compiled binaries
|
|
41
|
+
- **Python** — Data science, APIs, scripting
|
|
42
|
+
|
|
43
|
+
#### Q2: Project Type
|
|
44
|
+
"What type of project?"
|
|
45
|
+
- **Web App** — Frontend with UI (SPA or SSR)
|
|
46
|
+
- **API** — Backend REST/GraphQL service
|
|
47
|
+
- **Full-Stack** — Frontend + backend in one repo
|
|
48
|
+
- **CLI** — Command-line tool
|
|
49
|
+
|
|
50
|
+
#### Q3: Framework (filtered by language + type)
|
|
51
|
+
|
|
52
|
+
**Node.js + Web App / Full-Stack:**
|
|
53
|
+
- **Vite + React** — Fastest HMR, lightweight (Recommended)
|
|
54
|
+
- **Next.js** — SSR, server components, built-in routing
|
|
55
|
+
- **Vue 3** — Composition API, progressive framework
|
|
56
|
+
- **Nuxt** — Vue with SSR, auto-imports, file-based routing
|
|
57
|
+
|
|
58
|
+
**Node.js + Web App (also):**
|
|
59
|
+
- **Svelte** — Compiled, minimal runtime
|
|
60
|
+
- **SvelteKit** — Svelte with SSR, file-based routing
|
|
61
|
+
- **Angular** — Enterprise, batteries-included
|
|
62
|
+
- **Astro** — Content-first, island architecture
|
|
63
|
+
|
|
64
|
+
**Node.js + API:**
|
|
65
|
+
- **Fastify** — Fastest Node.js HTTP framework (Recommended)
|
|
66
|
+
- **Express** — Most popular, largest ecosystem
|
|
67
|
+
- **Hono** — Ultra-lightweight, edge-ready
|
|
68
|
+
|
|
69
|
+
**Go + API / Web App:**
|
|
70
|
+
- **Gin** — Most popular Go framework (Recommended)
|
|
71
|
+
- **Chi** — Lightweight, idiomatic
|
|
72
|
+
- **Echo** — High performance, auto TLS
|
|
73
|
+
- **Fiber** — Express-inspired, fasthttp
|
|
74
|
+
- **stdlib** — Standard library only
|
|
75
|
+
|
|
76
|
+
**Python + API / Full-Stack:**
|
|
77
|
+
- **FastAPI** — Modern, async, auto-docs (Recommended)
|
|
78
|
+
- **Django** — Full-featured, batteries-included
|
|
79
|
+
- **Flask** — Lightweight, flexible
|
|
80
|
+
|
|
81
|
+
#### Q4: Database
|
|
82
|
+
"Which database?"
|
|
83
|
+
- **MongoDB** — Document database
|
|
84
|
+
- **PostgreSQL** — Relational (Recommended for SQL)
|
|
85
|
+
- **MySQL** — Relational, widely deployed
|
|
86
|
+
- **MSSQL** — Microsoft SQL Server
|
|
87
|
+
- **SQLite** — Embedded, file-based
|
|
88
|
+
- **None** — No database
|
|
89
|
+
|
|
90
|
+
#### Q5: Hosting
|
|
91
|
+
"Where will this be deployed?"
|
|
92
|
+
- **Dokploy on Hostinger VPS** — Self-hosted Docker containers (Recommended)
|
|
93
|
+
- **Vercel** — Zero-config for Next.js / static
|
|
94
|
+
- **Static hosting** — GitHub Pages, Netlify, Cloudflare
|
|
95
|
+
- **None / Decide later**
|
|
96
|
+
|
|
97
|
+
#### Q6: Package Manager (auto-detected from language, overridable)
|
|
98
|
+
- Node.js default: **pnpm**
|
|
99
|
+
- Go: **gomod** (automatic, don't ask)
|
|
100
|
+
- Python: **pip** (ask if they prefer **uv** or **poetry**)
|
|
101
|
+
|
|
102
|
+
#### Q7: Analytics
|
|
103
|
+
"Include analytics?"
|
|
104
|
+
- **Rybbit** — Privacy-first analytics
|
|
105
|
+
- **None**
|
|
106
|
+
|
|
107
|
+
#### Q8: Options (multi-select)
|
|
108
|
+
"What extras? (select all that apply)"
|
|
109
|
+
- **SEO** — Meta tags, structured data, sitemap
|
|
110
|
+
- **SSR** — Server-side rendering
|
|
111
|
+
- **Tailwind CSS** — Utility-first CSS
|
|
112
|
+
- **Docker** — Containerized deployment
|
|
113
|
+
- **GitHub Actions CI** — Automated testing pipeline
|
|
114
|
+
- **Multi-region** — US + EU deployment (Dokploy only)
|
|
115
|
+
|
|
116
|
+
#### Q9: MCP Servers (multi-select)
|
|
117
|
+
"Which MCP servers? (select all that apply)"
|
|
118
|
+
- **Playwright** — Browser automation for E2E testing
|
|
119
|
+
- **Context7** — Live documentation lookup
|
|
120
|
+
- **RuleCatch** — AI session analytics & rule monitoring
|
|
121
|
+
|
|
122
|
+
#### Q10: Set as default?
|
|
123
|
+
"Set this as the default profile for `/new-project`?"
|
|
124
|
+
- **Yes** — Future `/new-project` commands use this profile
|
|
125
|
+
- **No** — Keep current default
|
|
126
|
+
|
|
127
|
+
### 4. Write the profile
|
|
128
|
+
|
|
129
|
+
Add a new `[profile-name]` section to `claude-mastery-project.conf` with all the collected values:
|
|
130
|
+
|
|
131
|
+
```ini
|
|
132
|
+
[profile-name]
|
|
133
|
+
language = node
|
|
134
|
+
type = api
|
|
135
|
+
framework = fastify
|
|
136
|
+
hosting = dokploy
|
|
137
|
+
package_manager = pnpm
|
|
138
|
+
database = postgres
|
|
139
|
+
analytics = none
|
|
140
|
+
options = docker, ci
|
|
141
|
+
mcp = context7, rulecatch
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If Q10 was "Yes", also set `default_profile = profile-name` in `[global]`.
|
|
145
|
+
|
|
146
|
+
### 5. Confirm
|
|
147
|
+
|
|
148
|
+
Read the file back and show the new profile section. Tell the user:
|
|
149
|
+
|
|
150
|
+
> Done. Profile `<name>` created. Use it with:
|
|
151
|
+
>
|
|
152
|
+
> /new-project my-app <name>
|
|
153
|
+
>
|
|
154
|
+
> Or set it as default with:
|
|
155
|
+
>
|
|
156
|
+
> /set-project-profile-default <name>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Display system architecture and data flow
|
|
3
|
+
scope: project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# System Architecture
|
|
7
|
+
|
|
8
|
+
Display the current system architecture.
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
1. Read `project-docs/ARCHITECTURE.md`
|
|
13
|
+
2. Read `project-docs/INFRASTRUCTURE.md` (if exists)
|
|
14
|
+
3. Display the architecture overview, data flow, and service map
|
|
15
|
+
|
|
16
|
+
If these documents don't exist yet, suggest creating them with:
|
|
17
|
+
- ASCII architecture diagram showing data flow
|
|
18
|
+
- Service responsibility table (Does / Does NOT)
|
|
19
|
+
- Port assignments
|
|
20
|
+
- Technology choices and WHY they were chosen
|
|
21
|
+
|
|
22
|
+
## Reminder
|
|
23
|
+
|
|
24
|
+
Architecture docs should be AUTHORITATIVE:
|
|
25
|
+
- "This document is AUTHORITATIVE. No exceptions."
|
|
26
|
+
- Use "If you are about to... STOP" pattern for boundaries
|
|
27
|
+
- Include "Does / Does NOT" tables to prevent scope creep
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Smart commit with context — generates conventional commit message
|
|
3
|
+
scope: project
|
|
4
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*)
|
|
5
|
+
argument-hint: [optional commit message override]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Smart Commit
|
|
9
|
+
|
|
10
|
+
## Context
|
|
11
|
+
- Current git status: !`git status --short`
|
|
12
|
+
- Current diff: !`git diff HEAD --stat`
|
|
13
|
+
- Current branch: !`git branch --show-current`
|
|
14
|
+
- Recent commits: !`git log --oneline -5`
|
|
15
|
+
|
|
16
|
+
## Auto-Branch (if on main)
|
|
17
|
+
|
|
18
|
+
Before committing, check the current branch:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git branch --show-current
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Default behavior** (`auto_branch = true` in `claude-mastery-project.conf`):
|
|
25
|
+
- If on `main` or `master`: automatically create a feature branch from the staged changes context:
|
|
26
|
+
```bash
|
|
27
|
+
git checkout -b feat/<scope-from-changes>
|
|
28
|
+
```
|
|
29
|
+
Report: "Created branch `feat/<scope>` — committing there instead of main."
|
|
30
|
+
Then proceed with the commit on the new branch.
|
|
31
|
+
- If already on a feature branch: proceed normally
|
|
32
|
+
- If not a git repo: skip this check
|
|
33
|
+
|
|
34
|
+
**To disable:** Set `auto_branch = false` in `claude-mastery-project.conf`. When disabled, warn and ask the user to confirm before committing to main.
|
|
35
|
+
|
|
36
|
+
## Task
|
|
37
|
+
|
|
38
|
+
Review the staged changes and create a commit.
|
|
39
|
+
|
|
40
|
+
### Rules
|
|
41
|
+
1. Use **conventional commit** format: `type(scope): description`
|
|
42
|
+
- Types: feat, fix, docs, style, refactor, test, chore, perf
|
|
43
|
+
2. Description should be concise but descriptive (max 72 chars)
|
|
44
|
+
3. If changes span multiple concerns, suggest splitting into multiple commits
|
|
45
|
+
4. NEVER commit .env files or secrets
|
|
46
|
+
5. Verify .gitignore includes .env before committing
|
|
47
|
+
|
|
48
|
+
### If message provided
|
|
49
|
+
Use this as the commit message: $ARGUMENTS
|
|
50
|
+
|
|
51
|
+
### If no message provided
|
|
52
|
+
Generate an appropriate commit message based on the diff.
|
|
53
|
+
|
|
54
|
+
### RuleCatch Report (post-commit)
|
|
55
|
+
|
|
56
|
+
After the commit succeeds, check RuleCatch for violations in the committed files:
|
|
57
|
+
|
|
58
|
+
- If the RuleCatch MCP server is available: query for violations on the files in this commit
|
|
59
|
+
- Report: "RuleCatch: X violations found in committed files" (with details if any)
|
|
60
|
+
- If no MCP available: remind the user — "Check your RuleCatch dashboard for violations in this commit"
|
|
61
|
+
- If violations are found: DO NOT undo the commit, just report them so the user can decide
|