forge-cc 0.1.4 → 0.1.6

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 (52) hide show
  1. package/README.md +96 -10
  2. package/dist/cli.js +225 -7
  3. package/dist/cli.js.map +1 -1
  4. package/dist/go/auto-chain.d.ts +37 -5
  5. package/dist/go/auto-chain.js +220 -81
  6. package/dist/go/auto-chain.js.map +1 -1
  7. package/dist/go/executor.d.ts +2 -0
  8. package/dist/go/executor.js.map +1 -1
  9. package/dist/hooks/pre-commit.js +9 -3
  10. package/dist/hooks/pre-commit.js.map +1 -1
  11. package/dist/reporter/human.d.ts +5 -0
  12. package/dist/reporter/human.js +30 -0
  13. package/dist/reporter/human.js.map +1 -1
  14. package/dist/setup/templates.js +97 -122
  15. package/dist/setup/templates.js.map +1 -1
  16. package/dist/spec/generator.d.ts +20 -0
  17. package/dist/spec/generator.js +23 -2
  18. package/dist/spec/generator.js.map +1 -1
  19. package/dist/spec/interview.d.ts +20 -2
  20. package/dist/spec/interview.js +8 -0
  21. package/dist/spec/interview.js.map +1 -1
  22. package/dist/spec/scanner.d.ts +34 -0
  23. package/dist/spec/scanner.js +93 -0
  24. package/dist/spec/scanner.js.map +1 -1
  25. package/dist/spec/templates.d.ts +22 -0
  26. package/dist/spec/templates.js +8 -0
  27. package/dist/spec/templates.js.map +1 -1
  28. package/dist/utils/platform.d.ts +29 -0
  29. package/dist/utils/platform.js +90 -0
  30. package/dist/utils/platform.js.map +1 -0
  31. package/dist/worktree/identity.d.ts +9 -0
  32. package/dist/worktree/identity.js +32 -0
  33. package/dist/worktree/identity.js.map +1 -0
  34. package/dist/worktree/manager.d.ts +70 -0
  35. package/dist/worktree/manager.js +217 -0
  36. package/dist/worktree/manager.js.map +1 -0
  37. package/dist/worktree/parallel.d.ts +87 -0
  38. package/dist/worktree/parallel.js +328 -0
  39. package/dist/worktree/parallel.js.map +1 -0
  40. package/dist/worktree/session.d.ts +64 -0
  41. package/dist/worktree/session.js +193 -0
  42. package/dist/worktree/session.js.map +1 -0
  43. package/dist/worktree/state-merge.d.ts +43 -0
  44. package/dist/worktree/state-merge.js +162 -0
  45. package/dist/worktree/state-merge.js.map +1 -0
  46. package/hooks/pre-commit-verify.js +9 -3
  47. package/hooks/version-check.js +78 -78
  48. package/package.json +1 -1
  49. package/skills/forge-go.md +39 -0
  50. package/skills/forge-setup.md +183 -157
  51. package/skills/forge-spec.md +50 -12
  52. package/skills/forge-update.md +92 -72
package/README.md CHANGED
@@ -8,7 +8,7 @@ Pre-PR verification harness and development workflow tool for Claude Code agents
8
8
 
9
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
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.
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
12
  - **Linear lifecycle** -- programmatic status transitions through Backlog, Planned, In Progress, In Review, and Done. Every skill keeps Linear in sync automatically.
13
13
 
14
14
  ## Quick Start
@@ -93,13 +93,23 @@ Results are cached to `.forge/last-verify.json` for freshness checking by hooks.
93
93
 
94
94
  ### `forge status`
95
95
 
96
- Print current project state: branch, last verification result, config source.
96
+ Print current project state: branch, last verification result, config source, and active sessions.
97
97
 
98
98
  ```bash
99
99
  npx forge status
100
100
  ```
101
101
 
102
- Output includes which gates passed/failed, how long ago verification ran, and whether config is from `.forge.json` or auto-detected.
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.
103
+
104
+ ### `forge cleanup`
105
+
106
+ Remove stale worktrees, deregister dead sessions, and reclaim disk space. Idempotent — safe to run multiple times.
107
+
108
+ ```bash
109
+ npx forge cleanup
110
+ ```
111
+
112
+ Output shows which stale sessions were removed and their worktree paths. If no stale sessions exist, prints a clean message.
103
113
 
