forge-cc 0.1.9 → 0.1.11

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 (59) hide show
  1. package/README.md +253 -178
  2. package/dist/cli.js +109 -8
  3. package/dist/cli.js.map +1 -1
  4. package/dist/gates/codex-gate.d.ts +51 -0
  5. package/dist/gates/codex-gate.js +121 -0
  6. package/dist/gates/codex-gate.js.map +1 -0
  7. package/dist/go/auto-chain.d.ts +13 -23
  8. package/dist/go/auto-chain.js +29 -101
  9. package/dist/go/auto-chain.js.map +1 -1
  10. package/dist/go/executor.d.ts +5 -0
  11. package/dist/go/executor.js +43 -5
  12. package/dist/go/executor.js.map +1 -1
  13. package/dist/go/finalize.d.ts +50 -1
  14. package/dist/go/finalize.js +122 -0
  15. package/dist/go/finalize.js.map +1 -1
  16. package/dist/go/prd-queue.d.ts +43 -0
  17. package/dist/go/prd-queue.js +67 -0
  18. package/dist/go/prd-queue.js.map +1 -0
  19. package/dist/go/prd-selector.d.ts +57 -0
  20. package/dist/go/prd-selector.js +101 -0
  21. package/dist/go/prd-selector.js.map +1 -0
  22. package/dist/go/verify-loop.d.ts +18 -1
  23. package/dist/go/verify-loop.js +119 -2
  24. package/dist/go/verify-loop.js.map +1 -1
  25. package/dist/spec/templates.d.ts +2 -2
  26. package/dist/state/prd-status.d.ts +59 -0
  27. package/dist/state/prd-status.js +121 -0
  28. package/dist/state/prd-status.js.map +1 -0
  29. package/dist/state/reader.d.ts +2 -24
  30. package/dist/state/reader.js +4 -77
  31. package/dist/state/reader.js.map +1 -1
  32. package/dist/state/writer.d.ts +2 -41
  33. package/dist/state/writer.js +14 -130
  34. package/dist/state/writer.js.map +1 -1
  35. package/dist/team/consensus.d.ts +28 -0
  36. package/dist/team/consensus.js +130 -0
  37. package/dist/team/consensus.js.map +1 -0
  38. package/dist/team/index.d.ts +4 -0
  39. package/dist/team/index.js +5 -0
  40. package/dist/team/index.js.map +1 -0
  41. package/dist/team/lifecycle.d.ts +37 -0
  42. package/dist/team/lifecycle.js +92 -0
  43. package/dist/team/lifecycle.js.map +1 -0
  44. package/dist/team/reviewer.d.ts +10 -0
  45. package/dist/team/reviewer.js +345 -0
  46. package/dist/team/reviewer.js.map +1 -0
  47. package/dist/team/types.d.ts +269 -0
  48. package/dist/team/types.js +70 -0
  49. package/dist/team/types.js.map +1 -0
  50. package/dist/types.d.ts +1 -0
  51. package/dist/utils/browser.d.ts +1 -1
  52. package/dist/utils/browser.js +8 -1
  53. package/dist/utils/browser.js.map +1 -1
  54. package/dist/worktree/session.d.ts +3 -0
  55. package/dist/worktree/session.js +1 -0
  56. package/dist/worktree/session.js.map +1 -1
  57. package/package.json +2 -1
  58. package/skills/forge-go.md +176 -62
  59. package/skills/forge-spec.md +30 -5
package/README.md CHANGED
@@ -1,37 +1,171 @@
1
+ <p align="center">
2
+ <img src="https://img.shields.io/npm/v/forge-cc?style=flat-square&color=0969da" alt="npm version" />
3
+ <img src="https://img.shields.io/npm/l/forge-cc?style=flat-square&color=22863a" alt="license" />
4
+ <img src="https://img.shields.io/badge/node-%3E%3D18-339933?style=flat-square&logo=node.js&logoColor=white" alt="node version" />
5
+ <img src="https://img.shields.io/badge/TypeScript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white" alt="typescript strict" />
6
+ <img src="https://img.shields.io/badge/Claude_Code-ready-7c3aed?style=flat-square" alt="Claude Code ready" />
7
+ </p>
8
+
1
9
  # forge-cc
