Add Claude Code hooks, commands, and permissions
High priority: - Auto-format on edit (.claude/hooks/format-elixir.sh): runs mix format synchronously after every Edit/Write on .ex, .exs, and .heex files. Ensures code is formatted before the next read or tool call. - mix test permissions: added Bash(mix test) (bare) and Bash(mix test *) (with path/flags) to the allow list. Previously only Bash(mix test:*) was allowed, which didn't match common invocations. - Slash commands: /precommit runs the full mix precommit pipeline and reports failures with fix suggestions. /oban-status queries Oban job state via Tidewave SQL, grouped by state and worker. Medium priority: - Chrome DevTools permissions: added 8 new tools (select_page, list_network_requests, get_network_request, list_console_messages, get_console_message, hover, press_key, wait_for) for debugging API traffic, JS hook errors, hover states, and keyboard navigation. - Gettext extraction hook (.claude/hooks/gettext-extract.sh): runs mix gettext.extract --merge asynchronously after editing .heex files. Async because it's project-wide and doesn't need to block the next edit. - Sobelow permission: added Bash(mix sobelow:*) to the allow list for independent security checks.
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
INPUT=$(cat)
|
||||
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path')
|
||||
|
||||
if [[ "$FILE_PATH" == *.ex ]] || [[ "$FILE_PATH" == *.exs ]] || [[ "$FILE_PATH" == *.heex ]]; then
|
||||
cd "$CLAUDE_PROJECT_DIR"
|
||||
mix format "$FILE_PATH" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user