forge-cc 0.1.17 → 0.1.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-cc",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Pre-PR verification harness for Claude Code agents — gate runner + CLI + MCP server",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -425,6 +425,18 @@ After `gh pr create` succeeds, poll for Codex review comments:
425
425
 
426
426
  5. **Timeout:** If no Codex comments appear after 8 minutes, proceed — Codex may not be configured for this repository.
427
427
 
428
+ **Merge and cleanup:**
429
+
430
+ After Codex review completes (or times out with no comments), merge the PR and clean up:
431
+
432
+ ```bash
433
+ gh pr merge --squash --delete-branch
434
+ git checkout main
435
+ git pull origin main
436
+ ```
437
+
438
+ This merges the PR, deletes the remote branch, switches back to main, and pulls the merged result.
439
+
428
440
  Then shut down the agent team and print:
429
441
 
430
442
  ```
@@ -244,7 +244,89 @@ The target hook entry is:
244
244
 
245
245
  Create the `.claude/` directory if it doesn't exist (`mkdir -p .claude`).
246
246
 
247
- ### Step 9 — Summary
247
+ ### Step 9 — Run Verification
248
+
249
+ Run `npx forge verify` to confirm all gates pass with the scaffolded files:
250
+
251
+ ```bash
252
+ npx forge verify
253
+ ```
254
+
255
+ If any gate fails, fix the issues before proceeding. Common fixes:
256
+ - **lint:** Run the project's lint autofix (e.g., `npx biome check --fix .`)
257
+ - **tests:** Convert failing stub tests to `it.todo('description')` so they show as pending
258
+ - **types:** Fix any type errors introduced by scaffolding
259
+
260
+ Re-run `npx forge verify` until all gates pass.
261
+
262
+ ### Step 10 — Commit, PR, and Codex Review
263
+
264
+ Once all gates pass, automatically create a branch, commit, open a PR, and poll for Codex review.
265
+
266
+ **Create branch and commit:**
267
+
268
+ ```bash
269
+ git checkout -b feat/forge-setup
270
+ git add -A
271
+ git commit -m "feat: initialize forge workflow scaffolding
272
+
273
+ - .forge.json config with gate selection
274
+ - CLAUDE.md project instructions
275
+ - .planning/ directory with STATE.md and ROADMAP.md
276
+ - Test stubs and structural tests (if enabled)
277
+ - Version-check hook in .claude/settings.local.json
278
+
279
+ Co-Authored-By: Claude <noreply@anthropic.com>"
280
+ git push -u origin feat/forge-setup
281
+ ```
282
+
283
+ **Important:** Before `git add -A`, check `git diff --stat` for CRLF-only noise on unrelated files. If any files show changes but have zero content diff, discard them with `git checkout -- <file>` before staging.
284
+
285
+ **Open PR:**
286
+
287
+ ```bash
288
+ gh pr create --title "feat: initialize forge workflow" --body "$(cat <<'EOF'
289
+ ## Summary
290
+ - Scaffold forge verification gates, planning docs, and test infrastructure
291
+ - Gates configured: {comma-separated list}
292
+ - Test stubs: {N} it.todo() stubs as pending backlog + {N} structural tests passing
293
+
294
+ ## Test plan
295
+ - [x] `npx forge verify` passes all gates
296
+ - [x] `npx tsc --noEmit` clean
297
+ - [ ] Codex review (auto-polling)
298
+ EOF
299
+ )"
300
+ ```
301
+
302
+ **Codex Review Gate:**
303
+
304
+ After `gh pr create` succeeds, poll for Codex review comments:
305
+
306
+ 1. **Poll loop:** Every 60 seconds, check for new PR review comments:
307
+ ```bash
308
+ gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
309
+ ```
310
+
311
+ 2. **Duration:** Poll for up to 8 minutes (8 checks at 60-second intervals).
312
+
313
+ 3. **If comments found:** For each unresolved comment, address it — either fix the code or reply with justification. Push fixes and re-poll.
314
+
315
+ 4. **Timeout:** If no comments appear after 8 minutes, proceed — Codex may not be configured for this repository.
316
+
317
+ **Merge and cleanup:**
318
+
319
+ After Codex review completes (or times out with no comments), merge the PR and clean up:
320
+
321
+ ```bash
322
+ gh pr merge --squash --delete-branch
323
+ git checkout main
324
+ git pull origin main
325
+ ```
326
+
327
+ This merges the PR, deletes the remote branch, switches back to main, and pulls the merged result. The `--delete-branch` flag handles remote cleanup; git will also remove the local tracking branch on pull.
328
+
329
+ ### Step 11 — Summary
248
330
 
249
331
  Print a summary of everything that was created or updated:
250
332
 
@@ -254,6 +336,7 @@ Print a summary of everything that was created or updated:
254
336
  **Mode:** {Fresh Setup / Refresh}
255
337
  **Project:** {projectName}
256
338
  **Gates:** {comma-separated list}
339
+ **PR:** {PR URL}
257
340
 
258
341
  ### Files Created/Updated
259
342
  - ~/.claude/commands/forge/*.md ✓ (skills)
@@ -269,12 +352,11 @@ Print a summary of everything that was created or updated:
269
352
  {If tests gate enabled: "Test planning: {N} test stubs scaffolded, {runner} configured, structural tests {included/skipped}"}
270
353
  {If tests gate not enabled: "Test planning: skipped (tests gate not enabled)"}
271
354
 
355
+ ### Verification
356
+ - All gates passed ✓
357
+ - Codex review: {resolved N comments / no comments / not configured}
358
+
272
359
  ### Next Steps
273
360
  1. Review the generated `CLAUDE.md` and customize the Code Map section
274
- 2. Run `npx forge verify` to test your gate configuration
275
- 3. Run `/forge:spec` to create a PRD for your first feature
361
+ 2. Run `/forge:spec` to create a PRD for your first feature
276
362
  ```
277
-
278
- ---
279
-
280
- Do NOT commit or push. The user decides when to commit the scaffolded files.