104
114
  ## Verification Gates
105
115
 
@@ -149,6 +159,32 @@ Add to your `.claude/settings.json`:
149
159
  }
150
160
  ```
151
161
 
162
+ ### Version Check Hook
163
+
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.
165
+
166
+ Add to `.claude/settings.local.json`:
167
+
168
+ ```json
169
+ {
170
+ "hooks": {
171
+ "PreToolUse": [
172
+ {
173
+ "matcher": "Task",
174
+ "hooks": [
175
+ {
176
+ "type": "command",
177
+ "command": "node node_modules/forge-cc/hooks/version-check.js"
178
+ }
179
+ ]
180
+ }
181
+ ]
182
+ }
183
+ }
184
+ ```
185
+
186
+ `/forge:setup` installs this hook automatically.
187
+
152
188
  ### Git Pre-Commit Hook
153
189
 
154
190
  Standard git hook for non-Claude-Code environments. Same four checks as the PreToolUse hook.
@@ -208,6 +244,18 @@ Execute the next pending milestone from your PRD with wave-based agent teams. Ea
208
244
 
209
245
  **Flow:** Orient (read state) -> pre-flight checks -> execute waves -> verify -> update state -> (optional) create PR.
210
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.
258
+
211
259
  ## Linear Integration
212
260
 
213
261
  forge-cc manages the full Linear project lifecycle:
@@ -226,12 +274,47 @@ For a new developer joining the team:
226
274
 
227
275
  1. **Clone the repo** that uses forge-cc.
228
276
  2. **Install dependencies:** `npm install` (forge-cc should be in `devDependencies`).
229
- 3. **Run verification:** `npx forge verify` -- confirms your environment is set up correctly.
230
- 4. **Check status:** `npx forge status` -- shows current branch and last verification.
231
- 5. **Install the hook** (optional but recommended): add the PreToolUse hook to `.claude/settings.json` (see Enforcement section above).
232
- 6. **Create a `.forge.json`** if the auto-detected gates don't match your needs.
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.
281
+
282
+ The gates run the same commands your CI does, so if `npx forge verify` passes locally, CI will pass too.
283
+
284
+ ## Concurrency & Session Isolation
285
+
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.
287
+
288
+ ### How It Works
289
+
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`.
295
+
296
+ ### Session Visibility
297
+
298
+ ```bash
299
+ # See all active sessions
300
+ npx forge status
301
+
302
+ # Clean up stale sessions (process died, worktree left behind)
303
+ npx forge cleanup
304
+ ```
305
+
306
+ ### Parallel Milestones
307
+
308
+ Milestones can declare dependencies using the `dependsOn` field in the PRD. Independent milestones can execute in parallel, each in their own worktree:
309
+
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
313
+
314
+ ### Platform Notes
233
315
 
234
- That's it. The gates run the same commands your CI does, so if `npx forge verify` passes locally, CI will pass too.
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.
235
318
 
236
319
  ## Project Structure
237
320
 
@@ -249,8 +332,11 @@ forge-cc/
249
332
  state/ # Session state reader/writer (STATE.md, ROADMAP.md)
250
333
  spec/ # Spec interview engine + PRD generation
251
334
  go/ # Execution engine + verify loop + PR creation
252
- skills/ # Claude Code skill definitions (/forge:triage, /forge:spec, /forge:go)
253
- hooks/ # Installable hook files (PreToolUse)
335
+ setup/ # Setup templates for project scaffolding
336
+ worktree/ # Git worktree manager, session registry, state merge, parallel scheduler
337
+ utils/ # Platform utilities (atomic writes, path normalization)
338
+ skills/ # Claude Code skill definitions
339
+ hooks/ # Installable hook files (PreToolUse, version-check)
254
340
  tests/ # Test suite (vitest)
255
341
  .forge.json # Default configuration
