Add Claude Code hooks and release skill

- PostToolUse hook: auto-format .rs files with rustfmt after edit
- PreToolUse hook: block direct edits to Cargo.lock
- /release skill: build .deb and inspect package metadata

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-02-16 13:44:00 +01:00
commit 1f216243f0
4 changed files with 68 additions and 0 deletions

8
.claude/hooks/format-rs.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
# Auto-format Rust files after Edit/Write
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
if [[ "$FILE_PATH" == *.rs ]]; then
rustfmt --edition 2021 "$FILE_PATH" 2>/dev/null || true
fi