forgedock 1.0.20 → 1.0.22

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 +146 -77
  2. package/bin/demo.mjs +386 -0
  3. package/bin/forgedock.mjs +357 -30
  4. package/bin/init-detect.mjs +95 -0
  5. package/bin/runner.mjs +780 -0
  6. package/commands/ci-audit.md +469 -0
  7. package/commands/cleanup.md +85 -39
  8. package/commands/deploy-info.md +6 -2
  9. package/commands/forge-stats.md +1 -1
  10. package/commands/optimize.md +1 -1
  11. package/commands/orchestrate.md +684 -33
  12. package/commands/quality-gate.md +166 -46
  13. package/commands/review-pr-agents.md +106 -34
  14. package/commands/review-pr.md +33 -2
  15. package/commands/scope.md +11 -3
  16. package/commands/security-audit.md +24 -16
  17. package/commands/sync-ecosystem.md +2 -2
  18. package/commands/work-on/build/architect.md +47 -3
  19. package/commands/work-on/build/context.md +36 -5
  20. package/commands/work-on/build/validate.md +16 -7
  21. package/commands/work-on/close.md +129 -1
  22. package/commands/work-on/investigate.md +24 -1
  23. package/commands/work-on.md +226 -8
  24. package/docs/comparison.md +135 -0
  25. package/docs/design/developer-objections-ai-context-tools.md +244 -0
  26. package/docs/design/messaging-angles-research.md +179 -0
  27. package/docs/design/show-hn-draft.md +86 -0
  28. package/docs/site/annotations-explained.md +55 -0
  29. package/docs/site/command-learning-path.md +104 -0
  30. package/docs/site/command-reference.md +3 -0
  31. package/docs/site/getting-started.md +36 -14
  32. package/docs/site/troubleshooting.md +208 -0
  33. package/docs/spec/forge-protocol-v1.md +768 -0
  34. package/examples/forgedock-demo/README.md +113 -0
  35. package/examples/forgedock-demo/bootstrap.sh +125 -0
  36. package/examples/forgedock-demo/issues/01-bug-delete-missing-auth.md +37 -0
  37. package/examples/forgedock-demo/issues/02-feature-filter-notes.md +37 -0
  38. package/examples/forgedock-demo/issues/03-refactor-router-table.md +33 -0
  39. package/examples/forgedock-demo/issues/04-perf-index-lookup.md +35 -0
  40. package/examples/forgedock-demo/issues/05-docs-api-reference.md +39 -0
  41. package/examples/forgedock-demo/labels.json +21 -0
  42. package/examples/forgedock-demo/package.json +16 -0
  43. package/examples/forgedock-demo/scripts/smoke.js +61 -0
  44. package/examples/forgedock-demo/src/auth.js +28 -0
  45. package/examples/forgedock-demo/src/db.js +66 -0
  46. package/examples/forgedock-demo/src/routes/notes.js +64 -0
  47. package/examples/forgedock-demo/src/server.js +79 -0
  48. package/package.json +6 -2
  49. package/templates/forge.yaml.minimal +44 -0
package/README.md CHANGED
@@ -26,25 +26,17 @@
26
26
 
27
27
  <br />
28
28
 
29
- ## Why ForgeDock
30
-
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.
29
+ ## What ForgeDock Does
32
30
 
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.
34
-
35
- ---
31
+ ForgeDock runs the full issue lifecycle inside Claude Code — **investigate, architect, build, quality-gate, review, and merge** — autonomously. You open an issue, run `/work-on #42`, and click merge. Every stage writes structured context back to GitHub, so the next agent starts smart, not blind.
36
32
 
37
- ## How Is This Different
33
+ ```
34
+ You: /work-on #42
35
+ ForgeDock: Investigate → Architect → Build → Quality Gate → Review → open PR
36
+ You: click merge
37
+ ```
38
38
 
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.
40
-
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 |
39
+ No new runtime, no separate process, no cloud service — just prompt-engineered command specs that run inside the Claude Code you already use.
48
40
 
49
41
  ---
50
42
 
@@ -55,41 +47,36 @@ ForgeDock is **not another AI coding agent.** It's a set of prompt-engineered co
55
47
  | **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
