forgedock 1.0.15 → 1.0.17

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 (71) hide show
  1. package/README.md +82 -60
  2. package/bin/forgedock.mjs +1992 -540
  3. package/bin/github-app-manifest.json.license +2 -0
  4. package/bin/hooks/session-start.mjs +4 -5
  5. package/bin/registry.mjs +20 -0
  6. package/bin/tui.mjs +172 -96
  7. package/commands/adopt.md +433 -0
  8. package/commands/analytics.md +2 -0
  9. package/commands/audit-agents.md +2 -0
  10. package/commands/audit.md +2 -0
  11. package/commands/changelog.md +354 -0
  12. package/commands/cleanup.md +2 -0
  13. package/commands/compat-audit.md +330 -0
  14. package/commands/deploy-info.md +6 -5
  15. package/commands/diagnose.md +483 -0
  16. package/commands/explain.md +349 -0
  17. package/commands/forge-stats.md +2 -0
  18. package/commands/forgedock-init.md +2 -0
  19. package/commands/geo-audit.md +2 -0
  20. package/commands/incident-response.md +2 -0
  21. package/commands/issue.md +2 -0
  22. package/commands/milestone.md +2 -0
  23. package/commands/optimize.md +411 -0
  24. package/commands/orchestrate.md +118 -0
  25. package/commands/pipeline-health.md +60 -1
  26. package/commands/qa-sweep.md +2 -0
  27. package/commands/quality-gate.md +37 -0
  28. package/commands/replay.md +263 -0
  29. package/commands/resume.md +264 -0
  30. package/commands/review-pr-agents.md +5 -1
  31. package/commands/review-pr-staging.md +2 -0
  32. package/commands/review-pr.md +85 -3
  33. package/commands/rollback.md +2 -0
  34. package/commands/scope.md +280 -0
  35. package/commands/security-audit.md +2 -0
  36. package/commands/status.md +262 -0
  37. package/commands/sync-ecosystem.md +2 -0
  38. package/commands/validate.md +2 -0
  39. package/commands/work-on/build/architect.md +128 -18
  40. package/commands/work-on/build/context.md +130 -17
  41. package/commands/work-on/build/implement.md +2 -0
  42. package/commands/work-on/build/validate.md +2 -0
  43. package/commands/work-on/build.md +32 -7
  44. package/commands/work-on/close.md +85 -0
  45. package/commands/work-on/decompose.md +2 -0
  46. package/commands/work-on/investigate.md +30 -3
  47. package/commands/work-on/review.md +13 -1
  48. package/commands/work-on-monolithic.md +2 -0
  49. package/commands/work-on.md +624 -36
  50. package/docs/BRAND.md +51 -0
  51. package/docs/CONFIG.md +94 -0
  52. package/docs/articles/per-repo-adaptive-scripts-token-savings.md +174 -0
  53. package/docs/claude-breakpoints.json +47 -0
  54. package/docs/site/getting-started.md +21 -0
  55. package/package.json +10 -2
  56. package/scripts/classify-lane.sh +145 -0
  57. package/scripts/transition-label.sh +161 -0
  58. package/scripts/validate-pr-target.sh +30 -0
  59. package/templates/devdocs/README.md +72 -0
  60. package/templates/devdocs/agent/using-forgedock.md +3 -0
  61. package/templates/devdocs/agent/using-github.md +3 -0
  62. package/templates/devdocs/index.yaml +162 -0
  63. package/templates/devdocs/project/architecture.md +3 -0
  64. package/templates/devdocs/project/conventions.md +3 -0
  65. package/templates/devdocs/project/custom-instructions.md +3 -0
  66. package/templates/devdocs/project/glossary.md +3 -0
  67. package/templates/devdocs/project/stack.md +3 -0
  68. package/templates/devdocs/templates/commit-convention.md +3 -0
  69. package/templates/devdocs/templates/issue.md +3 -0
  70. package/templates/devdocs/templates/pull-request.md +3 -0
  71. package/templates/devdocs/templates/review-finding.md +3 -0
