Files
docker-docs/.agents/skills/write/scripts/post-edit.sh
T
David Karlsson 2c4facb6d0 feat: rewrite skills/agent docs
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2026-03-31 15:20:07 +02:00

13 lines
342 B
Bash
Executable File

#!/bin/bash
# PostToolUse hook for Edit/Write in the write skill.
# Auto-formats Markdown files with prettier after each edit.
set -euo pipefail
input=$(cat)
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
[ -z "$file_path" ] && exit 0
[[ "$file_path" != *.md ]] && exit 0
npx prettier --write "$file_path" 2>/dev/null