claudeforge-cli 1.0.1 → 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
|
@@ -92,15 +92,21 @@ Best if you already have Node.js installed.
|
|
|
92
92
|
npm install -g claudeforge-cli
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
### via pip
|
|
95
|
+
### via pip / uv
|
|
96
96
|
|
|
97
97
|
Best if you primarily work in Python environments. Node.js 18+ must still be installed on your system (see [Requirements](#requirements) above).
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
+
# pip
|
|
100
101
|
pip install claudeforge
|
|
102
|
+
|
|
103
|
+
# uv (recommended — installs as a global CLI tool)
|
|
104
|
+
uv tool install claudeforge
|
|
101
105
|
```
|
|
102
106
|
|
|
103
|
-
>
|
|
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.
|
|
108
|
+
|
|
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.
|
|
104
110
|
|
|
105
111
|
### Verify installation
|
|
106
112
|
|
|
@@ -326,7 +332,8 @@ Run these in the Claude Code chat window in VS Code, JetBrains, or any Claude Co
|
|
|
326
332
|
|
|
327
333
|
| Command | When to run | What it does |
|
|
328
334
|
|---------|-------------|-------------|
|
|
329
|
-
| `/
|
|
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 |
|
|
330
337
|
| `/scaffold-structure` | After `/setup-project` | Creates the actual `src/`, `tests/`, `cmd/` directory structure with real starter files for your stack |
|
|
331
338
|
| `/project-health` | Weekly / after big changes | Audits your setup: checks CLAUDE.md completeness, hook coverage, memory fill level, and gives prioritized improvement suggestions |
|
|
332
339
|
| `/memory-sync` | End of work session | Reviews the session and updates `memory/` files with preferences, decisions, and project context |
|
|
@@ -430,6 +437,13 @@ export PATH="$HOME/.local/bin:$PATH"
|
|
|
430
437
|
# Add to ~/.zshrc or ~/.bashrc to persist
|
|
431
438
|
```
|
|
432
439
|
|
|
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
|
+
|
|
433
447
|
**`Node.js is required but was not found on PATH`**
|
|
434
448
|
|
|
435
449
|
This happens when installing via pip — Node.js must be installed separately.
|
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
|