forgedock 1.0.16 → 1.0.18

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 (190) hide show
  1. package/README.md +54 -3
  2. package/bin/cross-publish.mjs +344 -0
  3. package/bin/forgedock.mjs +2205 -541
  4. package/bin/github-app-manifest.json.license +2 -0
  5. package/bin/hooks/session-start.mjs +4 -5
  6. package/bin/registry.mjs +20 -0
  7. package/bin/tui.mjs +172 -96
  8. package/commands/adopt.md +433 -0
  9. package/commands/analytics.md +2 -0
  10. package/commands/audit-agents.md +2 -0
  11. package/commands/audit.md +2 -0
  12. package/commands/autopilot.md +77 -0
  13. package/commands/changelog.md +354 -0
  14. package/commands/cleanup.md +2 -0
  15. package/commands/compat-audit.md +330 -0
  16. package/commands/deploy-info.md +6 -5
  17. package/commands/design-bench.md +176 -0
  18. package/commands/design-render-critique-loop.md +103 -0
  19. package/commands/design.md +259 -0
  20. package/commands/diagnose.md +483 -0
  21. package/commands/explain.md +349 -0
  22. package/commands/forge-stats.md +2 -0
  23. package/commands/forgedock-init.md +2 -0
  24. package/commands/geo-audit.md +2 -0
  25. package/commands/incident-response.md +2 -0
  26. package/commands/issue.md +9 -3
  27. package/commands/milestone.md +2 -0
  28. package/commands/optimize.md +411 -0
  29. package/commands/orchestrate.md +239 -0
  30. package/commands/pipeline-health.md +60 -1
  31. package/commands/qa-sweep.md +39 -2
  32. package/commands/quality-gate.md +67 -0
  33. package/commands/replay.md +263 -0
  34. package/commands/resume.md +264 -0
  35. package/commands/review-pr-agents.md +5 -1
  36. package/commands/review-pr-staging.md +160 -2
  37. package/commands/review-pr.md +85 -3
  38. package/commands/rollback.md +2 -0
  39. package/commands/scope.md +280 -0
  40. package/commands/security-audit.md +2 -0
  41. package/commands/status.md +262 -0
  42. package/commands/sync-ecosystem.md +2 -0
  43. package/commands/test-gate.md +929 -0
  44. package/commands/validate.md +2 -0
  45. package/commands/work-on/build/architect.md +128 -18
  46. package/commands/work-on/build/context.md +130 -17
  47. package/commands/work-on/build/implement.md +7 -3
  48. package/commands/work-on/build/validate.md +2 -0
  49. package/commands/work-on/build.md +32 -7
  50. package/commands/work-on/close.md +85 -0
  51. package/commands/work-on/decompose.md +2 -0
  52. package/commands/work-on/investigate.md +30 -3
  53. package/commands/work-on/review.md +13 -1
  54. package/commands/work-on-monolithic.md +2 -0
  55. package/commands/work-on.md +676 -38
  56. package/docs/BRAND.md +51 -0
  57. package/docs/CI.md +177 -0
  58. package/docs/CONFIG.md +94 -0
  59. package/docs/FORGE-PROTOCOL.md +324 -0
  60. package/docs/articles/b-vs-c-baseline.md +210 -0
  61. package/docs/articles/full-abc-benchmark.md +205 -0
  62. package/docs/articles/per-repo-adaptive-scripts-token-savings.md +174 -0
  63. package/docs/articles/selective-spec-loading-token-savings.md +140 -0
  64. package/docs/claude-breakpoints.json +47 -0
  65. package/docs/design/abc-benchmark.md +195 -0
  66. package/docs/design/design-architect-rationale.md +123 -0
  67. package/docs/design/design-memory.md +61 -0
  68. package/docs/design/design-spec-schema.md +248 -0
  69. package/docs/design/design-system-lint.md +150 -0
  70. package/docs/design/divergent-generation.md +106 -0
  71. package/docs/design/effects-appropriateness.md +133 -0
  72. package/docs/design/fixtures/briefs/README.md +47 -0
  73. package/docs/design/fixtures/briefs/cadence.md +39 -0
  74. package/docs/design/fixtures/briefs/plume.md +39 -0
  75. package/docs/design/fixtures/briefs/slipstream.md +39 -0
  76. package/docs/design/fixtures/briefs/tender.md +39 -0
  77. package/docs/design/fixtures/briefs/voltage.md +39 -0
  78. package/docs/design/fixtures/runs/b-vs-c-baseline/cadence/arm-b/run-1.html +364 -0
  79. package/docs/design/fixtures/runs/b-vs-c-baseline/cadence/arm-b/run-2.html +420 -0
  80. package/docs/design/fixtures/runs/b-vs-c-baseline/cadence/arm-b/run-3.html +506 -0
  81. package/docs/design/fixtures/runs/b-vs-c-baseline/plume/arm-b/run-1.html +611 -0
  82. package/docs/design/fixtures/runs/b-vs-c-baseline/plume/arm-b/run-2.html +594 -0
  83. package/docs/design/fixtures/runs/b-vs-c-baseline/plume/arm-b/run-3.html +817 -0
  84. package/docs/design/fixtures/runs/b-vs-c-baseline/runs.json +175 -0
  85. package/docs/design/fixtures/runs/b-vs-c-baseline/scorecard.json +138 -0
  86. package/docs/design/fixtures/runs/b-vs-c-baseline/slipstream/arm-b/run-1.html +373 -0
  87. package/docs/design/fixtures/runs/b-vs-c-baseline/slipstream/arm-b/run-2.html +398 -0
  88. package/docs/design/fixtures/runs/b-vs-c-baseline/slipstream/arm-b/run-3.html +595 -0
  89. package/docs/design/fixtures/runs/b-vs-c-baseline/tender/arm-b/run-1.html +531 -0
  90. package/docs/design/fixtures/runs/b-vs-c-baseline/tender/arm-b/run-2.html +565 -0
  91. package/docs/design/fixtures/runs/b-vs-c-baseline/tender/arm-b/run-3.html +674 -0
  92. package/docs/design/fixtures/runs/b-vs-c-baseline/voltage/arm-b/run-1.html +388 -0
  93. package/docs/design/fixtures/runs/b-vs-c-baseline/voltage/arm-b/run-2.html +463 -0
  94. package/docs/design/fixtures/runs/b-vs-c-baseline/voltage/arm-b/run-3.html +568 -0
  95. package/docs/design/fixtures/runs/full-abc/cadence/arm-a/run-1.html +562 -0
  96. package/docs/design/fixtures/runs/full-abc/cadence/arm-a/run-2.html +618 -0
  97. package/docs/design/fixtures/runs/full-abc/cadence/arm-a/run-3.html +618 -0
  98. package/docs/design/fixtures/runs/full-abc/cadence/arm-b/run-1.html +364 -0
  99. package/docs/design/fixtures/runs/full-abc/cadence/arm-b/run-2.html +420 -0
  100. package/docs/design/fixtures/runs/full-abc/cadence/arm-b/run-3.html +506 -0
  101. package/docs/design/fixtures/runs/full-abc/plume/arm-a/run-1.html +527 -0
  102. package/docs/design/fixtures/runs/full-abc/plume/arm-a/run-2.html +445 -0
  103. package/docs/design/fixtures/runs/full-abc/plume/arm-a/run-3.html +483 -0
  104. package/docs/design/fixtures/runs/full-abc/plume/arm-b/run-1.html +611 -0
  105. package/docs/design/fixtures/runs/full-abc/plume/arm-b/run-2.html +594 -0
  106. package/docs/design/fixtures/runs/full-abc/plume/arm-b/run-3.html +817 -0
  107. package/docs/design/fixtures/runs/full-abc/runs.json +190 -0
  108. package/docs/design/fixtures/runs/full-abc/scorecard.json +144 -0
  109. package/docs/design/fixtures/runs/full-abc/slipstream/arm-a/run-1.html +496 -0
  110. package/docs/design/fixtures/runs/full-abc/slipstream/arm-a/run-2.html +447 -0
  111. package/docs/design/fixtures/runs/full-abc/slipstream/arm-a/run-3.html +564 -0
  112. package/docs/design/fixtures/runs/full-abc/slipstream/arm-b/run-1.html +373 -0
  113. package/docs/design/fixtures/runs/full-abc/slipstream/arm-b/run-2.html +398 -0
  114. package/docs/design/fixtures/runs/full-abc/slipstream/arm-b/run-3.html +595 -0
  115. package/docs/design/fixtures/runs/full-abc/tender/arm-a/run-1.html +622 -0
  116. package/docs/design/fixtures/runs/full-abc/tender/arm-a/run-2.html +475 -0
  117. package/docs/design/fixtures/runs/full-abc/tender/arm-a/run-3.html +660 -0
  118. package/docs/design/fixtures/runs/full-abc/tender/arm-b/run-1.html +531 -0
  119. package/docs/design/fixtures/runs/full-abc/tender/arm-b/run-2.html +565 -0
  120. package/docs/design/fixtures/runs/full-abc/tender/arm-b/run-3.html +674 -0
  121. package/docs/design/fixtures/runs/full-abc/voltage/arm-a/run-1.html +525 -0
  122. package/docs/design/fixtures/runs/full-abc/voltage/arm-a/run-2.html +446 -0
  123. package/docs/design/fixtures/runs/full-abc/voltage/arm-a/run-3.html +463 -0
  124. package/docs/design/fixtures/runs/full-abc/voltage/arm-b/run-1.html +388 -0
  125. package/docs/design/fixtures/runs/full-abc/voltage/arm-b/run-2.html +463 -0
  126. package/docs/design/fixtures/runs/full-abc/voltage/arm-b/run-3.html +568 -0
  127. package/docs/design/fixtures/runs/full-abc-opus/cadence/arm-a/run-1.html +1068 -0
  128. package/docs/design/fixtures/runs/full-abc-opus/cadence/arm-a/run-2.html +1423 -0
  129. package/docs/design/fixtures/runs/full-abc-opus/cadence/arm-a/run-3.html +1245 -0
  130. package/docs/design/fixtures/runs/full-abc-opus/cadence/arm-b/run-1.html +305 -0
  131. package/docs/design/fixtures/runs/full-abc-opus/cadence/arm-b/run-2.html +327 -0
  132. package/docs/design/fixtures/runs/full-abc-opus/cadence/arm-b/run-3.html +428 -0
  133. package/docs/design/fixtures/runs/full-abc-opus/plume/arm-a/run-1.html +1270 -0
  134. package/docs/design/fixtures/runs/full-abc-opus/plume/arm-a/run-2.html +1172 -0
  135. package/docs/design/fixtures/runs/full-abc-opus/plume/arm-a/run-3.html +1532 -0
  136. package/docs/design/fixtures/runs/full-abc-opus/plume/arm-b/run-1.html +315 -0
  137. package/docs/design/fixtures/runs/full-abc-opus/plume/arm-b/run-2.html +342 -0
  138. package/docs/design/fixtures/runs/full-abc-opus/plume/arm-b/run-3.html +353 -0
  139. package/docs/design/fixtures/runs/full-abc-opus/runs.json +190 -0
  140. package/docs/design/fixtures/runs/full-abc-opus/scorecard.json +144 -0
  141. package/docs/design/fixtures/runs/full-abc-opus/slipstream/arm-a/run-1.html +345 -0
  142. package/docs/design/fixtures/runs/full-abc-opus/slipstream/arm-a/run-2.html +396 -0
  143. package/docs/design/fixtures/runs/full-abc-opus/slipstream/arm-a/run-3.html +502 -0
  144. package/docs/design/fixtures/runs/full-abc-opus/slipstream/arm-b/run-1.html +408 -0
  145. package/docs/design/fixtures/runs/full-abc-opus/slipstream/arm-b/run-2.html +446 -0
  146. package/docs/design/fixtures/runs/full-abc-opus/slipstream/arm-b/run-3.html +496 -0
  147. package/docs/design/fixtures/runs/full-abc-opus/tender/arm-a/run-1.html +813 -0
  148. package/docs/design/fixtures/runs/full-abc-opus/tender/arm-a/run-2.html +711 -0
  149. package/docs/design/fixtures/runs/full-abc-opus/tender/arm-a/run-3.html +721 -0
  150. package/docs/design/fixtures/runs/full-abc-opus/tender/arm-b/run-1.html +280 -0
  151. package/docs/design/fixtures/runs/full-abc-opus/tender/arm-b/run-2.html +291 -0
  152. package/docs/design/fixtures/runs/full-abc-opus/tender/arm-b/run-3.html +366 -0
  153. package/docs/design/fixtures/runs/full-abc-opus/voltage/arm-a/run-1.html +1010 -0
  154. package/docs/design/fixtures/runs/full-abc-opus/voltage/arm-a/run-2.html +836 -0
  155. package/docs/design/fixtures/runs/full-abc-opus/voltage/arm-a/run-3.html +930 -0
  156. package/docs/design/fixtures/runs/full-abc-opus/voltage/arm-b/run-1.html +407 -0
  157. package/docs/design/fixtures/runs/full-abc-opus/voltage/arm-b/run-2.html +396 -0
  158. package/docs/design/fixtures/runs/full-abc-opus/voltage/arm-b/run-3.html +529 -0
  159. package/docs/design/foundations/brutalist.css +294 -0
  160. package/docs/design/foundations/editorial.css +300 -0
  161. package/docs/design/foundations/minimal-luxury.css +295 -0
  162. package/docs/design/foundations/technical.css +293 -0
  163. package/docs/design/foundations/warm-photo.css +299 -0
  164. package/docs/design/reference-corpus.md +1726 -0
  165. package/docs/design/render-critique-loop.md +57 -0
  166. package/docs/site/getting-started.md +21 -0
  167. package/docs/spec-graph-schema.md +397 -0
  168. package/package.json +3 -3
  169. package/scripts/bench-scorecard.mjs +239 -0
  170. package/scripts/build-spec-graph.mjs +509 -0
  171. package/scripts/classify-lane.sh +138 -0
  172. package/scripts/design-system-lint.mjs +993 -0
  173. package/scripts/graph-query.sh +486 -0
  174. package/scripts/transition-label.sh +169 -0
  175. package/scripts/validate-pr-target.sh +30 -0
  176. package/scripts/validate-spec-graph.sh +423 -0
  177. package/templates/devdocs/README.md +72 -0
  178. package/templates/devdocs/agent/using-forgedock.md +3 -0
  179. package/templates/devdocs/agent/using-github.md +3 -0
  180. package/templates/devdocs/index.yaml +162 -0
  181. package/templates/devdocs/project/architecture.md +3 -0
  182. package/templates/devdocs/project/conventions.md +3 -0
  183. package/templates/devdocs/project/custom-instructions.md +3 -0
  184. package/templates/devdocs/project/glossary.md +3 -0
  185. package/templates/devdocs/project/stack.md +3 -0
  186. package/templates/devdocs/templates/commit-convention.md +3 -0
  187. package/templates/devdocs/templates/issue.md +3 -0
  188. package/templates/devdocs/templates/pull-request.md +3 -0
  189. package/templates/devdocs/templates/review-finding.md +3 -0
  190. package/templates/workflows/forgedock-review.yml +96 -0
