Files
gitlore/.claude/hooks/on-file-write.sh
Taylor Eernisse d54f669c5e chore: add multi-agent editor config and UBS file-write hook
Add rule/config files for Cursor, Cline, Codex, Gemini, Continue, and
OpenCode editors pointing them to project conventions, UBS usage, and
AGENTS.md. Add a Claude Code on-file-write hook that runs UBS on
supported source files after every save.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:16:28 -05:00

13 lines
490 B
Bash
Executable File

#!/bin/bash
# Ultimate Bug Scanner - Claude Code Hook
# Runs on every file save for UBS-supported languages (JS/TS, Python, C/C++, Rust, Go, Java, Ruby)
if [[ "$FILE_PATH" =~ \.(js|jsx|ts|tsx|mjs|cjs|py|pyw|pyi|c|cc|cpp|cxx|h|hh|hpp|hxx|rs|go|java|rb)$ ]]; then
echo "🔬 Running bug scanner..."
if ! command -v ubs >/dev/null 2>&1; then
echo "⚠️ 'ubs' not found in PATH; install it before using this hook." >&2
exit 0
fi
ubs "${PROJECT_DIR}" --ci 2>&1 | head -50
fi