fix(claude): add tool availability guards and fix skill docs

Add jq availability checks to hook scripts (block-rules-yml.sh,
post-edit-write.sh) and wrap actionlint call in command -v guard,
consistent with project rules #2 and #10. Fix validate skill to
reflect actual make all pipeline order and note that make test
runs separately.
This commit is contained in:
2026-03-07 22:13:43 +02:00
parent df3e034d42
commit 3d1d8e1013
3 changed files with 39 additions and 25 deletions

View File

@@ -2,6 +2,11 @@
set -eu set -eu
# Read JSON input from stdin to get the file path # Read JSON input from stdin to get the file path
if ! command -v jq >/dev/null 2>&1; then
echo "Error: jq is required but not found" >&2
exit 1
fi
INPUT=$(cat) INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.filePath // empty') FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.filePath // empty')

View File

@@ -2,6 +2,11 @@
set -eu set -eu
# Read JSON input from stdin to get the file path # Read JSON input from stdin to get the file path
if ! command -v jq >/dev/null 2>&1; then
echo "Error: jq is required but not found" >&2
exit 1
fi
INPUT=$(cat) INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.filePath // empty') FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.filePath // empty')
@@ -34,6 +39,8 @@ esac
# Run actionlint on action.yml files # Run actionlint on action.yml files
case "$FILE_PATH" in case "$FILE_PATH" in
*/action.yml) */action.yml)
if command -v actionlint >/dev/null 2>&1; then
actionlint "$FILE_PATH" 2>&1 || true actionlint "$FILE_PATH" 2>&1 || true
fi
;; ;;
esac esac

View File

@@ -12,7 +12,9 @@ Run the complete validation pipeline:
make all make all
``` ```
This runs in order: `docs` -> `format` -> `lint` -> `test` This runs in order: `install-tools` -> `update-validators` -> `docs` -> `update-catalog` -> `format` -> `lint` -> `precommit`
**Note:** `make test` must be run separately.
## If validation fails ## If validation fails