@@ -0,0 +1,349 @@
1
+ ---
2
+ description: Plain-English breakdown of what happened on a GitHub issue — translates FORGE pipeline annotations into a human-readable narrative for teammates and PMs
3
+ argument-hint: <issue number or PR#N> [--repo prefix]
4
+ ---
5
+
6
+ # /explain — FORGE Annotation Translator
7
+
8
+ **Input**: $ARGUMENTS
9
+
10
+ You translate the FORGE pipeline's machine-readable annotations on a GitHub issue or PR into a clear, plain-English narrative that anyone can understand — no pipeline knowledge required. This is a read-only command: it never writes to GitHub, never changes labels, and never modifies any state.
11
+
12
+ **Agent model policy**: Default `model: "sonnet"`. If Sonnet is rate-limited, fall back to `model: "opus"`.
13
+ **NEVER use plan mode (EnterPlanMode).**
14
+
15
+ ---
16
+
17
+ ## Config Preamble
18
+
19
+ Read `forge.yaml` from the project root before executing any phase:
20
+
21
+ ```bash
22
+ CONFIG_FILE="${FORGE_CONFIG:-forge.yaml}"
23
+ if [ -f "$CONFIG_FILE" ]; then
24
+ GH_OWNER=$(yq '.project.owner' "$CONFIG_FILE")
25
+ GH_REPO_NAME=$(yq '.project.repo' "$CONFIG_FILE")
26
+ GH_REPO="${GH_OWNER}/${GH_REPO_NAME}"
27
+ GH_FLAG="-R $GH_REPO"
28
+ REPO_PATH=$(yq '.paths.root' "$CONFIG_FILE")
29
+ else
30
+ echo "WARNING: forge.yaml not found — using placeholder values"
31
+ GH_REPO="your-org/your-repo"
32
+ GH_FLAG="-R $GH_REPO"
33
+ REPO_PATH="./"
34
+ fi
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Phase 1: Parse Input
40
+
41
+ Supported input forms:
42
+
43
+ | Input | Example | What it explains |
44
+ |-------|---------|-----------------|
45
+ | Issue number | `616` | GitHub issue #616 |
46
+ | Issue prefix | `#616` | GitHub issue #616 |
47
+ | PR prefix | `PR#42` or `PR 42` | Pull request #42 |
48
+ | Multi-repo prefix | `mcp:616` | Issue #616 in the `mcp` satellite repo |
49
+
50
+ ```bash
51
+ INPUT="$ARGUMENTS"
52
+
53
+ # Strip leading # if present
54
+ INPUT=$(echo "$INPUT" | sed 's/^#//')
55
+
56
+ # Check for repo prefix (e.g. "mcp:616")
57
+ REPO_PREFIX=$(echo "$INPUT" | grep -oE '^[a-z]+:' | sed 's/://')
58
+ if [ -n "$REPO_PREFIX" ]; then
59
+ INPUT=$(echo "$INPUT" | sed "s/^${REPO_PREFIX}://")
60
+ # Look up satellite repo from forge.yaml
61
+ SAT_REPO=$(yq ".repos.satellites[] | select(.prefix == \"$REPO_PREFIX\") | .repo" "$CONFIG_FILE" 2>/dev/null)
62
+ if [ -n "$SAT_REPO" ]; then
63
+ GH_REPO="$SAT_REPO"
64
+ GH_FLAG="-R $GH_REPO"
65
+ else
66
+ echo "Unknown repo prefix: $REPO_PREFIX — using default repo"
67
+ fi
68
+ fi
69
+
70
+ # Determine if this is an issue or PR
71
+ IS_PR=false
72
+ if echo "$INPUT" | grep -qiE '^pr[[:space:]]*#?[[:space:]]*[0-9]+$'; then
73
+ NUMBER=$(echo "$INPUT" | grep -oE '[0-9]+')
74
+ IS_PR=true
75
+ else
76
+ NUMBER=$(echo "$INPUT" | grep -oE '^[0-9]+')
77
+ fi
78
+
79
+ if [ -z "$NUMBER" ]; then
80
+ echo "ERROR: Could not parse a number from input: $ARGUMENTS"
81
+ echo "Usage: /explain 616 or /explain PR#42 or /explain mcp:616"
82
+ exit 1
83
+ fi
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Phase 2: Fetch GitHub Artifacts
89
+
90
+ Fetch the issue or PR metadata and all its comments.
91
+
92
+ ```bash
93
+ if [ "$IS_PR" = "true" ]; then
94
+ # Fetch PR details
95
+ METADATA=$(gh pr view "$NUMBER" $GH_FLAG --json number,title,body,state,mergedAt,baseRefName,headRefName,author,labels 2>/dev/null)
96
+ if [ -z "$METADATA" ]; then
97
+ echo "ERROR: PR #$NUMBER not found in $GH_REPO"
98
+ exit 1
99
+ fi
100
+ TITLE=$(echo "$METADATA" | jq -r '.title')
101
+ STATE=$(echo "$METADATA" | jq -r '.state')
102
+ COMMENTS=$(gh api repos/$GH_REPO/pulls/$NUMBER/comments --jq '.[].body' 2>/dev/null)
103
+ ISSUE_COMMENTS=$(gh api repos/$GH_REPO/issues/$NUMBER/comments --jq '.[].body' 2>/dev/null)
104
+ ALL_COMMENTS=$(printf '%s\n%s' "$COMMENTS" "$ISSUE_COMMENTS")
105
+ # Also check if this PR closes an issue, and fetch that issue's comments
106
+ CLOSES_ISSUE=$(gh pr view "$NUMBER" $GH_FLAG --json body --jq '.body' 2>/dev/null | grep -oiE 'Closes[[:space:]]+#[0-9]+' | grep -oE '[0-9]+' | head -1)
107
+ if [ -n "$CLOSES_ISSUE" ]; then
108
+ ISSUE_COMMENTS_FROM_LINKED=$(gh api repos/$GH_REPO/issues/$CLOSES_ISSUE/comments --jq '.[].body' 2>/dev/null)
109
+ ALL_COMMENTS=$(printf '%s\n%s' "$ALL_COMMENTS" "$ISSUE_COMMENTS_FROM_LINKED")
110
+ fi
111
+ else
112
+ # Fetch issue details
113
+ METADATA=$(gh issue view "$NUMBER" $GH_FLAG --json number,title,body,state,labels,milestone 2>/dev/null)
114
+ if [ -z "$METADATA" ]; then
115
+ echo "ERROR: Issue #$NUMBER not found in $GH_REPO"
116
+ exit 1
117
+ fi
118
+ TITLE=$(echo "$METADATA" | jq -r '.title')
119
+ STATE=$(echo "$METADATA" | jq -r '.state')
120
+ ALL_COMMENTS=$(gh api repos/$GH_REPO/issues/$NUMBER/comments --jq '.[].body' 2>/dev/null)
121
+ fi
122
+
123
+ if [ -z "$ALL_COMMENTS" ]; then
124
+ echo "## #$NUMBER — $TITLE"
125
+ echo ""
126
+ echo "**Status**: ${STATE}"
127
+ echo ""
128
+ echo "No FORGE pipeline annotations found on this issue. It may not have been processed by the pipeline yet, or it was handled manually."
129
+ exit 0
130
+ fi
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Phase 3: Parse FORGE Annotations
136
+
137
+ Extract each annotation block from the comments. Each `<!-- FORGE:TYPE -->` block is a structured comment posted by the pipeline agent.
138
+
139
+ ```bash
140
+ # Helper: extract comment body containing a FORGE marker
141
+ extract_forge() {
142
+ local marker="$1"
143
+ echo "$ALL_COMMENTS" | awk "
144
+ /<!-- ${marker}(:[A-Z]*)? -->/{found=1; buffer=\"\"}
145
+ found {buffer = buffer \$0 ORS}
146
+ /<!-- ${marker}[^>]*:COMPLETE -->/{if(found){print buffer; found=0; buffer=\"\"}}
147
+ END {if(found && length(buffer)>0) print buffer}
148
+ "
149
+ }
150
+
151
+ INVESTIGATOR=$(echo "$ALL_COMMENTS" | awk '/<!-- FORGE:INVESTIGATOR -->/{found=1} found{print} /<!-- INVESTIGATION:COMPLETE -->/{found=0}')
152
+ CONTRACT=$(echo "$ALL_COMMENTS" | grep -A 1000 "<!-- FORGE:CONTRACT -->" | head -80)
153
+ CONTEXT_COMMENT=$(echo "$ALL_COMMENTS" | grep -A 1000 "<!-- FORGE:CONTEXT -->" | head -80)
154
+ ARCHITECT=$(echo "$ALL_COMMENTS" | grep -A 1000 "<!-- FORGE:ARCHITECT -->" | head -100)
155
+ BUILDER=$(echo "$ALL_COMMENTS" | grep -A 1000 "<!-- FORGE:BUILDER -->" | head -100)
156
+ TRAJECTORY=$(echo "$ALL_COMMENTS" | grep -A 1000 "<!-- FORGE:TRAJECTORY -->" | head -60)
157
+ DECOMPOSED=$(echo "$ALL_COMMENTS" | grep -A 1000 "<!-- FORGE:DECOMPOSED -->" | head -40)
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Phase 4: Produce Plain-English Narrative
163
+
164
+ Output a clean, human-readable explanation. Do NOT include raw HTML comment markers in the output. Translate each FORGE annotation section into plain English.
165
+
166
+ ```
167
+ ## What happened on #$NUMBER: $TITLE
168
+ ```
169
+
170
+ ### 4A: Issue at a glance
171
+
172
+ Show the basics: title, current state, labels, and a one-sentence summary from the issue body.
173
+
174
+ ```bash
175
+ LABELS=$(echo "$METADATA" | jq -r '[.labels[].name] | join(", ")' 2>/dev/null || echo "none")
176
+ BODY_SUMMARY=$([ "$IS_PR" = "true" ] && \
177
+ gh pr view "$NUMBER" $GH_FLAG --json body --jq '.body' 2>/dev/null | head -5 || \
178
+ gh issue view "$NUMBER" $GH_FLAG --json body --jq '.body' 2>/dev/null | head -5)
179
+
180
+ echo "**Type**: $([ "$IS_PR" = "true" ] && echo "Pull Request" || echo "Issue") #$NUMBER"
181
+ echo "**Status**: $STATE"
182
+ echo "**Labels**: $LABELS"
183
+ echo ""
184
+ ```
185
+
186
+ ### 4B: Investigation
187
+
188
+ If a `FORGE:INVESTIGATOR` annotation exists, extract and present:
189
+ - What the pipeline investigated
190
+ - What it found (verdict and confidence)
191
+ - Root cause (in plain English)
192
+ - What files were affected
193
+
194
+ ```
195
+ ### What Was Investigated
196
+
197
+ Read the FORGE:INVESTIGATOR comment and present:
198
+ - **Verdict**: was the issue real? (Confirmed/Partial/Invalid) and confidence level
199
+ - **What was found**: the actual state of the code, in plain English
200
+ - **Root cause**: what specifically was wrong or missing
201
+ - **Affected files**: which files the pipeline identified as needing changes
202
+
203
+ If not present: "Investigation not yet run."
204
+ ```
205
+
206
+ ### 4C: What the team decided to build
207
+
208
+ If a `FORGE:CONTRACT` annotation exists, extract:
209
+ - Task type (Bug Fix / Feature / Refactor)
210
+ - The proposed approach in plain language
211
+ - Key deliverables (what files were changed and why)
212
+ - What was explicitly left out of scope
213
+
214
+ ```
215
+ ### What Was Planned
216
+
217
+ Read the FORGE:CONTRACT comment and present:
218
+ - **Task type**: e.g. "Feature — adding a new slash command"
219
+ - **Approach**: the implementation strategy chosen, in one to two sentences
220
+ - **Deliverables**: a plain list of files changed and the reason for each
221
+ - **Out of scope**: what the team consciously decided NOT to do
222
+
223
+ If not present: "No build contract posted — build phase not started."
224
+ ```
225
+
226
+ ### 4D: Implementation context reviewed
227
+
228
+ If a `FORGE:CONTEXT` annotation exists, summarize:
229
+ - Known pitfalls that were checked before coding
230
+ - Relevant past bugs or review findings
231
+ - Related code paths that needed to stay consistent
232
+
233
+ ```
234
+ ### What History Was Checked
235
+
236
+ Read the FORGE:CONTEXT comment and present:
237
+ - Any known pitfalls or gotchas the team reviewed
238
+ - Past bugs or review findings relevant to the changed files
239
+ - Related code the team needed to keep consistent
240
+
241
+ If not present: "No context review posted." (Omit this section entirely if absent to keep the output concise.)
242
+ ```
243
+
244
+ ### 4E: Architecture decisions
245
+
246
+ If a `FORGE:ARCHITECT` annotation exists, extract:
247
+ - The ordered implementation plan
248
+ - Key architectural decisions
249
+ - Risks identified and how they were mitigated
250
+
251
+ ```
252
+ ### How the Implementation Was Planned
253
+
254
+ Read the FORGE:ARCHITECT comment and present:
255
+ - The implementation order chosen and why
256
+ - Key architectural decisions (e.g. "Schema changes before logic, to avoid import errors")
257
+ - Risks identified and their mitigations
258
+
259
+ If not present: "No architecture plan posted." (Omit this section if absent.)
260
+ ```
261
+
262
+ ### 4F: What was built
263
+
264
+ If a `FORGE:BUILDER` annotation exists, extract:
265
+ - The branch and commit(s)
266
+ - What was actually changed (file list)
267
+ - Whether each acceptance criterion passed
268
+ - Any testing scenarios the team identified
269
+
270
+ ```
271
+ ### What Was Built
272
+
273
+ Read the FORGE:BUILDER comment and present:
274
+ - **Branch**: the feature/fix branch name
275
+ - **Files changed**: plain list of what was modified and why
276
+ - **Acceptance criteria**: which criteria passed, which (if any) did not
277
+ - **Testing checklist**: scenarios the reviewer should verify
278
+
279
+ If not present: "Build not yet completed."
280
+ ```
281
+
282
+ ### 4G: Pipeline performance
283
+
284
+ If a `FORGE:TRAJECTORY` annotation exists, extract:
285
+ - Which phases ran and whether each succeeded
286
+ - Any anomalies or skipped steps
287
+ - The overall outcome (merged, invalid, needs-human)
288
+
289
+ ```
290
+ ### How the Pipeline Performed
291
+
292
+ Read the FORGE:TRAJECTORY comment and present:
293
+ - A simple table or bullet list: which phases ran (Investigation / Build / Review / Close) and the result for each
294
+ - Any phases that were skipped and why
295
+ - Anomalies flagged (e.g. quality gate needed multiple iterations)
296
+ - Final outcome
297
+
298
+ If not present: "Pipeline trajectory not yet recorded — issue is still in progress."
299
+ ```
300
+
301
+ ### 4H: Sub-task breakdown (if decomposed)
302
+
303
+ If a `FORGE:DECOMPOSED` annotation exists:
304
+
305
+ ```
306
+ ### How the Work Was Split
307
+
308
+ This issue was decomposed into sub-tasks:
309
+ Read the FORGE:DECOMPOSED comment and list the sub-issues created with their titles and dependency order.
310
+ ```
311
+
312
+ ### 4I: Final summary
313
+
314
+ Close with a one-paragraph summary covering:
315
+ - What problem was solved (or found to be invalid)
316
+ - How it was solved
317
+ - Current status
318
+
319
+ ```
320
+ ### Summary
321
+
322
+ {One to three sentences covering: the problem, the solution, and the current status.}
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Output Format Rules
328
+
329
+ When producing the narrative, follow these rules:
330
+
331
+ 1. **Never include raw HTML comment markers** — no `<!-- FORGE:* -->` tags in the output
332
+ 2. **Use plain language** — avoid pipeline jargon like "investigator", "quality gate", "worktree". Say "the team checked", "the code was reviewed", "the change was validated"
333
+ 3. **Omit empty sections** — if an annotation is absent, skip its section (don't show "not run" unless it's meaningful context)
334
+ 4. **Verdicts in plain English** — "CONFIRMED" → "Yes, the issue was real"; "INVALID" → "On investigation, no problem was found"; "PARTIAL" → "The issue was partially confirmed"
335
+ 5. **Confidence in plain English** — "HIGH" → "with high confidence"; "MEDIUM" → "with moderate confidence"; "LOW" → "with low confidence — further review may be needed"
336
+ 6. **File paths as code** — wrap file paths in backticks
337
+ 7. **Keep it concise** — the goal is a 2-minute read for a non-technical stakeholder, not a full audit report
338
+
339
+ ---
340
+
341
+ ## Error Handling
342
+
343
+ | Situation | Response |
344
+ |-----------|----------|
345
+ | Issue not found | Print error: "Issue #N not found in {GH_REPO}" |
346
+ | PR not found | Print error: "PR #N not found in {GH_REPO}" |
347
+ | No FORGE annotations present | Print: "No pipeline annotations found on #N. It may not have run through the ForgeDock pipeline yet." |
348
+ | Unknown repo prefix | Warn and fall back to default repo |
349
+ | `forge.yaml` missing | Warn with placeholder values; still attempt to run if `$ARGUMENTS` contains a fully-qualified `owner/repo:N` reference |
@@ -2,6 +2,8 @@
2
2
  description: Track command sizes, detect bloat, compare against baselines and thresholds