2
10
 
3
- Pre-PR verification harness and development workflow tool for Claude Code agents. Gate runner + CLI + MCP server + workflow skills.
11
+ **The development workflow engine for Claude Code agents.**
12
+
13
+ forge-cc gives AI coding agents the same guardrails a senior engineering team enforces: type safety, linting, test coverage, visual regression, PRD compliance, and code review -- all verified automatically before code ever hits a PR. Combined with workflow skills that manage the entire lifecycle from idea to merged code, forge-cc turns Claude Code into a self-verifying, project-aware development partner.
14
+
15
+ ---
16
+
17
+ ## Why forge-cc?
4
18
 
5
- <!-- Badges: npm version, CI status, license -->
19
+ AI coding agents write code fast, but speed without quality gates means you spend more time reviewing than you save. forge-cc solves this by:
6
20
 
7
- ## What It Does
21
+ - **Catching errors before commit** -- TypeScript, linting, tests, visual regressions, and PRD compliance checks run automatically, so agents self-correct before you see the code.
22
+ - **Enforcing standards mechanically** -- Pre-commit hooks and Claude Code hooks block unverified commits. No discipline required; the machine enforces it.
23
+ - **Managing the full lifecycle** -- From triaging ideas into Linear to generating PRDs to executing milestones with parallel agent teams, forge-cc handles the project management plumbing so you focus on decisions.
24
+ - **Isolating concurrent work** -- Multiple agents can work on different milestones simultaneously using git worktrees with automatic state merging.
8
25
 
9
- - **Verification gates** -- runs TypeScript type-checking, linting, tests, visual screenshots, runtime endpoint validation, and PRD acceptance criteria checks against your project before you commit.
10
- - **Mechanical enforcement** -- Claude Code PreToolUse hook and git pre-commit hook block commits that haven't passed verification. No discipline required; the machine enforces it.
11
- - **Workflow skills** -- `/forge:triage` turns brain dumps into Linear projects, `/forge:spec` interviews you and generates a PRD with milestones, `/forge:go` executes milestones with wave-based agent teams, `/forge:setup` scaffolds new projects, `/forge:update` keeps forge-cc current.
12
- - **Linear lifecycle** -- programmatic status transitions through Backlog, Planned, In Progress, In Review, and Done. Every skill keeps Linear in sync automatically.
26
+ ---
13
27
 
14
28
  ## Quick Start
15
29
 
16
30
  ```bash
17
- # Install
18
- npm install forge-cc
31
+ # Install globally
32
+ npm install -g forge-cc
19
33
 
20
- # Run verification against current project
34
+ # Or as a dev dependency in your project
35
+ npm install --save-dev forge-cc
36
+
37
+ # Initialize your project
38
+ npx forge setup
39
+
40
+ # Run verification
21
41
  npx forge verify
22
42
 
23
- # Check last verification status
43
+ # Check status
24
44
  npx forge status
25
45
  ```
26
46
 
27
47
  On first run with no `.forge.json`, forge auto-detects gates from your `package.json`:
