forge-cc 0.1.5 → 0.1.7

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 (49) hide show
  1. package/README.md +50 -3
  2. package/dist/cli.js +295 -9
  3. package/dist/cli.js.map +1 -1
  4. package/dist/go/auto-chain.d.ts +44 -5
  5. package/dist/go/auto-chain.js +236 -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/spec/generator.d.ts +20 -0
  15. package/dist/spec/generator.js +23 -2
  16. package/dist/spec/generator.js.map +1 -1
  17. package/dist/spec/interview.d.ts +20 -2
  18. package/dist/spec/interview.js +8 -0
  19. package/dist/spec/interview.js.map +1 -1
  20. package/dist/spec/scanner.d.ts +34 -0
  21. package/dist/spec/scanner.js +93 -0
  22. package/dist/spec/scanner.js.map +1 -1
  23. package/dist/spec/templates.d.ts +34 -12
  24. package/dist/spec/templates.js +8 -0
  25. package/dist/spec/templates.js.map +1 -1
  26. package/dist/utils/platform.d.ts +29 -0
  27. package/dist/utils/platform.js +90 -0
  28. package/dist/utils/platform.js.map +1 -0
  29. package/dist/worktree/identity.d.ts +9 -0
  30. package/dist/worktree/identity.js +32 -0
  31. package/dist/worktree/identity.js.map +1 -0
  32. package/dist/worktree/manager.d.ts +70 -0
  33. package/dist/worktree/manager.js +217 -0
  34. package/dist/worktree/manager.js.map +1 -0
  35. package/dist/worktree/parallel.d.ts +87 -0
  36. package/dist/worktree/parallel.js +328 -0
  37. package/dist/worktree/parallel.js.map +1 -0
  38. package/dist/worktree/session.d.ts +64 -0
  39. package/dist/worktree/session.js +193 -0
  40. package/dist/worktree/session.js.map +1 -0
  41. package/dist/worktree/state-merge.d.ts +43 -0
  42. package/dist/worktree/state-merge.js +162 -0
  43. package/dist/worktree/state-merge.js.map +1 -0
  44. package/hooks/pre-commit-verify.js +9 -3
  45. package/package.json +1 -1
  46. package/skills/forge-go.md +57 -14
  47. package/skills/forge-setup.md +28 -2
  48. package/skills/forge-spec.md +51 -13
  49. package/skills/forge-update.md +21 -1
package/README.md CHANGED
@@ -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
 
@@ -271,6 +281,41 @@ For a new developer joining the team:
271
281
 
272
282
  The gates run the same commands your CI does, so if `npx forge verify` passes locally, CI will pass too.
273
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
315
+
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.
318
+
274
319
  ## Project Structure
275
320
 
276
321
  ```
@@ -288,7 +333,9 @@ forge-cc/
288
333
  spec/ # Spec interview engine + PRD generation
289
334
  go/ # Execution engine + verify loop + PR creation
290
335
  setup/ # Setup templates for project scaffolding
291
- skills/ # Claude Code skill definitions (/forge:triage, /forge:spec, /forge:go, /forge:setup, /forge:update)
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
292
339
  hooks/ # Installable hook files (PreToolUse, version-check)
293
340
  tests/ # Test suite (vitest)
294
341
  .forge.json # Default configuration
package/dist/cli.js CHANGED
@@ -1,15 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
- import { execSync } from "node:child_process";
4
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
- import { join } from "node:path";
3
+ import { execSync, spawnSync } from "node:child_process";
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 { countPendingMilestones } from "./go/auto-chain.js";
13
+ import { getRepoRoot, cleanupStaleWorktrees } from "./worktree/manager.js";
14
+ import { formatSessionsReport } from "./reporter/human.js";
8
15
  const program = new Command();
9
16
  program
10
17
  .name("forge")
11
18
  .description("forge-cc — verification + workflow CLI for Claude Code agents")
12
- .version("0.1.0");
19
+ .version("0.1.7");
13
20
  program
14
21
  .command("verify")
15
22
  .description("Run verification gates against the current project")
@@ -70,8 +77,12 @@ program
70
77
  catch { /* not a git repo */ }
71
78
  console.log(`## Forge Status`);