3
3
  argument-hint: [diff | baseline | full]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /forge-stats — Prompt Bloat Tracker
7
9
 
@@ -2,6 +2,8 @@
2
2
  description: AI-powered forge.yaml config generator — scans codebase, queries GitHub, auto-fills all optional sections from detection
3
3
  argument-hint: [--preserve | --interactive | --section <name>]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /forgedock-init — AI-Powered Config Generator
7
9
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  description: "Run a GEO audit — check AI referral traffic, page compliance, and auto-create improvement issues"
3
3
  ---
4
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
5
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
4
6
 
5
7
  # /geo-audit — GEO Discoverability Audit & Issue Generator
6
8
 
@@ -2,6 +2,8 @@
2
2
  description: Coordinate P0 incident response — hotfix validation, timeline reconstruction, and post-incident analysis
3
3
  argument-hint: [issue number | "active" | "postmortem {issue}"]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /incident-response — P0 Incident Coordination
7
9
 
package/commands/issue.md CHANGED
@@ -2,6 +2,8 @@
2
2
  description: Create a well-structured GitHub issue that the pipeline can consume reliably
3
3
  argument-hint: [description of the problem or feature]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /issue — Deterministic Issue Creator
7
9
 
@@ -203,10 +205,12 @@ Files that need changes (ordered by dependency — change these in this order):
203
205
 
