forge-cc 0.1.14 → 0.1.16

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.
@@ -59,7 +59,7 @@ function buildPackageJsonUpdates(runner, report) {
59
59
  const devDependencies = {};
60
60
  if (runner === "vitest") {
61
61
  scripts["test"] = "vitest run";
62
- devDependencies["vitest"] = "^3.0.0";
62
+ devDependencies["vitest"] = "^4.0.0";
63
63
  }
64
64
  else {
65
65
  scripts["test"] = "jest";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-cc",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Pre-PR verification harness for Claude Code agents — gate runner + CLI + MCP server",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -215,36 +215,34 @@ If `forge doctor` shows all checks passing, print: "Environment checks passed."
215
215
 
216
216
  ### Step 8 — Install Hooks
217
217
 
218
- Check if the user has a `.claude/settings.json` or `.claude/settings.local.json` in the project:
218
+ The version-check hook **must always be installed**. Read the existing settings file (if any), merge the hook in, and write it back.
219
219
 
220
220
  ```bash
221
- ls .claude/settings.json .claude/settings.local.json 2>/dev/null
221
+ cat .claude/settings.local.json 2>/dev/null || echo "{}"
222
222
  ```
223
223
 
224
- If no settings file exists, create `.claude/settings.local.json` with the version-check hook:
224
+ The target hook entry is:
225
225
 
226
226
  ```json
227
227
  {
228
- "hooks": {
229
- "PreToolUse": [
230
- {
231
- "matcher": "Task",
232
- "hooks": [
233
- {
234
- "type": "command",
235
- "command": "node node_modules/forge-cc/hooks/version-check.js"
236
- }
237
- ]
238
- }
239
- ]
240
- }
228
+ "matcher": "Task",
229
+ "hooks": [
230
+ {
231
+ "type": "command",
232
+ "command": "node node_modules/forge-cc/hooks/version-check.js"
233
+ }
234
+ ]
241
235
  }
242
236
  ```
243
237
 
244
- If a settings file already exists, inform the user:
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.
245
244
 
246
- > Settings file already exists. To add the version-check hook manually, add this to your hooks config:
247
- > `"command": "node node_modules/forge-cc/hooks/version-check.js"`
245
+ Create the `.claude/` directory if it doesn't exist (`mkdir -p .claude`).
248
246
 
249
247
  ### Step 9 — Summary
250
248