48
  | **Persistent agent memory** | Structured `FORGE:` annotations on GitHub issues/PRs survive context resets and session boundaries. Agents never start blind. |
57
49
  | **9 specialist review agents** | Security, billing, database, concurrency, auth, frontend, API, performance, infrastructure — every PR gets domain-expert review. |
58
- | **Cross-issue knowledge graph** | Agent fixing issue #43 reads the investigation from #42 and applies the known pattern — no re-investigation. |
50
+ | **Institutional memory that compounds** | Agent fixing issue #43 reads the investigation from #42 and applies the known pattern — no re-investigation. |
59
51
  | **Self-improving pipeline** | Review agents learn from past findings — recurring patterns automatically become new quality gate checks. |
60
52
  | **Parallel orchestration** | `/orchestrate` decomposes milestones into waves and runs `/work-on` on each in parallel. |
61
53
 
62
54
  > **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.
63
55
 
64
- <details>
65
- <summary><strong>See a real pipeline run</strong></summary>
56
+ ---
66
57
 
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:
58
+ ## How It Works
68
59
 
69
60
  ```
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.
75
-
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.
79
-
80
- FORGE:ARCHITECT → 3 new functions in bin/forgedock.mjs: parseFrontmatter(),
81
- generateStubContent(), updated install() flow.
82
-
83
- FORGE:BUILDER → Branch feat/stub-install-pattern-619, 1 file changed.
84
-
85
- FORGE:REVIEW → Auto-merged to staging.
86
-
87
- FORGE:TRAJECTORY → Full audit trail recorded.
61
+ Issue → Investigate → Architect → Build → Quality Gate → Review → Merge
62
+ ↓ ↓ ↓ ↓ ↓
63
+ writes to reads from reads from reads from writes to
64
+ GitHub GitHub GitHub GitHub GitHub
88
65
  ```
89
66
 
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)
67
+ 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.
91
68
 
92
- </details>
69
+ | Stage | What it does |
70
+ |---|---|
71
+ | **Investigate** | Traces root cause via `git blame`, related issues/PRs. Writes verdict, affected files, severity. |
72
+ | **Context** | Surfaces historical bugs and known pitfalls from the same module. Institutional memory. |
73
+ | **Architect** | Produces ordered implementation plan with exact file/function/line targets. |
74
+ | **Build** | Writes code, creates branch, makes commits. Follows the architect's plan. |
75
+ | **Quality Gate** | 14+ domain-specific checks (security, auth, DB, concurrency, etc.) |
76
+ | **Review** | 9 specialist agents review the PR diff with confidence-rated findings. |
77
+ | **Close** | Records full audit trail as `FORGE:TRAJECTORY`. |
78
+
79
+ 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.
93
80
 
94
81
  ---
95
82
 
@@ -109,9 +96,14 @@ npx forgedock
109
96
 
110
97
  # Generate config for your repo
111
98
  npx forgedock init
99
+
100
+ # Verify everything is wired up correctly
101
+ npx forgedock doctor
112
102
  ```
113
103
 
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`.
104
+ This symlinks 25+ pipeline commands into `~/.claude/commands/` and generates a `forge.yaml` config in your project root. `npx forgedock doctor` runs an installation health check — command symlinks, `forge.yaml`, required tools (`gh`, `yq`, Claude Code), GitHub workflow labels, and Playwright MCP — printing a clear pass/fail/warn line with a fix hint for each, and exiting non-zero if anything is broken. Run it any time your setup feels off. That's it — open Claude Code and run `/work-on #42`.
105
+
106
+ **Try it risk-free:** Follow the [5-minute Getting Started walkthrough](docs/site/getting-started.md) to install, configure, and run your first pipeline end-to-end. New to the commands? Start with the [Command Reference](docs/site/command-reference.md) for a guided tour of what each one does.
115
107
 
116
108
  <details>
117
109
  <summary><strong>Other install methods & commands</strong></summary>
@@ -129,6 +121,22 @@ npx forgedock uninstall # Remove all ForgeDock commands from ~/.claude/comman
129
121
  npx forgedock help # Show all available commands