204
206
  ## Acceptance Criteria
205
207
 
206
- - [ ] {Specific, testable criterion}
208
+ - [ ] {Specific, testable criterion} [type:api]
207
209
  - [ ] {Specific, testable criterion}
208
210
  - [ ] {No regressions in {related_feature}}
209
211
 
212
+ > **Test-type annotation** (optional): Append `[type:api]`, `[type:unit]`, `[type:e2e]`, or `[type:manual]` to each criterion. The test gate reads this annotation directly and skips regex inference. Omit it to rely on regex classification fallback.
213
+
210
214
  ## Dependencies
211
215
 
212
216
  {If this issue depends on other issues:}
@@ -279,8 +283,10 @@ Files that need changes (ordered by dependency):
279
283
 
280
284
  ## Acceptance Criteria
281
285
 
286
+ - [ ] {Specific, testable criterion} [type:api]
282
287
  - [ ] {Specific, testable criterion}
283
- - [ ] {Specific, testable criterion}
288
+
289
+ > **Test-type annotation** (optional): Append `[type:api]`, `[type:unit]`, `[type:e2e]`, or `[type:manual]` to each criterion. The test gate reads this annotation directly and skips regex inference. Omit it to rely on regex classification fallback.
284
290
 
285
291
  ## Context
286
292
 