72
79
  console.log(`**Branch:** ${branch}`);
73
- // Last verify
74
- const cachePath = join(projectDir, ".forge", "last-verify.json");
80
+ // Last verify — try per-branch first, fall back to old path
81
+ const perBranchCachePath = getVerifyCachePath(projectDir, branch);
82
+ const legacyCachePath = join(projectDir, ".forge", "last-verify.json");
83
+ const cachePath = existsSync(perBranchCachePath)
84
+ ? perBranchCachePath
85
+ : legacyCachePath;
75
86
  if (existsSync(cachePath)) {
76
87
  const cache = JSON.parse(readFileSync(cachePath, "utf-8"));
77
88
  const status = cache.passed ? "PASSED" : "FAILED";
@@ -94,22 +105,297 @@ program
94
105
  else {
95
106
  console.log(`**Config:** auto-detected (no .forge.json)`);
96
107
  }
108
+ // Sessions
109
+ try {
110
+ const repoRoot = getRepoRoot(projectDir);
111
+ detectStaleSessions(repoRoot);
112
+ const registry = loadRegistry(repoRoot);
113
+ if (registry.sessions.length > 0) {
114
+ console.log("");
115
+ console.log(formatSessionsReport(registry.sessions));
116
+ }
117
+ }
118
+ catch {
119
+ // Not a git repo or no session registry — skip silently
120
+ }
121
+ });
122
+ // ── Skill installation helper ──────────────────────────────────────
123
+ function getPackageRoot() {
124
+ return resolve(dirname(fileURLToPath(import.meta.url)), "..");
125
+ }
126
+ function installSkills() {
127
+ const skillsDir = join(getPackageRoot(), "skills");
128
+ const targetDir = join(homedir(), ".claude", "commands", "forge");
129
+ mkdirSync(targetDir, { recursive: true });
130
+ const installed = [];
131
+ const files = readdirSync(skillsDir).filter((f) => f.startsWith("forge-") && f.endsWith(".md"));
132
+ for (const file of files) {
133
+ const targetName = file.replace(/^forge-/, "");
134
+ copyFileSync(join(skillsDir, file), join(targetDir, targetName));
135
+ installed.push(targetName);
136
+ }
137
+ return installed;
138
+ }
139
+ // ── setup command ──────────────────────────────────────────────────
140
+ program
141
+ .command("setup")
142
+ .description("Initialize forge project and install skills")
143
+ .option("--skills-only", "Only install skills to ~/.claude/commands/forge/")
144
+ .action((opts) => {
145
+ // Always install skills
146
+ const installed = installSkills();
147
+ console.log(`Installed ${installed.length} skills to ~/.claude/commands/forge/`);
148
+ for (const s of installed) {
149
+ console.log(` - ${s}`);
150
+ }
151
+ if (opts.skillsOnly) {
152
+ return;
153
+ }
154
+ // Check if project already initialized
155
+ const projectDir = process.cwd();
156
+ if (existsSync(join(projectDir, ".forge.json"))) {
157
+ console.log("\nProject already initialized. Run `/forge:setup` to refresh.");
158
+ return;
159
+ }
160
+ // Scaffold project files
161
+ const projectName = basename(projectDir);
162
+ const ctx = {
163
+ projectName,
164
+ techStack: "TypeScript, Node.js",
165
+ description: "Project description — customize in CLAUDE.md",
166
+ gates: ["types", "lint", "tests"],
167
+ date: new Date().toISOString().split("T")[0],
168
+ };
169
+ mkdirSync(join(projectDir, ".planning"), { recursive: true });
170
+ mkdirSync(join(projectDir, "tasks"), { recursive: true });
171
+ writeFileSync(join(projectDir, ".forge.json"), forgeConfigTemplate(ctx));
172
+ writeFileSync(join(projectDir, "CLAUDE.md"), claudeMdTemplate(ctx));
173
+ writeFileSync(join(projectDir, ".planning", "STATE.md"), stateMdTemplate(ctx));
174
+ writeFileSync(join(projectDir, ".planning", "ROADMAP.md"), roadmapMdTemplate(ctx));
175
+ writeFileSync(join(projectDir, "tasks", "lessons.md"), lessonsMdTemplate(ctx));
176
+ // Append to .gitignore
177
+ const gitignorePath = join(projectDir, ".gitignore");
178
+ const forgeLines = gitignoreForgeLines();
179
+ if (existsSync(gitignorePath)) {
180
+ const content = readFileSync(gitignorePath, "utf-8");
181
+ if (!content.includes(".forge/")) {
182
+ writeFileSync(gitignorePath, content + "\n" + forgeLines);
183
+ }
184
+ }
185
+ else {
186
+ writeFileSync(gitignorePath, forgeLines);
187
+ }
188
+ // Create global CLAUDE.md if needed
189
+ const globalClaudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
190
+ if (!existsSync(globalClaudeMdPath)) {
191
+ mkdirSync(dirname(globalClaudeMdPath), { recursive: true });
192
+ writeFileSync(globalClaudeMdPath, globalClaudeMdTemplate());
193
+ console.log("\nCreated ~/.claude/CLAUDE.md");
194
+ }
195
+ console.log(`\n## Forge Setup Complete`);
196
+ console.log(`**Project:** ${projectName}`);
197
+ console.log(`**Gates:** ${ctx.gates.join(", ")}`);
198
+ console.log(`\nFiles created:`);
199
+ console.log(` - .forge.json`);
200
+ console.log(` - CLAUDE.md`);
201
+ console.log(` - .planning/STATE.md`);
202
+ console.log(` - .planning/ROADMAP.md`);
203
+ console.log(` - tasks/lessons.md`);
204
+ console.log(` - .gitignore (forge lines)`);
205
+ console.log(`\nNext: Review CLAUDE.md, then run \`npx forge verify\``);
206
+ });
207
+ // ── update command ─────────────────────────────────────────────────
208
+ program
209
+ .command("update")
210
+ .description("Check for updates and install latest forge-cc")
211
+ .action(() => {
212
+ // Get current version from our own package.json
213
+ const pkgPath = join(getPackageRoot(), "package.json");
214
+ const currentVersion = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
215
+ // Get latest version from npm registry
216
+ let latestVersion;
217
+ try {
218
+ latestVersion = execSync("npm view forge-cc version", {
219
+ encoding: "utf-8",
220
+ }).trim();
221
+ }
222
+ catch {
223
+ console.error("Could not reach npm registry. Check your internet connection.");
224
+ process.exit(1);
225
+ }
226
+ console.log(`## Forge Version Check\n`);
227
+ console.log(`**Installed:** v${currentVersion}`);
228
+ console.log(`**Latest:** v${latestVersion}`);
229
+ if (currentVersion === latestVersion) {
230
+ console.log(`**Status:** Up to date\n`);
231
+ console.log("You're on the latest version.");
232
+ return;
233
+ }
234
+ console.log(`**Status:** Update available\n`);
235
+ console.log(`Updating forge-cc to v${latestVersion}...`);
236
+ try {
237
+ execSync("npm install -g forge-cc@latest", { stdio: "inherit" });
238
+ }
239
+ catch {
240
+ console.error("Update failed. Try manually: npm install -g forge-cc@latest");
241
+ process.exit(1);
242
+ }
243
+ // Re-sync skills after update
244
+ const installed = installSkills();
245
+ console.log(`\nSynced ${installed.length} skills to ~/.claude/commands/forge/`);
246
+ console.log(`\n## Update Complete`);
247
+ console.log(`**Previous:** v${currentVersion}`);
248
+ console.log(`**Current:** v${latestVersion}`);
249
+ if (existsSync(join(process.cwd(), ".forge.json"))) {
250
+ console.log(`\nConsider running \`/forge:setup\` (Refresh) to update project files.`);
251
+ }
252
+ });
253
+ // ── cleanup command ────────────────────────────────────────────────
254
+ program
255
+ .command("cleanup")
256
+ .description("Remove stale worktrees, deregister dead sessions, reclaim disk space")
257
+ .action(() => {
258
+ let repoRoot;
259
+ try {
260
+ repoRoot = getRepoRoot(process.cwd());
261
+ }
262
+ catch {
263
+ console.error("Error: not a git repository. Run this from inside a git project.");
264
+ process.exit(1);
265
+ return; // unreachable but helps TypeScript narrow
266
+ }
267
+ console.log("## Forge Cleanup\n");
268
+ // Detect and mark stale sessions (mutates registry)
269
+ detectStaleSessions(repoRoot);
270
+ // Load registry and filter for stale sessions
271
+ const registry = loadRegistry(repoRoot);
272
+ const staleSessions = registry.sessions.filter((s) => s.status === "stale");
273
+ if (staleSessions.length === 0) {
274
+ console.log("No stale sessions found. Nothing to clean up.");
275
+ return;
276
+ }
277
+ console.log(`Found ${staleSessions.length} stale session${staleSessions.length === 1 ? "" : "s"}.\n`);
278
+ // Remove worktrees
279
+ const result = cleanupStaleWorktrees(repoRoot, staleSessions);
280
+ // Deregister successfully removed sessions and print results
281
+ for (const removed of result.removed) {
282
+ deregisterSession(repoRoot, removed.sessionId);
283
+ console.log(`- Removed: ${removed.sessionId} (${removed.branch}) — worktree deleted`);
284
+ }
285
+ for (const err of result.errors) {
286
+ console.log(`- Error: ${err.sessionId} — ${err.error}`);
287
+ }
288
+ // Summary
289
+ const cleanedCount = result.removed.length;
290
+ const errorCount = result.errors.length;
291
+ console.log("");
292
+ if (errorCount === 0) {
293
+ console.log(`Cleaned up ${cleanedCount} session${cleanedCount === 1 ? "" : "s"}.`);
294
+ }
295
+ else {
296
+ console.log(`Cleaned up ${cleanedCount} session${cleanedCount === 1 ? "" : "s"}, ${errorCount} error${errorCount === 1 ? "" : "s"}.`);
297
+ }
97
298
  });