28
- - Has `typescript` in dependencies? Enables the **types** gate.
29
- - Has `@biomejs/biome` or `biome` in dependencies? Enables the **lint** gate.
30
- - Has a `test` script? Enables the **tests** gate.
48
+
49
+ | Detected | Gate Enabled |
50
+ |----------|-------------|
51
+ | `typescript` in dependencies | **types** -- `tsc --noEmit` |
52
+ | `@biomejs/biome` in dependencies | **lint** -- `biome check` |
53
+ | `test` script in package.json | **tests** -- `npm test` |
54
+
55
+ ---
56
+
57
+ ## Workflow Overview
58
+
59
+ forge-cc manages the complete development lifecycle through five workflow skills. Here's how a typical project flows from idea to merged PR:
60
+
61
+ ```
62
+ Brain dump PRD with Code built & Merged
63
+ or idea milestones verified to main
64
+ | | | |
65
+ v v v v
66
+ /forge:triage --> /forge:spec --> /forge:go --> PR Review --> Done
67
+ | | |
68
+ v v v
69
+ Linear projects Codebase scan Wave-based agent
70
+ created in + interview + teams execute each
71
+ Backlog PRD generation milestone with
72
+ + Linear sync verification gates
73
+ ```
74
+
75
+ ### Step 1: Triage Ideas (`/forge:triage`)
76
+
77
+ Paste unstructured notes, feature requests, or brainstorms. The skill extracts distinct projects, deduplicates against your existing Linear backlog, and creates them after your confirmation.
78
+
79
+ ```
80
+ You: /forge:triage
81
+ "We need auth, a dashboard with charts, and email notifications.
82
+ Also the onboarding flow is broken on mobile."
83
+
84
+ Forge: Extracted 4 projects:
85
+ 1. User Authentication System
86
+ 2. Analytics Dashboard
87
+ 3. Email Notification Service
88
+ 4. Mobile Onboarding Fix
89
+ Creating in Linear...
90
+ ```
91
+
92
+ ### Step 2: Spec & Plan (`/forge:spec`)
93
+
94
+ Select a project from your Linear backlog. Forge scans your codebase (structure, patterns, dependencies), conducts an adaptive interview (leading with recommendations, not blank-slate questions), then generates a PRD with milestones and syncs everything back to Linear.
95
+
96
+ ```
97
+ You: /forge:spec
98
+
99
+ Forge: Scanning codebase... found Next.js + Prisma + tRPC
100
+ Based on your stack, I recommend:
101
+ - Milestone 1: Database schema + auth provider
102
+ - Milestone 2: Login/signup UI components
103
+ - Milestone 3: Session management + middleware
104
+ [Interview continues with focused questions...]
105
+ PRD generated -> Milestones created in Linear
106
+ ```
107
+
108
+ ### Step 3: Execute (`/forge:go`)
109
+
110
+ Executes milestones using wave-based agent teams. Each wave runs parallel agents for independent work, with type-checking between waves. The verify loop catches errors and retries automatically.
111
+
112
+ ```
113
+ You: /forge:go
114
+
115
+ Forge: Executing Milestone 1: Database Schema
116
+ Wave 1: [schema-agent] [migration-agent] -- parallel
117
+ Verify: tsc --noEmit ... PASS
118
+ Wave 2: [seed-agent] [test-agent] -- parallel
119
+ Verify: types PASS | lint PASS | tests PASS
120
+ Milestone 1 complete. Creating PR...
121
+ ```
122
+
123
+ ### Step 4: Auto-Chain (Optional)
124
+
125
+ Run all remaining milestones autonomously:
126
+
127
+ ```bash
128
+ npx forge run
129
+ ```
130
+
131
+ Each milestone executes in a fresh session with full verification. Stall detection stops the loop if a milestone fails to make progress.
132
+
133
+ ### Supporting Skills
134
+
135
+ | Skill | Purpose |
136
+ |-------|---------|
137
+ | `/forge:setup` | Initialize or refresh project scaffolding, hooks, and config |
138
+ | `/forge:update` | Check for and install the latest forge-cc version |
139
+
140
+ ---
141
+
142
+ ## Verification Gates
143
+
144
+ Gates are the core of forge-cc's quality enforcement. Each gate checks one aspect of your codebase and returns structured results with file paths, line numbers, and actionable error messages.
145
+
146
+ | Gate | What It Checks | Requires |
147
+ |------|---------------|----------|
148
+ | `types` | TypeScript compilation (`tsc --noEmit`) | `typescript` in dependencies |
149
+ | `lint` | Biome linting (`biome check`) | `@biomejs/biome` in dependencies |
150
+ | `tests` | Test suite (`npm test`) | A `test` script in package.json |
151
+ | `visual` | Multi-viewport screenshots (desktop, tablet, mobile) + DOM extraction + before/after comparison + console error detection | Dev server config, `playwright` |
152
+ | `runtime` | HTTP endpoint validation (status codes, response shape) | Dev server config, endpoint list |
153
+ | `prd` | Diff against PRD acceptance criteria | PRD file path, git history |
154
+ | `review` | Code review against PRD criteria and CLAUDE.md rules | Git history |
155
+
156
+ ### Gate Remediation
157
+
158
+ When gates fail, forge-cc doesn't just report errors -- it generates structured remediation templates that give fix agents actionable instructions. Each error includes the file, line, message, and a specific remediation step.
159
+
160
+ ### Pipeline Behavior
161
+
162
+ Gates run in the configured order. If all three core gates (types, lint, tests) fail, remaining gates are skipped to save time. Each gate has a 2-minute timeout.
163
+
164
+ ---
31
165
 
