Skip to content

MLAI-1333 - Run skill-governance hooks through a node launcher for Windows - #94

Open
nadav-dvir wants to merge 1 commit into
mainfrom
windows-node-hook-launcher
Open

nadav-dvir wants to merge 1 commit into
mainfrom
windows-node-hook-launcher

Conversation

@nadav-dvir

Copy link
Copy Markdown
Collaborator

The governed hooks (PreToolUse, UserPromptExpansion) and the SessionStart agent-guard pre-warm were shell: "bash" one-liners, so on Windows without Git Bash they never ran and skills were allowed unchecked.

  • scripts/enforce-skill.mjs: computes the enforcement deadline, sets the npm fetch bounds, and spawns npx @jfrog/agent-guard --enforce-skill --client claude-code (npx.cmd through cmd.exe on Windows). Exit 2 and stdout pass through; a spawn failure fails open.
  • scripts/warm-agent-guard.mjs: the async pre-warm (--version, online, npm default fetch policy, always exits 0).
  • hooks.json: all three hooks are now node "${CLAUDE_PLUGIN_ROOT}/..." with no shell field.
  • validate-enforce-hook.mjs: asserts the launcher wiring and spawn plans, including the Windows plan, and executes both launchers against a stub npx.

Mirrors the same launcher in jfrog/vscode-plugin.

The governed hooks (PreToolUse, UserPromptExpansion) and the SessionStart
agent-guard pre-warm were `shell: "bash"` one-liners, so on Windows without
Git Bash they never ran and skills were allowed unchecked.

- scripts/enforce-skill.mjs: computes the enforcement deadline, sets the npm
  fetch bounds, and spawns `npx @jfrog/agent-guard --enforce-skill --client
  claude-code` (npx.cmd through cmd.exe on Windows). Exit 2 and stdout pass
  through; a spawn failure fails open.
- scripts/warm-agent-guard.mjs: the async pre-warm (`--version`, online, npm
  default fetch policy, always exits 0).
- hooks.json: all three hooks are now `node "${CLAUDE_PLUGIN_ROOT}/..."` with
  no `shell` field.
- validate-enforce-hook.mjs: asserts the launcher wiring and spawn plans,
  including the Windows plan, and executes both launchers against a stub npx.

Mirrors the same launcher in jfrog/vscode-plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nadav-dvir
nadav-dvir requested a review from a team as a code owner October 15, 2026 11:31
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant