forgedock 1.0.21 → 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 (44) hide show
  1. package/README.md +134 -80
  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/cleanup.md +85 -39
  7. package/commands/deploy-info.md +6 -2
  8. package/commands/forge-stats.md +1 -1
  9. package/commands/optimize.md +1 -1
  10. package/commands/orchestrate.md +320 -26
  11. package/commands/quality-gate.md +91 -49
  12. package/commands/review-pr-agents.md +62 -38
  13. package/commands/review-pr.md +33 -2
  14. package/commands/scope.md +11 -3
  15. package/commands/security-audit.md +24 -16
  16. package/commands/sync-ecosystem.md +2 -2
  17. package/commands/work-on/build/architect.md +47 -3
  18. package/commands/work-on/build/context.md +36 -5
  19. package/commands/work-on/build/validate.md +16 -7
  20. package/commands/work-on/close.md +129 -1
  21. package/commands/work-on/investigate.md +24 -1
  22. package/commands/work-on.md +226 -8
  23. package/docs/site/annotations-explained.md +55 -0
  24. package/docs/site/command-learning-path.md +104 -0
  25. package/docs/site/command-reference.md +3 -0
  26. package/docs/site/getting-started.md +36 -14
  27. package/docs/site/troubleshooting.md +208 -0
  28. package/docs/spec/forge-protocol-v1.md +768 -0
  29. package/examples/forgedock-demo/README.md +113 -0
  30. package/examples/forgedock-demo/bootstrap.sh +125 -0
  31. package/examples/forgedock-demo/issues/01-bug-delete-missing-auth.md +37 -0
  32. package/examples/forgedock-demo/issues/02-feature-filter-notes.md +37 -0
  33. package/examples/forgedock-demo/issues/03-refactor-router-table.md +33 -0
  34. package/examples/forgedock-demo/issues/04-perf-index-lookup.md +35 -0
  35. package/examples/forgedock-demo/issues/05-docs-api-reference.md +39 -0
  36. package/examples/forgedock-demo/labels.json +21 -0
  37. package/examples/forgedock-demo/package.json +16 -0
  38. package/examples/forgedock-demo/scripts/smoke.js +61 -0
  39. package/examples/forgedock-demo/src/auth.js +28 -0
  40. package/examples/forgedock-demo/src/db.js +66 -0
  41. package/examples/forgedock-demo/src/routes/notes.js +64 -0
  42. package/examples/forgedock-demo/src/server.js +79 -0
  43. package/package.json +5 -1
  44. package/templates/forge.yaml.minimal +44 -0
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: "What Are Those FORGE Comments on My GitHub Issues?"
3
+ description: "A 2-minute, plain-English explainer of FORGE annotations — the structured comments ForgeDock agents post on your GitHub issues and PRs. What they are, why they matter, and whether you should touch them."
4
+ keywords: ["forge annotations explained", "forgedock comments", "ai agent github comments", "claude code annotations", "what are forge comments"]
5
+ ---
6
+
7
+ # What Are Those Comments on My GitHub Issues?
8
+
9
+ After your first ForgeDock run, your GitHub issue fills up with comments that start like this:
10
+
11
+ ```html
12
+ <!-- FORGE:INVESTIGATOR -->
13
+ <!-- FORGE:CONTRACT -->
14
+ <!-- FORGE:ARCHITECT -->
15
+ <!-- FORGE:BUILDER -->
16
+ ```
17
+
18
+ These are **FORGE annotations** — structured notes each pipeline stage leaves behind so the next stage (and your future self) can pick up exactly where the last one stopped. They're how your agents remember things.
19
+
20
+ ## Before and After
21
+
22
+ **A bare GitHub issue:** a title, a description, and... nothing else. Every time an agent touches it, it starts from zero — re-reading the code, re-guessing the root cause, re-deciding the approach.
23
+
24
+ **An issue with FORGE annotations:** a full paper trail. The investigator's findings, the architect's plan, the builder's contract, and the review results all live on the issue. Any agent — or any teammate — can scroll the thread and see the whole story.
25
+
26
+ ## How It Works in 30 Seconds
27
+
28
+ When you run `/work-on #42`:
29
+
30
+ 1. The **investigator** traces the root cause and posts its findings as a `FORGE:INVESTIGATOR` comment.
31
+ 2. The **architect** reads that comment, then posts its implementation plan.
32
+ 3. The **builder** reads the plan, writes the code, and posts what it built.
33
+ 4. **Review** reads everything above and records the outcome.
34
+
35
+ Each stage builds on the last. Your agents never start blind — even after Claude's context window resets, the next session just reads the thread and resumes.
36
+
37
+ Here's a real one:
38
+
39
+ ```
40
+ <!-- FORGE:INVESTIGATOR -->
41
+ Verdict: CONFIRMED. All 27 command spec files load into context
42
+ on every session, blowing the token budget.
43
+ Root cause: symlink-based install pulls in every file eagerly.
44
+ Affected: bin/forgedock.mjs
45
+ ```
46
+
47
+ ## Do I Need to Edit Them?
48
+
49
+ **No.** FORGE annotations are machine-generated and machine-consumed. You don't have to write, edit, or delete them — the pipeline manages them for you. The `<!-- ... -->` wrapper means they render as invisible HTML comments, so they won't clutter your issue's rendered view.
50
+
51
+ Read them whenever you want visibility into what your agents are doing. That's the whole point: the work is transparent and auditable, right there in GitHub.
52
+
53
+ ## Want the Technical Details?
54
+
55
+ If you're building your own agent pipeline or contributing to ForgeDock, the full machine-readable format — every annotation type, completion markers, and parsing rules — is documented in the [FORGE Annotation Protocol](./forge-annotation-protocol.md).
@@ -0,0 +1,104 @@
1
+ ---
2
+ title: "ForgeDock Command Learning Path"
3
+ description: "A tiered learning path for ForgeDock's slash commands. Learn the 3 essential commands first, then add team, operations, and pipeline-tuning commands as you need them."
4
+ keywords: ["claude code commands guide", "forgedock learning path", "claude code getting started", "which claude code commands to learn", "ai pipeline commands"]
5
+ ---
6
+
7
+ # Command Learning Path
8
+
9
+ ForgeDock installs 25+ slash commands. You do **not** need to learn them all. Most of the time you'll use three.
10
+
11
+ This page tiers every command by *when you need it* — so you can start small and add commands as your workflow grows. For an alphabetical, domain-grouped lookup of every command, see the [Complete Command Reference](./command-reference.md).
12
+
13
+ ---
14
+
15
+ ## Start here: 3 commands
16
+
17
+ If you only learn three commands, learn these. They cover the entire issue-to-merge loop:
18
+
19
+ ```text
20
+ /issue → describe what you want, get a pipeline-ready issue
21
+ /work-on #N → investigate, build, review, and merge it automatically
22
+ /review-pr → review a pull request with domain-specialist agents
23
+ ```
24
+
25
+ Everything below is optional and additive. Come back when you hit the situation each tier describes.
26
+
27
+ ---
28
+
29
+ ## Tier 1 — Essential
30
+
31
+ **When you need this:** Day 1. This is the minimum viable ForgeDock.
32
+
33
+ | Command | What it does |
34
+ |---------|-------------|
35
+ | `/work-on #N` | Pick up an issue and run the full pipeline: investigate → build → review → merge |
36
+ | `/issue` | Create a well-structured issue the pipeline can consume reliably |
37
+ | `/review-pr` | Review a PR with context-aware, domain-specialist agents |
38
+
39
+ With just these three, you can ship a change end-to-end: write an issue, run it, and review the result.
40
+
41
+ ---
42
+
43
+ ## Tier 2 — Team Workflows
44
+
45
+ **When you need this:** Week 1, once you're running more than one issue at a time or coordinating work across a milestone.
46
+
47
+ | Command | What it does |
48
+ |---------|-------------|
49
+ | `/orchestrate` | Run multiple issues — or an entire milestone — in parallel |
50
+ | `/milestone` | Plan, track, and ship a milestone |
51
+ | `/deploy-info` | See what will deploy next: staging vs. main diff with risk assessment |
52
+ | `/quality-gate` | Run pre-commit quality checks before you push |
53
+
54
+ These commands scale ForgeDock from "one issue at a time" to "a planned body of work moving in parallel."
55
+
56
+ ---
57
+
58
+ ## Tier 3 — Operations
59
+
60
+ **When you need this:** When something goes wrong in production, or when you're shipping a release.
61
+
62
+ | Command | What it does |
63
+ |---------|-------------|
64
+ | `/rollback` | Create a revert PR to roll back a shipped feature or fix |
65
+ | `/incident-response` | Coordinate a P0 incident: hotfix validation, timeline, postmortem |
66
+ | `/security-audit` | Run a periodic security posture audit |
67
+ | `/changelog` | Generate release notes from merged work |
68
+
69
+ You'll reach for these occasionally, not daily — but you'll be glad they exist the moment you need them.
70
+
71
+ ---
72
+
73
+ ## Tier 4 — Pipeline Tuning
74
+
75
+ **When you need this:** Advanced. Once ForgeDock is part of your daily workflow and you want to make the pipeline itself faster and smarter.
76
+
77
+ | Command | What it does |
78
+ |---------|-------------|
79
+ | `/autopilot` | Autonomous improvement cycle: recon → triage → fix |
80
+ | `/pipeline-health` | Self-analysis: measure pipeline performance and propose improvements |
81
+ | `/optimize` | Generate adaptive scripts to speed up repeated pipeline work |
82
+ | `/diagnose` | Debug pipeline failures |
83
+
84
+ These commands turn ForgeDock on itself — measuring, debugging, and tuning the pipeline you run every day.
85
+
86
+ ---
87
+
88
+ ## How to grow your toolkit
89
+
90
+ 1. **Start with the 3 Essential commands.** Ship one issue end-to-end.
91
+ 2. **Add Tier 2 when you have more than one thing in flight.** Orchestrate a milestone instead of babysitting issues one by one.
92
+ 3. **Reach for Tier 3 only when operations demand it** — a bad deploy, an incident, a release.
93
+ 4. **Explore Tier 4 once the pipeline is routine** and you want it faster and self-tuning.
94
+
95
+ You never have to memorize the full command set. Learn the next tier the day you need it.
96
+
97
+ ---
98
+
99
+ ## Next Steps
100
+
101
+ - [Getting Started with ForgeDock in 5 Minutes](./getting-started.md) — install and run your first pipeline
102
+ - [Complete Command Reference](./command-reference.md) — every command, grouped by domain, with usage and examples
103
+ - [How ForgeDock's Knowledge Graph Works](./how-it-works.md) — understand how commands share context
104
+ - [ForgeDock vs. Manual Claude Code Workflows](./vs-manual-workflows.md) — why structured commands beat ad-hoc prompting
@@ -16,6 +16,8 @@ npx forgedock
16
16
 
17
17
  After installation, every command is available as `/command-name` in any Claude Code session.
18
18
 
19
+ **New here?** You don't need to learn all of these at once. Start with the [Command Learning Path](./command-learning-path.md) — it tiers every command by when you need it, beginning with the three you'll use on Day 1.
20
+
19
21
  ---
20
22
 
21
23
  ## Core Pipeline Commands
@@ -417,6 +419,7 @@ These are invoked automatically by `/work-on` but can also be run standalone.
417
419
 
418
420
  ## Next Steps
419
421
 
422
+ - [Command Learning Path](./command-learning-path.md) — which commands to learn first, tiered by when you need them
420
423
  - [Getting Started with ForgeDock in 5 Minutes](./getting-started.md) — install and run your first pipeline
421
424
  - [How ForgeDock's Knowledge Graph Works](./how-it-works.md) — understand how commands share context
422
425
  - [ForgeDock vs. Manual Claude Code Workflows](./vs-manual-workflows.md) — why structured commands beat ad-hoc prompting
@@ -54,31 +54,41 @@ This symlinks all 25+ ForgeDock command specs into `~/.claude/commands/` — mak
54
54
  **Verify the install:**
55
55
 
56
56
  ```bash
57
- ls ~/.claude/commands/ | grep -E "work-on|review-pr|quality-gate"
57
+ npx forgedock doctor
58
58
  ```
59
59
 
60
- You should see `work-on.md`, `review-pr.md`, and `quality-gate.md`.
60
+ `doctor` runs an installation health check across six categories — command symlinks, `forge.yaml`, required tools (`gh`, `yq`, Claude Code), GitHub workflow labels, and Playwright MCP — and prints a pass/fail/warn line with a fix hint for each:
61
+
62
+ ```
63
+ ForgeDock Doctor — Installation Health Check
64
+
65
+ ✔ Command symlinks 25 symlinks valid
66
+ ✔ gh CLI installed and authenticated
67
+ ✔ yq yq (https://github.com/mikefarah/yq/) version v4.x
68
+ ✔ Claude Code v2.x (compatible, >= v2.0.0)
69
+ ⚠ Playwright MCP Not registered — needed for /qa-sweep
70
+
71
+ All checks passed. ForgeDock installation is healthy.
72
+ ```
73
+
74
+ It exits `0` when everything passes and `1` if any check fails, so you can also use it in CI. The `forge.yaml` and GitHub-label checks will fully pass once you finish Step 2 below — re-run `doctor` any time your setup feels off.
75
+
76
+ > Prefer a quick spot-check? `ls ~/.claude/commands/ | grep -E "work-on|review-pr|quality-gate"` should list `work-on.md`, `review-pr.md`, and `quality-gate.md`.
61
77
 
62
78
  ---
63
79
 
64
80
  ## Step 2: Configure Your Repository
65
81
 
66
- In your project root, initialize a `forge.yaml` config file:
82
+ ForgeDock reads a single `forge.yaml` in your project root. **Start minimal** — only the `project`, `paths`, and `branches` sections are required. Everything else is optional and falls back to sensible defaults; add sections as you need them.
83
+
84
+ The fastest way to get a working config is the `--minimal` flag, which scans your repo and writes just the required sections with detected values:
67
85
 
68
86
  ```bash
69
87
  cd /path/to/your/project
70
- # Open Claude Code in this directory, then run:
71
- /forgedock-init
88
+ npx forgedock init --minimal
72
89
  ```
73
90
 
74
- The `/forgedock-init` command scans your repo and generates a `forge.yaml` with:
75
-
76
- - Your GitHub repo owner and name
77
- - Worktree base path
78
- - Branch strategy (staging vs. feature lanes)
79
- - Project board connection (optional)
80
-
81
- **Minimal `forge.yaml` example:**
91
+ This produces a short, readable `forge.yaml` like the one below — this is essentially ForgeDock's own real-world config:
82
92
 
83
93
  ```yaml
84
94
  project:
@@ -91,10 +101,17 @@ paths:
91
101
  worktree_base: "/path/to/my-app/.claude/worktrees"
92
102
 
93
103
  branches:
104
+ default: "main"
94
105
  staging: "staging"
95
- default: "staging"
106
+ feature_pattern: "milestone/{slug}"
96
107
  ```
97
108
 
109
+ That's the whole config. Run `npx forgedock doctor` to confirm it's valid.
110
+
111
+ > **The three required sections are `project`, `paths`, and `branches`** — `npx forgedock init --minimal` auto-detects `paths` for you (so worktrees land in the right place) and you rarely need to touch it. Everything else (project board, review context, verification commands, multi-repo routing) is optional and falls back to sensible defaults. Browse [`forge.yaml.example`](https://github.com/RapierCraftStudios/ForgeDock/blob/main/forge.yaml.example) and [`docs/CONFIG.md`](https://github.com/RapierCraftStudios/ForgeDock/blob/main/docs/CONFIG.md) when you're ready to customize.
112
+
113
+ **Prefer guided, AI-powered setup?** Open Claude Code in your project directory and run `/forgedock-init` instead — it scans your repo and fills in the optional sections (repo owner/name, worktree path, branch strategy, project board) for you. Plain `npx forgedock init` (no flag) generates the full annotated template with every optional section commented out.
114
+
98
115
  ---
99
116
 
100
117
  ## Step 3: Open an Issue
@@ -164,14 +181,19 @@ For a deep dive into how this works, read [How ForgeDock's Knowledge Graph Works
164
181
 
165
182
  ## Next Steps
166
183
 
184
+ - [Command Learning Path](./command-learning-path.md) — which commands to learn next, tiered by when you need them
167
185
  - [How ForgeDock's Knowledge Graph Works](./how-it-works.md) — understand the architecture
186
+ - [What Are Those FORGE Comments?](./annotations-explained.md) — a 2-minute explainer for the annotations on your issues
168
187
  - [ForgeDock vs. Manual Claude Code Workflows](./vs-manual-workflows.md) — why this beats ad-hoc prompting
169
188
  - [Complete Command Reference](./command-reference.md) — all 25 commands with examples
189
+ - [Troubleshooting & Recovery Guide](./troubleshooting.md) — diagnose and recover from common pipeline failures
170
190
 
171
191
  ---
172
192
 
173
193
  ## Troubleshooting
174
194
 
195
+ The quick fixes below cover the most common first-run issues. For the full list of failure modes — quality gate failures, worktree conflicts, stale labels, rate limits, and more — see the [Troubleshooting & Recovery Guide](./troubleshooting.md).
196
+
175
197
  **`/work-on` not found in Claude Code**
176
198
 
177
199
  The symlink wasn't created. Re-run `npx forgedock` and check `ls ~/.claude/commands/`.
@@ -0,0 +1,208 @@
1
+ ---
2
+ title: "ForgeDock Troubleshooting & Recovery Guide"
3
+ description: "Diagnose and recover from the most common ForgeDock pipeline failures: missing forge.yaml, gh auth errors, quality gate failures, worktree conflicts, stale labels, and API rate limits. Symptom, cause, and fix for each."
4
+ keywords: ["forgedock troubleshooting", "claude code pipeline errors", "work-on recovery", "forge.yaml not found", "gh auth login", "quality gate failed"]
5
+ ---
6
+
7
+ # ForgeDock Troubleshooting & Recovery Guide
8
+
9
+ When the pipeline stops, it should tell you exactly why and how to recover. This guide covers the most common failure modes, each with its **symptom**, **cause**, and **fix**.
10
+
11
+ ForgeDock is resumable by design: GitHub is the source of truth. After fixing the underlying problem, you can almost always re-run `/work-on #N` and the pipeline picks up where it left off — it reads the issue's comments and labels to reconstruct state.
12
+
13
+ > Tip: `/work-on` runs a Phase 0 pre-flight check that catches several of these problems before the pipeline spends any tokens. The errors below mirror what that check reports.
14
+
15
+ ---
16
+
17
+ ## 1. `forge.yaml` not found
18
+
19
+ **Symptom**
20
+ The pipeline stalls early, or an agent guesses project values (owner, repo, paths) instead of reading them.
21
+
22
+ **Cause**
23
+ Every ForgeDock command reads `forge.yaml` from the repository root for project identity, paths, and branch configuration. If the file is missing, there is nothing to resolve `GH_REPO`, `REPO_PATH`, or branch targets from.
24
+
25
+ **Fix**
26
+ ```bash
27
+ npx forgedock init
28
+ ```
29
+ This scans your codebase and generates a `forge.yaml`. Alternatively, copy `forge.yaml.example` from the ForgeDock repo to `forge.yaml` and edit the `project`, `paths`, and `branches` sections. Re-run `/work-on #N` afterward.
30
+
31
+ ---
32
+
33
+ ## 2. `forge.yaml` has a syntax error
34
+
35
+ **Symptom**
36
+ A parse error appears in agent output, or values that clearly exist in the file resolve as empty.
37
+
38
+ **Cause**
39
+ `forge.yaml` is not valid YAML — usually a bad indentation level, a tab character where spaces are required, or an unquoted value containing a special character (`:`, `#`, `@`).
40
+
41
+ **Fix**
42
+ Validate the file and find the offending line:
43
+ ```bash
44
+ # With yq (recommended):
45
+ yq '.' forge.yaml
46
+
47
+ # Or with Python:
48
+ python -c "import yaml,sys; yaml.safe_load(open('forge.yaml'))"
49
+ ```
50
+ Both print the line and column of the first error. Fix the indentation or quote the value (e.g. `description: "turns GitHub into a knowledge graph"`), then re-run.
51
+
52
+ ---
53
+
54
+ ## 3. `gh` CLI not authenticated
55
+
56
+ **Symptom**
57
+ A `gh` command fails partway through the pipeline with `HTTP 401`, `Bad credentials`, or `gh: To use GitHub CLI, please run gh auth login`.
58
+
59
+ **Cause**
60
+ ForgeDock uses the GitHub CLI for every GitHub operation (reading issues, posting comments, creating PRs, merging). If `gh` is not authenticated — or the token expired — these calls fail.
61
+
62
+ **Fix**
63
+ ```bash
64
+ gh auth login
65
+ gh auth status # confirm you are logged in and the token has repo scope
66
+ ```
67
+ Phase 0 pre-flight detects this before the pipeline starts. Re-run `/work-on #N` once `gh auth status` is clean.
68
+
69
+ ---
70
+
71
+ ## 4. Quality gate failed
72
+
73
+ **Symptom**
74
+ ```
75
+ QUALITY GATE: FAIL
76
+ ```
77
+ The build stops after listing HIGH/MEDIUM findings, and the issue keeps a `workflow:building` label.
78
+
79
+ **Cause**
80
+ The pre-commit quality gate caught defects (security, correctness, or convention violations) that the review would otherwise flag. The pipeline retries fixes up to 3 times; if it still fails, it adds `needs-human` and stops.
81
+
82
+ **Fix**
83
+ Read the findings in the issue comment, fix the flagged issues in the worktree, then re-run `/work-on #N` to resume the build. If `needs-human` was added, address the findings and remove the label before re-running. The worktree path is recorded in the build comment on the issue.
84
+
85
+ ---
86
+
87
+ ## 5. Worktree already exists
88
+
89
+ **Symptom**
90
+ ```
91
+ fatal: '<path>' already exists
92
+ ```
93
+ when the pipeline tries to create a git worktree for the issue.
94
+
95
+ **Cause**
96
+ A previous run created a worktree for this branch and it was never cleaned up — usually because the run was interrupted before Phase 6 cleanup.
97
+
98
+ **Fix**
99
+ Either reuse it (if it's on the correct branch) or remove and let the pipeline recreate it:
100
+ ```bash
101
+ git worktree list # find the path
102
+ git worktree remove <path> --force # remove the stale worktree
103
+ git branch -D <branch> # optional: delete the leftover branch
104
+ ```
105
+ Re-run `/work-on #N`.
106
+
107
+ ---
108
+
109
+ ## 6. Label in the wrong state
110
+
111
+ **Symptom**
112
+ The pipeline is confused by labels that don't match reality — e.g. an issue tagged `workflow:merged` with no merged PR, or `workflow:building` with no open branch.
113
+
114
+ **Cause**
115
+ A run was interrupted between updating a label and completing the corresponding phase, leaving a stale `workflow:*` label.
116
+
117
+ **Fix**
118
+ ```bash
119
+ /cleanup
120
+ ```
121
+ `/cleanup` sweeps closed issues and stale labels, reconciling `workflow:*` state with actual PR/branch status. Then re-run `/work-on #N` if the issue still needs work.
122
+
123
+ ---
124
+
125
+ ## 7. Branch already exists
126
+
127
+ **Symptom**
128
+ ```
129
+ fatal: a branch named 'feat/issue-N-slug' already exists
130
+ ```
131
+
132
+ **Cause**
133
+ A previous run created the implementation branch and it wasn't deleted after merge or abandonment.
134
+
135
+ **Fix**
136
+ - **To continue** the existing work: check out the branch and let the pipeline reuse it.
137
+ - **To restart** from scratch:
138
+ ```bash
139
+ git branch -D feat/issue-N-slug # local
140
+ git push origin --delete feat/issue-N-slug # remote, if pushed
141
+ ```
142
+ Re-run `/work-on #N`.
143
+
144
+ ---
145
+
146
+ ## 8. PR targets the wrong branch
147
+
148
+ **Symptom**
149
+ A PR is opened against `main`, or against a branch that isn't the issue's correct target.
150
+
151
+ **Cause**
152
+ ForgeDock never targets `main`. Fast-lane issues (no milestone) target `staging`; milestone issues target `milestone/{slug}`. A wrong target usually means the lane was misclassified or the PR was created manually.
153
+
154
+ **Fix**
155
+ The `/work-on` pipeline computes the correct base from the issue's milestone and re-targets automatically — close the mis-targeted PR and re-run `/work-on #N`. To retarget an existing PR without recreating it:
156
+ ```bash
157
+ gh pr edit <PR_NUMBER> --base staging # or milestone/<slug>
158
+ ```
159
+
160
+ ---
161
+
162
+ ## 9. Missing workflow labels
163
+
164
+ **Symptom**
165
+ The pipeline can't transition state; `gh issue edit --add-label "workflow:..."` fails with `label not found`.
166
+
167
+ **Cause**
168
+ The repository doesn't have ForgeDock's managed `workflow:*` labels yet (new repo, or labels were deleted).
169
+
170
+ **Fix**
171
+ ```bash
172
+ npx forgedock labels setup # from the project directory
173
+ # or, for a different repo:
174
+ npx forgedock labels setup --repo owner/repo
175
+ ```
176
+ This idempotently bootstraps every managed label with canonical colors and descriptions. Re-run `/work-on #N`.
177
+
178
+ ---
179
+
180
+ ## 10. GitHub API rate limit exceeded
181
+
182
+ **Symptom**
183
+ ```
184
+ API rate limit exceeded
185
+ ```
186
+ `gh` commands fail in bursts, often during heavy orchestration runs.
187
+
188
+ **Cause**
189
+ The GitHub REST API allows 5,000 requests/hour per token, shared across all tools and agents. Parallel orchestration can exhaust this.
190
+
191
+ **Fix**
192
+ Check your remaining quota and reset time:
193
+ ```bash
194
+ gh api rate_limit --jq '.resources.core'
195
+ ```
196
+ Wait until the `reset` timestamp, or authenticate with a Personal Access Token that has higher limits. Reduce parallelism (fewer concurrent `/orchestrate` agents) to stay under the cap. Re-run `/work-on #N` after the limit resets.
197
+
198
+ ---
199
+
200
+ ## Still stuck?
201
+
202
+ If your problem isn't listed here, or a fix didn't work:
203
+
204
+ 1. **Read the issue's comments.** Every phase writes a structured `FORGE:*` comment (investigation, contract, builder, trajectory). They explain what the pipeline saw and decided.
205
+ 2. **Check the labels.** The `workflow:*` label tells you which phase the issue is in.
206
+ 3. **Re-run `/work-on #N`.** The pipeline is idempotent and resumable — re-running is safe and usually cheap.
207
+
208
+ If none of that resolves it, open an issue on the [ForgeDock GitHub repository](https://github.com/RapierCraftStudios/ForgeDock/issues) with the failing command, the relevant `FORGE:*` comment, and the error output.