forgedockcli
v1.8.3
Published
Provider-neutral software delivery workflows with GitHub as durable institutional memory.
Maintainers
Readme
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, or count them yourself:
gh issue list -R RapierCraftStudios/ForgeDock --state closed --limit 1000 --json number --jq 'length'A single run, up close — a real one, issue #1230:
$ /work-on #1230 "orchestrate: Layer 5 co-change signal is dead code"
✓ investigate CONFIRMED/HIGH — feature shipped 3h earlier (PR #1204) reads a
never-populated variable; the co-change query can never fire
✓ build fix branch, 1 file
✓ review caught a defect in the fix itself: stray backticks in the grep
meant every git-log pathspec silently matched zero commits —
"the fix would not have actually worked." Corrected.
✓ merged 30m 37s → staging
filed by the pipeline's own staging review. fixed before a human read it.Launch the ForgeDock terminal
Requires: GitHub CLI (authenticated), Node.js ≥ 22.19, and credentials for any Pi-supported model provider.
npm install -g forgedockcli
forgedockcliThe published package is forgedockcli; forgedock remains an executable
alias for compatibility with existing installations and scripts.
When testing unpublished changes from a source checkout, use the checkout-safe launcher instead:
npm run terminalnpx forgedockcli resolves the installed/cached ForgeDock Next package; it does not implicitly run unpublished files from the current repository. Use /forgedock-runtime to verify the semantic-tools+live-subagents-v2 runtime, bundled delegation bridge, and resolved package root on demand; the idle terminal does not reserve space for a persistent runtime widget.
When orchestration is active, press ← or ↓ on an empty editor to focus the worker fleet, select a worker, and press Enter to open its live controller transcript. ForgeDock expands tool arguments and streaming output by default; press x (or Ctrl+O) to toggle the compact view.
ForgeDock now ships a source-maintained Pi fork with ForgeDock's Chrome & Ember identity. First launch guides you through terminal appearance, provider authentication, and explicit model selection. The terminal exposes native /deep-plan plus controller-backed /work-on, /review-pr, /orchestrate, and /forgedock-status commands. /deep-plan runs a confirmation-gated planning interview; only a separate post-confirmation materialize action, bound to the exact confirmed packet and an explicit owner/repo, can create the idempotent GitHub issue DAG. Materialization returns an orchestration-ready handoff but never dispatches workers. Each command lazily activates its own semantic native tool, so the selected model can interpret natural-language intent without loading large Markdown workflow specs into every conversation. Direct work and review runs start as native background controller tasks by default. Normal TUI shutdown detaches still-running native tasks so a later local supervisor can reconcile or adopt them; /forgedock-tasks cancel <task-id> remains an explicit process-tree cancellation. Standalone /review-pr owns the configured PR CI/mechanical gate while keeping product-review remediation separate from /work-on: its safe default clearly asks the user to fix failed checks, while an explicit next.review.ci.failure_action: "auto-fix" lets ForgeDock make bounded, independently verified commits to a same-repository PR head without amend or force-push. CLI and TUI orchestration share one typed durable controller for DAG execution, attempts, recovery, and persistence while retaining their respective scope-selection adapters. Use native DAG status/resume or forgedock-next status --orchestration <dag-id> and forgedock-next orchestrate --resume <dag-id> after interruption. Completed nodes remain completed, live native workers are reconciled before any relaunch, and only interrupted work is relaunched through typed work-on recovery. The scheduler caps dispatch to transport capacity, preserves frozen lane/target/plan/model metadata, derives stable serialization edges from path/component claims, and streams the live ready set as predecessors finish. A successful batch Outcome is projected to every member before the controller closes the member issues.
Verification is serialized across ForgeDock runs on the machine, Node test fanout is bounded, and timeout/cancellation terminates the complete subprocess tree rather than orphaning workers. Subagent transcripts stay in temporary operational storage instead of delivery worktrees, and automatic remediation cannot expand beyond the frozen Build Packet.
forge.yaml remains the project configuration file. ForgeDock Next creates a minimal marker-bounded file when one is absent, and /forgedock-config <preference> updates the managed section while preserving unrelated user content. Model, thinking, concurrency, and merge settings are resolved through the live authenticated catalog and typed controller. FORGE.md is explicit user-maintained project guidance, and /forgedock-remember can persist a preference or a structured decision. devdocs/ is reference-only memory: ForgeDock retrieves compact anchored summaries, links, and backlinks, and memory can never authorize actions or override current intent or typed contracts. The fork is an internal interaction kernel; ForgeDock is the product identity, and its typed controller remains the sole owner of workflow transitions, verification, GitHub publication, review gates, and merge authority.
ForgeDock Next local safety bootstrap
Mutating Next controllers require an authenticated retained lease witness. From the canonical checkout, build once and bootstrap it once:
npm run build
node bin/forgedock-next.mjs lease-witness-bootstrapThe command generates a non-overwriting Ed25519 key and signed checkpoint in OS-local user data, outside .forgedock/state.db, and writes only ignored path references to .forgedock/lease-witness.json. Private-key permissions are restricted where the operating system supports POSIX modes. A complete FORGEDOCK_LEASE_WITNESS_PATH / FORGEDOCK_LEASE_WITNESS_PUBLIC_KEY / FORGEDOCK_LEASE_WITNESS_PRIVATE_KEY environment configuration remains the highest-priority explicit override; partial configuration fails closed.
This bootstrap fences processes using one canonical checkout on one machine. It is not cross-machine or cross-checkout coordination, and copying or rolling back the SQLite database without the independently retained witness requires explicit authenticated recovery. Confirmed Deep Plan packets currently live only in the active TUI session, so finish and materialize before restarting the terminal. Detached native tasks remain locally adoptable, but loss of their owning bridge may require explicit DAG resume.
⭐ If ForgeDock saves you time, star the repo — it's the whole marketing budget.
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.
Without ForgeDock vs. With ForgeDock
| Without ForgeDock | With ForgeDock |
|---|---|
| Agent starts every session blind — no context from prior work | Agent reads structured investigation, root cause, and history straight from GitHub |
| The same bugs get reintroduced across PRs | Review agents surface known pitfalls from past PRs before you commit |
| A crash or compaction loses the run | State lives on GitHub and in an event-sourced run log — the pipeline resumes where it stopped |
| You write the issue, plan the fix, open the PR, and review it | /work-on #42 → investigated, built, reviewed, merged |
| Review depends on whoever has capacity | 9 domain-specialist agents (security, billing, DB, concurrency…) review every PR |
| One task at a time, serialized by your attention | /orchestrate runs a whole milestone through a streaming DAG; compatible findings can share one pipeline |
The idea in one paragraph
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.
┌──────────────────────────────────────────────────────────────────┐
│ GITHUB (Knowledge Graph) │
│ │
│ Issues: FORGE:INVESTIGATOR → FORGE:CONTEXT → FORGE:ARCHITECT │
│ → FORGE:TRAJECTORY (the run's full audit trail) │
│ PRs: FORGE:BUILDER → structured review FINDING blocks │
│ Links: git blame → commit → PR → issue → related issues │
│ │
│ Every agent reads this. Every agent writes to it. │
│ Nothing is lost between conversations. │
└──────────────────────────────────────────────────────────────────┘Watch the machine work
Not a staged demo — these are real, public runs on this repository. Open any of them and read the full trail:
- #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.
- #1172 — review found an
ANTHROPIC_API_KEYexfiltration 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) — the pipeline red-teams its own fixes. - #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.
- #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.
- #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.
And the part that makes it compound — the context phase citing past bugs by number before a line is written (from #1196):
"
commands/orchestrate.mdhas 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."
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: no estimated efficiency claims.
Orchestrate an entire milestone
/work-on ships one work unit. /orchestrate ships a milestone. It builds a dependency DAG and streams each ready work unit as soon as its own predecessors complete. Ordinary issues remain individual units; compatible P2/P3 review findings may be contracted into one batch issue and one /work-on pipeline, with all member issues closed only after the batch is verified, reviewed, and completed. On this repo's record day, that meant 29 issues taken to merged inside a single hour.
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.
/orchestrate milestone/checkout-v2 # resolve → streaming conflict-aware DAG → merged PRsHow it works
Each stage reads the structured output of the stages before it and writes its own findings back:
Issue → Investigate → Context → Architect → Build → Quality Gate → Review → Merge
└──────────── each stage reads & writes GitHub ────────────┘| Stage | Reads | Writes |
| --- | --- | --- |
| Investigate | Issue body, git blame, related issues/PRs | FORGE:INVESTIGATOR — verdict, root cause, affected files, severity |
| Context | Historical findings from related PRs, known pitfalls | FORGE:CONTEXT — institutional memory for this module |
| Architect | Investigation + context | FORGE:ARCHITECT — ordered plan, code paths, risks |
| Build | Everything above | FORGE:BUILDER — branch, commits, files changed |
| Quality Gate | Builder output, domain-specific checks | gate results, recorded in the run's trajectory |
| Review | PR diff, contract, gate results | FORGE:REVIEW_STARTED on the issue; per-agent findings as structured FINDING blocks on the PR |
| Close | All of the above | FORGE:TRAJECTORY — the full audit trail of the run |
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.
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; wiring the interactive path onto the same engine is in progress (#1323–#1325).
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.
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).
Built for the ways agents fail
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:
| "We've all seen this go wrong…" | The mechanism |
| --- | --- |
| 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 |
| 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 |
| Third retry = increasingly creative excuses | Engine-owned state machine: bounded retries, then escalation to needs-human |
| One runaway agent wrecks the codebase | 1 issue = 1 agent, bounded by decomposition; conflict-aware scheduling; isolated worktrees |
| 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 |
| No way to tell when an agent drifts | A FORGE:TRAJECTORY receipt on the issue records what every phase actually did |
| Humans rubber-stamp 95%-good output | Specialist review raises the floor before a human looks at the PR |
| 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) |
Commands
The core loop:
| Command | What it does |
| --- | --- |
| /deep-plan | Confirmation-gated planning, explicit GitHub issue-DAG materialization, then a separately confirmed orchestration handoff |
| /work-on | Full issue lifecycle: investigate → build → quality gate → review → merge |
| /orchestrate | A whole milestone through a streaming conflict-aware DAG; compatible P2/P3 findings can share one batch pipeline |
| /issue | Creates pipeline-ready GitHub issues |
| /milestone | Create, manage, and ship milestones |
| /review-pr | Context-aware PR review with domain-specialist agents |
| /quality-gate | Pre-commit checks, gated by the domains your change actually touches |
| /test-gate | Acceptance verification against running code before anything deploys |
Observe & recover — the durable-state story, as commands:
| Command | What it does |
| --- | --- |
| /pipeline-status | Fleet view of every in-flight issue, straight from workflow labels |
| /pipeline-resume | Resume an interrupted run from whatever state GitHub reports |
| /diagnose | Trace why a run failed, from its annotations |
| /explain | Translate the FORGE annotations on any issue into plain language |
| /replay | Replay a past run's full audit trail |
| /changelog | Release notes assembled from merged PRs and trajectory receipts |
Ops:
| Command | What it does |
| --- | --- |
| /deploy-info | Staging vs. main diff with risk assessment |
| /rollback | Automated revert PR for production incidents |
| /autopilot | Production signals → triaged issues → fixes |
| /security-audit | Multi-phase security posture audit |
| /cleanup | Sweeps stale issues, branches, worktrees |
More ship today (web-property analytics, browser QA sweeps, self-benchmarking) — see the full command reference. A leaner, tiered install that keeps the core loop front and center is planned in #1257.
Install
ForgeDock Next is distributed as the forgedockcli npm package.
Requirements: GitHub CLI (authenticated), Node.js ≥ 22.19, and credentials for a Pi-supported model provider.
npm install -g forgedockcli
forgedockcliFor a one-off run:
npx forgedockcliThe forgedock executable remains an alias for compatibility with existing
installations and scripts. The published package contains the ForgeDock Next
terminal and runtime only; legacy command/spec trees are intentionally excluded
from the npm tarball and remain recoverable in the source repository during the
transition.
ForgeDock Next commands are native terminal commands such as /work-on,
/review-pr, /orchestrate, and /forgedock-status. For unpublished source
changes from this repository, use:
npm run terminalThe package is free and open-source. It runs the pipeline using your own provider account; no compute is resold or marked up.
For companies
The core is AGPL-3.0 and stays that way: engineers run the full pipeline on their own Claude account, forever free.
Two things are for sale:
- A commercial license — for organizations that need ForgeDock inside proprietary workflows or products without AGPL copyleft obligations. Contact [email protected].
- 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 — see ForgeDock for Companies for details and intake.
Where it's going
Month one built the execution layer. The open roadmap — tracked in the five-foundations epic (#1320) — is about earning trust while unattended:
- Durability — engine-owned state instead of prose-owned state. Headless core shipped (PR #1326); interactive wiring in progress.
- Verification — an outcome-based acceptance gate and a graded eval corpus, so "done" is machine-checkable before anything claims success. Per-release pipeline scorecards are published in
docs/eval/; model upgrades follow the model-release playbook. - Learning — per-codebase memory that compounds across runs.
- Economics — per-run cost accounting and risk×cost dispatch decisions.
- Provenance — signed, replayable records of every autonomous change.
Marketing is held to the same standard: #1264 gates our own launch on measured cost-per-issue benchmarks — no estimated claims.
Show your support
Using ForgeDock in your pipeline? Add the badge — each one is a backlink and a signal to other developers:
[](https://github.com/RapierCraftStudios/ForgeDock)Star History
Docs & community
- GitHub Is Already Your Agents' Memory — the canonical argument: why GitHub is the right place for agent memory, how FORGE annotations make it machine-readable, and how to adopt the protocol without ForgeDock
- Getting Started in 5 Minutes
- How the Knowledge Graph Works
- What Are Those FORGE Comments? — 2-minute explainer for annotations you meet in the wild
- FORGE Annotation Protocol — the open standard for AI context passing (CC-BY-4.0)
- ForgeDock vs. Manual Claude Code Workflows
- ForgeDock vs. DeepWiki, AGENTS.md, and Cursor Memories
- Command Learning Path — which commands to learn first
- Complete Command Reference
- Troubleshooting & Recovery
- Pipeline Eval Scorecards — per-release published results for every model/Claude Code upgrade
- Model-Release Upgrade Playbook — how to validate a new model before adopting it
Contributing: PRs welcome — every change goes through a PR, tested against 3+ scenarios, using conventional commits (fix(command):, feat(command):). License: AGPL-3.0 — 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.