299
+ // ── run command ────────────────────────────────────────────────────
300
+ program
301
+ .command("run")
302
+ .description("Execute all remaining milestones autonomously in fresh Claude sessions (Ralph Loop pattern)")
303
+ .option("--max-iterations <n>", "Maximum iterations before stopping (safety cap)", "20")
304
+ .action(async (opts) => {
305
+ const projectDir = process.cwd();
306
+ const maxIterations = parseInt(opts.maxIterations, 10);
307
+ // Pre-flight: check ROADMAP.md exists
308
+ const roadmapPath = join(projectDir, ".planning", "ROADMAP.md");
309
+ if (!existsSync(roadmapPath)) {
310
+ console.error("Error: No .planning/ROADMAP.md found. Run /forge:spec first to create a PRD with milestones.");
311
+ process.exit(1);
312
+ }
313
+ // Pre-flight: check pending milestones
314
+ let pending = await countPendingMilestones(projectDir);
315
+ if (pending === 0) {
316
+ console.log("All milestones complete! Nothing to run.");
317
+ console.log('Create a PR with `gh pr create` or run `/forge:spec` to start a new project.');
318
+ process.exit(0);
319
+ }
320
+ // Banner
321
+ console.log("## Forge Auto-Chain (Ralph Loop)\n");
322
+ console.log(`**Milestones remaining:** ${pending}`);
323
+ console.log(`**Max iterations:** ${maxIterations}`);
324
+ console.log(`**Stop:** Ctrl+C\n`);
325
+ console.log("Each milestone runs in a fresh Claude session with full /forge:go pipeline.");
326
+ console.log("Output streams inline below.\n");
327
+ console.log("---\n");
328
+ const prompt = [
329
+ "You are executing one milestone of a forge auto-chain.",
330
+ 'Use the Skill tool: skill="forge:go", args="--single"',
331
+ "After the skill completes, stop.",
332
+ ].join("\n");
333
+ for (let i = 0; i < maxIterations; i++) {
334
+ const iteration = i + 1;
335
+ console.log(`\n=== Iteration ${iteration} (${pending} milestones remaining) ===\n`);
336
+ const result = spawnSync("claude", ["-p", prompt, "--dangerously-skip-permissions"], {
337
+ stdio: "inherit",
338
+ cwd: projectDir,
339
+ });
340
+ // Check exit code
341
+ if (result.status !== 0) {
342
+ console.error(`\nError: Claude session exited with code ${result.status ?? "unknown"}. Stopping.`);
343
+ console.log("Fix the issue, then run `npx forge run` again to resume.");
344
+ process.exit(1);
345
+ }
346
+ // Check pending count (stall detection)
347
+ const newPending = await countPendingMilestones(projectDir);
348
+ if (newPending === 0) {
349
+ console.log("\n---\n");
350
+ console.log("## All Milestones Complete!\n");
351
+ console.log(`Completed in ${iteration} iteration${iteration === 1 ? "" : "s"}.`);
352
+ console.log('Create a PR with `gh pr create` or run `/forge:spec` to start a new project.');
353
+ process.exit(0);
354
+ }
355
+ if (newPending >= pending) {
356
+ console.error(`\nStall detected: pending count did not decrease (was ${pending}, now ${newPending}). Stopping.`);
357
+ console.log("Fix the issue, then run `npx forge run` again to resume.");
358
+ process.exit(1);
359
+ }
360
+ pending = newPending;
361
+ }
362
+ console.error(`\nReached max iterations (${maxIterations}). Stopping.`);
363
+ console.log(`${pending} milestone${pending === 1 ? "" : "s"} remaining. Run \`npx forge run\` again to continue.`);
364
+ process.exit(1);
365
+ });
366
+ // ── helpers ────────────────────────────────────────────────────────
367
+ /**
368
+ * Get the verify cache path for the current branch.
369
+ * Returns: .forge/verify-cache/<branch-slug>.json
370
+ */
371
+ function getVerifyCachePath(projectDir, branch) {
372
+ let branchName = branch;
373
+ if (!branchName) {
374
+ try {
375
+ branchName = execSync("git branch --show-current", { encoding: "utf-8" }).trim();
376
+ }
377
+ catch {
378
+ branchName = "unknown";
379
+ }
380
+ }
381
+ const slug = branchName.replace(/\//g, "-").toLowerCase();
382
+ return join(projectDir, ".forge", "verify-cache", `${slug}.json`);
383
+ }
98
384
  function writeVerifyCache(projectDir, result) {
99
- const forgeDir = join(projectDir, ".forge");
100
- mkdirSync(forgeDir, { recursive: true });
101
385
  let branch = "unknown";
102
386
  try {
103
387
  branch = execSync("git branch --show-current", { encoding: "utf-8" }).trim();
104
388
  }
105
389
  catch { /* not a git repo */ }
390
+ const cachePath = getVerifyCachePath(projectDir, branch);
391
+ mkdirSync(dirname(cachePath), { recursive: true });
106
392
  const cache = {
107
393
  passed: result.passed,
108
394
  timestamp: new Date().toISOString(),
109
395
  gates: result.gates,
110
396
  branch,
111
397
  };
112
- writeFileSync(join(forgeDir, "last-verify.json"), JSON.stringify(cache, null, 2));
398
+ writeFileSync(cachePath, JSON.stringify(cache, null, 2));
113
399
  }
114
400
  function formatReport(result) {
115
401
  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,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,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,CAAC,CAAC,CAAC;IACjE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,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 {
@@ -66,14 +71,27 @@ export declare function buildFreshSessionPrompt(projectDir: string, prdPath: str
66
71
  * Returns the lowest-numbered pending milestone, or null if all are done.
67
72
  */
68
73
  export declare function findNextPendingMilestone(projectDir: string): Promise<MilestoneProgress | null>;
74
+ /**
75
+ * Count the number of pending (not complete/done) milestones in the roadmap.
76
+ *
77
+ * Used by `npx forge run` to determine if there are milestones to execute
78
+ * and to detect stalls (pending count should decrease each iteration).
79
+ */
80
+ export declare function countPendingMilestones(projectDir: string): Promise<number>;
69
81
  /**
70
82
  * Auto-chain orchestrator: manages multi-milestone execution with context resets.
71
83
  *
72
84
  * For each pending milestone:
73
85
  * 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
86
+ * 2. Creates a git worktree for isolated execution
87
+ * 3. Registers a session in the session registry
88
+ * 4. Builds a fresh-context prompt for the milestone agent
89
+ * 5. Calls the milestone context builder for structured data
90
+ * 6. Returns results so the calling skill can spawn agents and drive execution
91
+ * 7. On completion or failure, deregisters the session and cleans up the worktree
92
+ *
93
+ * The worktree is created ONCE per /forge:go session, not per milestone.
94
+ * All milestones in the chain execute in the same worktree.
77
95
  *
78
96
  * The chain stops on the first milestone failure, or when all milestones
79
97
  * are complete. The caller is responsible for actually executing each
@@ -86,8 +104,9 @@ export declare function runAutoChain(options: AutoChainOptions): Promise<AutoCha
86
104
  *
87
105
  * Handles:
88
106
  * 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
107
+ * 2. Committing milestone work to git (in the worktree if one was used)
108
+ * 3. Merging worktree branch into the feature branch (if worktree was used)
109
+ * 4. Returning the commit SHA for the milestone result
91
110
  *
92
111
  * The caller should update the MilestoneResult with the returned commit info.
93
112
  */
@@ -101,7 +120,27 @@ export declare function completeMilestone(options: {
101
120
  developer: string;
102
121
  filesToStage: string[];
103
122
  push?: boolean;
123
+ /** Path to the worktree used for execution. If set, commit happens in the worktree. */
124
+ worktreePath?: string;
125
+ /** Repository root, required when worktreePath is provided (for merge operations). */
126
+ repoRoot?: string;
104
127
  }): Promise<{
105
128
  commitResult: CommitResult;
106
129
  isLast: boolean;
107
130
  }>;
131
+ /**
132
+ * Build a parallel execution plan for all milestones in a PRD.
133
+ *
134
+ * Parses the PRD markdown for milestone definitions and `dependsOn` fields,
135
+ * builds a dependency DAG, and computes parallel execution waves showing
136
+ * which milestones can run simultaneously.
137
+ *
138
+ * If no `dependsOn` fields are found in the PRD, all milestones are treated
139
+ * as roots (no dependencies) and placed in a single wave. This is backward
140
+ * compatible — the caller can process them sequentially by milestone number.
141
+ *
142
+ * @param prdPath - Absolute path to the PRD markdown file
143
+ * @returns The wave schedule showing which milestones can run simultaneously
144
+ * @throws If a dependency cycle is detected or a referenced dependency doesn't exist
145
+ */
146
+ export declare function buildParallelPlan(prdPath: string): Promise<SchedulerResult>;