Comprehensive Claude Code guidance system with: - 5 agents: tdd-guardian, code-reviewer, security-scanner, refactor-scan, dependency-audit - 18 skills covering languages (Python, TypeScript, Rust, Go, Java, C#), infrastructure (AWS, Azure, GCP, Terraform, Ansible, Docker/K8s, Database, CI/CD), testing (TDD, UI, Browser), and patterns (Monorepo, API Design, Observability) - 3 hooks: secret detection, auto-formatting, TDD git pre-commit - Strict TDD enforcement with 80%+ coverage requirements - Multi-model strategy: Opus for planning, Sonnet for execution (opusplan) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.4 KiB
Bash
55 lines
1.4 KiB
Bash
#!/bin/bash
|
|
# Auto-format files after writing
|
|
# Runs appropriate formatter based on file extension
|
|
|
|
set -e
|
|
|
|
# Read the file path from stdin
|
|
INPUT=$(cat)
|
|
FILE_PATH=$(echo "$INPUT" | jq -r '.file_path // .filePath // empty')
|
|
|
|
if [ -z "$FILE_PATH" ] || [ ! -f "$FILE_PATH" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
# Get file extension
|
|
EXT="${FILE_PATH##*.}"
|
|
|
|
case "$EXT" in
|
|
py)
|
|
if command -v ruff &> /dev/null; then
|
|
ruff format "$FILE_PATH" 2>/dev/null || true
|
|
ruff check --fix "$FILE_PATH" 2>/dev/null || true
|
|
fi
|
|
;;
|
|
ts|tsx|js|jsx)
|
|
# Try to find and use project's ESLint config
|
|
DIR=$(dirname "$FILE_PATH")
|
|
while [ "$DIR" != "/" ]; do
|
|
if [ -f "$DIR/package.json" ]; then
|
|
cd "$DIR"
|
|
if [ -f "node_modules/.bin/eslint" ]; then
|
|
./node_modules/.bin/eslint --fix "$FILE_PATH" 2>/dev/null || true
|
|
fi
|
|
break
|
|
fi
|
|
DIR=$(dirname "$DIR")
|
|
done
|
|
;;
|
|
rs)
|
|
if command -v rustfmt &> /dev/null; then
|
|
rustfmt "$FILE_PATH" 2>/dev/null || true
|
|
fi
|
|
;;
|
|
tf)
|
|
if command -v terraform &> /dev/null; then
|
|
terraform fmt "$FILE_PATH" 2>/dev/null || true
|
|
fi
|
|
;;
|
|
yaml|yml)
|
|
# Skip YAML formatting to preserve structure
|
|
;;
|
|
esac
|
|
|
|
exit 0
|