@@ -305,7 +311,7 @@ Files that need changes (ordered by dependency):
305
311
  - Title MUST use conventional commit prefix: `fix:`, `feat:`, `refactor:`, `investigate:`, `docs:`
306
312
  - `## Problem` is MANDATORY — every issue must state what's wrong or what's needed
307
313
  - `## Affected Files` is MANDATORY — list actual file paths the investigator should read first
308
- - `## Acceptance Criteria` is MANDATORY — at least one testable `- [ ]` criterion
314
+ - `## Acceptance Criteria` is MANDATORY — at least one testable `- [ ]` criterion; each item MAY carry an optional `[type:api|unit|e2e|manual]` annotation for deterministic test-gate classification (omit to fall back to regex inference)
309
315
  - Domain-specific sections (Evidence Trail, Pattern Metadata, Validation Checklist, etc.) SHOULD be preserved — they add pipeline value. Add mandatory sections around them, not instead of them.
310
316
  - `## Prior Investigation` is OPTIONAL — include only when parent/sibling investigation Gist URLs are available. Each Gist URL must be wrapped in a `<!-- FORGE:PRIOR_GIST: {url} -->` annotation for machine-readable parsing by downstream agents. <!-- Added: forge#339 -->
311
317
 
@@ -2,6 +2,8 @@
2
2
  description: Create, manage, and ship milestones — the top-level planning layer for feature development
3
3
  argument-hint: [create <name> | status | ship <slug> | sync <slug>]
4
4
  ---
5
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
6
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
5
7
 
6
8
  # /milestone — Milestone Lifecycle Manager
7
9