forge-cc 0.1.24 → 0.1.26

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.24",
3
+ "version": "0.1.26",
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`
@@ -362,12 +362,12 @@ Check for the Linear project ID in this priority order:
362
362
 
363
363
  If a Linear project ID is found:
364
364
 
365
- 1. Transition issues for the completed milestone to appropriate state:
366
- - If this was the **last milestone**: move issues to "In Review"
365
+ 1. **Transition issues** for the completed milestone:
366
+ - If this was the **last milestone**: use `mcp__linear__update_issue` on each issue to set state to "In Review"
367
367
  - Otherwise: keep issues as-is (they were set to "In Progress" at start)
368
368
 
369
- 2. If this is the **last milestone**, also:
370
- - Transition the project to "In Review"
369
+ 2. If this is the **last milestone**, **also transition the project itself** (separate from issues):
370
+ - Use `mcp__linear__update_project` to set the project state to "In Review". **Do not skip this — the project is a separate entity from its issues.**
371
371
  - Create a PR (see Step 8)
372
372
 
373
373
  If no Linear project ID is found in either location, skip this step silently.
@@ -514,12 +514,12 @@ At the START of milestone execution (between Step 2 and Step 3), check for the L
514
514
  1. `linearProjectId` field in `.planning/status/<slug>.json`
515
515
  2. `linearProject` field in `.forge.json`
516
516
 
517
- If a Linear project ID is found:
517
+ If a Linear project ID is found, **execute ALL four steps below — do not skip any**:
518
518
 
519
- 1. Find issues associated with this milestone in Linear.
520
- 2. Transition them to "In Progress".
521
- 3. Transition the project to "In Progress" (if not already).
522
- 4. Add a brief comment: "Starting execution via forge:go."
519
+ 1. **Find issues:** Use `mcp__linear__list_issues` with the project ID to find issues associated with this milestone.
520
+ 2. **Transition issues:** Use `mcp__linear__update_issue` on each issue to set state to "In Progress".
521
+ 3. **Transition the project:** Use `mcp__linear__update_project` to set the project state to "In Progress". **This is a separate step from transitioning issues — do not skip it.** The project and its issues are independent entities in Linear.
522
+ 4. **Add comment:** Use `mcp__linear__create_comment` on each milestone issue with the body: "Starting execution via forge:go."
523
523
 
524
524
  If no Linear project ID is found, skip silently.
525
525
 
@@ -235,12 +235,13 @@ The target hook entry is:
235
235
  }
236
236
  ```
237
237
 
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.
238
+ **Merge logic — follow ALL 5 steps. Do NOT overwrite the file; you MUST read-merge-write to preserve existing user settings:**
239
+
240
+ 1. Parse the existing file (or start with `{}`). **Use the Read tool first** — never write without reading.
241
+ 2. Ensure `hooks.PreToolUse` exists as an array. If the key is missing, create it. If it exists, preserve all existing entries.
242
+ 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.**
243
+ 4. If NOT found, append the hook entry to `hooks.PreToolUse`. Do not replace existing entries.
244
+ 5. Write the merged result back to `.claude/settings.local.json`, preserving ALL existing settings (permissions, other hooks, custom keys).
244
245
 
245
246
  Create the `.claude/` directory if it doesn't exist (`mkdir -p .claude`).
246
247
 
@@ -265,8 +266,11 @@ Once all gates pass, automatically create a branch, commit, open a PR, and poll
265
266
 
266
267
  **Create branch and commit:**
267
268
 
269
+ **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.
270
+
268
271
  ```bash
269
272
  git checkout -b feat/forge-setup
273
+ git diff --stat # Check for CRLF noise — discard any whitespace-only changes on unrelated files
270
274
  git add -A
271
275
  git commit -m "feat: initialize forge workflow scaffolding
272
276
 
@@ -280,8 +284,6 @@ Co-Authored-By: Claude <noreply@anthropic.com>"
280
284
  git push -u origin feat/forge-setup
281
285
  ```
282
286
 
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
287
  **Open PR:**
286
288
 
287
289
  ```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
  ```