docs(vibe): add hooks/vibe/README.md and link from Directory Structure

Every other agent with a dedicated hook implementation carries a
hooks/<agent>/README.md (see antigravity/cline/opencode/copilot/hermes
for the shape). The initial Vibe commit skipped this, leaving Vibe as
the odd one out in the hooks/ layout.

- Add hooks/vibe/README.md following the Copilot template (Rust binary
  hook, no shell dependency). Documents the pre_tool hook location,
  input JSON shape, rewrite response, passthrough / deny behavior,
  and the belt-and-suspenders prompt fallback.
- Fix hooks/README.md Directory Structure entry to point at
  vibe/README.md (previously claimed 'no dedicated subdirectory').
This commit is contained in:
Xavier Pestel
2026-08-05 15:37:02 +02:00
parent 1847b07f7a
commit 94ae76b2da
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ Each agent subdirectory has its own README with hook-specific details:
- **[`opencode/`](opencode/README.md)** — TypeScript plugin, `zx` library, `tool.execute.before` event, in-place mutation
- **[`pi/`](pi/README.md)** — TypeScript extension, `tool_call` event, `isToolCallEventType` guard, in-place mutation, `~/.pi/agent/extensions/`
- **[`hermes/`](hermes/README.md)** — Python plugin, `pre_tool_call` hook, in-place terminal command mutation
- **Mistral Vibe** — Native Rust binary (`rtk hook vibe`), `pre_tool` hook in `~/.vibe/hooks.toml`, `hook_specific_output.tool_input` rewrite (no dedicated subdirectory — the hook is a subcommand of the RTK binary itself, installed via `src/hooks/init.rs::run_vibe_mode`)
- **[`vibe/`](vibe/README.md)** — Rust binary hook (`rtk hook vibe`), `pre_tool` entry in `~/.vibe/hooks.toml`, `hook_specific_output.tool_input` rewrite plus `system_message` for UI visibility
## Supported Agents
+19
View File
@@ -0,0 +1,19 @@
# Mistral Vibe Hooks
> Part of [`hooks/`](../README.md) — see also [`src/hooks/`](../../src/hooks/README.md) for installation code
## Specifics
- Uses the `rtk hook vibe` Rust binary (not a shell script) -- no `jq` dependency
- `pre_tool` hook declared in `~/.vibe/hooks.toml` (user-scoped) with `match = "bash"` and `strict = false`
- Reads Vibe's stdin JSON payload (`tool_name`, `tool_input.command`, `hook_event_name`, `session_id`)
- Returns `hook_specific_output.tool_input.command` for transparent rewrite plus a `system_message` for UI visibility
- Non-bash tool / empty command / malformed JSON / RTK-unknown command → passthrough (exit 0, empty stdout)
- RTK permission deny → `{"decision":"deny","reason":"..."}`
- Alongside the hook, a system prompt at `~/.vibe/prompts/rtk.md` is installed as a belt-and-suspenders fallback (skip with `--hook-only`)
- Installed globally via `rtk init -g --agent vibe`; there is no project-scoped variant
## Notes
- This directory intentionally holds only this README — the hook is a subcommand of the RTK binary (`rtk hook vibe`), not a standalone script or plugin file, so nothing is deployed here
- Vibe hook contract reference: https://docs.mistral.ai/vibe/code/cli/hooks