32
166
  ## Configuration
33
167
 
34
- Create a `.forge.json` in your project root to customize behavior:
168
+ Create a `.forge.json` in your project root:
35
169
 
36
170
  ```json
37
171
  {
@@ -44,52 +178,43 @@ Create a `.forge.json` in your project root to customize behavior:
44
178
  "readyPattern": "ready on"
45
179
  },
46
180
  "prdPath": ".planning/prds/active.md",
47
- "linearProject": "My Project"
181
+ "linearProject": "My Project",
182
+ "review": {
183
+ "blocking": false
184
+ }
48
185
  }
49
186
  ```
50
187
 
51
188
  | Option | Type | Default | Description |
52
189
  |--------|------|---------|-------------|
53
- | `gates` | `string[]` | `["types", "lint", "tests"]` | Which verification gates to run |
54
- | `maxIterations` | `number` | `5` | Max retry iterations for the verification pipeline |
55
- | `verifyFreshness` | `number` | `600000` | How long (ms) a passing verification stays valid. Default: 10 minutes |
56
- | `devServer.command` | `string` | -- | Command to start the dev server (for visual/runtime gates) |
57
- | `devServer.port` | `number` | -- | Port the dev server listens on |
58
- | `devServer.readyPattern` | `string` | -- | Stdout pattern indicating the server is ready |
59
- | `prdPath` | `string` | -- | Path to PRD file for acceptance criteria checking |
190
+ | `gates` | `string[]` | `["types", "lint", "tests"]` | Verification gates to run |
191
+ | `maxIterations` | `number` | `5` | Max retry iterations for the verify loop |
192
+ | `verifyFreshness` | `number` | `600000` | Cache validity period in ms (default: 10 min) |
193
+ | `devServer.command` | `string` | -- | Command to start the dev server |
194
+ | `devServer.port` | `number` | -- | Dev server port |
195
+ | `devServer.readyPattern` | `string` | -- | Stdout pattern indicating server is ready |
196
+ | `prdPath` | `string` | -- | Path to PRD for acceptance criteria checking |
60
197
  | `linearProject` | `string` | -- | Linear project name for lifecycle tracking |
198
+ | `review.blocking` | `boolean` | `false` | When `true`, review findings fail the gate |
61
199
 
62
- If no `.forge.json` exists, forge auto-detects from `package.json` (see Quick Start).
200
+ ---
63
201
 
64
- ## CLI Commands
202
+ ## CLI Reference
65
203
 
66
204
  ### `forge verify`
67
205
 
68
206
  Run verification gates against the current project.
69
207
 
70
208
  ```bash
71
- # Run all configured gates
72
- npx forge verify
73
-
74
- # Run specific gates only
75
- npx forge verify --gate types,lint
76
-
77
- # Output structured JSON (for programmatic use)
78
- npx forge verify --json
79
-
80
- # Include PRD acceptance criteria check
81
- npx forge verify --prd .planning/prds/active.md
209
+ npx forge verify # Run all configured gates
210
+ npx forge verify --gate types,lint # Run specific gates
211
+ npx forge verify --json # Output structured JSON
212
+ npx forge verify --prd .planning/prds/active.md # Include PRD check
82
213
  ```
83
214
 
84
- | Flag | Description |
85
- |------|-------------|
86
- | `--gate <gates>` | Comma-separated list of gates to run (overrides config) |
87
- | `--json` | Output structured JSON instead of human-readable markdown |
88
- | `--prd <path>` | Path to PRD file for the `prd` gate |
89
-
90
- Exit code: `0` if all gates pass, `1` if any gate fails.
215
+ Exit code `0` = all gates pass. Exit code `1` = any gate fails.
91
216
 
92
- Results are cached to `.forge/last-verify.json` for freshness checking by hooks.
217
+ Results are cached per-branch to `.forge/verify-cache/<branch>.json`.
93
218
 
