forge-cc 0.1.25 → 0.1.27

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.25",
3
+ "version": "0.1.27",
4
4
  "description": "Pre-PR verification harness for Claude Code agents — gate runner + CLI + MCP server",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -158,7 +158,7 @@ For each wave, in order:
158
158
 
159
159
  **Build Agent Prompts:**
160
160
 
161
- For each agent in the wave, construct a prompt that includes:
161
+ For each agent in the wave, construct a prompt that includes **ALL 10 items below — do not skip any.** Items 9 and 10 are mandatory context that prevent repeated mistakes and ensure consistent agent behavior:
162
162
 
163
163
  1. **Agent identity:** "You are **{agent-name}** working on Milestone {N}: {name}."
164
164
  2. **Team context:** "You are part of team `{slug}-m{N}`. Use SendMessage to communicate with the executive and other builders."
@@ -168,8 +168,8 @@ For each agent in the wave, construct a prompt that includes:
168
168
  6. **Existing code context:** Read the actual contents of files the agent depends on (imports, types, utilities). **Inline the actual code** — never reference files by path alone. This is critical for agents that run in isolated contexts.
169
169
  7. **Subagent guidance:** "You may spawn subagents for research (Explore type — read-only) or implementation grunt work (general-purpose type). Use subagents for tasks that don't require team coordination."
170
170
  8. **Conflict avoidance:** "Do NOT modify files outside your assignment. If you discover a need to change a file owned by another agent, send a message to the executive describing the conflict instead of making the change."
171
- 9. **Lessons:** Read `tasks/lessons.md` and include all active lessons.
172
- 10. **Rules:**
171
+ 9. **Lessons (MANDATORY):** Read `tasks/lessons.md` and include the full text of all active lessons in the prompt. These are hard-won fixes for recurring mistakes — omitting them causes agents to repeat known errors.
172
+ 10. **Rules (MANDATORY):** Include these rules verbatim in every agent prompt:
173
173
  - Use ES module imports with `.js` extension in import paths
174
174
  - Stage only your files (never `git add .` or `git add -A`)
175
175
  - Run `npx tsc --noEmit` after creating files to verify compilation
@@ -235,14 +235,14 @@ If `.forge.json` includes `visual` in gates or specifies a `devServerUrl`, captu
235
235
 
236
236
  After mechanical gates pass, engage the reviewer agent:
237
237
 
238
- 1. **Send diff to reviewer:** Use SendMessage to send the wave's git diff to the reviewer agent, along with:
238
+ 1. **Send diff to reviewer:** Use SendMessage to send **ALL of the following** to the reviewer agent. Do not send partial context — the reviewer cannot do its job without every item:
239
239
  - The PRD milestone section including:
240
240
  - The **Goal** line (what this milestone delivers)
241
241
  - All `- [ ]` checklist items from the milestone (these are the acceptance criteria)
242
242
  - The **User Stories** section from the PRD (for context on what users expect)
243
- - The full git diff for the wave
243
+ - The full git diff for the wave (run `git diff --cached` or `git diff HEAD` — do not summarize or truncate)
244
244
  - CLAUDE.md rules and architecture decisions
245
- - The list of files changed and their ownership
245
+ - The list of files changed and their ownership (which agent created/modified which files)
246
246
  - If the visual gate ran, include the screenshot file paths:
247
247
  - Before: `.forge/screenshots/before/*.png` (if captured in Step 2)
248
248
  - After: `.forge/screenshots/after/*.png`
@@ -39,21 +39,31 @@ options:
39
39
 
40
40
  ### Step 3 — Configure Gates
41
41
 
42
- Ask the user which verification gates to enable:
42
+ Ask the user which verification gates to enable. **AskUserQuestion supports max 4 options — use TWO questions to cover all 8 gates:**
43
43
 
44
44
  <AskUserQuestion>
45
- question: "Which verification gates should be active?"
45
+ question: "Which core gates should be active? (Recommended: all four)"
46
+ header: "Core gates"
46
47
  multiSelect: true
47
48
  options:
48
- - "types — TypeScript type checking (tsc --noEmit)"
49
- - "lint — ESLint / Biome linting"
50
- - "tests — Vitest / Jest test runner"
51
- - "visual — Playwright screenshot regression"
52
- - "runtime — Start the app and check for crashes"
49
+ - "types — TypeScript type checking (tsc --noEmit) (Recommended)"
50
+ - "lint — ESLint / Biome linting (Recommended)"
51
+ - "tests — Vitest / Jest test runner (Recommended)"
53
52
  - "prd — PRD completeness check"
54
53
  </AskUserQuestion>
55
54
 
