|
1 | 1 | claude_plugin_hook_deepwork_invocation: |
2 | | - description: "Plugin hook scripts must fall back to `uvx deepwork` when the bare binary is not on PATH." |
| 2 | + description: "PLUG-REQ-001.15: Plugin hook scripts must invoke the `deepwork` CLI via `uvx deepwork`, never via a bare binary on PATH." |
3 | 3 | match: |
4 | 4 | include: |
5 | 5 | - "hooks/*.sh" |
6 | 6 | review: |
7 | 7 | strategy: individual |
8 | 8 | instructions: | |
9 | 9 | Plugin hook scripts run in end-user installs where the MCP server is |
10 | | - launched via `uvx deepwork serve` (see plugins/claude/.mcp.json). In |
11 | | - that environment the bare `deepwork` binary is NOT on PATH. Any hook |
12 | | - that calls `deepwork ...` (or `uv run deepwork ...`) directly will |
13 | | - exit 127, and Claude Code reports it as a failed hook on every Bash |
14 | | - tool use. Regression history: PR #361 reintroduced this exact bug. |
| 10 | + launched via `uvx deepwork serve` (see plugins/claude/.mcp.json) and |
| 11 | + the bare `deepwork` binary may be missing from PATH, or present but |
| 12 | + stale — e.g., a user-level `uv tool install deepwork` pinned to an |
| 13 | + older release. A stale bare binary produces errors like "Hook |
| 14 | + '...' not found" (when the hook module did not exist in that |
| 15 | + version) on every Bash tool use, which Claude Code surfaces as a |
| 16 | + failed hook. |
15 | 17 |
|
16 | | - For each `deepwork` (or `uv run deepwork`) invocation in this script, |
17 | | - verify it uses a fallback pattern equivalent to: |
| 18 | + To avoid both failure modes, plugin hook scripts MUST invoke the |
| 19 | + CLI the same way the MCP server is launched: via `uvx deepwork`. |
| 20 | + A bare `deepwork ...` (or `uv run deepwork ...`, or any invocation |
| 21 | + that uses PATH lookup) is a FAIL. |
| 22 | + |
| 23 | + Expected pattern: |
18 | 24 |
|
19 | 25 | ```bash |
20 | | - if command -v deepwork >/dev/null 2>&1; then |
21 | | - echo "${INPUT}" | deepwork hook some_hook |
22 | | - else |
23 | | - echo "${INPUT}" | uvx deepwork hook some_hook |
24 | | - fi |
| 26 | + echo "${INPUT}" | uvx deepwork hook some_hook |
25 | 27 | ``` |
26 | 28 |
|
27 | | - A bare `deepwork ...` call without a `command -v deepwork` guard (or |
28 | | - equivalent fallback to `uvx deepwork ...`) is a FAIL. |
| 29 | + For each `deepwork` invocation in this script, verify the command |
| 30 | + prefix is `uvx deepwork`. Shell word-splitting counts — the word |
| 31 | + immediately before `deepwork` on the command line must be `uvx`. |
29 | 32 |
|
30 | 33 | Output Format: |
31 | | - - PASS: Every `deepwork` invocation has a `uvx` fallback, or the |
| 34 | + - PASS: Every `deepwork` invocation is prefixed with `uvx`, or the |
32 | 35 | script makes no `deepwork` calls. |
33 | | - - FAIL: List each unguarded `deepwork` invocation with its line |
34 | | - number and the suggested fallback edit. |
| 36 | + - FAIL: List each non-`uvx` `deepwork` invocation with its line |
| 37 | + number and the required edit. |
35 | 38 |
|
36 | 39 | claude_plugin_skill_instructions: |
37 | 40 | description: "PLUG-REQ-001 & REVIEW-REQ-007: Verify skill instructions adequately convey behavioral requirements." |
|
0 commit comments