94
219
  ### `forge status`
95
220
 
@@ -99,47 +224,43 @@ Print current project state: branch, last verification result, config source, an
99
224
  npx forge status
100
225
  ```
101
226
 
102
- Output includes which gates passed/failed, how long ago verification ran, config source, and a table of active forge sessions (if any) showing user, skill, milestone, branch, duration, and worktree path. Stale sessions are flagged with a warning symbol.
227
+ ### `forge setup`
228
+
229
+ Initialize a new project with forge-cc scaffolding or reinstall skills.
230
+
231
+ ```bash
232
+ npx forge setup # Full project initialization
233
+ npx forge setup --skills-only # Only install skills to ~/.claude/commands/forge/
234
+ ```
103
235
 
104
236
  ### `forge cleanup`
105
237
 
106
- Remove stale worktrees, deregister dead sessions, and reclaim disk space. Idempotent — safe to run multiple times.
238
+ Remove stale worktrees, deregister dead sessions, and reclaim disk space.
107
239
 
108
240
  ```bash
109
241
  npx forge cleanup
110
242
  ```
111
243
 
112
- Output shows which stale sessions were removed and their worktree paths. If no stale sessions exist, prints a clean message.
244
+ ### `forge run`
113
245
 
114
- ## Verification Gates
246
+ Execute all remaining milestones autonomously in fresh Claude sessions.
115
247
 
116
- | Gate | What It Checks | Requires |
117
- |------|---------------|----------|
118
- | `types` | TypeScript compilation (`tsc --noEmit`) | `typescript` in dependencies |
119
- | `lint` | Biome linting (`biome check`) | `@biomejs/biome` in dependencies |
120
- | `tests` | Test suite (`npm run test`) | A `test` script in `package.json` |
121
- | `visual` | Playwright screenshots + console error detection | Dev server config, `playwright` |
122
- | `runtime` | HTTP endpoint validation (status codes, response shape) | Dev server config, endpoint list |
123
- | `prd` | Diff against PRD acceptance criteria | PRD file path, git history |
248
+ ```bash
249
+ npx forge run # Run until all milestones complete
250
+ npx forge run --max-iterations 10 # Safety cap on iterations
251
+ ```
124
252
 
125
- **Pipeline behavior:** Gates run in order. If all three core gates (types, lint, tests) fail, remaining gates are skipped. Each gate returns structured results with file paths, line numbers, and error messages.
253
+ ---
126
254
 
127
255
  ## Enforcement
128
256
 
129
- forge-cc provides two enforcement mechanisms that block commits without passing verification.
257
+ forge-cc provides two enforcement mechanisms that block unverified commits.
130
258
 
131
- ### Claude Code PreToolUse Hook
259
+ ### Claude Code Hook (Recommended)
132
260
 
133
- The recommended enforcement for Claude Code users. Intercepts `git commit` commands and checks:
261
+ Intercepts `git commit` and checks: branch protection, verification required, verification passed, and freshness.
134
262
 
135
- 1. **Branch protection** -- blocks commits directly to `main` or `master`.
136
- 2. **Verification required** -- blocks if no `.forge/last-verify.json` exists.
137
- 3. **Verification passed** -- blocks if the last run failed.
138
- 4. **Freshness** -- blocks if verification is older than `verifyFreshness` (default 10 min).
139
-
140
- **Install:**
141
-
142
- Add to your `.claude/settings.json`:
263
+ Add to `.claude/settings.json`:
143
264
 
144
265
  ```json
145
266
  {
@@ -159,9 +280,13 @@ Add to your `.claude/settings.json`:
159
280
  }
160
281
  ```
161
282
 
162
- ### Version Check Hook
283
+ ### Git Pre-Commit Hook
284
+
285
+ Standard git hook for non-Claude-Code environments. Same checks as the Claude Code hook. Wire `src/hooks/pre-commit.ts` into your hook runner (husky, simple-git-hooks, etc.).
163
286
 
164
- Optional session hook that checks for forge-cc updates when Claude Code starts a task. Prints a one-line notice to stderr if a newer version is available. Never blocks execution.
287
+ ### Version Check Hook (Optional)
288
+
289
+ Prints a one-line notice when a newer forge-cc version is available. Never blocks execution.
165
290
 
166
291
  Add to `.claude/settings.local.json`:
167
292
 
@@ -183,19 +308,13 @@ Add to `.claude/settings.local.json`:
183
308
  }
184
309
  ```
