Skip to content

Fix: skip POSIX hook guard on Windows installs (#452) - #453

Draft
abdulwahabone wants to merge 2 commits into
mainfrom
fix/issue-452-windows-hook-guard
Draft

Fix: skip POSIX hook guard on Windows installs (#452)#453
abdulwahabone wants to merge 2 commits into
mainfrom
fix/issue-452-windows-hook-guard

Conversation

@abdulwahabone

Copy link
Copy Markdown
Collaborator

Fixes #452.

npx impeccable install on Windows wrote the POSIX [ ! -f ... ] || guard into Codex hook commands; PowerShell rejects it at parse time (ParserError: Missing type name after '['), so both hooks never ran. guardHookCommand() now emits the direct node "PATH" invocation on win32 (the form the bundled plugin manifests already use) and keeps the guard elsewhere.

Validated by simulating a Windows install (faked process.platform, project and global scope) and running the generated commands in PowerShell 7.6.4: old form reproduces the exact ParserError, new form exits 0. macOS installer output is byte-identical; tests/skills-cli.test.js passes. Generated provider output intentionally untouched.

AI assistance was used for the reproduction and fix.

Made with Cursor

PowerShell rejects the `[ ! -f ... ] ||` guard at parse time, so Codex
hooks generated by `npx impeccable install` on Windows never ran. Emit
the direct `node "PATH"` invocation there; POSIX output is unchanged.

AI-assisted (Cursor).

Co-authored-by: Cursor <cursoragent@cursor.com>
@abdulwahabone
abdulwahabone requested a review from pbakaus as a code owner July 30, 2026 10:26
Comment thread cli/bin/commands/skills.mjs Outdated
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Greptile Summary

This change replaces the Windows-incompatible POSIX hook-file guard with a Node-based wrapper while retaining the existing POSIX form on other platforms.

The generated wrapper was exercised with missing and existing hook files, including paths containing spaces. Missing hooks exited successfully without output; existing hooks preserved stdout, stderr, and exit status 23. The isolated skills CLI suite completed with 67 passing tests and 8 skipped tests.

Confidence Score: 5/5

T-Rex T-Rex Logs

What T-Rex did

    • Ran a focused Node harness containing the hook wrapper emitted from cli/bin/commands/skills.mjs to exercise its behavior.
    • Compared missing and existing hook files under both the POSIX guard and a Windows-style wrapper, noting that missing files produced no output and exit 0 while the existing hook produced stdout, stderr, and exit status 23.
    • Executed the CLI regression suite under an isolated Bun environment and observed 67 passing tests, 8 skipped tests, and no failures.
    • Validated the Windows-wrapper checks, the Before and After artifact captures, and the CLI regression suite results, confirming that all checks passed and totals matched expectations.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "Keep the missing-file no-op in Windows-g..." | Re-trigger Greptile

Greptile review on #453: project hook manifests are committable, so a
bare `node "PATH"` written on Windows loses the silent no-op when a
POSIX teammate without the skill consumes it. Replace the bare form
with a shell-agnostic `node -e` existence guard that parses in
PowerShell, cmd.exe, and sh, and forwards the hook's exit code.

AI-assisted (Cursor).

Co-authored-by: Cursor <cursoragent@cursor.com>
@abdulwahabone
abdulwahabone marked this pull request as draft July 30, 2026 10:45
@github-actions github-actions Bot added the waiting on contributor Waiting for the PR author to respond or make changes label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting on contributor Waiting for the PR author to respond or make changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: installed Codex hook guard uses POSIX shell syntax

1 participant