forgedock 1.0.21 → 1.1.1

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 (76) hide show
  1. package/README.md +227 -174
  2. package/bin/cinema.mjs +320 -0
  3. package/bin/demo.mjs +386 -0
  4. package/bin/engine/phases.mjs +148 -0
  5. package/bin/engine/projector.mjs +32 -0
  6. package/bin/engine/reconcile.mjs +11 -0
  7. package/bin/engine/runlog.mjs +79 -0
  8. package/bin/engine/state.mjs +27 -0
  9. package/bin/engine-cli.mjs +50 -0
  10. package/bin/engine.mjs +138 -0
  11. package/bin/forgedock.mjs +693 -1393
  12. package/bin/init-detect.mjs +95 -0
  13. package/bin/journey.mjs +783 -0
  14. package/bin/runner.mjs +847 -0
  15. package/bin/settings-hook.mjs +112 -0
  16. package/bin/tui.mjs +6 -3
  17. package/commands/autopilot.md +4 -4
  18. package/commands/cleanup.md +85 -39
  19. package/commands/deploy-info.md +11 -5
  20. package/commands/design-bench.md +1 -0
  21. package/commands/design-render-critique-loop.md +1 -0
  22. package/commands/design.md +1 -0
  23. package/commands/forge-stats.md +2 -1
  24. package/commands/issue.md +1 -1
  25. package/commands/optimize.md +1 -1
  26. package/commands/orchestrate.md +346 -34
  27. package/commands/quality-gate.md +168 -80
  28. package/commands/review-pr-agents.md +69 -45
  29. package/commands/review-pr.md +54 -6
  30. package/commands/scope.md +11 -3
  31. package/commands/security-audit.md +24 -16
  32. package/commands/sync-ecosystem.md +2 -2
  33. package/commands/work-on/build/architect.md +47 -3
  34. package/commands/work-on/build/context.md +36 -5
  35. package/commands/work-on/build/implement.md +16 -4
  36. package/commands/work-on/build/validate.md +54 -8
  37. package/commands/work-on/build.md +27 -9
  38. package/commands/work-on/close.md +131 -3
  39. package/commands/work-on/investigate.md +24 -1
  40. package/commands/work-on/review.md +24 -0
  41. package/commands/work-on-monolithic.md +1 -0
  42. package/commands/work-on.md +271 -11
  43. package/docs/BRAND.md +6 -2
  44. package/docs/CONFIG.md +39 -34
  45. package/docs/site/.vitepress/config.mjs +85 -0
  46. package/docs/site/annotations-explained.md +55 -0
  47. package/docs/site/command-learning-path.md +104 -0
  48. package/docs/site/command-reference.md +3 -0
  49. package/docs/site/getting-started.md +42 -13
  50. package/docs/site/index.md +1 -1
  51. package/docs/site/troubleshooting.md +208 -0
  52. package/docs/spec/forge-protocol-v1.md +768 -0
  53. package/docs/superpowers/plans/2026-07-03-cinematic-onboarding-tui.md +2339 -0
  54. package/docs/superpowers/plans/2026-07-03-durable-execution-engine.md +1223 -0
  55. package/docs/superpowers/specs/2026-07-03-cinematic-onboarding-tui-design.md +157 -0
  56. package/docs/superpowers/specs/2026-07-03-durable-execution-engine-design.md +194 -0
  57. package/examples/forgedock-demo/README.md +113 -0
  58. package/examples/forgedock-demo/bootstrap.sh +125 -0
  59. package/examples/forgedock-demo/issues/01-bug-delete-missing-auth.md +37 -0
  60. package/examples/forgedock-demo/issues/02-feature-filter-notes.md +37 -0
  61. package/examples/forgedock-demo/issues/03-refactor-router-table.md +33 -0
  62. package/examples/forgedock-demo/issues/04-perf-index-lookup.md +35 -0
  63. package/examples/forgedock-demo/issues/05-docs-api-reference.md +39 -0
  64. package/examples/forgedock-demo/labels.json +21 -0
  65. package/examples/forgedock-demo/package.json +16 -0
  66. package/examples/forgedock-demo/scripts/smoke.js +61 -0
  67. package/examples/forgedock-demo/src/auth.js +28 -0
  68. package/examples/forgedock-demo/src/db.js +66 -0
  69. package/examples/forgedock-demo/src/routes/notes.js +64 -0
  70. package/examples/forgedock-demo/src/server.js +79 -0
  71. package/package.json +13 -3
  72. package/scripts/verify-env-vars.sh +18 -2
  73. package/scripts/verify-host-headers.sh +4 -4
  74. package/scripts/verify-route-registration.sh +2 -2
  75. package/scripts/worktree-lifecycle.sh +202 -0
  76. package/templates/forge.yaml.minimal +44 -0
package/README.md CHANGED
@@ -4,282 +4,335 @@
4
4
 
5
5
  <h1>ForgeDock</h1>
6
6
 
7
- <p><strong>Autonomous software development for Claude Code.</strong></p>
7
+ <p><strong>Deterministic orchestration for autonomous software engineering.</strong></p>
8
8
 