185
310
 
186
- `/forge:setup` installs this hook automatically.
187
-
188
- ### Git Pre-Commit Hook
189
-
190
- Standard git hook for non-Claude-Code environments. Same four checks as the PreToolUse hook.
191
-
192
- The hook logic lives in `src/hooks/pre-commit.ts` and can be wired into any git hook runner (husky, simple-git-hooks, etc.).
311
+ ---
193
312
 
194
313
  ## MCP Server
195
314
 
196
- forge-cc registers its gates as MCP tools so agents can call them programmatically.
315
+ Expose verification gates as MCP tools for programmatic agent access.
197
316
 
198
- **Configure in `.mcp.json`:**
317
+ Add to `.mcp.json`:
199
318
 
200
319
  ```json
201
320
  {
@@ -208,113 +327,79 @@ forge-cc registers its gates as MCP tools so agents can call them programmatical
208
327
  }
209
328
  ```
210
329
 
211
- **Available MCP tools:**
330
+ **Available tools:**
212
331
 
213
332
  | Tool | Description |
214
333
  |------|-------------|
215
334
  | `forge_verify_types` | Run TypeScript type checking |
216
335
  | `forge_verify_lint` | Run Biome linting |
217
336
  | `forge_verify_tests` | Run project test suite |
218
- | `forge_verify_visual` | Take screenshots, check console errors |
337
+ | `forge_verify_visual` | Multi-viewport screenshots + DOM comparison |
219
338
  | `forge_verify_runtime` | Validate API endpoints |
220
339
  | `forge_verify_prd` | Check changes against PRD criteria |
221
340
  | `forge_run_pipeline` | Run full verification pipeline |
222
341
 
223
342
  All tools accept `projectDir` (absolute path) and return structured JSON results.
224
343
 
225
- ## Workflow Skills
226
-
227
- Claude Code skills that drive the full development lifecycle. Invoke them with slash commands.
228
-
229
- ### `/forge:triage` -- Brain Dump to Linear Projects
230
-
231
- Paste unstructured ideas, sticky notes, or stream-of-consciousness text. The skill extracts distinct projects, deduplicates against your existing Linear backlog, and creates them after your confirmation.
232
-
233
- **Flow:** Input text -> extract projects -> deduplicate against Linear -> confirm -> create in Linear (Backlog state).
234
-
235
- ### `/forge:spec` -- Interview to PRD
236
-
237
- Select a Linear project in Backlog state. The skill scans your codebase (structure, patterns, dependencies), conducts an adaptive interview (leading with recommendations, not blank-slate questions), generates a PRD with milestones, and syncs the plan back to Linear.
238
-
239
- **Flow:** Select project -> scan codebase -> interview -> generate PRD -> create milestones + issues in Linear -> move project to Planned.
240
-
241
- ### `/forge:go` -- Execute Milestones
242
-
243
- Execute the next pending milestone from your PRD with wave-based agent teams. Each wave runs parallel agents for independent work, with verification between waves. Supports `--auto` to chain all remaining milestones without manual intervention.
244
-
245
- **Flow:** Orient (read state) -> pre-flight checks -> execute waves -> verify -> update state -> (optional) create PR.
246
-
247
- ### `/forge:setup` -- Initialize or Refresh a Project
248
-
249
- Bootstrap a new project with forge-cc scaffolding (`.forge.json`, `CLAUDE.md`, planning docs, hooks), or refresh an existing project's files to the latest templates while preserving your learned rules and lessons.
250
-
251
- **Flow:** Detect project -> choose mode (Fresh/Refresh) -> configure gates -> create files -> patch global config -> install hooks -> summary.
252
-
253
- ### `/forge:update` -- Update Forge
254
-
255
- Check for newer versions of forge-cc and install the latest. After updating, suggests running `/forge:setup` in Refresh mode to pick up new templates.
256
-
257
- **Flow:** Check versions -> compare -> update via npm -> post-update check.
344
+ ---
258
345
 