130
122
  ```
131
123
 
124
+ **Standalone runner** (run pipelines outside Claude Code — CI/CD, headless batch):
125
+ ```bash
126
+ # Preview the assembled prompt + tool plan (no API key needed)
127
+ npx forgedock run work-on 42 --dry-run
128
+
129
+ # Execute headlessly via the Anthropic API directly
130
+ export ANTHROPIC_API_KEY=sk-ant-...
131
+ npm install @anthropic-ai/sdk # optional dependency — only needed for live runs
132
+ npx forgedock run work-on 42
133
+ ```
134
+ `forgedock run` loads the same `commands/*.md` specs and drives an Anthropic
135
+ tool-use loop directly, so the pipeline no longer depends on the Claude Code
136
+ agent loop. Claude Code remains the recommended interactive experience; the
137
+ runner adds CI/CD and non-Claude-Code paths. Flags: `--dry-run`, `--model <id>`,
138
+ `--max-iterations <n>`.
139
+
132
140
  **AI-powered setup** (inside Claude Code):
133
141
  ```
134
142
  /forgedock-init # Guided config walkthrough — scans your repo, queries GitHub, auto-fills forge.yaml
@@ -136,57 +144,49 @@ npx forgedock help # Show all available commands
136
144
 
137
145
  </details>
138
146
 
139
- ---
140
-
141
- ## Global Command Namespace
147
+ <details>
148
+ <summary><strong>See a real pipeline run</strong></summary>
142
149
 
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:
150
+ 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:
144
151
 
145
152
  ```
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
- ```
153
+ FORGE:INVESTIGATOR → CONFIRMED. All 27 command spec files (848KB) load into
154
+ context at session start via symlinks. ~200K tokens wasted.
152
155
 
153
- **Project-specific commands** should install to the **project-local** `.claude/commands/` directory instead:
156
+ FORGE:CONTRACT → Replace symlink-based install with stub-file pattern.
157
+ Installer parses frontmatter, writes minimal stubs.
154
158
 
155
- ```
156
- your-project/
157
- .claude/
158
- commands/
159
- my-custom-command.md ← project-local — Claude Code merges these in
159
+ FORGE:CONTEXT → Issue #577: install() had overly broad catch{} — fixed to
160
+ check err.code === 'ENOENT'. Issue #587: Windows writes
161
+ regular files, not symlinks — keep both paths working.
162
+
163
+ FORGE:ARCHITECT → 3 new functions in bin/forgedock.mjs: parseFrontmatter(),
164
+ generateStubContent(), updated install() flow.
165
+
166
+ FORGE:BUILDER → Branch feat/stub-install-pattern-619, 1 file changed.
167
+
168
+ FORGE:REVIEW → Auto-merged to staging.
169
+
170
+ FORGE:TRAJECTORY → Full audit trail recorded.
160
171
  ```
161
172
 
162
- Claude Code merges global (`~/.claude/commands/`) and project-local (`.claude/commands/`) automatically. Project-local commands win on name collisions.
173
+ 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)
163
174
 
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.
175
+ </details>
165
176
 
166
177
  ---
167
178
 
168
- ## How It Works
179
+ ## Where to Start
169
180
 
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
- ```
176
-
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.
181
+ ForgeDock installs 25+ commands, but **you only need three to start.** They cover the entire issue-to-merge loop:
178
182
 
179
- | Stage | What it does |
183
+ | Command | What it does |
180
184
  |---|---|
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`. |
185
+ | `/issue` | Describe what you want — get a pipeline-ready issue |
186
+ | **`/work-on #N`** | Investigate, build, review, and merge it automatically |
187
+ | `/review-pr` | Review a PR with domain-specialist agents |
188
188
 
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.
189
+ Everything else is additive — add commands as your workflow grows: **Team Workflows** (`/orchestrate`, `/milestone`) when you run work in parallel, **Operations** (`/rollback`, `/incident-response`) when production needs it, and **Pipeline Tuning** (`/autopilot`, `/pipeline-health`) once it's routine. See the [Command Learning Path](docs/site/command-learning-path.md) for the full tiered guide.
190
190
 
191
191
  ---
192
192
 
@@ -213,6 +213,69 @@ Labels track workflow state (`workflow:investigating`, `workflow:building`, `wor
213
213
 
214
214
  ---
215
215
 
216
+ ## Global Command Namespace
217
+
218
+ 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:
219
+
220
+ ```
221
+ ~/.claude/commands/
222
+ .symlink-source ← sentinel: "ForgeDock owns this namespace"
223
+ work-on.md → /path/to/forgedock/commands/work-on.md
224
+ review-pr.md → /path/to/forgedock/commands/review-pr.md
225
+ ...
226
+ ```
227
+
228
+ **Project-specific commands** should install to the **project-local** `.claude/commands/` directory instead:
229
+
230
+ ```
231
+ your-project/
232
+ .claude/
233
+ commands/
234
+ my-custom-command.md ← project-local — Claude Code merges these in
235
+ ```
236
+
237
+ Claude Code merges global (`~/.claude/commands/`) and project-local (`.claude/commands/`) automatically. Project-local commands win on name collisions.
238
+
239
+ 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.
240
+
241
+ ---
242
+
243
+ ## Why ForgeDock
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ ---
250
+
251
+ ## How Is This Different
252
+
253
+ 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.
254
+
255
+ | | ForgeDock | Plain Claude Code | Cursor / Windsurf | Devin / Sweep |
256
+ |---|---|---|---|---|
257
+ | Memory across sessions | Structured annotations on GitHub | CLAUDE.md + manual notes | Per-project context | Proprietary cloud state |
258
+ | Autonomous pipeline | Full lifecycle: investigate → merge | Manual, step by step | Autocomplete + chat | Autonomous but opaque |
259
+ | Review quality | 9 domain-specialist agents | You review everything | Basic suggestions | Varies |
260
+ | Infrastructure needed | None — just `npx forgedock` | None | IDE-specific | Cloud service |
261
+ | Codebase visibility | Everything stays on GitHub | Local | Local + cloud sync | Cloud-only |
262
+
263
+ ---
264
+
265
+ ## FAQ — How is ForgeDock different from X?
266
+
267
+ **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.
268
+
269
+ **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.
270
+
271
+ **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.
272
+
273
+ **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.
274
+
275
+ [Full comparison →](docs/comparison.md)
276
+
277
+ ---
278
+
216
279
  ## Uninstall
217
280
 
218
281
  ```bash
@@ -225,11 +288,17 @@ Removes all ForgeDock command symlinks from `~/.claude/commands/`. Your `forge.y
225
288
 
226
289
  ## Documentation
227
290
 
291
+ - [Try ForgeDock Risk-Free](examples/forgedock-demo/) — a tiny demo repo with 5 pre-written issues; clone, `npx forgedock`, `/work-on 1`, and watch a full pipeline run without touching your real code
228
292
  - [Getting Started in 5 Minutes](docs/site/getting-started.md) — install, configure, first pipeline run
229
293
  - [How the Knowledge Graph Works](docs/site/how-it-works.md) — FORGE annotations, context relay, compaction resilience
294
+ - [What Are Those FORGE Comments?](docs/site/annotations-explained.md) — 2-minute newcomer explainer for the annotations on your issues
230
295
  - [ForgeDock vs. Manual Workflows](docs/site/vs-manual-workflows.md) — structured pipelines vs. ad-hoc prompting
296
+ - [ForgeDock vs. DeepWiki, AGENTS.md, and Cursor Memories](docs/comparison.md) — structural differences between context tools
231
297
  - [FORGE Annotation Protocol](docs/site/forge-annotation-protocol.md) — open standard spec for AI context passing
298
+ - [FORGE Annotation Protocol v1.0 (formal spec)](docs/spec/forge-protocol-v1.md) — standalone, versioned, CC-BY-4.0 specification you can implement in any agent pipeline
299
+ - [Command Learning Path](docs/site/command-learning-path.md) — which commands to learn first, tiered by when you need them
232
300
  - [Command Reference](docs/site/command-reference.md) — all 25+ commands with usage and examples
301
+ - [Troubleshooting & Recovery Guide](docs/site/troubleshooting.md) — symptom, cause, and fix for the most common pipeline failures
233
302
 
234
303
  ---
235
304