9
- <p>ForgeDock turns every bug found, every fix shipped, and every review finding into structured context that makes the next agent smarter. It catches integration bugs that code review can't see — missing route registrations, env vars present in CI but absent in deploy, Docker permission mismatches, sibling code paths left unfixed. Every finding feeds back as a prevention rule for future builds. After thousands of issues on production codebases, the system catches bugs before they reach a testing branch.</p>
9
+ <p>LLMs generate the code. ForgeDock owns everything else — <strong>state, scheduling, recovery, review, and memory</strong> — as durable, inspectable structure on the GitHub you already have. Issues are the queue. PRs are the ledger. Annotations are the memory. Point it at an issue and get a merged, reviewed PR; point it at a <strong>milestone</strong> and get parallel pipelines with conflict-aware scheduling.</p>
10
+
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg" alt="License: AGPL-3.0" /></a>
12
+ <a href="https://github.com/RapierCraftStudios/ForgeDock/stargazers"><img src="https://img.shields.io/github/stars/RapierCraftStudios/ForgeDock?style=social" alt="GitHub Stars" /></a>
13
+ <a href="https://docs.anthropic.com/en/docs/claude-code"><img src="https://img.shields.io/badge/Built%20for-Claude%20Code-blueviolet" alt="Claude Code" /></a>
14
+ <a href="https://www.npmjs.com/package/forgedock"><img src="https://img.shields.io/npm/v/forgedock?color=cb3837&logo=npm" alt="npm" /></a>
15
+ <a href="https://www.npmjs.com/package/forgedock"><img src="https://img.shields.io/npm/dm/forgedock?color=cb3837&logo=npm&label=downloads" alt="npm downloads per month" /></a>
16
+ <a href="https://github.com/RapierCraftStudios/ForgeDock/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
17
+ <a href="https://github.com/sponsors/RapierCraftStudios"><img src="https://img.shields.io/badge/Sponsor-❤-ea4aaa.svg" alt="Sponsor" /></a>
18
+
19
+ </div>
10
20
 
11
- <a href="https://www.npmjs.com/package/forgedock"><img src="https://img.shields.io/npm/dm/forgedock?label=npm%20downloads&style=flat-square&color=CB3837" alt="npm downloads/month" /></a>&nbsp;
12
- <a href="https://www.npmjs.com/package/forgedock"><img src="https://img.shields.io/npm/v/forgedock?style=flat-square&color=CB3837" alt="npm version" /></a>&nbsp;
13
- <a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/forgedock?style=flat-square&color=339933" alt="node version" /></a>&nbsp;
14
- <a href="https://docs.anthropic.com/en/docs/claude-code"><img src="https://img.shields.io/badge/Built%20for-Claude%20Code-7C3AED?style=flat-square" alt="Claude Code" /></a>
15
21
  <br />
16
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square" alt="License: AGPL-3.0" /></a>&nbsp;
17
- <a href="https://github.com/RapierCraftStudios/ForgeDock/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome" /></a>
18
22
 
19
- <br /><br />
23
+ <div align="center">
20
24
 
21
- <img src="docs/demo.gif" alt="ForgeDock demo — parallel orchestration across 15+ issues" width="900" />
25
+ <img src="docs/demo.gif" alt="ForgeDock orchestrating multiple GitHub issues in parallel — agents investigate, build, review, and flip workflow labels through to merged" width="900" />
22
26
 
23
- <p><em>15+ issues orchestrated in parallel — investigated, built, reviewed, and shipped autonomously.</em></p>
27
+ <p><em><strong>One <code>/orchestrate</code> runs a whole milestone.</strong> Agents pick up issues in parallel, drive each through investigate → build → review, and flip the GitHub labels to <code>merged</code> — live.</em></p>
24
28
 
25
29
  </div>
26
30
 