259
346
  ## Linear Integration
260
347
 
261
- forge-cc manages the full Linear project lifecycle:
348
+ forge-cc manages the full Linear project lifecycle automatically:
262
349
 
263
350
  ```
264
- Backlog -> Planned -> In Progress -> In Review -> Done
265
- | | | | |
266
- triage spec/PRD go/execute PR created PR merged
351
+ Backlog ──> Planned ──> In Progress ──> In Review ──> Done
352
+ | | | | |
353
+ triage spec/PRD go/execute PR created PR merged
267
354
  ```
268
355
 
269
- Each skill transitions projects and issues to the appropriate status automatically. The Linear client (`src/linear/client.ts`) handles GraphQL queries, and dedicated modules manage projects, milestones, and issues.
356
+ Each skill transitions projects and issues to the appropriate status. Set `FORGE_LINEAR_API_KEY` (or `LINEAR_API_KEY`) in your environment and `linearProject` in `.forge.json` to enable.
270
357
 
271
- ## Multi-Developer Setup
358
+ ---
272
359
 
273
- For a new developer joining the team:
360
+ ## Concurrency & Session Isolation
274
361
 
275
- 1. **Clone the repo** that uses forge-cc.
276
- 2. **Install dependencies:** `npm install` (forge-cc should be in `devDependencies`).
277
- 3. **Run `/forge:setup`** -- scaffolds `.forge.json`, `CLAUDE.md`, planning docs, and installs hooks automatically. Or set up manually:
278
- - `npx forge verify` to confirm your environment.
279
- - Add the PreToolUse hook to `.claude/settings.json` (see Enforcement section).
280
- - Create `.forge.json` if auto-detected gates don't match.
362
+ forge-cc supports multiple simultaneous sessions on the same repository using git worktrees.
281
363
 
282
- The gates run the same commands your CI does, so if `npx forge verify` passes locally, CI will pass too.
364
+ **How it works:**
283
365
 
284
- ## Concurrency & Session Isolation
366
+ 1. Each forge skill creates a worktree in `../.forge-wt/<repo>/<session-id>/` with its own branch
367
+ 2. Active sessions are tracked in `.forge/sessions.json`
368
+ 3. Each session has its own git index -- parallel agents can't corrupt each other
369
+ 4. On completion, state merges back intelligently (not last-write-wins)
370
+ 5. Crashed sessions are detected via PID and cleaned up with `npx forge cleanup`
285
371
 
286
- forge-cc supports multiple simultaneous sessions on the same repository using git worktrees. Each `/forge:go` or `/forge:spec` invocation runs in an isolated worktree separate git index, separate working directory, separate state files.
372
+ **Parallel milestones:** Independent milestones (no `dependsOn` conflicts) execute simultaneously, each producing their own branch and PR.
287
373
 
288
- ### How It Works
374
+ **Platform notes:**
375
+ - **Windows:** 8-char hex session IDs avoid the 260-character path limit. Atomic writes use retry-on-rename for Windows file locking.
376
+ - **Git:** Requires git 2.5+ for worktree support.
289
377
 
290
- 1. **Worktree creation:** When a forge skill starts, it creates a git worktree in `../.forge-wt/<repo>/<session-id>/` with its own branch.
291
- 2. **Session registry:** Active sessions are tracked in `.forge/sessions.json` with user identity, skill type, milestone, PID, and timestamps.
292
- 3. **Isolation:** Each session has its own git index and file system. Two sessions staging files simultaneously cannot corrupt each other.
293
- 4. **State merge:** On completion, session state (STATE.md, ROADMAP.md updates) merges back to the main repo intelligently — not last-write-wins.
294
- 5. **Cleanup:** Successful sessions auto-cleanup. Crashed sessions are detected via PID and cleaned up with `npx forge cleanup`.
378
+ ---
295
379
 
296
- ### Session Visibility
380
+ ## For New Team Members
297
381
 
