forgedev 1.1.3 → 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.
Files changed (53) hide show
  1. package/README.md +2 -1
  2. package/bin/devforge.js +2 -1
  3. package/docs/00-README.md +310 -0
  4. package/docs/01-universal-prompt-library.md +1049 -0
  5. package/docs/02-claude-code-mastery-playbook.md +283 -0
  6. package/docs/03-multi-agent-verification.md +565 -0
  7. package/docs/04-errata-and-verification-checklist.md +284 -0
  8. package/docs/05-universal-scaffolder-vision.md +452 -0
  9. package/docs/06-confidence-assessment-and-repo-prompt.md +407 -0
  10. package/docs/errata.md +58 -0
  11. package/docs/multi-agent-verification.md +66 -0
  12. package/docs/plans/.gitkeep +0 -0
  13. package/docs/playbook.md +95 -0
  14. package/docs/prompt-library.md +160 -0
  15. package/docs/uat/UAT_CHECKLIST.csv +9 -0
  16. package/docs/uat/UAT_TEMPLATE.md +163 -0
  17. package/package.json +10 -2
  18. package/src/claude-configurator.js +1 -0
  19. package/src/cli.js +5 -5
  20. package/src/index.js +3 -3
  21. package/src/utils.js +1 -1
  22. package/templates/base/docs/plans/.gitkeep +0 -0
  23. package/templates/base/docs/uat/UAT_CHECKLIST.csv.template +2 -0
  24. package/templates/base/docs/uat/UAT_TEMPLATE.md.template +22 -0
  25. package/templates/claude-code/agents/build-error-resolver.md +3 -2
  26. package/templates/claude-code/agents/code-quality-reviewer.md +1 -1
  27. package/templates/claude-code/agents/database-reviewer.md +1 -1
  28. package/templates/claude-code/agents/doc-updater.md +1 -1
  29. package/templates/claude-code/agents/harness-optimizer.md +26 -0
  30. package/templates/claude-code/agents/loop-operator.md +2 -1
  31. package/templates/claude-code/agents/product-strategist.md +124 -0
  32. package/templates/claude-code/agents/security-reviewer.md +1 -0
  33. package/templates/claude-code/agents/spec-validator.md +31 -1
  34. package/templates/claude-code/agents/uat-validator.md +4 -0
  35. package/templates/claude-code/claude-md/base.md +1 -0
  36. package/templates/claude-code/claude-md/nextjs.md +1 -1
  37. package/templates/claude-code/commands/code-review.md +7 -1
  38. package/templates/claude-code/commands/full-audit.md +3 -2
  39. package/templates/claude-code/commands/workflows.md +3 -0
  40. package/templates/claude-code/hooks/scripts/autofix-polyglot.mjs +20 -10
  41. package/templates/claude-code/hooks/scripts/autofix-python.mjs +3 -4
  42. package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +3 -3
  43. package/templates/claude-code/hooks/scripts/guard-protected-files.mjs +2 -2
  44. package/templates/claude-code/skills/git-workflow/SKILL.md +2 -2
  45. package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
  46. package/templates/claude-code/skills/playwright/SKILL.md +6 -5
  47. package/templates/claude-code/skills/security-web/SKILL.md +1 -0
  48. package/templates/infra/github-actions/.github/workflows/ci.yml.template +49 -0
  49. package/templates/testing/pytest/backend/tests/__init__.py +0 -0
  50. package/templates/testing/pytest/backend/tests/conftest.py.template +11 -0
  51. package/templates/testing/pytest/backend/tests/test_health.py.template +10 -0
  52. package/templates/testing/vitest/vitest.config.ts.template +18 -0
  53. package/CLAUDE.md +0 -38
package/README.md CHANGED
@@ -185,7 +185,7 @@ With Claude Code infrastructure enabled (default):
185
185
  - **UAT templates** — scenario packs and CSV checklists
186
186
  - **Prompt library** — the complete development prompt library
187
187
 