256
342
  ```
package/dist/cli.js CHANGED
@@ -1,10 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
3
  import { execSync } from "node:child_process";
4
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
- import { join } from "node:path";
4
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, } from "node:fs";
5
+ import { basename, dirname, join, resolve } from "node:path";
6
+ import { homedir } from "node:os";
7
+ import { fileURLToPath } from "node:url";
6
8
  import { runPipeline } from "./gates/index.js";
7
9
  import { loadConfig } from "./config/loader.js";
10
+ import { forgeConfigTemplate, claudeMdTemplate, stateMdTemplate, roadmapMdTemplate, lessonsMdTemplate, globalClaudeMdTemplate, gitignoreForgeLines, } from "./setup/templates.js";
11
+ import { loadRegistry, detectStaleSessions, deregisterSession } from "./worktree/session.js";
12
+ import { getRepoRoot, cleanupStaleWorktrees } from "./worktree/manager.js";
13
+ import { formatSessionsReport } from "./reporter/human.js";
8
14
  const program = new Command();
9
15
  program
10
16
  .name("forge")
@@ -70,8 +76,12 @@ program
70
76
  catch { /* not a git repo */ }
71
77
  console.log(`## Forge Status`);
72
78
  console.log(`**Branch:** ${branch}`);
73
- // Last verify
74
- const cachePath = join(projectDir, ".forge", "last-verify.json");
79
+ // Last verify — try per-branch first, fall back to old path
80
+ const perBranchCachePath = getVerifyCachePath(projectDir, branch);
81
+ const legacyCachePath = join(projectDir, ".forge", "last-verify.json");
82
+ const cachePath = existsSync(perBranchCachePath)
83
+ ? perBranchCachePath
84
+ : legacyCachePath;
75
85
  if (existsSync(cachePath)) {
76
86
  const cache = JSON.parse(readFileSync(cachePath, "utf-8"));
77
87
  const status = cache.passed ? "PASSED" : "FAILED";
@@ -94,22 +104,230 @@ program
94
104
  else {
95
105
  console.log(`**Config:** auto-detected (no .forge.json)`);
96
106
  }
107
+ // Sessions
108
+ try {
109
+ const repoRoot = getRepoRoot(projectDir);
110
+ detectStaleSessions(repoRoot);
111
+ const registry = loadRegistry(repoRoot);
112
+ if (registry.sessions.length > 0) {
113
+ console.log("");
114
+ console.log(formatSessionsReport(registry.sessions));
115
+ }
116
+ }
117
+ catch {
118
+ // Not a git repo or no session registry — skip silently
119
+ }
120
+ });
121
+ // ── Skill installation helper ──────────────────────────────────────
122
+ function getPackageRoot() {
123
+ return resolve(dirname(fileURLToPath(import.meta.url)), "..");
124
+ }
125
+ function installSkills() {
126
+ const skillsDir = join(getPackageRoot(), "skills");
127
+ const targetDir = join(homedir(), ".claude", "commands", "forge");
128
+ mkdirSync(targetDir, { recursive: true });
129
+ const installed = [];
130
+ const files = readdirSync(skillsDir).filter((f) => f.startsWith("forge-") && f.endsWith(".md"));
131
+ for (const file of files) {
132
+ const targetName = file.replace(/^forge-/, "");
133
+ copyFileSync(join(skillsDir, file), join(targetDir, targetName));
134
+ installed.push(targetName);
135
+ }
136
+ return installed;
137
+ }
138
+ // ── setup command ──────────────────────────────────────────────────
139
+ program
140
+ .command("setup")
141
+ .description("Initialize forge project and install skills")
142
+ .option("--skills-only", "Only install skills to ~/.claude/commands/forge/")
143
+ .action((opts) => {
144
+ // Always install skills
145
+ const installed = installSkills();
146
+ console.log(`Installed ${installed.length} skills to ~/.claude/commands/forge/`);
147
+ for (const s of installed) {
148
+ console.log(` - ${s}`);
149
+ }
150
+ if (opts.skillsOnly) {
151
+ return;
152
+ }
153
+ // Check if project already initialized
154
+ const projectDir = process.cwd();
155
+ if (existsSync(join(projectDir, ".forge.json"))) {
156
+ console.log("\nProject already initialized. Run `/forge:setup` to refresh.");
157
+ return;
158
+ }
159
+ // Scaffold project files
160
+ const projectName = basename(projectDir);
161
+ const ctx = {
162
+ projectName,
163
+ techStack: "TypeScript, Node.js",
164
+ description: "Project description — customize in CLAUDE.md",
165
+ gates: ["types", "lint", "tests"],
166
+ date: new Date().toISOString().split("T")[0],
167
+ };
168
+ mkdirSync(join(projectDir, ".planning"), { recursive: true });
169
+ mkdirSync(join(projectDir, "tasks"), { recursive: true });
170
+ writeFileSync(join(projectDir, ".forge.json"), forgeConfigTemplate(ctx));
171
+ writeFileSync(join(projectDir, "CLAUDE.md"), claudeMdTemplate(ctx));
172
+ writeFileSync(join(projectDir, ".planning", "STATE.md"), stateMdTemplate(ctx));
173
+ writeFileSync(join(projectDir, ".planning", "ROADMAP.md"), roadmapMdTemplate(ctx));
174
+ writeFileSync(join(projectDir, "tasks", "lessons.md"), lessonsMdTemplate(ctx));
175
+ // Append to .gitignore
176
+ const gitignorePath = join(projectDir, ".gitignore");
177
+ const forgeLines = gitignoreForgeLines();
178
+ if (existsSync(gitignorePath)) {
179
+ const content = readFileSync(gitignorePath, "utf-8");
180
+ if (!content.includes(".forge/")) {
181
+ writeFileSync(gitignorePath, content + "\n" + forgeLines);
182
+ }
183
+ }
184
+ else {
185
+ writeFileSync(gitignorePath, forgeLines);
186
+ }
187
+ // Create global CLAUDE.md if needed
188
+ const globalClaudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
189
+ if (!existsSync(globalClaudeMdPath)) {
190
+ mkdirSync(dirname(globalClaudeMdPath), { recursive: true });
191
+ writeFileSync(globalClaudeMdPath, globalClaudeMdTemplate());
192
+ console.log("\nCreated ~/.claude/CLAUDE.md");
193
+ }
194
+ console.log(`\n## Forge Setup Complete`);
195
+ console.log(`**Project:** ${projectName}`);
196
+ console.log(`**Gates:** ${ctx.gates.join(", ")}`);
197
+ console.log(`\nFiles created:`);
198
+ console.log(` - .forge.json`);
199
+ console.log(` - CLAUDE.md`);
200
+ console.log(` - .planning/STATE.md`);
201
+ console.log(` - .planning/ROADMAP.md`);
202
+ console.log(` - tasks/lessons.md`);
203
+ console.log(` - .gitignore (forge lines)`);
204
+ console.log(`\nNext: Review CLAUDE.md, then run \`npx forge verify\``);
205
+ });
206
+ // ── update command ─────────────────────────────────────────────────
207
+ program
208
+ .command("update")
209
+ .description("Check for updates and install latest forge-cc")
210
+ .action(() => {
211
+ // Get current version from our own package.json
212
+ const pkgPath = join(getPackageRoot(), "package.json");
213
+ const currentVersion = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
214
+ // Get latest version from npm registry
215
+ let latestVersion;
216
+ try {
217
+ latestVersion = execSync("npm view forge-cc version", {
218
+ encoding: "utf-8",
219
+ }).trim();
220
+ }
221
+ catch {
222
+ console.error("Could not reach npm registry. Check your internet connection.");
223
+ process.exit(1);
224
+ }
225
+ console.log(`## Forge Version Check\n`);
226
+ console.log(`**Installed:** v${currentVersion}`);
227
+ console.log(`**Latest:** v${latestVersion}`);
228
+ if (currentVersion === latestVersion) {
229
+ console.log(`**Status:** Up to date\n`);
230
+ console.log("You're on the latest version.");
231
+ return;
232
+ }
233
+ console.log(`**Status:** Update available\n`);
234
+ console.log(`Updating forge-cc to v${latestVersion}...`);
235
+ try {
236
+ execSync("npm install -g forge-cc@latest", { stdio: "inherit" });
237
+ }
238
+ catch {
239
+ console.error("Update failed. Try manually: npm install -g forge-cc@latest");
240
+ process.exit(1);
241
+ }
242
+ // Re-sync skills after update
243
+ const installed = installSkills();
244
+ console.log(`\nSynced ${installed.length} skills to ~/.claude/commands/forge/`);
245
+ console.log(`\n## Update Complete`);
246
+ console.log(`**Previous:** v${currentVersion}`);
247
+ console.log(`**Current:** v${latestVersion}`);
248
+ if (existsSync(join(process.cwd(), ".forge.json"))) {
249
+ console.log(`\nConsider running \`/forge:setup\` (Refresh) to update project files.`);
250
+ }
97
251
  });