27
- <br />
31
+ **This repository builds itself with ForgeDock.** In its first 30 days (June 4 → July 4, 2026): **693 issues filed, 605 closed, 603 PRs merged — median 56 minutes from open to merged-and-closed.** 57% of those issues were filed by the pipeline itself; 49% are findings its own review agents raised, filed, and then fixed. Every run leaves a public audit trail — [click through the receipts](#watch-the-machine-work), or count them yourself:
28
32
 
29
- ## Why ForgeDock
33
+ ```bash
34
+ gh issue list -R RapierCraftStudios/ForgeDock --state closed --limit 1000 --json number --jq 'length'
35
+ ```
30
36
 
31
- AI coding agents forget everything between sessions. They re-investigate the same bugs, miss context from past PRs, and make mistakes that were already caught and fixed last week. There's no institutional memory.
37
+ **A single run, up close** — a real one, [issue #1230](https://github.com/RapierCraftStudios/ForgeDock/issues/1230):
32
38
 
33
- ForgeDock fixes this by using **GitHub itself** as the memory layer. Every pipeline stage writes structured `FORGE:` annotations to issues and PRs. Every downstream agent reads them. When a new session starts — even after Claude's context resets — the agent queries GitHub and picks up exactly where the last one left off.
39
+ ```console
40
+ $ /work-on #1230 "orchestrate: Layer 5 co-change signal is dead code"
34
41
 
35
- ---
42
+ ✓ investigate CONFIRMED/HIGH — feature shipped 3h earlier (PR #1204) reads a
43
+ never-populated variable; the co-change query can never fire
44
+ ✓ build fix branch, 1 file
45
+ ✓ review caught a defect in the fix itself: stray backticks in the grep
46
+ meant every git-log pathspec silently matched zero commits —
47
+ "the fix would not have actually worked." Corrected.
48
+ ✓ merged 30m 37s → staging
49
+
50
+ filed by the pipeline's own staging review. fixed before a human read it.
51
+ ```
52
+
53
+ ### Try it in 30 seconds — on a throwaway repo, nothing to lose
36
54
 
37
- ## How Is This Different
55
+ ```bash
56
+ npx forgedock demo # spins up a risk-free demo repo and shows you the pipeline end to end
57
+ ```
38
58
 
39
- ForgeDock is **not another AI coding agent.** It's a set of prompt-engineered command specs (`.md` files) that run inside Claude Code. No new runtime, no separate process, no vendor lock-in beyond what you already use.
59
+ Ready to use it for real? **`npx forgedock`** walks you through one continuous setup: it checks your environment, installs the slash commands, reads your repo, and hands you a single annotated `forge.yaml` to review — you press Enter once.
40
60
 
41
- | | ForgeDock | Plain Claude Code | Cursor / Windsurf | Devin / Sweep |
42
- |---|---|---|---|---|
43
- | Memory across sessions | Structured annotations on GitHub | CLAUDE.md + manual notes | Per-project context | Proprietary cloud state |
44
- | Autonomous pipeline | Full lifecycle: investigate → merge | Manual, step by step | Autocomplete + chat | Autonomous but opaque |
45
- | Review quality | 9 domain-specialist agents | You review everything | Basic suggestions | Varies |
46
- | Infrastructure needed | None — just `npx forgedock` | None | IDE-specific | Cloud service |
47
- | Codebase visibility | Everything stays on GitHub | Local | Local + cloud sync | Cloud-only |
61
+ > ⭐ **If ForgeDock saves you time, [star the repo](https://github.com/RapierCraftStudios/ForgeDock/stargazers)** — it's the whole marketing budget.
48
62
 
49
63
  ---
50
64
 
51
- ## What You Get
65
+ **Your AI coding agent forgets everything after every session.** It re-explores the codebase from scratch, re-makes mistakes that were already fixed, and has no idea why the code it's touching looks the way it does. ForgeDock fixes that by making **GitHub itself the memory** — every pipeline stage writes structured findings that every later agent reads.
66
+
67
+ ## Without ForgeDock vs. With ForgeDock
52
68
 
53
- | Capability | How it works |
69
+ | Without ForgeDock | With ForgeDock |
54
70
  |---|---|
55
- | **Full-lifecycle automation** | `/work-on #42` — investigates the issue, architects a fix, builds it, runs quality gates, opens a PR, and reviews it. You click merge. |
56
- | **Persistent agent memory** | Structured `FORGE:` annotations on GitHub issues/PRs survive context resets and session boundaries. Agents never start blind. |
57
- | **9 specialist review agents** | Security, billing, database, concurrency, auth, frontend, API, performance, infrastructure — every PR gets domain-expert review. |
58
- | **Institutional memory that compounds** | Agent fixing issue #43 reads the investigation from #42 and applies the known pattern — no re-investigation. |
59
- | **Self-improving pipeline** | Review agents learn from past findings — recurring patterns automatically become new quality gate checks. |
60
- | **Parallel orchestration** | `/orchestrate` decomposes milestones into waves and runs `/work-on` on each in parallel. |
71
+ | Agent starts every session blind — no context from prior work | Agent reads structured investigation, root cause, and history straight from GitHub |
72
+ | The same bugs get reintroduced across PRs | Review agents surface known pitfalls from past PRs *before* you commit |
73
+ | A crash or compaction loses the run | State lives on GitHub and in an event-sourced run log — the pipeline resumes where it stopped |
74
+ | You write the issue, plan the fix, open the PR, and review it | `/work-on #42` → investigated, built, reviewed, merged |
75
+ | Review depends on whoever has capacity | 9 domain-specialist agents (security, billing, DB, concurrency…) review every PR |
76
+ | One task at a time, serialized by your attention | `/orchestrate` runs a whole milestone — many issues in parallel, each its own full pipeline |
61
77
 
62
- > **Cost note:** ForgeDock itself is free and open-source. It orchestrates Claude Code sessions, so you pay your normal Anthropic API usage. A typical `/work-on` run on a straightforward bug uses roughly the same tokens as a 15–20 minute manual Claude Code session.
78
+ ---
63
79
 
64
- <details>
65
- <summary><strong>See a real pipeline run</strong></summary>
80
+ ## The idea in one paragraph
66
81
 
67
- Here's what a real run looks like on [issue #619](https://github.com/RapierCraftStudios/ForgeDock/issues/619) — a performance bug where command specs were burning ~200K tokens in context:
82
+ AI agents have **no lookback**. They don't know a function was shaped by a bug fix in #347, that an approach was tried and reverted in PR #891, or that three other files need the same change. Context window isn't the bottleneck — **memory is.** But GitHub already stores everything an agent needs: commits, PRs, issues, blame, cross-references. It's a citation graph; agents just don't use it as one. ForgeDock makes every stage write **machine-readable annotations** to issues and PRs, and every downstream agent read them. The `gh` CLI becomes the query interface to institutional memory. The result: agents that follow structured data, not vibes.
68
83
 
69
84
  ```
70
- FORGE:INVESTIGATOR → CONFIRMED. All 27 command spec files (848KB) load into
71
- context at session start via symlinks. ~200K tokens wasted.
72
-
73
- FORGE:CONTRACT → Replace symlink-based install with stub-file pattern.
74
- Installer parses frontmatter, writes minimal stubs.
85
+ ┌──────────────────────────────────────────────────────────────────┐
86
+ │ GITHUB (Knowledge Graph) │
87
+ │ │
88
+ │ Issues: FORGE:INVESTIGATOR → FORGE:CONTEXT → FORGE:ARCHITECT │
89
+ │ → FORGE:TRAJECTORY (the run's full audit trail) │
90
+ │ PRs: FORGE:BUILDER → structured review FINDING blocks │
91
+ │ Links: git blame → commit → PR → issue → related issues │
92
+ │ │
93
+ │ Every agent reads this. Every agent writes to it. │
94
+ │ Nothing is lost between conversations. │
95
+ └──────────────────────────────────────────────────────────────────┘
96
+ ```
75
97
 
76
- FORGE:CONTEXT → Issue #577: install() had overly broad catch{} — fixed to
77
- check err.code === 'ENOENT'. Issue #587: Windows writes
78
- regular files, not symlinks — keep both paths working.
98
+ ---
79
99
 
80
- FORGE:ARCHITECT → 3 new functions in bin/forgedock.mjs: parseFrontmatter(),
81
- generateStubContent(), updated install() flow.
100
+ ## Watch the machine work
82
101
 
83
- FORGE:BUILDER → Branch feat/stub-install-pattern-619, 1 file changed.
102
+ Not a staged demo — these are real, public runs on this repository. Open any of them and read the full trail:
84
103
 
85
- FORGE:REVIEW → Auto-merged to staging.
104
+ - **[#1230](https://github.com/RapierCraftStudios/ForgeDock/issues/1230)** — the pipeline's staging review caught dead code in a feature the pipeline had shipped three hours earlier; review then caught a bug in the fix itself. Intent to merged: **30 minutes**.
105
+ - **[#1172](https://github.com/RapierCraftStudios/ForgeDock/issues/1172)** — review found an `ANTHROPIC_API_KEY` exfiltration path in the headless runner (an in-process file read bypassed the env scrub), with exact line evidence. Fixed and merged in **18 minutes**, with regression tests. A later re-review found a second-order bypass of the first fix ([#1243](https://github.com/RapierCraftStudios/ForgeDock/issues/1243)) — the pipeline red-teams its own fixes.
106
+ - **[#952](https://github.com/RapierCraftStudios/ForgeDock/issues/952)** — the investigator closed the pipeline's *own proposal* as INVALID with receipts: the deliverable had already shipped weeks earlier. Zero code written, 34 minutes, full explanation.
107
+ - **[#1256](https://github.com/RapierCraftStudios/ForgeDock/issues/1256)** — decomposition that respects the existing graph: it created only the two net-new sub-issues no open issue already claimed, then sequenced three existing issues into the dependency order.
108
+ - **[#1322](https://github.com/RapierCraftStudios/ForgeDock/issues/1322)** — a heavyweight feature (the durable execution engine itself): 9 TDD tasks, whole-branch review caught two Criticals pre-merge, merged in **under 2 hours**.
86
109
 
87
- FORGE:TRAJECTORY → Full audit trail recorded.
88
- ```
110
+ And the part that makes it compound — the context phase citing past bugs *by number* before a line is written (from [#1196](https://github.com/RapierCraftStudios/ForgeDock/issues/1196)):
89
111
 
90
- The context phase surfaced two historical bugs (#577, #587) in the same module — preventing the builder from repeating known mistakes. [View the full issue →](https://github.com/RapierCraftStudios/ForgeDock/issues/619)
112
+ > "`commands/orchestrate.md` has a dense review-finding history from PR #1081/#1107/#1126… associative-array declaration mistakes (#1113), array-element removal via pattern substitution corrupting partial matches (#1108)… the new Layer 5 subsection should not introduce a competing edge-direction convention that could reintroduce a cycle class."
91
113
 
92
- </details>
114
+ > Numbers on this page are point-in-time (2026-07-04), from this repository's first 30 days of dogfooding. A reproducible cost-per-issue benchmark is a hard gate on our own launch plan — [#1264](https://github.com/RapierCraftStudios/ForgeDock/issues/1264): no estimated efficiency claims.
93
115
 
94
116
  ---
95
117
 
96
- ## Install
118
+ ## Orchestrate an entire milestone
97
119
 
98
- **Requirements:** [Node.js 18+](https://nodejs.org/), [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [GitHub CLI (`gh`)](https://cli.github.com/), [`yq`](https://github.com/mikefarah/yq) (YAML parser used by pipeline commands to read `forge.yaml`), and **[Playwright MCP](https://github.com/microsoft/playwright-mcp)** (browser automation for `/qa-sweep` and visual testing commands)
120
+ `/work-on` ships one issue. **`/orchestrate` ships a milestone.** It decomposes the milestone into dependency-ordered waves and runs a full `/work-on` pipeline on each issue **in parallel** — investigating, building, reviewing, and merging many at once, while GitHub labels track every agent's state live. On this repo's record day, that meant **29 issues taken to merged inside a single hour**.
99
121
 
100
- > **Playwright MCP** is a guaranteed ForgeDock dependency for browser automation commands. Register it in Claude Code after installing ForgeDock:
101
- > ```bash
102
- > claude mcp add playwright npx @playwright/mcp@latest
103
- > ```
104
- > Verify with `npx forgedock doctor` — Check 9 confirms Playwright MCP is registered.
122
+ Scheduling is conflict-aware before it is parallel. Five detection layers decide what may run concurrently: same-file overlap, directory proximity, shared-module fan-in, a conservative fallback when file extraction is low-confidence, and **historical co-change coupling mined from `git log`** — files that changed together in the past are assumed to conflict now. Database-touching issues are always serialized. The resulting graph is cycle-checked (Kahn's algorithm) and executed in topologically sorted waves; overlapping work is expressed as ordinary `Depends on #N` edges anyone can read.
105
123
 
106
- ```bash
107
- # Install pipeline commands
108
- npx forgedock
124
+ <div align="center">
125
+ <img src="assets/orchestration.svg" alt="One milestone fanned out into parallel work-on pipelines, each issue advancing through investigating, building, in-review, and merged" width="920" />
126
+ </div>
109
127
 
110
- # Generate config for your repo
111
- npx forgedock init
128
+ ```bash
129
+ /orchestrate milestone/checkout-v2 # decompose → conflict-aware waves → merged PRs
112
130
  ```
113
131
 
114
- This symlinks 25+ pipeline commands into `~/.claude/commands/` and generates a `forge.yaml` config in your project root. That's it — open Claude Code and run `/work-on #42`.
115
-
116
- <details>
117
- <summary><strong>Other install methods & commands</strong></summary>
132
+ ---
118
133
 
119
- **Claude Code Plugin Marketplace** (v2.1.143+):
120
- ```
121
- /plugin marketplace add RapierCraftStudios/ForgeDock
122
- /plugin install forgedock@forgedock
123
- ```
134
+ ## How it works
124
135
 
125
- **CLI commands:**
126
- ```bash
127
- npx forgedock update # Pull latest commands
128
- npx forgedock uninstall # Remove all ForgeDock commands from ~/.claude/commands/
129
- npx forgedock help # Show all available commands
130
- ```
136
+ Each stage reads the structured output of the stages before it and writes its own findings back:
131
137
 
132
- **AI-powered setup** (inside Claude Code):
133
138
  ```
134
- /forgedock-init # Guided config walkthrough — scans your repo, queries GitHub, auto-fills forge.yaml
139
+ Issue → Investigate → Context → Architect → Build → Quality Gate → Review → Merge
140
+ └──────────── each stage reads & writes GitHub ────────────┘
135
141
  ```
136
142
 
137
- </details>
143
+ | Stage | Reads | Writes |
144
+ | --- | --- | --- |
145
+ | **Investigate** | Issue body, `git blame`, related issues/PRs | `FORGE:INVESTIGATOR` — verdict, root cause, affected files, severity |
146
+ | **Context** | Historical findings from related PRs, known pitfalls | `FORGE:CONTEXT` — institutional memory for this module |
147
+ | **Architect** | Investigation + context | `FORGE:ARCHITECT` — ordered plan, code paths, risks |
148
+ | **Build** | Everything above | `FORGE:BUILDER` — branch, commits, files changed |
149
+ | **Quality Gate** | Builder output, domain-specific checks | gate results, recorded in the run's trajectory |
150
+ | **Review** | PR diff, contract, gate results | `FORGE:REVIEW_STARTED` on the issue; per-agent findings as structured `FINDING` blocks on the PR |
151
+ | **Close** | All of the above | `FORGE:TRAJECTORY` — the full audit trail of the run |
138
152
 
139
- ---
153
+ **GitHub as the database.** Every annotation is wrapped in an HTML comment (`<!-- FORGE:INVESTIGATOR -->`) that makes it machine-parseable. When an agent starts — even in a brand-new conversation after compaction — it queries the issue via `gh` and reconstructs full context from these tags. Workflow labels (`workflow:investigating`, `workflow:in-review`, `workflow:merged`…) track state, and the pipeline resumes from whatever state GitHub reports. The annotation format is an open standard — see the [FORGE Annotation Protocol](docs/FORGE-PROTOCOL.md).
140
154
 
141
- ## Global Command Namespace
155
+ **Durable by design.** Headless runs are backed by a real execution engine, not prompt-hope: every phase transition is appended to an event-sourced, crash-safe run log, mirrored to the issue as a compact `FORGE:STATE` index, and guarded by leases so two agents can never own the same issue. Kill the process mid-run and restart it — the engine reconciles local state against GitHub (GitHub wins), adopts branches and PRs that already exist instead of re-running the LLM, and escalates to `needs-human` after bounded retries instead of looping. Phase selection is a pure rule-based state machine: **the engine, not the model, decides what happens next.** The headless core shipped in [PR #1326](https://github.com/RapierCraftStudios/ForgeDock/pull/1326); wiring the interactive path onto the same engine is in progress ([#1323](https://github.com/RapierCraftStudios/ForgeDock/issues/1323)–[#1325](https://github.com/RapierCraftStudios/ForgeDock/issues/1325)).
142
156
 
143
- ForgeDock owns the **global** `~/.claude/commands/` namespace. When `npx forgedock` runs, it symlinks all pipeline commands there and writes a `.symlink-source` sentinel file so other installers can detect the owner:
157
+ **Domain-specialist review.** Every PR is reviewed by agents with deep, narrow expertise — Security, Auth & Access Control, Billing Integrity, Database, Concurrency, Frontend, API, Performance, Infrastructure. Findings carry a confidence level, and a **reproduction gate** keeps them honest: a finding only blocks if the reviewer traced an actual code path or input that triggers it — pattern-match suspicions are downgraded, not merged into noise. Findings above the severity threshold are **automatically filed as new issues** that enter the same pipeline: on this repo, that loop produced 49% of all issues ever filed.
144
158
 
145
- ```
146
- ~/.claude/commands/
147
- .symlink-source ← sentinel: "ForgeDock owns this namespace"
148
- work-on.md → /path/to/forgedock/commands/work-on.md
149
- review-pr.md → /path/to/forgedock/commands/review-pr.md
150
- ...
151
- ```
159
+ **It measures itself.** `/pipeline-health` correlates every prompt change against review-finding rates, build failures, and manual fix-up commits, then files its own report — including failing grades — as an issue. `/autopilot` pulls production signals (errors, CI failures, stale issues, analytics), files issues from them, and optionally runs `/work-on` on the top ones. The pipeline also invalidates its own bad ideas: proposals that turn out to be already-shipped or wrong are closed `workflow:invalid` with the reasoning attached ([example](https://github.com/RapierCraftStudios/ForgeDock/issues/952)).
152
160
 
153
- **Project-specific commands** should install to the **project-local** `.claude/commands/` directory instead:
161
+ ---
154
162
 
155
- ```
156
- your-project/
157
- .claude/
158
- commands/
159
- my-custom-command.md ← project-local — Claude Code merges these in
160
- ```
163
+ ## Built for the ways agents fail
161
164
 
162
- Claude Code merges global (`~/.claude/commands/`) and project-local (`.claude/commands/`) automatically. Project-local commands win on name collisions.
165
+ Every mechanism above exists because autonomous agents fail in predictable ways. The skeptics are right about the failure modes — the answer is structure, not optimism:
163
166
 
164
- If another tool runs its own install script that targets `~/.claude/commands/`, it will silently repoint ForgeDock's symlinks to its own source path — breaking all ForgeDock commands globally. The `.symlink-source` sentinel is a machine-readable warning to other installers; ForgeDock also emits a per-command warning during `npx forgedock install` when it detects a collision.
167
+ | "We've all seen this go wrong…" | The mechanism |
168
+ | --- | --- |
169
+ | Parallel agents just turn typing time into *reading* time | Review is a pipeline stage: domain specialists with confidence ratings and a reproduction gate — not a pile of raw diffs |
170
+ | Agents game their own checks (or delete the tests) | Builders never grade their own work — the quality gate and reviewers are separate agents reading the diff cold |
171
+ | Third retry = increasingly creative excuses | Engine-owned state machine: bounded retries, then escalation to `needs-human` |
172
+ | One runaway agent wrecks the codebase | 1 issue = 1 agent, bounded by decomposition; conflict-aware scheduling; isolated worktrees |
173
+ | No institutional memory — "it can't read the Slack thread from 2023" | Every run writes citable annotations to GitHub; the context phase quotes past bugs by number |
174
+ | No way to tell when an agent drifts | A `FORGE:TRAJECTORY` receipt on the issue records what every phase actually did |
175
+ | Humans rubber-stamp 95%-good output | Specialist review raises the floor *before* a human looks at the PR |
176
+ | The economics are opaque | ForgeDock runs on your existing Claude account — it resells no compute and takes no per-task cut. Cost-per-issue benchmarks are tracked in the open ([#1264](https://github.com/RapierCraftStudios/ForgeDock/issues/1264)) |
165
177
 
166
178
  ---
167
179
 
168
- ## How It Works
169
-
170
- ```
171
- Issue → Investigate → Architect → Build → Quality Gate → Review → Merge
172
- ↓ ↓ ↓ ↓ ↓
173
- writes to reads from reads from reads from writes to
174
- GitHub GitHub GitHub GitHub GitHub
175
- ```
180
+ ## Commands
176
181
 
177
- Each stage writes a structured annotation (`<!-- FORGE:INVESTIGATOR -->`, `<!-- FORGE:CONTRACT -->`, etc.) to the GitHub issue or PR. Each downstream stage reads what came before. The `gh` CLI is the query interface.
182
+ **The core loop:**
178
183
 
179
- | Stage | What it does |
180
- |---|---|
181
- | **Investigate** | Traces root cause via `git blame`, related issues/PRs. Writes verdict, affected files, severity. |
182
- | **Context** | Surfaces historical bugs and known pitfalls from the same module. Institutional memory. |
183
- | **Architect** | Produces ordered implementation plan with exact file/function/line targets. |
184
- | **Build** | Writes code, creates branch, makes commits. Follows the architect's plan. |
185
- | **Quality Gate** | 14+ domain-specific checks (security, auth, DB, concurrency, etc.) |
186
- | **Review** | 9 specialist agents review the PR diff with confidence-rated findings. |
187
- | **Close** | Records full audit trail as `FORGE:TRAJECTORY`. |
184
+ | Command | What it does |
185
+ | --- | --- |
186
+ | **`/work-on`** | Full issue lifecycle: investigate → build → quality gate → review → merge |
187
+ | `/orchestrate` | A whole milestone in parallel — conflict-aware waves, one pipeline per issue |
188
+ | `/issue` | Creates pipeline-ready GitHub issues |
189
+ | `/milestone` | Create, manage, and ship milestones |
190
+ | `/review-pr` | Context-aware PR review with domain-specialist agents |
191
+ | `/quality-gate` | Pre-commit checks, gated by the domains your change actually touches |
192
+ | `/test-gate` | Acceptance verification against running code before anything deploys |
188
193
 
189
- Labels track workflow state (`workflow:investigating`, `workflow:building`, `workflow:in-review`, `workflow:merged`). The pipeline resumes from whatever state GitHub says it's in — restart-safe by design.
194
+ **Observe & recover** — the durable-state story, as commands:
190
195
 
191
- ---
196
+ | Command | What it does |
197
+ | --- | --- |
198
+ | `/pipeline-status` | Fleet view of every in-flight issue, straight from workflow labels |
199
+ | `/pipeline-resume` | Resume an interrupted run from whatever state GitHub reports |
200
+ | `/diagnose` | Trace why a run failed, from its annotations |
201
+ | `/explain` | Translate the FORGE annotations on any issue into plain language |
202
+ | `/replay` | Replay a past run's full audit trail |
203
+ | `/changelog` | Release notes assembled from merged PRs and trajectory receipts |
192
204
 
193
- ## Commands
205
+ **Ops:**
194
206
 
195
207
  | Command | What it does |
196
- |---|---|
197
- | **`/work-on #N`** | Full issue lifecycle: investigate → build → review → merge |
198
- | `/issue` | Create a pipeline-ready GitHub issue |
199
- | `/orchestrate` | Parallel execution across a milestone's issues |
200
- | `/review-pr` | PR review with 9 domain-specialist agents |
201
- | `/quality-gate` | Pre-commit checks across 14+ domains |
202
- | `/milestone` | Plan and ship milestones |
203
- | `/deploy-info` | Staging vs main diff with risk assessment |
204
- | `/review-pr-staging` | Staging-to-main review gate |
208
+ | --- | --- |
209
+ | `/deploy-info` | Staging vs. main diff with risk assessment |
205
210
  | `/rollback` | Automated revert PR for production incidents |
206
- | `/incident-response` | P0 coordination: hotfix, timeline, postmortem |
207
- | `/autopilot` | Autonomous improvement: recon → triage → fix |
208
- | `/pipeline-health` | Self-analysis and prompt tuning |
209
- | `/security-audit` | 4-phase security posture audit |
210
- | `/qa-sweep` | Full platform QA via browser automation |
211
- | `/analytics` | Pull metrics from GSC, Clarity, Umami, Stripe |
212
- | `/cleanup` | Sweep stale issues, branches, worktrees |
211
+ | `/autopilot` | Production signals → triaged issues → fixes |
212
+ | `/security-audit` | Multi-phase security posture audit |
213
+ | `/cleanup` | Sweeps stale issues, branches, worktrees |
214
+
215
+ More ship today (web-property analytics, browser QA sweeps, self-benchmarking) — see the [full command reference](docs/site/command-reference.md). A leaner, tiered install that keeps the core loop front and center is planned in [#1257](https://github.com/RapierCraftStudios/ForgeDock/issues/1257).
213
216
 
214
217
  ---
215
218
 
216
- ## Uninstall
219
+ ## Install
220
+
221
+ **Requirements:** [Claude Code](https://docs.anthropic.com/en/docs/claude-code) · [GitHub CLI](https://cli.github.com/) (authenticated) · Node.js ≥ 18.
217
222
 
218
223
  ```bash
219
- npx forgedock uninstall
224
+ npx forgedock # checks your environment, installs the commands, detects your repo, and hands you a reviewed forge.yaml
220
225
  ```
221
226
 
222
- Removes all ForgeDock command symlinks from `~/.claude/commands/`. Your `forge.yaml` config and any `FORGE:` annotations on GitHub issues/PRs are left untouched.
227
+ One command does everything: it checks your environment, installs the slash commands into Claude Code, detects your repo (owner, branches, paths), and hands you a single annotated `forge.yaml` to review — press Enter to accept. Run `npx forgedock init` any time afterward to re-generate the config only.
223
228
 
224
- ---
229
+ Installing also registers a SessionStart hook, so every Claude Code session
230
+ in a forge-managed directory starts already knowing ForgeDock runs it.
231
+ Per-directory control: `npx forgedock enable` / `disable` / `status`.
225
232
 
226
- ## FAQ — How is ForgeDock different from X?
233
+ Then just open Claude Code and run `/work-on <issue>`.
227
234
 
228
- **vs. DeepWiki (Devin)** — DeepWiki generates a read-only wiki from your codebase once. ForgeDock's FORGE annotations are written by pipeline agents during every issue run — capturing root causes, architectural decisions, and review findings as they happen, not as a snapshot of static code.
235
+ > **Cost:** ForgeDock is free and open-source. It orchestrates sessions on **your** Claude account — no compute resold, no per-task markup. A typical `/work-on` run on a straightforward bug costs about what a 15–20 minute manual Claude Code session does.
229
236
 
230
- **vs. AGENTS.md / CLAUDE.md** — These files are written and maintained by you. They capture conventions and rules. ForgeDock annotations are written automatically by pipeline agents and capture execution history — what bugs were confirmed, what fixes were shipped, what review findings recurred. Use both: CLAUDE.md for conventions, ForgeDock for institutional memory.
237
+ <details>
238
+ <summary><strong>Other install options & commands</strong></summary>
231
239
 
232
- **vs. Cursor Memories** — Cursor Memories are scoped to the Cursor IDE's backend and don't survive a Claude Code context reset. ForgeDock annotations live on GitHub — any agent, any tool, any human can read them. When Claude's context window compacts mid-session, a ForgeDock agent queries GitHub and resumes exactly where it left off.
240
+ **Claude Code plugin marketplace** (Claude Code v2.1.143+):
233
241
 
234
- **vs. Devin Knowledge Base** — Devin's KB is proprietary, opaque, and vendor-locked. ForgeDock context is plain GitHub issue comments — readable, editable, and queryable with `gh api`. No vendor lock-in, no black box.
242
+ ```
243
+ /plugin marketplace add RapierCraftStudios/ForgeDock
244
+ /plugin install forgedock@forgedock
245
+ ```
235
246
 
236
- [Full comparison →](docs/comparison.md)
247
+ Commands then appear as `/forgedock:work-on`, etc. You still run `npx forgedock init` to generate `forge.yaml`.
237
248
 
238
- ---
249
+ **Headless / CI:** the pipeline also runs outside Claude Code. `npx forgedock run work-on <issue> --dry-run` previews the assembled prompt and tool plan; with an `ANTHROPIC_API_KEY`, `npx forgedock run` drives the same command specs through a hardened tool-use loop, and `npx forgedock run-issue <issue>` executes them on the durable engine (event-sourced run log, leases, crash-safe resume).
250
+
251
+ **Maintenance:**
252
+
253
+ ```bash
254
+ npx forgedock update # relink commands + refresh the SessionStart hook
255
+ npx forgedock enable # turn ForgeDock on for this directory
256
+ npx forgedock disable # turn ForgeDock off for this directory
257
+ npx forgedock status # show ForgeDock's state for this directory
258
+ npx forgedock doctor # installation health check with fix hints
259
+ npx forgedock uninstall # remove commands, the hook, and tracked copies
260
+ npx forgedock help # show everything
261
+ ```
239
262
 
240
- ## Documentation
263
+ > Running `npx forgedock` from *inside* this repo uses the local working tree. From your own project, use `npx forgedock@latest` to pin the published release.
241
264
 
242
- - [Getting Started in 5 Minutes](docs/site/getting-started.md) — install, configure, first pipeline run
243
- - [How the Knowledge Graph Works](docs/site/how-it-works.md) — FORGE annotations, context relay, compaction resilience
244
- - [ForgeDock vs. Manual Workflows](docs/site/vs-manual-workflows.md) — structured pipelines vs. ad-hoc prompting
245
- - [ForgeDock vs. DeepWiki, AGENTS.md, and Cursor Memories](docs/comparison.md) — structural differences between context tools
246
- - [FORGE Annotation Protocol](docs/site/forge-annotation-protocol.md) — open standard spec for AI context passing
247
- - [Command Reference](docs/site/command-reference.md) — all 25+ commands with usage and examples
265
+ </details>
248
266
 
249
267
  ---
250
268
 
251
- ## Star History
269
+ ## For companies
252
270
 
253
- <a href="https://star-history.com/#RapierCraftStudios/ForgeDock&Date">
254
- <picture>
255
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=RapierCraftStudios/ForgeDock&type=Date&theme=dark" />
256
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=RapierCraftStudios/ForgeDock&type=Date" />
257
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=RapierCraftStudios/ForgeDock&type=Date" />
258
- </picture>
259
- </a>
271
+ The core is AGPL-3.0 and stays that way: engineers run the full pipeline on their own Claude account, forever free.
272
+
273
+ Two things are for sale:
274
+
275
+ - **A [commercial license](COMMERCIAL-LICENSE.md)** — for organizations that need ForgeDock inside proprietary workflows or products without AGPL copyleft obligations. Contact [licensing@rapiercraft.studio](mailto:licensing@rapiercraft.studio).
276
+ - **The fleet layer** *(in development)* — org-wide observability over every pipeline run: the receipts on this page, live, across all your repos, plus policy controls and audit-grade provenance for autonomous merges. We're onboarding a small group of design partners — [open a Discussion](https://github.com/RapierCraftStudios/ForgeDock/discussions) or email the address above to get in early.
260
277
 
261
278
  ---
262
279
 
263
- ## Contributing
280
+ ## Where it's going
264
281
 
265
- PRs welcome. Every change goes through a PR, tested against 3+ scenarios, using conventional commits (`fix(command):`, `feat(command):`, `refactor(command):`).
282
+ Month one built the execution layer. The open roadmap — tracked in the [five-foundations epic (#1320)](https://github.com/RapierCraftStudios/ForgeDock/issues/1320) — is about earning trust while unattended:
266
283
 
267
- ## License
284
+ 1. **Durability** — engine-owned state instead of prose-owned state. Headless core shipped ([PR #1326](https://github.com/RapierCraftStudios/ForgeDock/pull/1326)); interactive wiring in progress.
285
+ 2. **Verification** — an outcome-based acceptance gate and a graded eval corpus, so "done" is machine-checkable before anything claims success.
286
+ 3. **Learning** — per-codebase memory that compounds across runs.
287
+ 4. **Economics** — per-run cost accounting and risk×cost dispatch decisions.
288
+ 5. **Provenance** — signed, replayable records of every autonomous change.
268
289
 
269
- ForgeDock uses a **dual-licensing model**:
290
+ Marketing is held to the same standard: [#1264](https://github.com/RapierCraftStudios/ForgeDock/issues/1264) gates our own launch on measured cost-per-issue benchmarks — no estimated claims.
270
291
 
271
- - **[AGPL-3.0](LICENSE)** — free to use, modify, and distribute for open-source and personal use. If you modify ForgeDock and offer it as a service (including over a network), you must open-source your modifications under AGPL-3.0.
292
+ ---
293
+
294
+ ## Show your support
272
295
 
273
- - **[Commercial License](COMMERCIAL-LICENSE.md)** — for organizations that need to use ForgeDock in proprietary workflows or products without AGPL-3.0 copyleft obligations. [Contact RapierCraft Studios](mailto:licensing@rapiercraft.studio) to obtain a commercial license.
296
+ Using ForgeDock in your pipeline? Add the badge — each one is a backlink and a signal to other developers:
274
297
 
275
- The open-source core remains free under AGPL-3.0. The commercial license is an exception for customers who cannot meet the copyleft requirements.
298
+ ```markdown
299
+ [![Built with ForgeDock](https://raw.githubusercontent.com/RapierCraftStudios/ForgeDock/main/assets/built-with-forgedock.svg)](https://github.com/RapierCraftStudios/ForgeDock)
300
+ ```
301
+
302
+ [![Built with ForgeDock](assets/built-with-forgedock.svg)](https://github.com/RapierCraftStudios/ForgeDock)
276
303
 
277
304
  ---
278
305
 
306
+ ## Star History
307
+
279
308
  <div align="center">
280
309
 
281
- <p>Built by <a href="https://github.com/RapierCraftStudios">RapierCraft Studios</a></p>
310
+ <a href="https://star-history.com/#RapierCraftStudios/ForgeDock&Date">
311
+ <picture>
312
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=RapierCraftStudios/ForgeDock&type=Date&theme=dark" />
313
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=RapierCraftStudios/ForgeDock&type=Date" width="600" />
314
+ </picture>
315
+ </a>
316
+
317
+ </div>
282
318
 
283
- <a href="https://github.com/sponsors/RapierCraftStudios"><img src="https://img.shields.io/badge/Sponsor-%E2%9D%A4-ea4aaa.svg?style=flat-square" alt="Sponsor" /></a>
319
+ ---
284
320
 
321
+ ## Docs & community
322
+
323
+ - [Getting Started in 5 Minutes](docs/site/getting-started.md)
324
+ - [How the Knowledge Graph Works](docs/site/how-it-works.md)
325
+ - [What Are Those FORGE Comments?](docs/site/annotations-explained.md) — 2-minute explainer for annotations you meet in the wild
326
+ - [FORGE Annotation Protocol](docs/FORGE-PROTOCOL.md) — the open standard for AI context passing ([formal v1.0 spec](docs/spec/forge-protocol-v1.md))
327
+ - [ForgeDock vs. Manual Claude Code Workflows](docs/site/vs-manual-workflows.md)
328
+ - [ForgeDock vs. DeepWiki, AGENTS.md, and Cursor Memories](docs/comparison.md)
329
+ - [Command Learning Path](docs/site/command-learning-path.md) — which commands to learn first
330
+ - [Complete Command Reference](docs/site/command-reference.md)
331
+ - [Troubleshooting & Recovery](docs/site/troubleshooting.md)
332
+
333
+ **Contributing:** PRs welcome — every change goes through a PR, tested against 3+ scenarios, using conventional commits (`fix(command):`, `feat(command):`). **License:** [AGPL-3.0](LICENSE) — free to use, modify, and distribute; network use of modifications must be open-sourced under the same license. Commercial licenses are available for proprietary use — see [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md).
334
+
335
+ <div align="center">
336
+ <br />
337
+ <p>Built and dogfooded in production by <a href="https://github.com/RapierCraftStudios">RapierCraft Studios</a>.</p>
285
338
  </div>