Files
JakeHillion d60e81bd14
commit-validation / validate-single-commit (pull_request) Successful in 6s
nix-builder (x86_64-linux) Build completed successfully
flake / flake (push) Successful in 4m41s
claude: add OpenCode plugin for tool-use hooks
The nix skill relied on Claude following prose instructions to quote .#
targets and add --no-link/--print-out-paths flags. The commit skill had
a paragraph telling Claude to use jj instead of git in jj repos. Both
are better enforced mechanically.

Created pkgs/opencode-plugin/, a TypeScript package that implements
three tool-use hooks as pure functions: nix (adds flags and quotes .#
arguments), jj-redirect (blocks git commit in jj repos), and
redundant-cwd (blocks redundant -C/-R flags). The package exports an
OpenCode plugin via tool.execute.before and a Claude shim binary that
adapts the same logic to Claude's stdin/stdout hook protocol. Tests
(32 cases) run via node:test during the Nix build.

Settings.json is generated declaratively via Home Manager pointing at
the shim. OpenCode gets the plugin via opencode.json config.

Test plan:
- CI
- Smoke-tested shim with sample Claude hook JSON input
- Verified settings.json and opencode.json reference correct Nix store paths
2026-02-18 15:21:09 +00:00
..
2025-12-28 20:28:18 +00:00
2025-12-13 08:31:11 +00:00
2026-01-12 09:49:20 +00:00