Files
OthmanAdi be867c65d3 fix: dispatch every hook-bearing SKILL.md variant to the versioned script
Eleven of the thirteen hook bearing SKILL.md files still carried the v2.43
hook body inlined in their YAML scalars. The v3 refactor moved that logic into
scripts/inject-plan.sh so it would be versioned and testable instead of
duplicated, but only the canonical and .agents files were converted. The
reporter of #212 installed one of the eleven.

Those inline bodies never received: the PLANNING_DISABLED opt-out from #195,
which is why the documented workaround was inoperative on that route; the
symlink containment guard; the SHA cache key fix; nonce delimiters; the v3
attestation refusal; the ledger summary; and PWF_INJECT=smart. They also still
wrote the SHA cache to the world writable /tmp path that moved to
XDG_CACHE_HOME for security in v3.0.0.

The Stop scalar in those eleven probed only CLAUDE_SKILL_DIR and two
$HOME/.claude paths, none of which exists on Codex, Cursor, Factory,
CodeBuddy, Mastra or OpenCode, so completion checking there could never find
its script and silently did nothing.

Discovery is now a first match wins loop. The previous ls a b c | head -1
returns the alphabetically first hit, so a stale marketplace copy outranked
the host native one regardless of the order the candidates were written in.
Candidates are PWF_SCRIPT_DIR, then CLAUDE_SKILL_DIR, then the host's own
skill directory, then the two Claude paths. Repo relative candidates stay
banned: a cloned repository must not be able to plant a script the hook then
executes. PWF_SCRIPT_DIR exists for workspace installs, which are the
recommended method on several hosts and which no user level path can reach.

When nothing resolves, the once per turn hook says so rather than exiting
silently; the per tool call and precompact hooks stay quiet.

The scalars are generated from one template so the eleven cannot drift apart
again, the sync manifest ships inject-plan.sh, ledger-summary.sh and
resolve-plan-dir.sh to every variant that dispatches (without the resolver,
ledger-summary reported a false 0/0 complete), and a new test fails the build
if any hook bearing SKILL.md drifts back to an inlined body.
2026-08-01 22:05:13 +02:00
..
2026-04-29 14:44:20 +08:00