diff --git a/.claude/hooks/on-file-write.sh b/.claude/hooks/on-file-write.sh new file mode 100755 index 0000000..f98b260 --- /dev/null +++ b/.claude/hooks/on-file-write.sh @@ -0,0 +1,12 @@ +#!/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 diff --git a/.cline/rules b/.cline/rules new file mode 100644 index 0000000..36a8729 --- /dev/null +++ b/.cline/rules @@ -0,0 +1,50 @@ + +````markdown +## UBS Quick Reference for AI Agents + +UBS stands for "Ultimate Bug Scanner": **The AI Coding Agent's Secret Weapon: Flagging Likely Bugs for Fixing Early On** + +**Install:** `curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh | bash` + +**Golden Rule:** `ubs ` before every commit. Exit 0 = safe. Exit >0 = fix & re-run. + +**Commands:** +```bash +ubs file.ts file2.py # Specific files (< 1s) — USE THIS +ubs $(git diff --name-only --cached) # Staged files — before commit +ubs --only=js,python src/ # Language filter (3-5x faster) +ubs --ci --fail-on-warning . # CI mode — before PR +ubs --help # Full command reference +ubs sessions --entries 1 # Tail the latest install session log +ubs . # Whole project (ignores things like .venv and node_modules automatically) +``` + +**Output Format:** +``` +⚠️ Category (N errors) + file.ts:42:5 – Issue description + 💡 Suggested fix +Exit code: 1 +``` +Parse: `file:line:col` → location | 💡 → how to fix | Exit 0/1 → pass/fail + +**Fix Workflow:** +1. Read finding → category + fix suggestion +2. Navigate `file:line:col` → view context +3. Verify real issue (not false positive) +4. Fix root cause (not symptom) +5. Re-run `ubs ` → exit 0 +6. Commit + +**Speed Critical:** Scope to changed files. `ubs src/file.ts` (< 1s) vs `ubs .` (30s). Never full scan for small edits. + +**Bug Severity:** +- **Critical** (always fix): Null safety, XSS/injection, async/await, memory leaks +- **Important** (production): Type narrowing, division-by-zero, resource leaks +- **Contextual** (judgment): TODO/FIXME, console logs + +**Anti-Patterns:** +- ❌ Ignore findings → ✅ Investigate each +- ❌ Full scan per edit → ✅ Scope to file +- ❌ Fix symptom (`if (x) { x.y }`) → ✅ Root cause (`x?.y`) +```` diff --git a/.codex/rules/ubs.md b/.codex/rules/ubs.md new file mode 100644 index 0000000..36a8729 --- /dev/null +++ b/.codex/rules/ubs.md @@ -0,0 +1,50 @@ + +````markdown +## UBS Quick Reference for AI Agents + +UBS stands for "Ultimate Bug Scanner": **The AI Coding Agent's Secret Weapon: Flagging Likely Bugs for Fixing Early On** + +**Install:** `curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh | bash` + +**Golden Rule:** `ubs ` before every commit. Exit 0 = safe. Exit >0 = fix & re-run. + +**Commands:** +```bash +ubs file.ts file2.py # Specific files (< 1s) — USE THIS +ubs $(git diff --name-only --cached) # Staged files — before commit +ubs --only=js,python src/ # Language filter (3-5x faster) +ubs --ci --fail-on-warning . # CI mode — before PR +ubs --help # Full command reference +ubs sessions --entries 1 # Tail the latest install session log +ubs . # Whole project (ignores things like .venv and node_modules automatically) +``` + +**Output Format:** +``` +⚠️ Category (N errors) + file.ts:42:5 – Issue description + 💡 Suggested fix +Exit code: 1 +``` +Parse: `file:line:col` → location | 💡 → how to fix | Exit 0/1 → pass/fail + +**Fix Workflow:** +1. Read finding → category + fix suggestion +2. Navigate `file:line:col` → view context +3. Verify real issue (not false positive) +4. Fix root cause (not symptom) +5. Re-run `ubs ` → exit 0 +6. Commit + +**Speed Critical:** Scope to changed files. `ubs src/file.ts` (< 1s) vs `ubs .` (30s). Never full scan for small edits. + +**Bug Severity:** +- **Critical** (always fix): Null safety, XSS/injection, async/await, memory leaks +- **Important** (production): Type narrowing, division-by-zero, resource leaks +- **Contextual** (judgment): TODO/FIXME, console logs + +**Anti-Patterns:** +- ❌ Ignore findings → ✅ Investigate each +- ❌ Full scan per edit → ✅ Scope to file +- ❌ Fix symptom (`if (x) { x.y }`) → ✅ Root cause (`x?.y`) +```` diff --git a/.continue/config.json b/.continue/config.json new file mode 100644 index 0000000..dd973ee --- /dev/null +++ b/.continue/config.json @@ -0,0 +1,16 @@ +{ + "customCommands": [ + { + "name": "scan-bugs", + "description": "Run Ultimate Bug Scanner on current project", + "prompt": "Run 'ubs --fail-on-warning .' and fix any critical issues found before proceeding" + } + ], + "slashCommands": [ + { + "name": "quality", + "description": "Check code quality with UBS", + "run": "ubs ." + } + ] +} diff --git a/.cursor/rules b/.cursor/rules new file mode 100644 index 0000000..36a8729 --- /dev/null +++ b/.cursor/rules @@ -0,0 +1,50 @@ + +````markdown +## UBS Quick Reference for AI Agents + +UBS stands for "Ultimate Bug Scanner": **The AI Coding Agent's Secret Weapon: Flagging Likely Bugs for Fixing Early On** + +**Install:** `curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh | bash` + +**Golden Rule:** `ubs ` before every commit. Exit 0 = safe. Exit >0 = fix & re-run. + +**Commands:** +```bash +ubs file.ts file2.py # Specific files (< 1s) — USE THIS +ubs $(git diff --name-only --cached) # Staged files — before commit +ubs --only=js,python src/ # Language filter (3-5x faster) +ubs --ci --fail-on-warning . # CI mode — before PR +ubs --help # Full command reference +ubs sessions --entries 1 # Tail the latest install session log +ubs . # Whole project (ignores things like .venv and node_modules automatically) +``` + +**Output Format:** +``` +⚠️ Category (N errors) + file.ts:42:5 – Issue description + 💡 Suggested fix +Exit code: 1 +``` +Parse: `file:line:col` → location | 💡 → how to fix | Exit 0/1 → pass/fail + +**Fix Workflow:** +1. Read finding → category + fix suggestion +2. Navigate `file:line:col` → view context +3. Verify real issue (not false positive) +4. Fix root cause (not symptom) +5. Re-run `ubs ` → exit 0 +6. Commit + +**Speed Critical:** Scope to changed files. `ubs src/file.ts` (< 1s) vs `ubs .` (30s). Never full scan for small edits. + +**Bug Severity:** +- **Critical** (always fix): Null safety, XSS/injection, async/await, memory leaks +- **Important** (production): Type narrowing, division-by-zero, resource leaks +- **Contextual** (judgment): TODO/FIXME, console logs + +**Anti-Patterns:** +- ❌ Ignore findings → ✅ Investigate each +- ❌ Full scan per edit → ✅ Scope to file +- ❌ Fix symptom (`if (x) { x.y }`) → ✅ Root cause (`x?.y`) +```` diff --git a/.gemini/rules b/.gemini/rules new file mode 100644 index 0000000..36a8729 --- /dev/null +++ b/.gemini/rules @@ -0,0 +1,50 @@ + +````markdown +## UBS Quick Reference for AI Agents + +UBS stands for "Ultimate Bug Scanner": **The AI Coding Agent's Secret Weapon: Flagging Likely Bugs for Fixing Early On** + +**Install:** `curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh | bash` + +**Golden Rule:** `ubs ` before every commit. Exit 0 = safe. Exit >0 = fix & re-run. + +**Commands:** +```bash +ubs file.ts file2.py # Specific files (< 1s) — USE THIS +ubs $(git diff --name-only --cached) # Staged files — before commit +ubs --only=js,python src/ # Language filter (3-5x faster) +ubs --ci --fail-on-warning . # CI mode — before PR +ubs --help # Full command reference +ubs sessions --entries 1 # Tail the latest install session log +ubs . # Whole project (ignores things like .venv and node_modules automatically) +``` + +**Output Format:** +``` +⚠️ Category (N errors) + file.ts:42:5 – Issue description + 💡 Suggested fix +Exit code: 1 +``` +Parse: `file:line:col` → location | 💡 → how to fix | Exit 0/1 → pass/fail + +**Fix Workflow:** +1. Read finding → category + fix suggestion +2. Navigate `file:line:col` → view context +3. Verify real issue (not false positive) +4. Fix root cause (not symptom) +5. Re-run `ubs ` → exit 0 +6. Commit + +**Speed Critical:** Scope to changed files. `ubs src/file.ts` (< 1s) vs `ubs .` (30s). Never full scan for small edits. + +**Bug Severity:** +- **Critical** (always fix): Null safety, XSS/injection, async/await, memory leaks +- **Important** (production): Type narrowing, division-by-zero, resource leaks +- **Contextual** (judgment): TODO/FIXME, console logs + +**Anti-Patterns:** +- ❌ Ignore findings → ✅ Investigate each +- ❌ Full scan per edit → ✅ Scope to file +- ❌ Fix symptom (`if (x) { x.y }`) → ✅ Root cause (`x?.y`) +```` diff --git a/.opencode/rules b/.opencode/rules new file mode 100644 index 0000000..36a8729 --- /dev/null +++ b/.opencode/rules @@ -0,0 +1,50 @@ + +````markdown +## UBS Quick Reference for AI Agents + +UBS stands for "Ultimate Bug Scanner": **The AI Coding Agent's Secret Weapon: Flagging Likely Bugs for Fixing Early On** + +**Install:** `curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh | bash` + +**Golden Rule:** `ubs ` before every commit. Exit 0 = safe. Exit >0 = fix & re-run. + +**Commands:** +```bash +ubs file.ts file2.py # Specific files (< 1s) — USE THIS +ubs $(git diff --name-only --cached) # Staged files — before commit +ubs --only=js,python src/ # Language filter (3-5x faster) +ubs --ci --fail-on-warning . # CI mode — before PR +ubs --help # Full command reference +ubs sessions --entries 1 # Tail the latest install session log +ubs . # Whole project (ignores things like .venv and node_modules automatically) +``` + +**Output Format:** +``` +⚠️ Category (N errors) + file.ts:42:5 – Issue description + 💡 Suggested fix +Exit code: 1 +``` +Parse: `file:line:col` → location | 💡 → how to fix | Exit 0/1 → pass/fail + +**Fix Workflow:** +1. Read finding → category + fix suggestion +2. Navigate `file:line:col` → view context +3. Verify real issue (not false positive) +4. Fix root cause (not symptom) +5. Re-run `ubs ` → exit 0 +6. Commit + +**Speed Critical:** Scope to changed files. `ubs src/file.ts` (< 1s) vs `ubs .` (30s). Never full scan for small edits. + +**Bug Severity:** +- **Critical** (always fix): Null safety, XSS/injection, async/await, memory leaks +- **Important** (production): Type narrowing, division-by-zero, resource leaks +- **Contextual** (judgment): TODO/FIXME, console logs + +**Anti-Patterns:** +- ❌ Ignore findings → ✅ Investigate each +- ❌ Full scan per edit → ✅ Scope to file +- ❌ Fix symptom (`if (x) { x.y }`) → ✅ Root cause (`x?.y`) +````