forgedock 1.0.0
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.
- package/LICENSE +244 -0
- package/README.md +251 -0
- package/bin/forgedock.mjs +232 -0
- package/commands/analytics.md +777 -0
- package/commands/audit-agents.md +410 -0
- package/commands/audit.md +410 -0
- package/commands/autopilot.md +432 -0
- package/commands/cleanup.md +264 -0
- package/commands/deploy-info.md +292 -0
- package/commands/failure-recon.md +375 -0
- package/commands/forge-stats.md +183 -0
- package/commands/geo-audit.md +343 -0
- package/commands/incident-response.md +384 -0
- package/commands/issue.md +506 -0
- package/commands/milestone.md +599 -0
- package/commands/orchestrate.md +1044 -0
- package/commands/pipeline-health.md +2343 -0
- package/commands/qa-sweep.md +237 -0
- package/commands/quality-gate.md +777 -0
- package/commands/review-pr-agents.md +1711 -0
- package/commands/review-pr-staging.md +325 -0
- package/commands/review-pr.md +888 -0
- package/commands/rollback.md +253 -0
- package/commands/security-audit.md +529 -0
- package/commands/sync-ecosystem.md +527 -0
- package/commands/validate.md +131 -0
- package/commands/work-on/build/architect.md +291 -0
- package/commands/work-on/build/context.md +349 -0
- package/commands/work-on/build/implement.md +280 -0
- package/commands/work-on/build/validate.md +292 -0
- package/commands/work-on/build.md +262 -0
- package/commands/work-on/close.md +350 -0
- package/commands/work-on/decompose.md +254 -0
- package/commands/work-on/investigate.md +437 -0
- package/commands/work-on/review.md +245 -0
- package/commands/work-on-monolithic.md +298 -0
- package/commands/work-on.md +1089 -0
- package/docs/CODEX.md +92 -0
- package/docs/WORKFLOW.md +104 -0
- package/package.json +45 -0
- package/scripts/verify-env-vars.sh +201 -0
- package/scripts/verify-host-headers.sh +117 -0
- package/scripts/verify-route-registration.sh +118 -0
- package/scripts/verify-sops-chain.sh +163 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a well-structured GitHub issue that the pipeline can consume reliably
|
|
3
|
+
argument-hint: [description of the problem or feature]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /issue — Deterministic Issue Creator
|
|
7
|
+
|
|
8
|
+
**Input**: $ARGUMENTS
|
|
9
|
+
|
|
10
|
+
You create GitHub issues with the exact structure the `/work-on` pipeline expects. Every issue you create must give the investigation agent enough context to find the right files on the first pass — no vague descriptions, no missing domains, no ambiguous scope.
|
|
11
|
+
|
|
12
|
+
**Agent model policy**: Default `model: "sonnet"`. Fallback: `model: "opus"` if Sonnet is rate-limited.
|
|
13
|
+
**NEVER use plan mode (EnterPlanMode).**
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Why This Exists
|
|
18
|
+
|
|
19
|
+
Bad issues cause cascading pipeline failures. When an issue says "fix the docker mount" without specifying WHICH compose file, the investigator checks one file, misses the override, the builder writes an incomplete fix, the deploy fails, and a new audit issue gets filed about the original issue. One vague sentence costs 3+ agent runs. This command prevents that by enforcing structure at creation time.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Phase 1: Parse the Request
|
|
24
|
+
|
|
25
|
+
The user's input (`$ARGUMENTS`) can be:
|
|
26
|
+
|
|
27
|
+
| Input Form | Example |
|
|
28
|
+
|-----------|---------|
|
|
29
|
+
| Free-text description | "the billing page crashes when credits hit zero" |
|
|
30
|
+
| URL to error/log | "https://sentry.io/..." or a pasted stack trace |
|
|
31
|
+
| Reference to code | "the scraper queue leaks memory in unified_consumer.py" |
|
|
32
|
+
| Feature request | "add a dark mode toggle to the dashboard settings page" |
|
|
33
|
+
| Multi-repo prefix | "mcp: add list_schemas tool" or "n8n: fix credential refresh" |
|
|
34
|
+
| Audit/investigation | "investigate why deploy times doubled this week" |
|
|
35
|
+
|
|
36
|
+
### 1A: Resolve target repository
|
|
37
|
+
|
|
38
|
+
| Prefix | Repository | GH_REPO | GH_FLAG |
|
|
39
|
+
|--------|-----------|---------|---------|
|
|
40
|
+
| (none) / `alterlab:` | AlterLab | `RapierCraft/AlterLab` | (none) |
|
|
41
|
+
| `forge:` | Forge | `RapierCraftStudios/forge` | `-R RapierCraftStudios/forge` |
|
|
42
|
+
| `mcp:` | MCP Server | `RapierCraft/alterlab-mcp-server` | `-R RapierCraft/alterlab-mcp-server` |
|
|
43
|
+
| `n8n:` | n8n Node | `RapierCraft/n8n-nodes-alterlab` | `-R RapierCraft/n8n-nodes-alterlab` |
|
|
44
|
+
|
|
45
|
+
### 1B: Classify issue type
|
|
46
|
+
|
|
47
|
+
| Type | Signals | Title Prefix |
|
|
48
|
+
|------|---------|-------------|
|
|
49
|
+
| **Bug** | "crash", "broken", "fails", "error", stack trace, regression | `fix:` |
|
|
50
|
+
| **Feature** | "add", "enable", "support", "new", "implement" | `feat:` |
|
|
51
|
+
| **Refactor** | "clean up", "simplify", "extract", "rename", "dead code" | `refactor:` |
|
|
52
|
+
| **Investigation** | "investigate", "audit", "research", "evaluate", "why does" | `investigate:` |
|
|
53
|
+
| **Infra** | "deploy", "CI", "docker", "workflow", "pipeline" | `fix:` or `feat:` |
|
|
54
|
+
| **Docs** | "document", "README", "guide" | `docs:` |
|
|
55
|
+
|
|
56
|
+
### 1C: Classify priority
|
|
57
|
+
|
|
58
|
+
| Priority | Signals |
|
|
59
|
+
|----------|---------|
|
|
60
|
+
| **P0** | Production down, data loss, security vulnerability, user-facing crash |
|
|
61
|
+
| **P1** | Significant bug affecting users, broken feature, deploy blocked |
|
|
62
|
+
| **P2** | Minor bug, improvement, non-critical enhancement |
|
|
63
|
+
| **P3** | Cosmetic, nice-to-have, low-impact cleanup |
|
|
64
|
+
|
|
65
|
+
Default to **P2** if unclear. Never guess P0/P1 — ask the user if it seems critical but they didn't say so.
|
|
66
|
+
|
|
67
|
+
### 1D: Determine category label
|
|
68
|
+
|
|
69
|
+
Pick ONE primary category label:
|
|
70
|
+
- `bug` — something is broken
|
|
71
|
+
- `feature` — new capability
|
|
72
|
+
- `enhancement` — improvement to existing feature
|
|
73
|
+
- `refactor` — code restructuring, no behavior change
|
|
74
|
+
- `dead-code` — removing unused code
|
|
75
|
+
- `infra` — CI/CD, Docker, deployment
|
|
76
|
+
- `docs` — documentation
|
|
77
|
+
- `performance` — speed/resource optimization
|
|
78
|
+
- `seo` — search engine optimization
|
|
79
|
+
- `ux` — user experience improvement
|
|
80
|
+
- `frontend` — frontend-specific change
|
|
81
|
+
- `audit-finding` — discovered during pipeline audit
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Phase 2: Gather Context (MANDATORY)
|
|
86
|
+
|
|
87
|
+
**You MUST read code before writing the issue.** This is the critical difference between a good issue and a bad one. The investigation agent inherits YOUR file references — if you point to the wrong file, the entire pipeline goes sideways.
|
|
88
|
+
|
|
89
|
+
### 2A: Identify the domain
|
|
90
|
+
|
|
91
|
+
For AlterLab issues, map to domains and their key files:
|
|
92
|
+
|
|
93
|
+
| Domain | Key Entry Points |
|
|
94
|
+
|--------|-----------------|
|
|
95
|
+
| BILLING | `routers/billing.py`, `core/pricing.py`, `services/credit_service.py` |
|
|
96
|
+
| SCRAPING | `unified_consumer.py`, `queues.py`, `domain_playbooks.json` |
|
|
97
|
+
| AUTH | `core/auth.py`, `routers/auth.py`, `dependencies.py` |
|
|
98
|
+
| DATABASE | `infra/migrations/`, `models/`, `db/` |
|
|
99
|
+
| FRONTEND | `web/src/app/`, `web/src/components/`, `web/src/lib/` |
|
|
100
|
+
| CORTEX | `cortex_client.py`, `routers/cortex.py` |
|
|
101
|
+
| INFRA | `.github/workflows/`, `docker-compose.yml`, `docker-compose.prod.yml`, `infra/traefik/` |
|
|
102
|
+
|
|
103
|
+
For Forge issues: `commands/*.md`, `CLAUDE.md`, `install.sh`
|
|
104
|
+
For MCP issues: read the repo's `src/` directory
|
|
105
|
+
For n8n issues: read the repo's `nodes/` and `credentials/` directories
|
|
106
|
+
|
|
107
|
+
### 2B: Read the affected files
|
|
108
|
+
|
|
109
|
+
**CRITICAL RULE**: Read the ACTUAL code that the issue is about. Not just the file the user mentioned — also:
|
|
110
|
+
|
|
111
|
+
1. **Override/companion files**: If the issue mentions `docker-compose.yml`, ALSO check `docker-compose.prod.yml`. If it mentions a router, ALSO check the model it imports from.
|
|
112
|
+
2. **Config layers**: If the issue is about environment variables, check `.env.example`, `docker-compose.yml`, AND `docker-compose.prod.yml`.
|
|
113
|
+
3. **Import chains**: If the issue is about a function, check what imports it and what it imports.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# For AlterLab — resolve the right branch to read from
|
|
117
|
+
# Check staging first (most recent deployable state), then main
|
|
118
|
+
git fetch origin staging main 2>/dev/null
|
|
119
|
+
|
|
120
|
+
# Read the files relevant to the issue
|
|
121
|
+
# Use git show origin/staging:{filepath} for AlterLab files
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 2C: Identify ALL affected files
|
|
125
|
+
|
|
126
|
+
List every file that the fix/feature will need to touch. Be thorough:
|
|
127
|
+
- The primary file with the bug/feature location
|
|
128
|
+
- Test files that cover the affected code
|
|
129
|
+
- Config files that need updating
|
|
130
|
+
- Migration files if schema changes are needed
|
|
131
|
+
- Frontend files if the change has UI implications
|
|
132
|
+
- **Override files** (e.g., `docker-compose.prod.yml` if `docker-compose.yml` is affected)
|
|
133
|
+
|
|
134
|
+
### 2D: Check for duplicates
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Search for existing issues with similar scope
|
|
138
|
+
gh issue list {GH_FLAG} --state open --limit 20 --search "{key_terms}" --json number,title,labels --jq '.[] | "#\(.number) [\(.labels | map(.name) | join(","))] \(.title)"'
|
|
139
|
+
|
|
140
|
+
# Also check recently closed issues (might be a regression)
|
|
141
|
+
gh issue list {GH_FLAG} --state closed --limit 10 --search "{key_terms}" --json number,title,state --jq '.[] | "#\(.number) [closed] \(.title)"'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If a duplicate exists:
|
|
145
|
+
- **Open duplicate found**: Tell the user. Do NOT create the issue. Show the existing issue number.
|
|
146
|
+
- **Closed duplicate found (regression)**: Create the issue but reference the prior issue in the body: "Regression of #{N}."
|
|
147
|
+
|
|
148
|
+
### 2E: Check for milestone context
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# If user mentioned a milestone or the issue clearly belongs to one:
|
|
152
|
+
gh api repos/{GH_REPO}/milestones --jq '.[] | select(.state == "open") | "#\(.number) \(.title) (\(.open_issues) open)"'
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Phase 3: Draft the Issue
|
|
158
|
+
|
|
159
|
+
### 3A: Compose the title
|
|
160
|
+
|
|
161
|
+
Format: `{prefix}: {concise description}`
|
|
162
|
+
|
|
163
|
+
Rules:
|
|
164
|
+
- **Max 80 characters**
|
|
165
|
+
- Use conventional commit prefixes: `fix:`, `feat:`, `refactor:`, `investigate:`, `docs:`
|
|
166
|
+
- Be specific — "fix: billing page crash" is bad, "fix: credit_service division by zero when user credits reach 0" is good
|
|
167
|
+
- Include the component/domain if it helps: `fix(scraper): queue leak in unified_consumer heartbeat loop`
|
|
168
|
+
- Never use vague words: "improve", "update", "change", "handle" without specifics
|
|
169
|
+
|
|
170
|
+
### 3B: Compose the body
|
|
171
|
+
|
|
172
|
+
Use this exact template. Every section is MANDATORY for bugs and features. Investigation issues use a simplified template (see 3C).
|
|
173
|
+
|
|
174
|
+
```markdown
|
|
175
|
+
## Problem
|
|
176
|
+
|
|
177
|
+
{1-3 sentences describing what's wrong or what's missing. Be specific.}
|
|
178
|
+
|
|
179
|
+
{If bug: Include the error message, stack trace snippet, or observable symptom.}
|
|
180
|
+
{If regression: "Regression of #{N} — {brief description of original fix}."}
|
|
181
|
+
|
|
182
|
+
## Root Cause (if known)
|
|
183
|
+
|
|
184
|
+
{Point to the specific code path. Use `file:line` references.}
|
|
185
|
+
{If the cause spans multiple files, list the chain:}
|
|
186
|
+
1. `{file1}:{line}` — {what happens here}
|
|
187
|
+
2. `{file2}:{line}` — {what happens here}
|
|
188
|
+
3. Result: {the failure}
|
|
189
|
+
|
|
190
|
+
{If root cause is unknown, say: "Root cause unknown — investigation needed." and list hypotheses.}
|
|
191
|
+
|
|
192
|
+
## Affected Files
|
|
193
|
+
|
|
194
|
+
Files that need changes (ordered by dependency — change these in this order):
|
|
195
|
+
|
|
196
|
+
1. `{filepath}` — {what needs to change}
|
|
197
|
+
2. `{filepath}` — {what needs to change}
|
|
198
|
+
3. `{filepath}` — {what needs to change}
|
|
199
|
+
|
|
200
|
+
{CRITICAL: Include ALL files. If docker-compose.yml needs a change, docker-compose.prod.yml almost certainly does too. If a model changes, the migration file and any routers importing it need updating.}
|
|
201
|
+
|
|
202
|
+
## Expected Behavior
|
|
203
|
+
|
|
204
|
+
{What should happen after the fix/feature is implemented.}
|
|
205
|
+
|
|
206
|
+
## Acceptance Criteria
|
|
207
|
+
|
|
208
|
+
- [ ] {Specific, testable criterion}
|
|
209
|
+
- [ ] {Specific, testable criterion}
|
|
210
|
+
- [ ] {No regressions in {related_feature}}
|
|
211
|
+
|
|
212
|
+
## Dependencies
|
|
213
|
+
|
|
214
|
+
{If this issue depends on other issues:}
|
|
215
|
+
Depends on #{N} — {brief reason}
|
|
216
|
+
|
|
217
|
+
{If other issues should be done first:}
|
|
218
|
+
Should be done after #{N} — {brief reason}
|
|
219
|
+
|
|
220
|
+
{If no dependencies: omit this section entirely.}
|
|
221
|
+
|
|
222
|
+
## Additional Context
|
|
223
|
+
|
|
224
|
+
{Optional: screenshots, logs, links to Sentry/Grafana, user reports}
|
|
225
|
+
{Optional: "**Code branch**: `{branch}`" if the code only exists on a specific branch}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 3C: Investigation issue template
|
|
229
|
+
|
|
230
|
+
For investigation/audit issues, use this simplified template:
|
|
231
|
+
|
|
232
|
+
```markdown
|
|
233
|
+
## Scope
|
|
234
|
+
|
|
235
|
+
{What needs to be investigated and why.}
|
|
236
|
+
|
|
237
|
+
## Questions to Answer
|
|
238
|
+
|
|
239
|
+
- [ ] {Specific question 1}
|
|
240
|
+
- [ ] {Specific question 2}
|
|
241
|
+
- [ ] {Specific question 3}
|
|
242
|
+
|
|
243
|
+
## Starting Points
|
|
244
|
+
|
|
245
|
+
Files/areas to examine:
|
|
246
|
+
1. `{filepath}` — {why start here}
|
|
247
|
+
2. `{filepath}` — {why start here}
|
|
248
|
+
|
|
249
|
+
## Deliverable
|
|
250
|
+
|
|
251
|
+
{What the investigation should produce:}
|
|
252
|
+
- Execution plan with specific sub-issues, OR
|
|
253
|
+
- Root cause analysis with fix recommendation, OR
|
|
254
|
+
- Decision document with trade-offs
|
|
255
|
+
|
|
256
|
+
## Context
|
|
257
|
+
|
|
258
|
+
{Background information the investigator needs.}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### 3D: Pipeline Issue Template (machine-callable reference)
|
|
262
|
+
|
|
263
|
+
When pipeline agents create issues programmatically (not via user input), use this canonical template. All automated `gh issue create` calls across Forge commands MUST include these mandatory sections. Domain-specific sections are additive — preserve them, but wrap them with this structure.
|
|
264
|
+
|
|
265
|
+
```markdown
|
|
266
|
+
## Problem
|
|
267
|
+
|
|
268
|
+
{1-3 sentences: what's wrong or what's missing. Specific and concrete.}
|
|
269
|
+
|
|
270
|
+
## Root Cause (if known)
|
|
271
|
+
|
|
272
|
+
{Point to the specific code path. Use `file:line` references. If unknown, say "Root cause unknown — investigation needed."}
|
|
273
|
+
|
|
274
|
+
## Affected Files
|
|
275
|
+
|
|
276
|
+
Files that need changes (ordered by dependency):
|
|
277
|
+
1. `{filepath}` — {what needs to change}
|
|
278
|
+
2. `{filepath}` — {what needs to change}
|
|
279
|
+
|
|
280
|
+
## Acceptance Criteria
|
|
281
|
+
|
|
282
|
+
- [ ] {Specific, testable criterion}
|
|
283
|
+
- [ ] {Specific, testable criterion}
|
|
284
|
+
|
|
285
|
+
## Context
|
|
286
|
+
|
|
287
|
+
{Domain-specific context — logs, metrics, source report, linked issue, etc.}
|
|
288
|
+
|
|
289
|
+
## Dependencies
|
|
290
|
+
|
|
291
|
+
{If this depends on other issues: "Depends on #{N} — {reason}". If none, omit this section.}
|
|
292
|
+
|
|
293
|
+
## Prior Investigation
|
|
294
|
+
|
|
295
|
+
{Optional — include when this issue was spawned from or relates to a prior investigation that produced Knowledge Gists.}
|
|
296
|
+
|
|
297
|
+
{For each Gist URL from the parent/sibling investigation:}
|
|
298
|
+
<!-- FORGE:PRIOR_GIST: {gist_url} -->
|
|
299
|
+
- {gist_url}
|
|
300
|
+
|
|
301
|
+
{If no prior investigation Gists exist, omit this section entirely.}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Rules for automated issue creation**:
|
|
305
|
+
- Title MUST use conventional commit prefix: `fix:`, `feat:`, `refactor:`, `investigate:`, `docs:`
|
|
306
|
+
- `## Problem` is MANDATORY — every issue must state what's wrong or what's needed
|
|
307
|
+
- `## Affected Files` is MANDATORY — list actual file paths the investigator should read first
|
|
308
|
+
- `## Acceptance Criteria` is MANDATORY — at least one testable `- [ ]` criterion
|
|
309
|
+
- 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
|
+
- `## 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
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### 3E: Validate the draft
|
|
315
|
+
|
|
316
|
+
Before creating, verify:
|
|
317
|
+
|
|
318
|
+
1. **Title follows convention**: `{prefix}({scope}): {description}` or `{prefix}: {description}`
|
|
319
|
+
2. **Affected files are real**: Every file path in the body exists in the repo (check with `git show origin/staging:{path}` or `git show origin/main:{path}`)
|
|
320
|
+
3. **No vague sections**: Every section has concrete content, not placeholders
|
|
321
|
+
4. **Acceptance criteria are testable**: Each criterion can be verified with a specific action
|
|
322
|
+
5. **Override files included**: If `docker-compose.yml` is listed, `docker-compose.prod.yml` is too (if it exists). If a model is listed, its migration is too.
|
|
323
|
+
6. **Priority matches severity**: P0 = prod down, P1 = significant user impact, P2 = minor, P3 = cosmetic
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Phase 4: Create the Issue
|
|
328
|
+
|
|
329
|
+
### 4A: Present draft to user
|
|
330
|
+
|
|
331
|
+
```
|
|
332
|
+
## Issue Draft
|
|
333
|
+
|
|
334
|
+
**Repo**: {GH_REPO}
|
|
335
|
+
**Title**: {title}
|
|
336
|
+
**Labels**: {priority}, {category}
|
|
337
|
+
**Milestone**: {milestone or "none"}
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
{full issue body}
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
Create this issue? (yes / adjust / cancel)
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Wait for user confirmation.** Do NOT create the issue without approval.
|
|
349
|
+
|
|
350
|
+
### 4B: Create the issue
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
gh issue create {GH_FLAG} \
|
|
354
|
+
--title "{TITLE}" \
|
|
355
|
+
--label "{PRIORITY_LABEL},{CATEGORY_LABEL}" \
|
|
356
|
+
--body "$(cat <<'ISSUE_EOF'
|
|
357
|
+
{FULL_BODY}
|
|
358
|
+
ISSUE_EOF
|
|
359
|
+
)"
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
If milestone was identified:
|
|
363
|
+
```bash
|
|
364
|
+
gh issue create {GH_FLAG} \
|
|
365
|
+
--title "{TITLE}" \
|
|
366
|
+
--label "{PRIORITY_LABEL},{CATEGORY_LABEL}" \
|
|
367
|
+
--milestone "{MILESTONE_TITLE}" \
|
|
368
|
+
--body "$(cat <<'ISSUE_EOF'
|
|
369
|
+
{FULL_BODY}
|
|
370
|
+
ISSUE_EOF
|
|
371
|
+
)"
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### 4C: Post-creation verification
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Verify the issue was created correctly
|
|
378
|
+
ISSUE_URL=$(gh issue view {NEW_NUMBER} {GH_FLAG} --json url --jq '.url')
|
|
379
|
+
LABELS=$(gh issue view {NEW_NUMBER} {GH_FLAG} --json labels --jq '[.labels[].name] | join(", ")')
|
|
380
|
+
echo "Created: ${ISSUE_URL}"
|
|
381
|
+
echo "Labels: ${LABELS}"
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### 4C.5: Body Validation (MANDATORY)
|
|
385
|
+
|
|
386
|
+
After creation, verify the issue body contains the three mandatory pipeline sections. If any are missing, add placeholder content so downstream pipeline agents have the correct scaffolding.
|
|
387
|
+
|
|
388
|
+
**This step never fails or blocks.** Missing sections cause a repair, not an error. Issues created with full structure pass through immediately.
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
CREATED_BODY=$(gh issue view {NEW_NUMBER} {GH_FLAG} --json body --jq '.body')
|
|
392
|
+
|
|
393
|
+
MISSING_SECTIONS=""
|
|
394
|
+
echo "$CREATED_BODY" | grep -q "^## Problem" || MISSING_SECTIONS="$MISSING_SECTIONS PROBLEM"
|
|
395
|
+
echo "$CREATED_BODY" | grep -q "^## Affected Files" || MISSING_SECTIONS="$MISSING_SECTIONS AFFECTED_FILES"
|
|
396
|
+
echo "$CREATED_BODY" | grep -q "^## Acceptance Criteria" || MISSING_SECTIONS="$MISSING_SECTIONS ACCEPTANCE_CRITERIA"
|
|
397
|
+
|
|
398
|
+
if [ -n "$MISSING_SECTIONS" ]; then
|
|
399
|
+
echo "WARNING: Issue body is missing sections:$MISSING_SECTIONS — adding placeholders to preserve pipeline compatibility"
|
|
400
|
+
|
|
401
|
+
APPEND_TEXT=""
|
|
402
|
+
echo "$MISSING_SECTIONS" | grep -q "PROBLEM" && APPEND_TEXT="$APPEND_TEXT
|
|
403
|
+
## Problem
|
|
404
|
+
|
|
405
|
+
Root cause unknown — investigation needed."
|
|
406
|
+
|
|
407
|
+
echo "$MISSING_SECTIONS" | grep -q "AFFECTED_FILES" && APPEND_TEXT="$APPEND_TEXT
|
|
408
|
+
## Affected Files
|
|
409
|
+
|
|
410
|
+
Files to be identified during investigation."
|
|
411
|
+
|
|
412
|
+
echo "$MISSING_SECTIONS" | grep -q "ACCEPTANCE_CRITERIA" && APPEND_TEXT="$APPEND_TEXT
|
|
413
|
+
## Acceptance Criteria
|
|
414
|
+
|
|
415
|
+
- [ ] Fix confirmed during investigation."
|
|
416
|
+
|
|
417
|
+
# Append missing sections to the existing body (never replace — only extend)
|
|
418
|
+
REPAIRED_BODY="${CREATED_BODY}${APPEND_TEXT}"
|
|
419
|
+
gh issue edit {NEW_NUMBER} {GH_FLAG} --body "$REPAIRED_BODY"
|
|
420
|
+
echo "Body repaired — added:$MISSING_SECTIONS"
|
|
421
|
+
else
|
|
422
|
+
echo "Body validation passed — all mandatory sections present"
|
|
423
|
+
fi
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### 4D: Add to Project board (AlterLab only)
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
# For AlterLab issues, add to the project board
|
|
430
|
+
gh project item-add {PROJECT_NUMBER} --owner RapierCraft --url "${ISSUE_URL}" 2>/dev/null || true
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### 4E: Report to user
|
|
434
|
+
|
|
435
|
+
```
|
|
436
|
+
## Issue Created
|
|
437
|
+
|
|
438
|
+
**#{NUMBER}**: {title}
|
|
439
|
+
**URL**: {url}
|
|
440
|
+
**Labels**: {labels}
|
|
441
|
+
**Milestone**: {milestone or "none"}
|
|
442
|
+
|
|
443
|
+
{If ready to work on it: "Run `/work-on {NUMBER}` to start the pipeline."}
|
|
444
|
+
{If part of a milestone: "This issue will be picked up in the next `/orchestrate milestone {slug}` run."}
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## Batch Mode
|
|
450
|
+
|
|
451
|
+
If the user provides multiple issues to create (e.g., from an audit, analytics session, or decomposition):
|
|
452
|
+
|
|
453
|
+
1. Draft ALL issues first
|
|
454
|
+
2. Present them as a numbered list for review
|
|
455
|
+
3. Create all after confirmation
|
|
456
|
+
4. Report all created issue numbers
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
## Batch Issue Draft
|
|
460
|
+
|
|
461
|
+
| # | Title | Priority | Category | Deps |
|
|
462
|
+
|---|-------|----------|----------|------|
|
|
463
|
+
| 1 | {title} | P2 | bug | — |
|
|
464
|
+
| 2 | {title} | P1 | feature | After #1 |
|
|
465
|
+
| 3 | {title} | P2 | refactor | — |
|
|
466
|
+
|
|
467
|
+
<details><summary>Issue 1: {title}</summary>
|
|
468
|
+
|
|
469
|
+
{full body}
|
|
470
|
+
|
|
471
|
+
</details>
|
|
472
|
+
|
|
473
|
+
<details><summary>Issue 2: {title}</summary>
|
|
474
|
+
|
|
475
|
+
{full body}
|
|
476
|
+
|
|
477
|
+
</details>
|
|
478
|
+
|
|
479
|
+
Create all {N} issues? (yes / adjust #N / cancel)
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## Anti-Patterns — What NOT to Do
|
|
485
|
+
|
|
486
|
+
| Bad Issue | Why It Fails | Good Version |
|
|
487
|
+
|-----------|-------------|-------------|
|
|
488
|
+
| "Fix docker mount" | Which compose file? Which mount? | "fix: `.gemini` volume mount in docker-compose.prod.yml missing rw flag" |
|
|
489
|
+
| "Update billing" | What about billing? What's broken? | "fix: credit_service.deduct() raises DivisionByZero when user.credits == 0" |
|
|
490
|
+
| "Investigate performance" | Investigate what? Where? | "investigate: API p95 latency doubled since last deploy — trace hot paths in scraping routers" |
|
|
491
|
+
| No affected files listed | Investigator guesses wrong files | List every file with what needs to change |
|
|
492
|
+
| "Handle edge case" | Which edge case? In what function? | "fix: unified_consumer.process_job() silently drops jobs when queue.length > MAX_BATCH" |
|
|
493
|
+
| Missing override files | Fix is incomplete, deploy fails | Include docker-compose.prod.yml, .env.example, etc. |
|
|
494
|
+
| P0 for a typo fix | Wastes priority signaling | Use P3 for cosmetic issues |
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## Safety Rules
|
|
499
|
+
|
|
500
|
+
1. **Always read code before creating an issue.** Never create an issue based solely on user description without verifying the files exist and the problem is plausible.
|
|
501
|
+
2. **Always check for duplicates.** Creating duplicate issues wastes agent runs.
|
|
502
|
+
3. **Always wait for user confirmation.** Never create issues without showing the draft first.
|
|
503
|
+
4. **Never fabricate file paths.** Every path in the issue body must be verified against the actual repo.
|
|
504
|
+
5. **Never omit override/companion files.** If one compose file is affected, check the other. If one model is affected, check its migration.
|
|
505
|
+
6. **Use conventional commit prefixes in titles.** The pipeline and changelog depend on them.
|
|
506
|
+
7. **Default to P2.** Only use P0/P1 when the user explicitly indicates severity or the evidence clearly shows production impact.
|