188
- ## Agents (17)
188
+ ## Agents (18)
189
189
 
190
190
  Every scaffolded project gets these agents in `.claude/agents/`:
191
191
 
@@ -202,6 +202,7 @@ Every scaffolded project gets these agents in `.claude/agents/`:
202
202
  | `harness-optimizer` | Audit Claude Code setup, suggest optimizations | Read-only |
203
203
  | `loop-operator` | Autonomous improvement loops with stop conditions | Write |
204
204
  | `planner` | Create implementation plans before coding | Read-only |
205
+ | `product-strategist` | Research competitors, evaluate maturity, recommend improvements | Read-only |
205
206
  | `production-readiness` | Production deployment readiness review | Read-only |
206
207
  | `refactor-cleaner` | Dead code removal, duplicate elimination | Write |
207
208
  | `security-reviewer` | Security audit | Read-only |
package/bin/devforge.js CHANGED
@@ -9,5 +9,6 @@ try {
9
9
  console.log('');
10
10
  process.exit(0);
11
11
  }
12
- throw err;
12
+ console.error(`\x1b[31mError: ${err.message || err}\x1b[0m`);
13
+ process.exit(1);
13
14
  }
@@ -0,0 +1,310 @@
1
+ # Claude Code Mastery Kit
2
+ ## README — How to Use These Documents
3
+
4
+ ---
5
+
6
+ ## What Is This?
7
+
8
+ A complete system for getting production-grade code out of Claude Code (and any
9
+ AI coding agent) without the back-and-forth, regressions, and "are you sure?"
10
+ cycles that waste time and tokens.
11
+
12
+ It works in **Claude Code CLI**, **VS Code** (official extension), **Cursor**,
13
+ and **Windsurf** — anywhere Claude Code runs.
14
+
15
+ ---
16
+
17
+ ## Documents in This Kit
18
+
19
+ | # | Document | Universal? | Purpose |
20
+ |---|----------|-----------|---------|
21
+ | 1 | `universal-prompt-library.md` | ✅ YES | Every prompt you need from idea to production — 6 flows, utility prompts, Mermaid workflow diagram |
22
+ | 2 | `multi-agent-verification.md` | ⚠️ TEMPLATE | 5 specialized read-only agents that check each other's work — needs customization per project |
23
+ | 3 | `claude-code-mastery-playbook.md` | ⚠️ TEMPLATE | How to structure CLAUDE.md, hooks, skills, and directory scoping — needs customization per project |
24
+ | 4 | `errata-and-verification-checklist.md` | ✅ YES | Known issues, corrections, and step-by-step testing checklist |
25
+ | 5 | This file (`README.md`) | ✅ YES | How to use everything |
26
+
27
+ **✅ Universal** = use as-is on any project, any stack, any team size.
28
+ **⚠️ Template** = the architecture and patterns are universal, but the specific
29
+ checklists, hook commands, and agent rules contain example content (marked with
30
+ `[CUSTOMIZE]` tags) that you replace with your project's actual commands,
31
+ patterns, and rules.
32
+
33
+ ---
34
+
35
+ ## Quick Start (5 Minutes)
36
+
37
+ ### If you're starting a NEW project:
38
+
39
+ 1. Open `universal-prompt-library.md`
40
+ 2. Go to **Flow 1: NEW PROJECT**
41
+ 3. Copy-paste Step 1.1 into Claude Code with your idea
42
+ 4. Follow each step in sequence
43
+
44
+ ### If you're adding a feature to an EXISTING project:
45
+
46
+ 1. Open `universal-prompt-library.md`
47
+ 2. Go to **Flow 2: NEW FEATURE**
48
+ 3. Start at Step 2.1
49
+
50
+ ### If you're fixing a bug:
51
+
52
+ 1. **Flow 3: BUG FIX** — start at Step 3.1
53
+
54
+ ### If you're joining someone else's project:
55
+
56
+ 1. **Flow 5: PROJECT ONBOARDING** — start at Step 5.1
57
+
58
+ ### If you want the full infrastructure (hooks, agents, skills):
59
+
60
+ 1. Read `errata-and-verification-checklist.md` FIRST (known issues)
61
+ 2. Follow the 2-week rollout plan at the bottom of that document
62
+ 3. Use `claude-code-mastery-playbook.md` as your architecture guide
63
+ 4. Use `multi-agent-verification.md` to set up your review agents
64
+
65
+ ---
66
+
67
+ ## How Each Document Fits Together
68
+
69
+ ```
70
+ ┌─────────────────────────────────────────────────┐
71
+ │ universal-prompt-library.md │
72
+ │ Your daily driver. Open this every session. │
73
+ │ Contains: every prompt for every situation. │
74
+ │ │
75
+ │ Flow 1: New Project │
76
+ │ Flow 2: New Feature ←── most used │
77
+ │ Flow 3: Bug Fix │
78
+ │ Flow 4: Cleanup / Refactor │
79
+ │ Flow 5: Join Existing Project │
80
+ │ Flow 6: Audit / Validate │
81
+ │ + Utility prompts (lost? pre-PR? explain code?) │
82
+ └───────────────────┬─────────────────────────────┘
83
+
84
+ │ Step 1.4 of Flow 1 says
85
+ │ "set up hooks, skills, agents"
86
+
87
+ ┌─────────────────────────────────────────────────┐
88
+ │ claude-code-mastery-playbook.md │
89
+ │ Your architecture guide. Read once, set up, │
90
+ │ then reference when tweaking. │
91
+ │ │
92
+ │ - How to structure CLAUDE.md (lean, ~150 lines) │
93
+ │ - How to create Skills (on-demand knowledge) │
94
+ │ - How to create Hooks (deterministic gates) │
95
+ │ - How to scope CLAUDE.md per directory │
96
+ │ - AI prompt quality standards │
97
+ │ - Frontend/backend separation patterns │
98
+ └───────────────────┬─────────────────────────────┘
99
+
100
+ │ Playbook references agents
101
+ │ for verification
102
+
103
+ ┌─────────────────────────────────────────────────┐
104
+ │ multi-agent-verification.md │
105
+ │ Your review team. Set up once, use on demand. │
106
+ │ │
107
+ │ 5 read-only agents: │
108
+ │ 1. Code Quality Reviewer │
109
+ │ 2. Security Reviewer │
110
+ │ 3. Spec Compliance Validator │
111
+ │ 4. AI Output Quality Auditor │
112
+ │ 5. Production Readiness Checker │
113
+ │ │
114
+ │ + How to chain them (sequential or parallel) │
115
+ │ + Claude Code Review (managed PR reviews) │
116
+ └───────────────────┬─────────────────────────────┘
117
+
118
+ │ Before trusting ANY of this
119
+
120
+ ┌─────────────────────────────────────────────────┐
121
+ │ errata-and-verification-checklist.md │
122
+ │ Read this BEFORE implementing hooks or agents. │
123
+ │ │
124
+ │ - Known errors and corrections │
125
+ │ - Step-by-step testing for each component │
126
+ │ - 2-week rollout plan │
127
+ │ - What needs YOUR customization │
128
+ └─────────────────────────────────────────────────┘
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Customization Guide (Making Templates Work for Your Project)
134
+
135
+ ### Step 1: Customize the Playbook
136
+
137
+ Open `claude-code-mastery-playbook.md` and replace:
138
+
139
+ | Find | Replace With |
140
+ |------|-------------|
141
+ | Example lint commands (`npx eslint`, `ruff check`, etc.) | Your project's actual lint commands |
142
+ | Example type check commands (`npx tsc --noEmit`, `npx pyright`) | Your project's actual type check commands |
143
+ | Example test commands (`npx vitest run`, `npm run e2e`) | Your project's actual test commands |
144
+ | Example tech stack references | Your actual tech stack |
145
+ | Example skill names and content | Skills relevant to your project's domain |
146
+ | Protected file patterns (`.env`, `migrations/`) | Your project's actual protected paths |
147
+
148
+ ### Step 2: Customize the Agents
149
+
150
+ Open `multi-agent-verification.md` and for each agent:
151
+
152
+ | Agent | What to Customize |
153
+ |-------|-------------------|
154
+ | Code Quality Reviewer | Your language-specific patterns, naming conventions, architecture rules |
155
+ | Security Reviewer | Your auth middleware names, input sanitization helpers, security patterns |
156
+ | Spec Validator | Your spec file locations and format |
157
+ | AI Quality Auditor | Your AI service file paths, prompt patterns, and quality standards |
158
+ | Production Readiness | Your deployment platform, env var conventions, infrastructure patterns |
159
+
160
+ **If your project doesn't use AI features**, you can skip the AI Quality Auditor agent entirely.
161
+
162
+ **If your project is frontend-only**, simplify the Security Reviewer to focus
163
+ on XSS, CSRF, and client-side storage patterns instead of backend auth.
164
+
165
+ ### Step 3: Create Your Hooks
166
+
167
+ The hook scripts need your project's actual commands. Use the templates in the
168
+ playbook as a starting point, but test each one manually before relying on it.
169
+ See the errata document for the step-by-step testing process.
170
+
171
+ ---
172
+
173
+ ## For Teams: How to Share This
174
+
175
+ ### Option A: Drop into your repo (recommended)
176
+
177
+ ```
178
+ your-project/
179
+ ├── .claude/
180
+ │ ├── settings.json # Hooks config
181
+ │ ├── hooks/ # Hook scripts
182
+ │ │ ├── protect-files.sh
183
+ │ │ ├── post-edit.sh
184
+ │ │ └── stop-quality-gate.sh
185
+ │ ├── agents/ # Subagent definitions
186
+ │ │ ├── code-quality-reviewer.md
187
+ │ │ ├── security-reviewer.md
188
+ │ │ ├── spec-validator.md
189
+ │ │ └── production-readiness.md
190
+ │ ├── skills/ # On-demand knowledge
191
+ │ │ ├── testing/SKILL.md
192
+ │ │ ├── frontend/SKILL.md
193
+ │ │ ├── backend/SKILL.md
194
+ │ │ └── security/SKILL.md
195
+ │ └── commands/ # Slash commands
196
+ │ ├── verify-all.md
197
+ │ ├── audit-spec.md
198
+ │ ├── audit-wiring.md
199
+ │ └── pre-pr.md
200
+ ├── CLAUDE.md # Root project rules (~150 lines)
201
+ ├── backend/CLAUDE.md # Backend-scoped rules
202
+ ├── src/CLAUDE.md # Frontend-scoped rules (or frontend/)
203
+ ├── e2e/CLAUDE.md # Test-scoped rules (or tests/)
204
+ └── docs/
205
+ ├── prompt-library.md # This kit's universal prompt library
206
+ └── plans/ # Feature plans written during Plan Mode
207
+ ```
208
+
209
+ Commit everything except `settings.local.json` (personal overrides, gitignored).
210
+
211
+ Every developer on the team gets the same hooks, agents, skills, and commands
212
+ automatically. When someone runs Claude Code in this repo, they get the full
213
+ infrastructure.
214
+
215
+ ### Option B: Global setup (for personal use across all projects)
216
+
217
+ ```
218
+ ~/.claude/
219
+ ├── CLAUDE.md # Your personal global rules
220
+ ├── settings.json # Global hooks (protect .env everywhere)
221
+ ├── agents/ # Agents available in all projects
222
+ │ └── code-quality-reviewer.md
223
+ └── skills/ # Skills available in all projects
224
+ ```
225
+
226
+ Project-level files override global files when both exist.
227
+
228
+ ### Option C: Share as a template repo
229
+
230
+ Create a GitHub template repository with the full `.claude/` structure.
231
+ When starting a new project: "Use this template" → customize for the
232
+ specific project.
233
+
234
+ ---
235
+
236
+ ## FAQ
237
+
238
+ ### Does this work in VS Code?
239
+
240
+ Yes. The official Claude Code VS Code extension reads the same `.claude/`
241
+ directory, CLAUDE.md files, hooks, skills, agents, and commands as the CLI.
242
+ Install from the VS Code marketplace (search "Claude Code" by Anthropic).
243
+
244
+ ### Does this work in Cursor / Windsurf?
245
+
246
+ Yes for CLAUDE.md and hooks. Subagents and skills are Claude Code-specific
247
+ features — they work in Cursor/Windsurf only through the Claude Code extension,
248
+ not through those editors' native AI features.
249
+
250
+ ### Do I need a Team or Enterprise plan?
251
+
252
+ No. Hooks, subagents, skills, commands, and directory-scoped CLAUDE.md all
253
+ work on Pro and Max plans. Claude Code Review (the managed PR reviewer) requires
254
+ Team or Enterprise.
255
+
256
+ ### How much does the agent chain cost in tokens?
257
+
258
+ Running all 5 review agents sequentially costs roughly 50-80K tokens total.
259
+ On a Max plan with 5x usage, that's fine for every feature. On a Pro plan,
260
+ you might want to run agents only before PRs, not after every task.
261
+
262
+ ### What if my project doesn't use Python/FastAPI?
263
+
264
+ The patterns are universal — the specific commands are examples. Replace:
265
+ - `ruff check` → your linter (e.g., `cargo clippy`, `go vet`, `rubocop`)
266
+ - `npx pyright` → your type checker (e.g., `mypy`, `cargo check`)
267
+ - `npx tsc --noEmit` → whatever applies to your frontend
268
+ - Security agent checklist → your framework's auth patterns
269
+
270
+ ### What if I'm a solo developer?
271
+
272
+ Use the sequential agent chain (Option A in the multi-agent doc) and run it
273
+ before PRs. Skip agent teams — they're for when you need parallel speed on
274
+ larger changes.
275
+
276
+ ### Can I use this with other AI coding tools (Copilot, Aider, etc.)?
277
+
278
+ The prompt library (Flow 1-6) works with any AI coding tool — they're just
279
+ well-structured prompts. The hooks, agents, and skills are Claude Code-specific
280
+ features. The CLAUDE.md concept has equivalents in other tools (AGENTS.md for
281
+ OpenCode/Aider, .cursorrules for Cursor).
282
+
283
+ ---
284
+
285
+ ## What's NOT in This Kit (And Where to Find It)
286
+
287
+ | Need | Where |
288
+ |------|-------|
289
+ | CI/CD pipeline integration | Claude Code GitHub Actions: `anthropics/claude-code-action` |
290
+ | Managed PR reviews | Claude Code Review (Team/Enterprise): `code.claude.com/docs/en/code-review` |
291
+ | Security scanning | Claude Code Security (Team/Enterprise): `anthropic.com/news/claude-code-security` |
292
+ | MCP server setup | `code.claude.com/docs/en/mcp` |
293
+ | Plugin marketplace | `/plugins` command in Claude Code |
294
+ | Advanced multi-agent orchestration | Gas Town, Multiclaude, or Claude Code Agent Teams (experimental) |
295
+
296
+ ---
297
+
298
+ ## Contributing / Improving This Kit
299
+
300
+ These documents are living — they should evolve as Claude Code evolves and as
301
+ you discover what works for your projects.
302
+
303
+ **After every project:** Ask yourself:
304
+ - Did any prompt consistently need tweaking? → Update the prompt library.
305
+ - Did any hook fail or need adjustment? → Update the hook and errata.
306
+ - Did an agent miss something important? → Add it to the agent's checklist.
307
+ - Did a new pattern emerge? → Add it as a skill.
308
+
309
+ **Version your `.claude/` directory** the same way you version your code.
310
+ Review it in PRs. It compounds in value over time.