@@ -0,0 +1,433 @@
1
+ ---
2
+ description: Bootstrap an existing repo for ForgeDock — triage open issues, apply labels, suggest a starter milestone, and identify first /work-on candidates
3
+ argument-hint: [--dry-run | --limit <N> | --milestone | --no-milestone]
4
+ ---
5
+
6
+ # /adopt — Repo Bootstrap & Backlog Triage
7
+
8
+ **Input**: $ARGUMENTS
9
+
10
+ You onboard an existing repo into the ForgeDock pipeline. Unlike `/forgedock-init` (which generates `forge.yaml`) and `/issue` (which creates new issues), `/adopt` operates on an existing backlog: scanning open issues, classifying them, applying category and priority labels, suggesting a starter milestone, and ranking the best `/work-on` first candidates.
11
+
12
+ Run `/adopt` once after `npx forgedock init` + `/forgedock-init` to make a legacy backlog pipeline-ready without touching the issues themselves.
13
+
14
+ **Agent model policy**: Default `model: "sonnet"`. Fallback: `model: "opus"` if Sonnet is rate-limited.
15
+ **NEVER use plan mode (EnterPlanMode).**
16
+
17
+ ---
18
+
19
+ ## Argument Parsing
20
+
21
+ | Flag | Effect |
22
+ |------|--------|
23
+ | (none) | Full triage — scan issues, apply labels, suggest milestone, report candidates |
24
+ | `--dry-run` | Classify and report but do NOT write any labels or create any milestone |
25
+ | `--limit <N>` | Cap issue scan to the N most recently updated open issues (default: 200) |
26
+ | `--milestone` | After labeling, automatically create the suggested starter milestone (no prompt) |
27
+ | `--no-milestone` | Skip milestone suggestion entirely |
28
+
29
+ Parse `$ARGUMENTS`:
30
+ ```bash
31
+ DRY_RUN=false
32
+ ISSUE_LIMIT=200
33
+ AUTO_MILESTONE=false
34
+ SKIP_MILESTONE=false
35
+
36
+ for arg in $ARGUMENTS; do
37
+ case "$arg" in
38
+ --dry-run) DRY_RUN=true ;;
39
+ --milestone) AUTO_MILESTONE=true ;;
40
+ --no-milestone) SKIP_MILESTONE=true ;;
41
+ --limit) NEXT_IS_LIMIT=true ;;
42
+ *)
43
+ if [ "$NEXT_IS_LIMIT" = "true" ]; then
44
+ ISSUE_LIMIT="$arg"
45
+ NEXT_IS_LIMIT=false
46
+ fi
47
+ ;;
48
+ esac
49
+ done
50
+ ```
51
+
52
+ If `DRY_RUN=true`, prefix all actions with `[DRY RUN]` and skip all `gh label` writes and issue creation.
53
+
54
+ ---
55
+
56
+ ## Config Resolution
57
+
58
+ Read `forge.yaml` at the project root to resolve all project-specific variables before running any commands:
59
+
60
+ ```bash
61
+ CONFIG_FILE="${FORGE_CONFIG:-forge.yaml}"
62
+ if [ ! -f "$CONFIG_FILE" ]; then
63
+ echo "ERROR: forge.yaml not found."
64
+ echo ""
65
+ echo "Run first: npx forgedock init"
66
+ echo "Then: /forgedock-init"
67
+ echo "Then: /adopt"
68
+ exit 1
69
+ fi
70
+
71
+ GH_REPO=$(yq '.project.owner + "/" + .project.repo' "$CONFIG_FILE")
72
+ GH_FLAG="-R $GH_REPO"
73
+ REPO_PATH=$(yq '.paths.root' "$CONFIG_FILE")
74
+ STAGING_BRANCH=$(yq '.branches.staging' "$CONFIG_FILE")
75
+ DEFAULT_BRANCH=$(yq '.branches.default' "$CONFIG_FILE")
76
+ PROJECT_BOARD_OWNER=$(yq '.project_board.owner // .project.owner' "$CONFIG_FILE")
77
+ PROJECT_NUMBER=$(yq '.project_board.project_number // empty' "$CONFIG_FILE" 2>/dev/null || echo "")
78
+ PROJECT_ID=$(yq '.project_board.project_id // empty' "$CONFIG_FILE" 2>/dev/null || echo "")
79
+ ```
80
+
81
+ All `{GH_REPO}`, `{GH_FLAG}`, `{REPO_PATH}`, `{STAGING_BRANCH}`, `{DEFAULT_BRANCH}`, `{PROJECT_BOARD_OWNER}`, `{PROJECT_NUMBER}`, and `{PROJECT_ID}` references below are populated from `forge.yaml`.
82
+
83
+ ---
84
+
85
+ ## Phase 0: Prerequisites
86
+
87
+ ### 0A: GitHub auth check
88
+
89
+ ```bash
90
+ if ! gh auth status &>/dev/null; then
91
+ echo "ERROR: GitHub CLI not authenticated. Run: gh auth login"
92
+ exit 1
93
+ fi
94
+ ```
95
+
96
+ ### 0B: Ensure required labels exist
97
+
98
+ ForgeDock commands depend on canonical label names. Bootstrap them idempotently before any labeling.
99
+
100
+ ```bash
101
+ echo "Checking ForgeDock labels on ${GH_REPO}..."
102
+ cd "$REPO_PATH" && npx forgedock labels setup --repo "$GH_REPO" 2>&1 | tail -5
103
+ echo "Labels ready."
104
+ ```
105
+
106
+ If `npx forgedock labels setup` is unavailable (e.g. local dev install), fall back to verifying key labels exist and creating any that are missing:
107
+
108
+ ```bash
109
+ # Fallback: verify a sample of key labels exist
110
+ MISSING_LABELS=""
111
+ for label in "priority:P0" "priority:P1" "priority:P2" "priority:P3" "workflow:investigating" "workflow:ready-to-build" "workflow:building" "workflow:in-review" "workflow:merged" "workflow:invalid" "needs-human"; do
112
+ gh label list ${GH_FLAG} --json name --jq '.[].name' 2>/dev/null | grep -qx "$label" || MISSING_LABELS="$MISSING_LABELS $label"
113
+ done
114
+ if [ -n "$MISSING_LABELS" ]; then
115
+ echo "WARNING: Missing labels:$MISSING_LABELS"
116
+ echo "Run 'npx forgedock labels setup' from $REPO_PATH to create them."
117
+ fi
118
+ ```
119
+
120
+ ### 0C: Count open issues
121
+
122
+ ```bash
123
+ TOTAL_OPEN=$(gh issue list ${GH_FLAG} --state open --limit 1 --json number --jq '. | length' 2>/dev/null || echo "0")
124
+ # More accurate count via API
125
+ TOTAL_OPEN=$(gh api "repos/${GH_REPO}/issues?state=open&per_page=1" -i 2>/dev/null \
126
+ | grep -i "^link:" | grep -oE 'page=[0-9]+>; rel="last"' | grep -oE '[0-9]+' | tail -1 || echo "$TOTAL_OPEN")
127
+ echo "Open issues in ${GH_REPO}: ${TOTAL_OPEN}"
128
+ echo "Will process up to ${ISSUE_LIMIT} issues."
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Phase 1: Issue Scan
134
+
135
+ ### 1A: Fetch all open issues
136
+
137
+ ```bash
138
+ echo "Fetching open issues..."
139
+ ALL_ISSUES=$(gh issue list ${GH_FLAG} \
140
+ --state open \
141
+ --limit "$ISSUE_LIMIT" \
142
+ --json number,title,body,labels,createdAt,updatedAt \
143
+ --jq '.[]')
144
+ ```
145
+
146
+ ### 1B: Split into already-adopted and legacy
147
+
148
+ An issue is "already pipeline-ready" if it has ANY `workflow:` label OR any `priority:` label already applied. These should be skipped — they were either created via `/issue` or previously adopted.
149
+
150
+ ```bash
151
+ LEGACY_ISSUES=$(echo "$ALL_ISSUES" | jq -s '
152
+ .[] | select(
153
+ (.labels | map(.name) | any(startswith("workflow:") or startswith("priority:"))) | not
154
+ )
155
+ ')
156
+
157
+ ALREADY_READY=$(echo "$ALL_ISSUES" | jq -s '
158
+ .[] | select(
159
+ (.labels | map(.name) | any(startswith("workflow:") or startswith("priority:")))
160
+ )
161
+ ')
162
+
163
+ LEGACY_COUNT=$(echo "$LEGACY_ISSUES" | jq -s '. | length')
164
+ READY_COUNT=$(echo "$ALREADY_READY" | jq -s '. | length')
165
+
166
+ echo "Already pipeline-ready: ${READY_COUNT}"
167
+ echo "Need triage: ${LEGACY_COUNT}"
168
+ ```
169
+
170
+ If `LEGACY_COUNT == 0`:
171
+ ```
172
+ All ${READY_COUNT} open issues already have pipeline labels. Nothing to adopt.
173
+ Run /work-on next to start working on the highest-priority issue.
174
+ ```
175
+ → Skip to Phase 6 (Summary).
176
+
177
+ ---
178
+
179
+ ## Phase 2: Triage — Classify Each Legacy Issue
180
+
181
+ For each issue in `LEGACY_ISSUES`, analyze the title and body to determine:
182
+
183
+ ### 2A: Type classification
184
+
185
+ | Type | Label | Signals in title/body |
186
+ |------|-------|----------------------|
187
+ | Bug | `bug` | "crash", "broken", "fails", "error", "exception", "TypeError", "not working", "regression", "fix" prefix, stack traces |
188
+ | Feature | `feature` | "add", "support", "implement", "new", "create", "enable", "feat" prefix |
189
+ | Enhancement | `enhancement` | "improve", "better", "update", "upgrade", "enhance" |
190
+ | Refactor | `refactor` | "clean", "refactor", "extract", "rename", "simplify", "dead code", "remove" |
191
+ | Investigation | `feature` | "investigate", "audit", "research", "evaluate", "why does", "figure out" |
192
+ | Documentation | `documentation` | "docs", "document", "README", "guide", "write up" |
193
+ | Infrastructure | `bug` (infra) | "deploy", "CI", "docker", "workflow", "pipeline", "kubernetes", "nginx" |
194
+
195
+ Default to `enhancement` when no signal is clear.
196
+
197
+ ### 2B: Priority classification
198
+
199
+ | Priority | Label | Signals |
200
+ |----------|-------|---------|
201
+ | P0 | `priority:P0` | "production down", "data loss", "security breach", "P0", "critical", "outage", "blocked deploy" |
202
+ | P1 | `priority:P1` | "broken", "regression", "blocks", "cannot", "P1", "high priority", "urgent", "major bug" |
203
+ | P2 | `priority:P2` | "minor", "improve", "enhancement", "feature", P2 |
204
+ | P3 | `priority:P3` | "cosmetic", "typo", "nice to have", "polish", "low priority", no severity signals |
205
+
206
+ Default to `priority:P2` for features and enhancements, `priority:P3` for documentation and cosmetic issues, `priority:P1` for bugs with unclear severity.
207
+
208
+ ### 2C: Build classification table
209
+
210
+ Build a triage table in memory:
211
+
212
+ ```
213
+ TRIAGE_RESULTS = [
214
+ { number, title, type_label, priority_label, type_signal, priority_signal },
215
+ ...
216
+ ]
217
+ ```
218
+
219
+ For each issue: read title + first 500 chars of body, apply the rules from 2A and 2B, record both the assigned labels AND the signal that drove the assignment (for the report).
220
+
221
+ ---
222
+
223
+ ## Phase 3: Apply Labels
224
+
225
+ **Skip if `DRY_RUN=true`** — report what would be applied instead.
226
+
227
+ For each issue in TRIAGE_RESULTS:
228
+
229
+ ```bash
230
+ # Apply type label and priority label
231
+ gh issue edit {NUMBER} ${GH_FLAG} \
232
+ --add-label "{TYPE_LABEL},{PRIORITY_LABEL}" 2>&1
233
+
234
+ echo " #${NUMBER}: +{TYPE_LABEL} +{PRIORITY_LABEL} — {TITLE}"
235
+ ```
236
+
237
+ **Rate limiting note**: If applying labels to 50+ issues, add a brief pause between batches:
238
+ ```bash
239
+ # After every 20 issues:
240
+ BATCH_MOD=$((COUNT % 20))
241
+ [ "$BATCH_MOD" -eq 0 ] && sleep 2
242
+ ```
243
+
244
+ **Idempotency**: `gh issue edit --add-label` is idempotent — adding a label that already exists is a no-op. No need to pre-check.
245
+
246
+ ---
247
+
248
+ ## Phase 4: Milestone Suggestion
249
+
250
+ **Skip if `SKIP_MILESTONE=true`** or `DRY_RUN=true`.
251
+
252
+ ### 4A: Detect existing milestones
253
+
254
+ ```bash
255
+ EXISTING_MILESTONES=$(gh api "repos/${GH_REPO}/milestones?state=open" \
256
+ --jq '.[] | {number: .number, title: .title, open_issues: .open_issues}' 2>/dev/null)
257
+
258
+ if [ -n "$EXISTING_MILESTONES" ]; then
259
+ echo "Existing open milestones:"
260
+ echo "$EXISTING_MILESTONES"
261
+ fi
262
+ ```
263
+
264
+ ### 4B: Cluster issues for milestone suggestion
265
+
266
+ From the TRIAGE_RESULTS, identify the best starter milestone candidates:
267
+ - Prefer `bug` and `feature` type issues over documentation
268
+ - Prefer issues with `priority:P1` or `priority:P2`
269
+ - Group by keyword overlap in titles (e.g., all issues mentioning "auth", "dashboard", "API")
270
+ - Target 3–7 issues for the starter milestone — enough to be a meaningful deliverable, small enough to complete quickly
271
+
272
+ **Clustering heuristic**:
273
+ 1. Extract top 3 keyword clusters from issue titles (nouns, domain terms — not stop words)
274
+ 2. For each cluster, list the issues it covers
275
+ 3. Pick the cluster with the most P1/P2 issues — this is the starter milestone scope
276
+ 4. If no clear cluster emerges (all issues are unrelated), pick the top 5 P1/P2 bugs as the starter milestone
277
+
278
+ ### 4C: Name the milestone
279
+
280
+ Derive a title from the cluster:
281
+ - If cluster keyword is "auth": "Auth Hardening"
282
+ - If cluster keyword is "api": "API Stability"
283
+ - If cluster keyword is "dashboard": "Dashboard Polish"
284
+ - Otherwise: "Initial Triage — {month} {year}" (e.g., "Initial Triage — Jun 2025")
285
+
286
+ ### 4D: Present suggestion
287
+
288
+ ```
289
+ ## Suggested Starter Milestone
290
+
291
+ Title: "{MILESTONE_TITLE}"
292
+ Issues ({N}):
293
+ #{N1} [{TYPE}/{PRIORITY}] — {TITLE}
294
+ #{N2} [{TYPE}/{PRIORITY}] — {TITLE}
295
+ ...
296
+
297
+ This would create milestone "{MILESTONE_TITLE}" in ${GH_REPO} and assign the above issues to it.
298
+ ```
299
+
300
+ ### 4E: Create milestone (if `--milestone` flag or user confirms)
301
+
302
+ **With `--milestone` flag**: create automatically.
303
+ **Without flag**: ask for confirmation:
304
+
305
+ ```
306
+ Create this milestone? [Y/n]
307
+ ```
308
+
309
+ Wait for user input. Default: Y.
310
+
311
+ ```bash
312
+ # Create the milestone
313
+ MILESTONE_NUMBER=$(gh api "repos/${GH_REPO}/milestones" \
314
+ --method POST \
315
+ --field title="{MILESTONE_TITLE}" \
316
+ --field description="Starter milestone generated by /adopt. Covers the first /work-on batch." \
317
+ --field state="open" \
318
+ --jq '.number' 2>&1)
319
+
320
+ echo "Created milestone #${MILESTONE_NUMBER}: {MILESTONE_TITLE}"
321
+
322
+ # Assign issues to the milestone
323
+ for NUM in {MILESTONE_ISSUE_NUMBERS}; do
324
+ gh api "repos/${GH_REPO}/issues/${NUM}" -X PATCH --field milestone="$MILESTONE_NUMBER" 2>/dev/null
325
+ echo " Assigned #${NUM} → milestone"
326
+ done
327
+ ```
328
+
329
+ **Also create the milestone branch** (so `/work-on` feature-lane issues get their own branch):
330
+
331
+ ```bash
332
+ cd "$REPO_PATH"
333
+ git fetch origin "$DEFAULT_BRANCH"
334
+ MILESTONE_SLUG=$(echo "{MILESTONE_TITLE}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-')
335
+ git branch "milestone/${MILESTONE_SLUG}" "origin/${DEFAULT_BRANCH}" 2>/dev/null \
336
+ && git push origin "milestone/${MILESTONE_SLUG}" \
337
+ && echo "Created branch: milestone/${MILESTONE_SLUG}" \
338
+ || echo "Branch milestone/${MILESTONE_SLUG} already exists — skipping"
339
+ ```
340
+
341
+ ---
342
+
343
+ ## Phase 5: /work-on Candidate Report
344
+
345
+ Identify the best first issues for `/work-on`. Rank by:
346
+
347
+ 1. **Priority**: P0 > P1 > P2 > P3
348
+ 2. **Scope**: Issues with explicit file references in the body score higher (smaller investigation burden)
349
+ 3. **Clarity**: Issues with "## Acceptance Criteria" or a checklist score higher
350
+ 4. **Type**: Confirmed bugs score higher than feature requests (bugs are more actionable)
351
+
352
+ Score each issue in TRIAGE_RESULTS:
353
+ ```
354
+ score = priority_score(priority_label) # P0=40, P1=30, P2=20, P3=10
355
+ + has_affected_files(body) * 15 # body contains "## Affected Files" or file paths
356
+ + has_acceptance_criteria(body) * 10 # body contains "## Acceptance Criteria" or "- [ ]"
357
+ + is_bug(type_label) * 5 # bug type
358
+ ```
359
+
360
+ Report the top 5 (or all if fewer than 5):
361
+
362
+ ```
363
+ ## Top /work-on Candidates
364
+
365
+ | Rank | Issue | Type | Priority | Score | Why |
366
+ |------|-------|------|----------|-------|-----|
367
+ | 1 | #{N} — {title} | {type} | {priority} | {score} | {reason} |
368
+ | 2 | #{N} — {title} | {type} | {priority} | {score} | {reason} |
369
+ ...
370
+ ```
371
+
372
+ Where `{reason}` is a brief signal: "confirmed bug + file refs", "P1 + acceptance criteria", etc.
373
+
374
+ ---
375
+
376
+ ## Phase 6: Summary Report
377
+
378
+ ```
379
+ ## /adopt Complete — {GH_REPO}
380
+
381
+ ### Issues Processed
382
+
383
+ | Category | Count |
384
+ |----------|-------|
385
+ | Already pipeline-ready (skipped) | {READY_COUNT} |
386
+ | Triaged in this run | {LEGACY_COUNT} |
387
+ | Total open issues | {TOTAL_OPEN} |
388
+
389
+ ### Labels Applied
390
+
391
+ | Issue | Type Label | Priority Label |
392
+ |-------|------------|----------------|
393
+ | #{N} — {title[:50]} | {type} | {priority} |
394
+ ...
395
+
396
+ {If DRY_RUN: "** DRY RUN — no labels were written **"}
397
+
398
+ ### Milestone
399
+
400
+ {If milestone created: "Created milestone '#{MS_NUMBER}: {TITLE}' with {N} issues. Branch: milestone/{slug}"}
401
+ {If milestone skipped: "No milestone created (--no-milestone or skipped by user)"}
402
+ {If milestone existed: "Existing milestones detected — no new milestone created"}
403
+
404
+ ### Top /work-on Candidates
405
+
406
+ #{N1}, #{N2}, #{N3} (see ranking table above)
407
+
408
+ ### Next Steps
409
+
410
+ 1. Review the label assignments above — adjust any misclassifications:
411
+ \`gh issue edit #{N} -R {GH_REPO} --add-label "bug" --remove-label "enhancement"\`
412
+
413
+ 2. Start working on the top candidate:
414
+ \`/work-on {TOP_CANDIDATE_NUMBER}\`
415
+
416
+ 3. Or run the full milestone:
417
+ \`/orchestrate milestone {MILESTONE_SLUG}\` (runs all milestone issues in parallel)
418
+
419
+ 4. To re-run adoption on newly added issues:
420
+ \`/adopt\` (already-labeled issues are skipped automatically)
421
+ ```
422
+
423
+ ---
424
+
425
+ ## Error Handling
426
+
427
+ - **`forge.yaml` missing**: Tell the user to run `npx forgedock init` first, then `/forgedock-init`. Stop.
428
+ - **GitHub auth failure**: Tell the user to run `gh auth login`. Stop.
429
+ - **No open issues**: Report "No open issues found in {GH_REPO}" and stop gracefully.
430
+ - **All issues already labeled**: Report "All {N} open issues already have pipeline labels" and suggest `/work-on next`.
431
+ - **Label creation fails**: Log the failure, continue with remaining issues. Report failures in Phase 6.
432
+ - **Milestone already exists with same title**: Skip milestone creation, report the existing milestone number.
433
+ - **Rate limit hit**: Pause and retry with exponential backoff (max 3 retries). If still failing, report the last successfully processed issue number and instruct the user to re-run with `--limit` set to the remaining count.
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  description: Pull production analytics from GSC, Bing Webmaster, Clarity, Umami, Cloudflare, Stripe, and GA4 — generate insights and create actionable GitHub issues. Trigger when user says things like "check analytics", "look at prod analytics", "make issues from analytics", "what's happening on the site", "audit the site", "check revenue", etc.
3
3
  ---
4
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
5
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
4
6
 
5
7
  # /analytics — Production Analytics Audit & Issue Generator
6
8
 
@@ -2,6 +2,8 @@
2
2
  description: Audit agent outputs from an orchestration run — timeline analysis, stall detection, active vs idle time breakdown
3
3
  argument-hint: [session-id | latest | <agent-id>]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /audit-agents — Agent Output Auditor
7
9
 
package/commands/audit.md CHANGED
@@ -2,6 +2,8 @@
2
2
  description: Trace a production issue or pipeline failure end-to-end through GitHub artifacts, then file a detailed improvement issue to the Forge repo
3
3
  argument-hint: <description of what went wrong> [--issue N] [--pr N] [--repo prefix]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /audit — Pipeline Failure Trace & Self-Healing Issue
7
9