56
- Default recommendation: `types`, `lint`, `tests`.
55
+ <AskUserQuestion>
56
+ question: "Enable any advanced gates? These require extra setup (Playwright, dev server, API access)."
57
+ header: "Advanced gates"
58
+ multiSelect: true
59
+ options:
60
+ - "visual — Playwright screenshot regression (requires Playwright + Chromium)"
61
+ - "runtime — Start the app and check for crashes (requires devServerUrl)"
62
+ - "review — AI code review (runs during forge verify)"
63
+ - "codex — Codex PR review polling (runs after PR creation)"
64
+ </AskUserQuestion>
65
+
66
+ Combine selections from both questions into the final gates list.
57
67
 
58
68
  Also collect project metadata (skip in Refresh mode if `.forge.json` already has values):
59
69
 
@@ -235,12 +245,13 @@ The target hook entry is:
235
245
  }
236
246
  ```
237
247
 
238
- **Merge logic:**
239
- 1. Parse the existing file (or start with `{}`).
240
- 2. Ensure `hooks.PreToolUse` exists as an array.
241
- 3. Check if any entry in `hooks.PreToolUse` already has a hook with `command` containing `version-check.js`. If so, skip already installed.
242
- 4. Otherwise, append the hook entry to `hooks.PreToolUse`.
243
- 5. Write the merged result back to `.claude/settings.local.json`, preserving all existing settings.
248
+ **Merge logic — follow ALL 5 steps. Do NOT overwrite the file; you MUST read-merge-write to preserve existing user settings:**
249
+
250
+ 1. Parse the existing file (or start with `{}`). **Use the Read tool first** — never write without reading.
251
+ 2. Ensure `hooks.PreToolUse` exists as an array. If the key is missing, create it. If it exists, preserve all existing entries.
252
+ 3. Check if any entry in `hooks.PreToolUse` already has a hook with `command` containing `version-check.js`. **If found, skip — already installed. Do not duplicate it.**
253
+ 4. If NOT found, append the hook entry to `hooks.PreToolUse`. Do not replace existing entries.
254
+ 5. Write the merged result back to `.claude/settings.local.json`, preserving ALL existing settings (permissions, other hooks, custom keys).
244
255
 
245
256
  Create the `.claude/` directory if it doesn't exist (`mkdir -p .claude`).
246
257
 
@@ -265,8 +276,11 @@ Once all gates pass, automatically create a branch, commit, open a PR, and poll
265
276
 
266
277
  **Create branch and commit:**
267
278
 
279
+ **IMPORTANT — CRLF check is mandatory before staging.** Run `git diff --stat` first. If any files show changes but have zero meaningful content diff (CRLF-only / whitespace-only noise on unrelated files), discard them with `git checkout -- <file>` BEFORE running `git add`. Skipping this check causes unrelated files to be included in the commit.
280
+
268
281
  ```bash
269
282
  git checkout -b feat/forge-setup
283
+ git diff --stat # Check for CRLF noise — discard any whitespace-only changes on unrelated files
270
284
  git add -A
271
285
  git commit -m "feat: initialize forge workflow scaffolding
272
286
 
@@ -280,8 +294,6 @@ Co-Authored-By: Claude <noreply@anthropic.com>"
280
294
  git push -u origin feat/forge-setup
281
295
  ```
282
296
 
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
297
  **Open PR:**
286
298
 
287
299
  ```bash
@@ -199,9 +199,9 @@ The PRD should follow this structure:
199
199
 
200
200
  Write the final PRD to `.planning/prds/{project-slug}.md`.
201
201
 
202
- After writing the PRD file, also:
202
+ After writing the PRD file, **execute BOTH steps below — do not skip either**:
203
203
 
204
- 1. **Create status file:** Write `.planning/status/<slug>.json` with all milestones set to "pending". Include `linearProjectId` from the project selected in Step 1 (this is the Linear project UUID required for `/forge:go` to sync issue status automatically):
204
+ 1. **Create status file:** Write `.planning/status/<slug>.json` with all milestones set to "pending". **You MUST include `linearProjectId`** — this is the Linear project UUID from the project selected in Step 1. Without it, `/forge:go` cannot sync Linear issue or project state and will silently skip all Linear operations. Copy the exact project ID string — do not omit this field:
205
205
  ```json
206
206
  {
207
207
  "project": "{project name}",
@@ -268,12 +268,14 @@ Use mcp__linear__create_issue with:
268
268
  - milestoneId: the milestone ID just created
269
269
  ```
270
270
 
271
- After all milestones and issues are created, transition the project to "Planned":
271
+ **After all milestones and issues are created, transition the project to "Planned" — this is a separate mandatory step, do not skip it:**
272
272
 
273
273
  ```
274
274
  Use mcp__linear__update_project to set the project state to "planned".
275
275
  ```
276
276
 
277
+ **The project is a separate entity from its milestones and issues.** Creating milestones and issues does NOT automatically update the project state. You must explicitly call `mcp__linear__update_project`. Without this transition, `/forge:go` will find the project still in "Backlog" and the state machine will reject the "In Progress" transition.
278
+
277
279
  Print a summary:
278
280
 
279
281
  ```