298
- ```bash
299
- # See all active sessions
300
- npx forge status
382
+ Joining a project that uses forge-cc:
301
383
 
302
- # Clean up stale sessions (process died, worktree left behind)
303
- npx forge cleanup
304
- ```
384
+ ```bash
385
+ # 1. Clone and install
386
+ git clone <repo-url> && cd <repo>
387
+ npm install
305
388
 
306
- ### Parallel Milestones
389
+ # 2. Initialize forge (installs skills, hooks, scaffolding)
390
+ npx forge setup
307
391
 
308
- Milestones can declare dependencies using the `dependsOn` field in the PRD. Independent milestones can execute in parallel, each in their own worktree:
392
+ # 3. Verify your environment works
393
+ npx forge verify
309
394
 
310
- - Milestones with no unmet dependencies start simultaneously
311
- - When a dependency completes, dependent milestones become unblocked
312
- - Each milestone produces its own branch and PR
395
+ # 4. Start working
396
+ # Use /forge:go to execute milestones, or just code normally --
397
+ # the pre-commit hook ensures verification passes before any commit.
398
+ ```
313
399
 
314
- ### Platform Notes
400
+ The gates run the same checks as CI, so if `npx forge verify` passes locally, CI will pass too.
315
401
 
316
- - **Windows:** Short session IDs (8-char hex) avoid the 260-character path limit. Atomic writes use retry-on-rename for Windows file locking.
317
- - **Git version:** Requires git 2.5+ (2015) for worktree support.
402
+ ---
318
403
 
319
404
  ## Project Structure
320
405
 
@@ -322,47 +407,37 @@ Milestones can declare dependencies using the `dependsOn` field in the PRD. Inde
322
407
  forge-cc/
323
408
  src/
324
409
  cli.ts # CLI entry point (npx forge)
325
- server.ts # MCP server entry point
410
+ server.ts # MCP server (stdio transport)
326
411
  types.ts # Core type definitions
327
- gates/ # Verification gates (types, lint, tests, visual, runtime, prd)
412
+ gates/ # Verification gates + remediation templates
413
+ config/ # .forge.json schema + auto-detection
328
414
  linear/ # Linear API client + lifecycle management
329
415
  hooks/ # Pre-commit hook logic
330
- config/ # .forge.json schema + auto-detection loader
331
416
  reporter/ # Human (markdown) and JSON output formatting
332
- state/ # Session state reader/writer (STATE.md, ROADMAP.md)
417
+ state/ # Session state reader/writer
333
418
  spec/ # Spec interview engine + PRD generation
334
- go/ # Execution engine + verify loop + PR creation
335
- setup/ # Setup templates for project scaffolding
336
- worktree/ # Git worktree manager, session registry, state merge, parallel scheduler
419
+ go/ # Execution engine + verify loop + auto-chain
420
+ setup/ # Project scaffolding templates
421
+ worktree/ # Git worktree manager + session registry + state merge
337
422
  utils/ # Platform utilities (atomic writes, path normalization)
338
423
  skills/ # Claude Code skill definitions
339
- hooks/ # Installable hook files (PreToolUse, version-check)
340
- tests/ # Test suite (vitest)
341
- .forge.json # Default configuration
424
+ hooks/ # Installable hook files
425
+ tests/ # Test suite (420 tests, vitest)
342
426
  ```
343
427
 
344
428
  ## Development
345
429
 
346
- Working on forge-cc itself:
347
-
348
430
  ```bash
349
- # Install dependencies
350
- npm install
351
-
352
- # Build
353
- npm run build
354
-
355
- # Run tests
356
- npm test
357
-
358
- # Watch mode (rebuild on changes)
359
- npm run dev
360
-
361
- # Run verification on forge-cc itself
362
- npm run verify
431
+ npm install # Install dependencies
432
+ npm run build # Build
433
+ npm test # Run tests (420 tests)
434
+ npm run dev # Watch mode
435
+ npx forge verify # Verify forge-cc itself
363
436
  ```
364
437
 
365
- **Tech stack:** TypeScript (ES2022, strict), Node.js, `@modelcontextprotocol/sdk`, Commander, Playwright, Zod, Vitest.
438
+ **Tech stack:** TypeScript (ES2022, strict), Node.js 18+, MCP SDK, Commander, Playwright, Zod, Vitest
439
+
440
+ ---
366
441
 
367
442
  ## License
368
443