claudeforge-cli 1.0.0 → 1.0.2
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Forge production-ready AI agent projects — agents, slash commands, memory, CI/CD, and devcontainers in one command.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/claudeforge)
|
|
5
|
+
[](https://www.npmjs.com/package/claudeforge-cli)
|
|
6
6
|
[](https://pypi.org/project/claudeforge)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
[](https://nodejs.org)
|
|
@@ -12,6 +12,42 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
> **Node.js 18+ is required regardless of how you install claudeforge.**
|
|
18
|
+
> The CLI is built on Node.js — the pip package is a thin wrapper that delegates to it automatically.
|
|
19
|
+
|
|
20
|
+
| Requirement | Version | Notes |
|
|
21
|
+
|-------------|---------|-------|
|
|
22
|
+
| Node.js | 18+ | Required for the CLI — install first |
|
|
23
|
+
| npm | any | Included with Node.js |
|
|
24
|
+
| Python | 3.8+ | Only needed if installing via pip |
|
|
25
|
+
| Claude Code | latest | IDE extension for slash commands |
|
|
26
|
+
|
|
27
|
+
### Install Node.js (if you don't have it)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# macOS
|
|
31
|
+
brew install node
|
|
32
|
+
|
|
33
|
+
# macOS / Linux — via nvm (recommended)
|
|
34
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
35
|
+
nvm install 20
|
|
36
|
+
|
|
37
|
+
# Ubuntu / Debian
|
|
38
|
+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
|
39
|
+
sudo apt-get install -y nodejs
|
|
40
|
+
|
|
41
|
+
# Windows — download installer from https://nodejs.org
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Verify:
|
|
45
|
+
```bash
|
|
46
|
+
node --version # should print v18 or higher
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
15
51
|
## Table of Contents
|
|
16
52
|
|
|
17
53
|
- [What It Does](#what-it-does)
|
|
@@ -50,19 +86,29 @@
|
|
|
50
86
|
|
|
51
87
|
### via npm (recommended)
|
|
52
88
|
|
|
89
|
+
Best if you already have Node.js installed.
|
|
90
|
+
|
|
53
91
|
```bash
|
|
54
|
-
npm install -g claudeforge
|
|
92
|
+
npm install -g claudeforge-cli
|
|
55
93
|
```
|
|
56
94
|
|
|
57
|
-
### via pip
|
|
95
|
+
### via pip / uv
|
|
96
|
+
|
|
97
|
+
Best if you primarily work in Python environments. Node.js 18+ must still be installed on your system (see [Requirements](#requirements) above).
|
|
58
98
|
|
|
59
99
|
```bash
|
|
100
|
+
# pip
|
|
60
101
|
pip install claudeforge
|
|
102
|
+
|
|
103
|
+
# uv (recommended — installs as a global CLI tool)
|
|
104
|
+
uv tool install claudeforge
|
|
61
105
|
```
|
|
62
106
|
|
|
63
|
-
> **
|
|
107
|
+
> **Important:** If using `uv`, use `uv tool install` — not `uv pip install`. The `pip` variant installs into a virtualenv and won't put `claudeforge` on your PATH.
|
|
64
108
|
|
|
65
|
-
|
|
109
|
+
> The pip/uv package is a thin wrapper — when you run `claudeforge`, it locates Node.js on your PATH and delegates all commands to the Node.js CLI automatically.
|
|
110
|
+
|
|
111
|
+
### Verify installation
|
|
66
112
|
|
|
67
113
|
```bash
|
|
68
114
|
claudeforge --version
|
|
@@ -286,7 +332,8 @@ Run these in the Claude Code chat window in VS Code, JetBrains, or any Claude Co
|
|
|
286
332
|
|
|
287
333
|
| Command | When to run | What it does |
|
|
288
334
|
|---------|-------------|-------------|
|
|
289
|
-
| `/
|
|
335
|
+
| `/analyze-project` | Existing project, no description needed | Reads your actual codebase — code, patterns, conventions, git history — and generates the full Claude Code setup automatically |
|
|
336
|
+
| `/setup-project "description"` | New project or when you want to describe it manually | Fills in CLAUDE.md, settings, .env.example, .mcp.json, memory, generates project-specific skills, agents, and commands |
|
|
290
337
|
| `/scaffold-structure` | After `/setup-project` | Creates the actual `src/`, `tests/`, `cmd/` directory structure with real starter files for your stack |
|
|
291
338
|
| `/project-health` | Weekly / after big changes | Audits your setup: checks CLAUDE.md completeness, hook coverage, memory fill level, and gives prioritized improvement suggestions |
|
|
292
339
|
| `/memory-sync` | End of work session | Reviews the session and updates `memory/` files with preferences, decisions, and project context |
|
|
@@ -376,24 +423,46 @@ The CLI handles file scaffolding. The AI work happens inside the IDE where Claud
|
|
|
376
423
|
|
|
377
424
|
## Troubleshooting
|
|
378
425
|
|
|
379
|
-
**`claudeforge: command not found
|
|
426
|
+
**`claudeforge: command not found` after npm install**
|
|
380
427
|
```bash
|
|
381
|
-
# npm
|
|
382
|
-
npm
|
|
383
|
-
#
|
|
384
|
-
|
|
428
|
+
# Ensure npm global bin is on PATH
|
|
429
|
+
export PATH="$(npm prefix -g)/bin:$PATH"
|
|
430
|
+
# Add to ~/.zshrc or ~/.bashrc to persist
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**`claudeforge: command not found` after pip install**
|
|
434
|
+
```bash
|
|
435
|
+
# Ensure pip user bin is on PATH
|
|
385
436
|
export PATH="$HOME/.local/bin:$PATH"
|
|
437
|
+
# Add to ~/.zshrc or ~/.bashrc to persist
|
|
386
438
|
```
|
|
387
439
|
|
|
388
|
-
|
|
440
|
+
**`claudeforge: command not found` after `uv pip install`**
|
|
441
|
+
|
|
442
|
+
`uv pip install` puts packages into a virtualenv, not on your PATH. Use `uv tool install` instead:
|
|
443
|
+
```bash
|
|
444
|
+
uv tool install claudeforge
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**`Node.js is required but was not found on PATH`**
|
|
448
|
+
|
|
449
|
+
This happens when installing via pip — Node.js must be installed separately.
|
|
450
|
+
|
|
389
451
|
```bash
|
|
390
452
|
# macOS
|
|
391
453
|
brew install node
|
|
392
|
-
|
|
454
|
+
|
|
455
|
+
# macOS / Linux — via nvm
|
|
456
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
457
|
+
nvm install 20
|
|
458
|
+
|
|
459
|
+
# Ubuntu / Debian
|
|
393
460
|
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
|
394
461
|
sudo apt-get install -y nodejs
|
|
395
462
|
```
|
|
396
463
|
|
|
464
|
+
After installing Node.js, open a new terminal and retry.
|
|
465
|
+
|
|
397
466
|
**`/setup-project` didn't generate anything**
|
|
398
467
|
Make sure you ran `claudeforge init` first — the `.claude/commands/` directory must exist for slash commands to work.
|
|
399
468
|
|
|
@@ -415,17 +484,6 @@ Confirm you're running Claude Code (not just Copilot Chat). The `.claude/command
|
|
|
415
484
|
|
|
416
485
|
---
|
|
417
486
|
|
|
418
|
-
## Requirements
|
|
419
|
-
|
|
420
|
-
| Requirement | Version | Notes |
|
|
421
|
-
|-------------|---------|-------|
|
|
422
|
-
| Node.js | 18+ | Required for the CLI |
|
|
423
|
-
| npm | any | Included with Node.js |
|
|
424
|
-
| Python | 3.8+ | Only if installing via pip |
|
|
425
|
-
| Claude Code | latest | IDE extension for slash commands |
|
|
426
|
-
|
|
427
|
-
---
|
|
428
|
-
|
|
429
487
|
## License
|
|
430
488
|
|
|
431
489
|
MIT
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -36,6 +36,7 @@ const MANIFEST = [
|
|
|
36
36
|
{ type: 'file', src: 'claude/commands/review-pr.md.tpl', dest: '.claude/commands/review-pr.md' },
|
|
37
37
|
// AI setup & maintenance commands
|
|
38
38
|
{ type: 'file', src: 'claude/commands/setup-project.md.tpl', dest: '.claude/commands/setup-project.md' },
|
|
39
|
+
{ type: 'file', src: 'claude/commands/analyze-project.md.tpl', dest: '.claude/commands/analyze-project.md' },
|
|
39
40
|
{ type: 'file', src: 'claude/commands/memory-sync.md.tpl', dest: '.claude/commands/memory-sync.md' },
|
|
40
41
|
{ type: 'file', src: 'claude/commands/project-health.md.tpl', dest: '.claude/commands/project-health.md' },
|
|
41
42
|
// Developer productivity commands
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze an existing codebase and auto-generate the full Claude Code setup — CLAUDE.md, skills, agents, commands, and memory — by reading actual code, patterns, and conventions already in the project. No description required.
|
|
3
|
+
allowed-tools: Read, Write, Edit, MultiEdit, Bash(git log:*), Bash(git diff:*), Bash(ls:*), Bash(find:*), Bash(cat:*), Bash(wc:*)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Step 1 — Deep Codebase Scan
|
|
7
|
+
|
|
8
|
+
Do not ask the user for a description. Read the codebase directly to infer everything.
|
|
9
|
+
|
|
10
|
+
### 1a. Project identity
|
|
11
|
+
|
|
12
|
+
!`ls -la`
|
|
13
|
+
!`cat package.json 2>/dev/null || cat pyproject.toml 2>/dev/null || cat go.mod 2>/dev/null || cat Cargo.toml 2>/dev/null || echo "(no manifest found)"`
|
|
14
|
+
!`cat README.md 2>/dev/null | head -60 || echo "(no README)"`
|
|
15
|
+
|
|
16
|
+
### 1b. Full dependency map
|
|
17
|
+
|
|
18
|
+
!`cat package.json 2>/dev/null`
|
|
19
|
+
!`cat requirements.txt 2>/dev/null || cat pyproject.toml 2>/dev/null`
|
|
20
|
+
!`cat go.mod 2>/dev/null`
|
|
21
|
+
!`cat Cargo.toml 2>/dev/null`
|
|
22
|
+
!`cat pom.xml 2>/dev/null | head -80`
|
|
23
|
+
!`cat Gemfile 2>/dev/null`
|
|
24
|
+
|
|
25
|
+
### 1c. Project structure
|
|
26
|
+
|
|
27
|
+
!`find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" -o -name "*.rb" \) -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/dist/*" -not -path "*/__pycache__/*" -not -path "*/target/*" | head -80`
|
|
28
|
+
!`find . -type d -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/__pycache__/*" -not -path "*/target/*" -not -path "*/dist/*" | head -40`
|
|
29
|
+
|
|
30
|
+
### 1d. Read actual source code — infer real patterns
|
|
31
|
+
|
|
32
|
+
Read the most representative files in each layer of the project. For each category below, find and read 2–3 real files:
|
|
33
|
+
|
|
34
|
+
- **Entry points**: `main.py`, `index.ts`, `main.go`, `app.py`, `server.js`, etc.
|
|
35
|
+
- **Route/controller layer**: files in `routes/`, `controllers/`, `handlers/`, `api/`, `pages/api/`
|
|
36
|
+
- **Service/business logic layer**: files in `services/`, `lib/`, `internal/`, `core/`
|
|
37
|
+
- **Data/database layer**: files in `models/`, `db/`, `prisma/`, `migrations/`, `schema/`
|
|
38
|
+
- **UI components** (if frontend): files in `components/`, `pages/`, `views/`, `screens/`
|
|
39
|
+
- **Tests**: files in `tests/`, `__tests__/`, `spec/`, `test/`
|
|
40
|
+
- **Config**: `tsconfig.json`, `eslint.config.*`, `.prettierrc`, `pytest.ini`, `ruff.toml`, etc.
|
|
41
|
+
|
|
42
|
+
Read enough code to answer:
|
|
43
|
+
- What frameworks and libraries are actually used (not just listed in deps)?
|
|
44
|
+
- How are files structured and named?
|
|
45
|
+
- What patterns repeat across files (error handling, auth checks, response format, logging)?
|
|
46
|
+
- What conventions are enforced (naming, imports, exports)?
|
|
47
|
+
- How are tests written?
|
|
48
|
+
|
|
49
|
+
### 1e. Git history — understand how the project evolved
|
|
50
|
+
|
|
51
|
+
!`git log --oneline -20 2>/dev/null || echo "(no git history)"`
|
|
52
|
+
!`git log --pretty=format:"%s" -50 2>/dev/null | sort | uniq -c | sort -rn | head -20`
|
|
53
|
+
|
|
54
|
+
What do the commit messages reveal about the team's workflow and focus areas?
|
|
55
|
+
|
|
56
|
+
### 1f. Existing CI/CD and infrastructure
|
|
57
|
+
|
|
58
|
+
!`cat .github/workflows/*.yml 2>/dev/null | head -100 || echo "(no GitHub Actions)"`
|
|
59
|
+
!`cat Dockerfile 2>/dev/null | head -40 || echo "(no Dockerfile)"`
|
|
60
|
+
!`cat docker-compose.yml 2>/dev/null || echo "(no docker-compose)"`
|
|
61
|
+
!`cat .env.example 2>/dev/null || cat .env.sample 2>/dev/null || echo "(no .env.example)"`
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Step 2 — Build a Mental Model of the Project
|
|
66
|
+
|
|
67
|
+
Before writing any files, reason through what you found:
|
|
68
|
+
|
|
69
|
+
1. **What does this project do?** — infer from code, not just README
|
|
70
|
+
2. **What is the architecture?** — layers, boundaries, data flow
|
|
71
|
+
3. **What are the distinct technical domains?** — each will become a skill
|
|
72
|
+
4. **What conventions are already established?** — naming, patterns, idioms in real use
|
|
73
|
+
5. **What are the high-risk areas?** — where bugs are costly (payments, auth, data, migrations)
|
|
74
|
+
6. **What does the team care about?** — infer from commit patterns, test coverage, CI config
|
|
75
|
+
7. **What is missing or inconsistent?** — patterns that are partially established but not enforced
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Step 3 — Generate the Full Claude Code Setup
|
|
80
|
+
|
|
81
|
+
Using only what you observed — no assumptions, no generic advice — generate all files.
|
|
82
|
+
|
|
83
|
+
### 3a. Write `CLAUDE.md`
|
|
84
|
+
|
|
85
|
+
Write a complete `CLAUDE.md` based on the actual project:
|
|
86
|
+
|
|
87
|
+
**Header**: Real project name and a one-line description inferred from the code.
|
|
88
|
+
|
|
89
|
+
**Commands table**: Only commands that actually exist in the project (from `package.json` scripts, `Makefile`, CI config, etc.). Do not invent commands.
|
|
90
|
+
|
|
91
|
+
**Architecture**: An accurate directory tree of the real project structure with a description of each folder's purpose — inferred from what files are actually there.
|
|
92
|
+
|
|
93
|
+
**Code Style**: Conventions observed in the actual code — not generic guidelines. Examples:
|
|
94
|
+
- "Functions use early return pattern — no nested if/else"
|
|
95
|
+
- "All async functions are wrapped in the shared `tryCatch` utility from `lib/errors.ts`"
|
|
96
|
+
- "Database queries always go through `src/db/client.ts` — never import Prisma directly"
|
|
97
|
+
|
|
98
|
+
**Environment Variables**: Table built from `.env.example`, config files, and any `process.env` / `os.environ` references found in the code.
|
|
99
|
+
|
|
100
|
+
**Gotchas**: Real non-obvious things found in the code — not generic stack gotchas. Look for comments like `// important`, `// NOTE`, `// FIXME`, `# WARNING`, unusual patterns, or workarounds.
|
|
101
|
+
|
|
102
|
+
**Workflow**: How to use Claude Code slash commands and agents with this specific project.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### 3b. Update `.claude/settings.json`
|
|
107
|
+
|
|
108
|
+
Read the current file, then add permissions for the commands and tools the project actually uses (from CI config, Makefile, package.json scripts).
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### 3c. Write `.env.example` (if missing or incomplete)
|
|
113
|
+
|
|
114
|
+
If `.env.example` is missing or sparse, generate a complete one from:
|
|
115
|
+
- Existing `.env.example` / `.env.sample`
|
|
116
|
+
- All `process.env.X`, `os.environ["X"]`, `viper.GetString("X")` references in the code
|
|
117
|
+
- Any config files that reference environment variables
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### 3d. Create Skills — One Per Observed Domain
|
|
122
|
+
|
|
123
|
+
For each distinct technical domain found in the codebase, create a skill at `.claude/skills/<domain>/SKILL.md`.
|
|
124
|
+
|
|
125
|
+
The skill must reflect **actual conventions in this codebase** — read from real code, not inferred from the framework name. For example:
|
|
126
|
+
|
|
127
|
+
- If the project uses Express, read how routes are actually structured in this project, how middleware is applied, how errors are returned — and write that into the skill
|
|
128
|
+
- If the project uses React, read how components are actually written here — hooks, prop patterns, styling approach, state management — and write that in
|
|
129
|
+
- If the project uses PostgreSQL, read how queries are written — raw SQL vs ORM, transaction patterns, connection handling — and write that in
|
|
130
|
+
|
|
131
|
+
Each skill must include:
|
|
132
|
+
1. **What this domain covers** in this project — which files/folders
|
|
133
|
+
2. **Naming and file conventions** — as actually observed
|
|
134
|
+
3. **Key patterns** — with short code snippets taken or adapted from the real codebase
|
|
135
|
+
4. **Integration points** — how this domain connects to others in this project
|
|
136
|
+
5. **Gotchas** — non-obvious things found in the actual code
|
|
137
|
+
|
|
138
|
+
`description` frontmatter: write as a precise trigger — when should Claude load this skill?
|
|
139
|
+
|
|
140
|
+
Always create/update the base `project-conventions` skill with cross-cutting conventions observed across the whole codebase.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### 3e. Create Agents — Reviewers for High-Risk Domains
|
|
145
|
+
|
|
146
|
+
Identify which domains in this project carry the most risk if done wrong. Only create reviewer agents for those.
|
|
147
|
+
|
|
148
|
+
Reviewer checklists must be built from what you observed:
|
|
149
|
+
- If the project has a custom auth pattern, the `security-auditor` checklist must check for that pattern
|
|
150
|
+
- If the project uses a specific migration tool, the `db-reviewer` checklist must include migration-specific checks for that tool
|
|
151
|
+
- If the project has payment logic, the `stripe-reviewer` (or equivalent) checklist must reflect the actual payment flow
|
|
152
|
+
|
|
153
|
+
Always create:
|
|
154
|
+
- `code-reviewer.md` — general review tailored to this project's conventions
|
|
155
|
+
- `security-auditor.md` — security review tailored to the auth and data patterns in this code
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### 3f. Create Slash Commands
|
|
160
|
+
|
|
161
|
+
Create 2–4 slash commands for the workflows the team clearly uses (inferred from CI, Makefile, commit patterns):
|
|
162
|
+
|
|
163
|
+
- If the project has a test suite → `/test`
|
|
164
|
+
- If the project has migrations → `/migrate`
|
|
165
|
+
- If the project deploys → `/deploy`
|
|
166
|
+
- If the project has a linter/formatter → include in `/test` or as a step in `/commit`
|
|
167
|
+
|
|
168
|
+
Each command must use `!` to pull live context (e.g., `!git diff`, `!npm test 2>&1`).
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### 3g. Write `memory/project_ai_workflow.md`
|
|
173
|
+
|
|
174
|
+
Document:
|
|
175
|
+
- Which skill loads for which task
|
|
176
|
+
- Which agent to invoke and when
|
|
177
|
+
- Project-specific AI conventions based on what was found (e.g., "always read `src/schema.ts` before modifying any API types")
|
|
178
|
+
- Any architectural decisions that Claude must respect
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Step 4 — Document Every File Generated
|
|
183
|
+
|
|
184
|
+
Add headers to each file explaining what it is and how to customize it (same format as `/setup-project`).
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Step 5 — Write `SETUP_SUMMARY.md`
|
|
189
|
+
|
|
190
|
+
```markdown
|
|
191
|
+
# Claude Code Setup Summary
|
|
192
|
+
|
|
193
|
+
Analyzed and generated by `/analyze-project` on [today's date].
|
|
194
|
+
|
|
195
|
+
## What Was Observed
|
|
196
|
+
|
|
197
|
+
- **Stack**: [detected stack]
|
|
198
|
+
- **Architecture**: [brief description]
|
|
199
|
+
- **Domains identified**: [list]
|
|
200
|
+
- **High-risk areas**: [list]
|
|
201
|
+
|
|
202
|
+
## What Was Generated
|
|
203
|
+
|
|
204
|
+
| File | Based On |
|
|
205
|
+
|------|---------|
|
|
206
|
+
| `CLAUDE.md` | Actual project structure, commands, and code conventions |
|
|
207
|
+
| Skills | Conventions observed in real source files per domain |
|
|
208
|
+
| Agents | High-risk areas identified in the codebase |
|
|
209
|
+
| Commands | Workflows found in CI, Makefile, package.json scripts |
|
|
210
|
+
| `.env.example` | Environment references found throughout the codebase |
|
|
211
|
+
|
|
212
|
+
## Skills Available
|
|
213
|
+
|
|
214
|
+
| Skill | Loaded When |
|
|
215
|
+
|-------|------------|
|
|
216
|
+
| `project-conventions` | Always |
|
|
217
|
+
| *(domain skills)* | See `.claude/skills/` |
|
|
218
|
+
|
|
219
|
+
## Agents Available
|
|
220
|
+
|
|
221
|
+
| Agent | Invoked When |
|
|
222
|
+
|-------|-------------|
|
|
223
|
+
| `code-reviewer` | Before every PR |
|
|
224
|
+
| `security-auditor` | Auth, secrets, input handling |
|
|
225
|
+
| *(domain reviewers)* | See `.claude/agents/` |
|
|
226
|
+
|
|
227
|
+
## Next Steps
|
|
228
|
+
|
|
229
|
+
1. Review `CLAUDE.md` — verify the commands table matches your actual workflow
|
|
230
|
+
2. Skim the generated skills — adjust any conventions that were misread
|
|
231
|
+
3. Run `/project-health` to audit the setup
|
|
232
|
+
4. Delete this file once you've reviewed it
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Step 6 — Final Summary
|
|
238
|
+
|
|
239
|
+
Print what was generated:
|
|
240
|
+
1. Every skill created — what domain it covers and its trigger condition
|
|
241
|
+
2. Every agent created — what it reviews and when it triggers
|
|
242
|
+
3. Every slash command created
|
|
243
|
+
4. Any gaps found (e.g., missing `.env.example`, no tests detected, no CI config)
|
|
244
|
+
5. Suggested next step
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: AI-fill the complete Claude Code project configuration. Run after `claudeforge project "description"` — or run it directly with your project description as the argument. Generates CLAUDE.md, settings, agents, commands, memory, and more.
|
|
2
|
+
description: AI-fill the complete Claude Code project configuration. Run after `claudeforge project "description"` — or run it directly with your project description as the argument. Generates CLAUDE.md, settings, skills, agents, commands, memory, and more.
|
|
3
3
|
allowed-tools: Read, Write, Edit, MultiEdit, Bash(git status:*), Bash(git log:*), Bash(ls:*), Bash(find:*), Bash(cat:*), Bash(rm:*)
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -46,7 +46,7 @@ Write a complete `CLAUDE.md` that includes:
|
|
|
46
46
|
|
|
47
47
|
**Gotchas**: 3–5 non-obvious things about this stack (e.g., "FastAPI route order matters — more specific routes must be declared before generic ones").
|
|
48
48
|
|
|
49
|
-
**Workflow**: How to use `/commit`, `/review-pr`, and
|
|
49
|
+
**Workflow**: How to use `/commit`, `/review-pr`, and which skills and agents apply to this project.
|
|
50
50
|
|
|
51
51
|
### 2b. Update `.claude/settings.json`
|
|
52
52
|
|
|
@@ -84,37 +84,114 @@ Always keep `context7`. Add servers based on the stack:
|
|
|
84
84
|
### 2e. Rewrite `memory/project_ai_workflow.md`
|
|
85
85
|
|
|
86
86
|
Write a complete, project-specific workflow document:
|
|
87
|
-
- Which
|
|
87
|
+
- Which skills load automatically and when (be explicit: "the `prisma` skill loads whenever writing database queries")
|
|
88
|
+
- Which agents to use and when (be explicit: "use `security-auditor` whenever adding auth or payment logic")
|
|
88
89
|
- Which slash commands map to which tasks
|
|
89
90
|
- MCP servers available and how to invoke them
|
|
90
91
|
- Project-specific AI conventions (e.g., "always read `src/db/schema.py` before writing queries")
|
|
91
92
|
- Any architectural decisions that Claude should know and respect
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### 2f. Infer and Create Skills — Domain Specialists
|
|
97
|
+
|
|
98
|
+
**Skills** live in `.claude/skills/` and are loaded as context *before* Claude writes code. They encode how to write code correctly for a specific domain in this project — like a senior developer's internal style guide baked into Claude's context.
|
|
99
|
+
|
|
100
|
+
#### Step 1 — Identify the distinct technical domains in this project
|
|
101
|
+
|
|
102
|
+
Read the project description and detected files. Extract every distinct technical concern that has its own patterns, conventions, or APIs. Each is a candidate for a skill. Think domain-by-domain:
|
|
103
|
+
|
|
104
|
+
- "Next.js SaaS with Stripe, Prisma, and Clerk auth"
|
|
105
|
+
→ domains: Next.js components/pages, Stripe payments, Prisma queries, Clerk authentication
|
|
106
|
+
- "Go gRPC microservice with PostgreSQL and Redis"
|
|
107
|
+
→ domains: gRPC service definitions, PostgreSQL queries, Redis caching
|
|
108
|
+
- "React Native app with Firebase and Expo"
|
|
109
|
+
→ domains: React Native screens/navigation, Firebase Firestore, Firebase Auth, Expo config
|
|
110
|
+
- "Django REST API with Celery and S3"
|
|
111
|
+
→ domains: Django REST endpoints, Celery tasks, S3 file handling
|
|
112
|
+
- "Rust CLI tool for CSV parsing"
|
|
113
|
+
→ domains: CLI argument parsing, CSV parsing/transformation, Rust error handling
|
|
114
|
+
|
|
115
|
+
There is no fixed number — create as many skills as there are meaningful, distinct domains with non-obvious conventions. A simple project may need 2. A complex one may need 6.
|
|
116
|
+
|
|
117
|
+
#### Step 2 — Create a SKILL.md for each domain
|
|
118
|
+
|
|
119
|
+
Each skill lives at `.claude/skills/<domain-name>/SKILL.md`.
|
|
120
|
+
|
|
121
|
+
Every skill file must have:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
---
|
|
125
|
+
description: "<precise trigger condition — when should Claude load this skill>"
|
|
126
|
+
---
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The `description` is the most important field. Write it as a specific trigger condition so Claude loads it at exactly the right moment:
|
|
130
|
+
- Good: `"Load when writing or modifying any Stripe payment intent, webhook handler, or subscription logic"`
|
|
131
|
+
- Bad: `"Stripe knowledge"`
|
|
132
|
+
|
|
133
|
+
The skill body must read like a senior developer's internal guide for this domain in this specific project. Include:
|
|
134
|
+
|
|
135
|
+
1. **Overview** — what this domain does in this project, which files/folders it lives in
|
|
136
|
+
2. **Conventions** — naming patterns, file structure, how new files should be organized
|
|
137
|
+
3. **Key patterns** — the specific way this project does things (e.g., "all Prisma queries go through `src/lib/db.ts`, never import PrismaClient directly")
|
|
138
|
+
4. **Integration points** — how this domain connects to others (e.g., "Stripe webhooks call the same service layer as the REST API")
|
|
139
|
+
5. **Common mistakes** — non-obvious pitfalls specific to this stack/version
|
|
140
|
+
6. **Examples** — 1–2 short, concrete code snippets showing the right pattern for this project
|
|
141
|
+
|
|
142
|
+
#### Step 3 — Always create the base `project-conventions` skill
|
|
143
|
+
|
|
144
|
+
Update `.claude/skills/project-conventions/SKILL.md` with project-specific conventions:
|
|
145
|
+
- Commit message format
|
|
146
|
+
- PR conventions
|
|
147
|
+
- General code style rules that apply across all domains
|
|
148
|
+
- How to name files, variables, functions in this project
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### 2g. Infer and Create Agents — Reviewers and Auditors
|
|
153
|
+
|
|
154
|
+
**Agents** live in `.claude/agents/` and are invoked as focused subagents to *review, audit, or run a workflow* independently. They have tool access. Do not create agents for writing code — that is what skills are for.
|
|
155
|
+
|
|
156
|
+
#### Step 1 — Identify domains that have non-obvious review risks
|
|
157
|
+
|
|
158
|
+
Not every domain needs a reviewer agent. Only create one when a focused checklist genuinely adds value — e.g., database migrations (irreversible), payment flows (financial risk), auth logic (security risk), caching strategies (correctness risk).
|
|
159
|
+
|
|
160
|
+
Examples by project type:
|
|
161
|
+
- "Next.js SaaS with Stripe, Prisma, and Clerk" → `stripe-reviewer` (payment correctness), `db-reviewer` (migration safety)
|
|
162
|
+
- "Go gRPC microservice with PostgreSQL and Redis" → `db-reviewer` (query performance), `api-reviewer` (gRPC contract safety)
|
|
163
|
+
- "React Native app with Firebase" → `security-auditor` (Firebase rules, auth), `performance-reviewer` (React Native render performance)
|
|
164
|
+
- "Django REST API with Celery" → `api-reviewer` (REST conventions), `db-reviewer` (ORM query safety)
|
|
165
|
+
|
|
166
|
+
#### Step 2 — Create a reviewer agent for each high-risk domain
|
|
94
167
|
|
|
95
|
-
|
|
168
|
+
Each agent file at `.claude/agents/<name>.md` must have:
|
|
96
169
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
170
|
+
```
|
|
171
|
+
---
|
|
172
|
+
description: "<precise trigger — when Claude should invoke this agent>"
|
|
173
|
+
---
|
|
174
|
+
```
|
|
100
175
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
176
|
+
The agent body must include:
|
|
177
|
+
1. A focused role statement — what this agent reviews and why it matters
|
|
178
|
+
2. A numbered checklist specific to this stack and domain
|
|
179
|
+
3. A clear output format: severity rating per issue, actionable fix suggestion
|
|
104
180
|
|
|
105
|
-
|
|
106
|
-
- `data-validator.md` — Validates data pipelines: schema consistency, null handling, statistical reasonableness
|
|
107
|
-
- `ml-reviewer.md` — Reviews model code: data leakage, correct train/val/test splits, metric definitions
|
|
181
|
+
#### Step 3 — Always create these two agents regardless of project type
|
|
108
182
|
|
|
109
|
-
|
|
110
|
-
- `security-auditor.md` —
|
|
183
|
+
- `code-reviewer.md` — General code review across correctness, error handling, style, test coverage, and documentation. Invoked before every PR.
|
|
184
|
+
- `security-auditor.md` — Reviews any code touching auth, secrets, input validation, or external APIs. No tool access restrictions.
|
|
111
185
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
186
|
+
#### Rules for all agents
|
|
187
|
+
|
|
188
|
+
- `description` must be a specific trigger condition, not a job title
|
|
189
|
+
- Reviewer checklists must be tailored to the actual stack — not generic
|
|
190
|
+
- Every agent must have a clear output format with severity levels
|
|
191
|
+
|
|
192
|
+
---
|
|
116
193
|
|
|
117
|
-
###
|
|
194
|
+
### 2h. Create 2–4 Slash Commands
|
|
118
195
|
|
|
119
196
|
Create command files in `.claude/commands/` specific to this workflow:
|
|
120
197
|
|
|
@@ -126,7 +203,7 @@ Create command files in `.claude/commands/` specific to this workflow:
|
|
|
126
203
|
|
|
127
204
|
Each command must use `!` dynamic context (e.g., `!git diff`, `!npm test 2>&1`) and have a clear `## Task` section.
|
|
128
205
|
|
|
129
|
-
###
|
|
206
|
+
### 2i. Append `.gitignore` Tech-Stack Patterns
|
|
130
207
|
|
|
131
208
|
Append a labeled section with patterns for this stack. Examples:
|
|
132
209
|
- Python: `__pycache__/`, `*.pyc`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `dist/`, `*.egg-info/`
|
|
@@ -150,25 +227,30 @@ rm -f SETUP_CONTEXT.md
|
|
|
150
227
|
|
|
151
228
|
After all files are written, go back and add a documentation header to each one so users know what they're looking at and what to customize.
|
|
152
229
|
|
|
153
|
-
For each file written, prepend (or add at an appropriate location):
|
|
154
|
-
|
|
155
230
|
**CLAUDE.md** — add at the top after the title:
|
|
156
231
|
```
|
|
157
232
|
> **Setup status**: Generated by claudeforge. Update the Commands table with your actual
|
|
158
233
|
> project commands after verifying them. Fill in the Gotchas section as you discover them.
|
|
159
234
|
```
|
|
160
235
|
|
|
161
|
-
**`.claude/settings.json`** — add a `_readme` key
|
|
236
|
+
**`.claude/settings.json`** — add a `_readme` key:
|
|
162
237
|
```json
|
|
163
|
-
"_readme": "Team-shared Claude Code settings. Personal overrides go in settings.local.json (gitignored).
|
|
238
|
+
"_readme": "Team-shared Claude Code settings. Personal overrides go in settings.local.json (gitignored)."
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Each skill file** — after the frontmatter, add:
|
|
242
|
+
```
|
|
243
|
+
<!-- WHAT THIS IS: A skill that loads as context when Claude works in this domain.
|
|
244
|
+
HOW IT WORKS: Claude reads this automatically before writing code that matches the description.
|
|
245
|
+
HOW TO CUSTOMIZE: Update the patterns and examples below as your project evolves.
|
|
246
|
+
THINGS TO ADD: New conventions, discovered gotchas, team-specific patterns. -->
|
|
164
247
|
```
|
|
165
248
|
|
|
166
249
|
**Each agent file** — after the frontmatter, add:
|
|
167
250
|
```
|
|
168
|
-
<!-- WHAT THIS IS: A
|
|
251
|
+
<!-- WHAT THIS IS: A reviewer agent Claude invokes to audit this domain.
|
|
169
252
|
HOW TO INVOKE: Claude uses this automatically when the task matches the description.
|
|
170
|
-
HOW TO CUSTOMIZE: Edit the checklist items
|
|
171
|
-
THINGS TO ADD: Project-specific anti-patterns, naming conventions, architectural rules. -->
|
|
253
|
+
HOW TO CUSTOMIZE: Edit the checklist items to match your project's specific patterns. -->
|
|
172
254
|
```
|
|
173
255
|
|
|
174
256
|
**Each command file** — after the frontmatter, add:
|
|
@@ -205,9 +287,29 @@ Generated by `/setup-project` on [today's date].
|
|
|
205
287
|
| `.env.example` | Documents required env vars | Update with any new vars; never commit real values |
|
|
206
288
|
| `.mcp.json` | MCP servers your team shares | Add connection strings to .env for any DB servers |
|
|
207
289
|
| `memory/project_ai_workflow.md` | AI conventions for this project | Update as your workflow evolves; Claude reads this every session |
|
|
208
|
-
| [
|
|
290
|
+
| [skill files] | Domain expertise loaded before writing code | Update conventions as the project evolves |
|
|
291
|
+
| [agent files] | Specialized reviewer agents | Customize checklists to add project-specific patterns |
|
|
209
292
|
| [command files] | Slash commands for your workflow | Edit the ## Task section to match your exact needs |
|
|
210
293
|
|
|
294
|
+
## Skills Available
|
|
295
|
+
|
|
296
|
+
Claude loads these automatically before writing code in each domain:
|
|
297
|
+
|
|
298
|
+
| Skill | Loaded When |
|
|
299
|
+
|-------|------------|
|
|
300
|
+
| `project-conventions` | Always — applies to all code |
|
|
301
|
+
| *(project-specific skills)* | See `.claude/skills/` for the full list |
|
|
302
|
+
|
|
303
|
+
## Agents Available
|
|
304
|
+
|
|
305
|
+
Claude invokes these automatically to review and audit:
|
|
306
|
+
|
|
307
|
+
| Agent | Invoked When |
|
|
308
|
+
|-------|-------------|
|
|
309
|
+
| `code-reviewer` | After writing code, before PR |
|
|
310
|
+
| `security-auditor` | Any auth, secrets, or input-handling code |
|
|
311
|
+
| *(project-specific reviewers)* | See `.claude/agents/` for the full list |
|
|
312
|
+
|
|
211
313
|
## Slash Commands Available
|
|
212
314
|
|
|
213
315
|
Run these in the Claude Code chat window:
|
|
@@ -223,15 +325,6 @@ Run these in the Claude Code chat window:
|
|
|
223
325
|
| `/scaffold-structure` | Once — creates the src/, tests/, etc. directory structure |
|
|
224
326
|
| [project commands] | See .claude/commands/ for project-specific commands |
|
|
225
327
|
|
|
226
|
-
## Agents Available
|
|
227
|
-
|
|
228
|
-
Claude uses these automatically based on what you're doing:
|
|
229
|
-
|
|
230
|
-
| Agent | Invoked When |
|
|
231
|
-
|-------|-------------|
|
|
232
|
-
| `code-reviewer` | After writing code, before PR |
|
|
233
|
-
| [project agents] | See .claude/agents/ for project-specific agents |
|
|
234
|
-
|
|
235
328
|
## Next Steps
|
|
236
329
|
|
|
237
330
|
1. **Verify commands** in `CLAUDE.md` — run each one and confirm they work
|
|
@@ -247,7 +340,7 @@ Claude uses these automatically based on what you're doing:
|
|
|
247
340
|
|
|
248
341
|
Print a clear summary of everything that was done:
|
|
249
342
|
|
|
250
|
-
1. List every
|
|
343
|
+
1. List every skill created with its trigger description
|
|
251
344
|
2. List every agent created with its trigger description
|
|
252
345
|
3. List every slash command created with its use case
|
|
253
346
|
4. State the exact next step: "Run `/scaffold-structure` in Claude Code to create your project's directory structure"
|