252
+ // ── cleanup command ────────────────────────────────────────────────
253
+ program
254
+ .command("cleanup")
255
+ .description("Remove stale worktrees, deregister dead sessions, reclaim disk space")
256
+ .action(() => {
257
+ let repoRoot;
258
+ try {
259
+ repoRoot = getRepoRoot(process.cwd());
260
+ }
261
+ catch {
262
+ console.error("Error: not a git repository. Run this from inside a git project.");
263
+ process.exit(1);
264
+ return; // unreachable but helps TypeScript narrow
265
+ }
266
+ console.log("## Forge Cleanup\n");
267
+ // Detect and mark stale sessions (mutates registry)
268
+ detectStaleSessions(repoRoot);
269
+ // Load registry and filter for stale sessions
270
+ const registry = loadRegistry(repoRoot);
271
+ const staleSessions = registry.sessions.filter((s) => s.status === "stale");
272
+ if (staleSessions.length === 0) {
273
+ console.log("No stale sessions found. Nothing to clean up.");
274
+ return;
275
+ }
276
+ console.log(`Found ${staleSessions.length} stale session${staleSessions.length === 1 ? "" : "s"}.\n`);
277
+ // Remove worktrees
278
+ const result = cleanupStaleWorktrees(repoRoot, staleSessions);
279
+ // Deregister successfully removed sessions and print results
280
+ for (const removed of result.removed) {
281
+ deregisterSession(repoRoot, removed.sessionId);
282
+ console.log(`- Removed: ${removed.sessionId} (${removed.branch}) — worktree deleted`);
283
+ }
284
+ for (const err of result.errors) {
285
+ console.log(`- Error: ${err.sessionId} — ${err.error}`);
286
+ }
287
+ // Summary
288
+ const cleanedCount = result.removed.length;
289
+ const errorCount = result.errors.length;
290
+ console.log("");
291
+ if (errorCount === 0) {
292
+ console.log(`Cleaned up ${cleanedCount} session${cleanedCount === 1 ? "" : "s"}.`);
293
+ }
294
+ else {
295
+ console.log(`Cleaned up ${cleanedCount} session${cleanedCount === 1 ? "" : "s"}, ${errorCount} error${errorCount === 1 ? "" : "s"}.`);
296
+ }
297
+ });
298
+ // ── helpers ────────────────────────────────────────────────────────
299
+ /**
300
+ * Get the verify cache path for the current branch.
301
+ * Returns: .forge/verify-cache/<branch-slug>.json
302
+ */
303
+ function getVerifyCachePath(projectDir, branch) {
304
+ let branchName = branch;
305
+ if (!branchName) {
306
+ try {
307
+ branchName = execSync("git branch --show-current", { encoding: "utf-8" }).trim();
308
+ }
309
+ catch {
310
+ branchName = "unknown";
311
+ }
312
+ }
313
+ const slug = branchName.replace(/\//g, "-").toLowerCase();
314
+ return join(projectDir, ".forge", "verify-cache", `${slug}.json`);
315
+ }
98
316
  function writeVerifyCache(projectDir, result) {
99
- const forgeDir = join(projectDir, ".forge");
100
- mkdirSync(forgeDir, { recursive: true });
101
317
  let branch = "unknown";
102
318
  try {
103
319
  branch = execSync("git branch --show-current", { encoding: "utf-8" }).trim();
104
320
  }
105
321
  catch { /* not a git repo */ }
322
+ const cachePath = getVerifyCachePath(projectDir, branch);
323
+ mkdirSync(dirname(cachePath), { recursive: true });
106
324
  const cache = {
107
325
  passed: result.passed,
108
326
  timestamp: new Date().toISOString(),
109
327
  gates: result.gates,
110
328
  branch,
111
329
  };
112
- writeFileSync(join(forgeDir, "last-verify.json"), JSON.stringify(cache, null, 2));
330
+ writeFileSync(cachePath, JSON.stringify(cache, null, 2));
113
331
  }
114
332
  function formatReport(result) {
115
333
  const lines = [];
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EA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I,EAAE,CAAC,CAAC;YAChC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3E,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -12,6 +12,7 @@
12
12
  import type { MilestoneProgress } from "../state/reader.js";
13
13
  import type { CommitResult } from "../state/writer.js";
14
14
  import type { ForgeConfig } from "../types.js";
15
+ import type { SchedulerResult } from "../worktree/parallel.js";
15
16
  export interface AutoChainOptions {
16
17
  projectDir: string;
17
18
  prdPath: string;
@@ -23,6 +24,8 @@ export interface AutoChainOptions {
23
24
  activePrd: string;
24
25
  /** Developer name for session memory */
25
26
  developer: string;
27
+ /** Repository root (for worktree operations). Defaults to projectDir. */
28
+ repoRoot?: string;
26
29
  /** If not provided, detect from STATE.md */
27
30
  startMilestone?: number;
28
31
  /** Called when a milestone begins execution */
@@ -40,6 +43,8 @@ export interface MilestoneResult {
40
43
  isLast: boolean;
41
44
  /** Fresh-context prompt for spawning this milestone's agent */
42
45
  freshPrompt: string;
46
+ /** Path to the worktree used for execution */
47
+ worktreePath?: string;
43
48
  errors: string[];
44
49
  }
45
50
  export interface AutoChainResult {
@@ -71,9 +76,15 @@ export declare function findNextPendingMilestone(projectDir: string): Promise<Mi
71
76
  *
72
77
  * For each pending milestone:
73
78
  * 1. Determines the starting milestone (from options or STATE.md/ROADMAP.md)
74
- * 2. Builds a fresh-context prompt for the milestone agent
75
- * 3. Calls the milestone context builder for structured data
76
- * 4. Returns results so the calling skill can spawn agents and drive execution
79
+ * 2. Creates a git worktree for isolated execution
80
+ * 3. Registers a session in the session registry
81
+ * 4. Builds a fresh-context prompt for the milestone agent
82
+ * 5. Calls the milestone context builder for structured data
83
+ * 6. Returns results so the calling skill can spawn agents and drive execution
84
+ * 7. On completion or failure, deregisters the session and cleans up the worktree
85
+ *
86
+ * The worktree is created ONCE per /forge:go session, not per milestone.
87
+ * All milestones in the chain execute in the same worktree.
77
88
  *
78
89
  * The chain stops on the first milestone failure, or when all milestones
79
90
  * are complete. The caller is responsible for actually executing each
@@ -86,8 +97,9 @@ export declare function runAutoChain(options: AutoChainOptions): Promise<AutoCha
86
97
  *
87
98
  * Handles:
88
99
  * 1. Updating milestone progress in STATE.md and ROADMAP.md
89
- * 2. Committing milestone work to git
90
- * 3. Returning the commit SHA for the milestone result
100
+ * 2. Committing milestone work to git (in the worktree if one was used)
101
+ * 3. Merging worktree branch into the feature branch (if worktree was used)
102
+ * 4. Returning the commit SHA for the milestone result
91
103
  *
92
104
  * The caller should update the MilestoneResult with the returned commit info.
93
105
  */
@@ -101,7 +113,27 @@ export declare function completeMilestone(options: {
101
113
  developer: string;
102
114
  filesToStage: string[];
103
115
  push?: boolean;
116
+ /** Path to the worktree used for execution. If set, commit happens in the worktree. */
117
+ worktreePath?: string;
118
+ /** Repository root, required when worktreePath is provided (for merge operations). */
119
+ repoRoot?: string;
104
120
  }): Promise<{
105
121
  commitResult: CommitResult;
106
122
  isLast: boolean;
107
123
  }>;
124
+ /**
125
+ * Build a parallel execution plan for all milestones in a PRD.
126
+ *
127
+ * Parses the PRD markdown for milestone definitions and `dependsOn` fields,
128
+ * builds a dependency DAG, and computes parallel execution waves showing
129
+ * which milestones can run simultaneously.
130
+ *
131
+ * If no `dependsOn` fields are found in the PRD, all milestones are treated
132
+ * as roots (no dependencies) and placed in a single wave. This is backward
133
+ * compatible — the caller can process them sequentially by milestone number.
134
+ *
135
+ * @param prdPath - Absolute path to the PRD markdown file
136
+ * @returns The wave schedule showing which milestones can run simultaneously
137
+ * @throws If a dependency cycle is detected or a referenced dependency doesn't exist
138
+ */
139
+ export declare function buildParallelPlan(prdPath: string): Promise<SchedulerResult>;