mirror of
https://github.com/obra/superpowers.git
synced 2026-09-25 22:09:05 +00:00
docs: polyglot-hooks.md is stale — describes an older hook wrapper that diverges from the current run-hook.cmd #1653
Labels
No labels
antigravity
automated-issue-report
brainstorming
bug
claude-code
codex
copilot
cursor
documentation
duplicate
enhancement
factory
gemini-cli
good first issue
help wanted
hermes
hooks
invalid
kiro
needs-categorization
needs-rebase-to-dev-branch
needs-repro-case
new-harness
no-obvious-human-review
opencode
pi
plans
pr-template-rules-ignored
question
skill:brainstorming
skill:diagnosing-superpowers
skill:dispatching-parallel-agents
skill:executing-plans
skill:finishing-a-development-branch
skill:receiving-code-review
skill:requesting-code-review
skills
skill:subagent-driven-development
skill:systematic-debugging
skill:test-driven-development
skill:using-git-worktrees
skill:using-superpowers
skill:verification-before-completion
skill:writing-plans
skill:writing-skills
stale
subagents
tdd
trae
triage
upstream-bug
windows
wontfix
worktrees
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
skills/obra-superpowers#1653
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
docs/windows/polyglot-hooks.md documents a cross-platform hook technique that no longer matches the implementation actually shipped in hooks/run-hook.cmd. Every concrete detail in the doc diverges from the code, so a contributor following the doc would reproduce the older, since-replaced approach.
Verified divergences (doc vs.
hooks/run-hook.cmd+hooks/hooks*.jsonondev)session-start.cmd+session-start.sh(per-script.cmdwrapper,.shlogic)session-start,session-start-codex) dispatched by a single genericrun-hook.cmdbashto any command containing.sh(documented inrun-hook.cmditself). This is the key fix and the doc omits it."C:\Program Files\Git\bin\bash.exe" -l -c "...cygpath...""C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1", then(x86)path, thenwhere bash; exits 0 (no error) if no bash found. No-l, nocygpath.matcherexamplebash -l -c "cd $(cygpath...) && ./$SCRIPT_NAME", args passed as.shfilenamesrun-hook.cmdexecs the named extensionless script directly andexec bashon UnixWhy it matters
The new
docs/porting-to-a-new-harness.mdguide points porters at this doc for Windows/cross-platform background. Following the stale doc would lead a contributor to recreate the.cmd/.sh+cygpath+bash -lpattern thatrun-hook.cmdwas rewritten to avoid. The porting guide currently works around this by telling readers to "trust the code over that doc where they differ," which is a band-aid.Suggested fix
Rewrite polyglot-hooks.md to describe the current
run-hook.cmd(single generic dispatcher, extensionless scripts, the.sh-auto-bash-prepend rationale, the bash-location fallback chain, clean exit when bash is absent), or replace it with a short pointer torun-hook.cmdas the authoritative implementation plus the rationale.Environment
Found while writing the porting-to-a-new-harness guide; the divergence was confirmed by reading both files on
dev.Planning to submit a fix for this. The approach: rewrite
polyglot-hooks.mdto describe the actualrun-hook.cmdimplementation — extensionless scripts, three-location bash fallback, no-l, nocygpath, silent exit on no-bash. Will also update thehooks.jsonexample to use the correct matcher (startup|clear|compact) and command (run-hook.cmd session-start). Documentation-only change, single file.