skills/dicklesworthstone/ubs/SKILL.md
Ultimate Bug Scanner - Pre-commit static analysis for AI coding workflows. 18 detection categories, 8 languages, 4-layer analysis engine. The AI agent's quality gate.
npx skillsauth add aiskillstore/marketplace ubsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Static analysis tool built for AI coding workflows. Catches bugs that AI agents commonly introduce: null safety, async/await issues, security holes, memory leaks. Scans JS/TS, Python, Go, Rust, Java, C++, Ruby, Swift in 3-5 seconds.
AI agents move fast. Bugs move faster. You're shipping features in minutes, but:
await causes silent failuresUBS is the quality gate: scan before commit, fix before merge.
ubs <changed-files> --fail-on-warning
Exit 0 = safe to commit. Exit 1 = fix and re-run.
ubs file.ts file2.py # Specific files (< 1s)
ubs $(git diff --name-only --cached) # Staged files
ubs --staged # Same, cleaner syntax
ubs --diff # Working tree vs HEAD
ubs . # Current directory
ubs /path/to/project # Specific path
ubs --only=js,python src/ # Language filter (faster)
ubs --ci --fail-on-warning . # Strict mode for CI
ubs --format=json . # Machine-readable
ubs --format=sarif . # GitHub code scanning
⚠️ 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
| Category | What It Catches |
|----------|-----------------|
| Null Safety | Unguarded property access, missing null checks |
| Security | XSS, injection, prototype pollution, hardcoded secrets |
| Async/Await | Missing await, unhandled rejections, race conditions |
| Memory Leaks | Event listeners without cleanup, timer leaks |
| Type Coercion | == vs ===, parseInt without radix, NaN comparison |
| Category | What It Catches |
|----------|-----------------|
| Division Safety | Division without zero check |
| Resource Lifecycle | Unclosed files, connections, context managers |
| Error Handling | Empty catch blocks, swallowed errors |
| Promise Chains | .then() without .catch() |
| Array Mutations | Mutating during iteration |
| Category | What It Catches |
|----------|-----------------|
| Debug Code | console.log, debugger, print() statements |
| TODO Markers | TODO, FIXME, HACK comments |
| Type Safety | TypeScript any usage |
| Readability | Complex ternaries, deep nesting |
| Language | Key Patterns |
|----------|-------------|
| JavaScript/TypeScript | innerHTML XSS, eval(), missing await, React hooks deps |
| Python | eval(), open() without with, missing encoding=, None checks |
| Go | Nil pointer, goroutine leaks, defer symmetry, context cancel |
| Rust | .unwrap() panics, unsafe blocks, Option handling |
| Java | Resource leaks (try-with-resources), null checks, JDBC |
| C/C++ | Buffer overflows, strcpy(), memory leaks, use-after-free |
| Ruby | eval(), send(), instance_variable_set |
| Swift | Force unwrap (!), ObjC bridging issues |
ubs --profile=strict . # Fail on warnings, enforce high standards
ubs --profile=loose . # Skip TODO/debug nits when prototyping
ubs --category=resource-lifecycle . # Python/Go/Java resource hygiene
Narrows scan to relevant languages and suppresses unrelated categories.
# Capture baseline
ubs --ci --report-json .ubs/baseline.json .
# Compare against baseline
ubs --ci --comparison .ubs/baseline.json --report-json .ubs/latest.json .
Useful for CI to detect regressions vs. main branch.
| Format | Flag | Use Case |
|--------|------|----------|
| text | (default) | Human-readable terminal output |
| json | --format=json | Machine parsing, scripting |
| jsonl | --format=jsonl | Line-delimited, streaming |
| sarif | --format=sarif | GitHub code scanning |
| html | --html-report=file.html | PR attachments, dashboards |
When a finding is intentional:
eval(trustedCode); // ubs:ignore
// ubs:ignore-next-line
dangerousOperation();
| Code | Meaning |
|------|---------|
| 0 | No critical issues (safe to commit) |
| 1 | Critical issues or warnings (with --fail-on-warning) |
| 2 | Environment error (missing ast-grep, etc.) |
ubs doctor # Check environment
ubs doctor --fix # Auto-fix missing dependencies
Checks: curl/wget, ast-grep, ripgrep, jq, typos, Node.js + TypeScript.
UBS auto-configures hooks for coding agents during install:
| Agent | Hook Location |
|-------|---------------|
| Claude Code | .claude/hooks/on-file-write.sh |
| Cursor | .cursor/rules |
| Codex CLI | .codex/rules/ubs.md |
| Gemini | .gemini/rules |
| Windsurf | .windsurf/rules |
| Cline | .cline/rules |
#!/bin/bash
# .claude/hooks/on-file-write.sh
if [[ "$FILE_PATH" =~ \.(js|jsx|ts|tsx|py|go|rs|java|rb)$ ]]; then
echo "🔬 Quality check running..."
if ubs "${PROJECT_DIR}" --ci 2>&1 | head -30; then
echo "✅ No critical issues"
else
echo "⚠️ Issues detected - review above"
fi
fi
#!/bin/bash
# .git/hooks/pre-commit
echo "🔬 Running bug scanner..."
if ! ubs . --fail-on-warning 2>&1 | tail -30; then
echo "❌ Critical issues found. Fix or: git commit --no-verify"
exit 1
fi
echo "✅ Quality check passed"
Small (5K lines): 0.8 seconds
Medium (50K lines): 3.2 seconds
Large (200K lines): 12 seconds
Huge (1M lines): 58 seconds
10,000+ lines per second. Use --jobs=N to control parallelism.
ubs src/file.ts (< 1s) vs ubs . (30s)--only=js,python skips irrelevant scanners--skip=11,14 to skip debug/TODO markers1. 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 <file> → exit 0
6. Commit
| Don't | Do |
|-------|-----|
| Ignore findings | Investigate each |
| Full scan per edit | Scope to changed files |
| Fix symptom (if (x) { x.y }) | Fix root cause (x?.y) |
| Suppress without understanding | Verify false positive first |
# One-liner (recommended)
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/install.sh?$(date +%s)" | bash -s -- --easy-mode
# Manual
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/ultimate_bug_scanner/master/ubs \
-o /usr/local/bin/ubs && chmod +x /usr/local/bin/ubs
mkdir -p ~/.config/ubs/rules
cat > ~/.config/ubs/rules/no-console.yml <<'EOF'
id: custom.no-console
language: javascript
rule:
pattern: console.log($$$)
severity: warning
message: "Remove console.log before production"
EOF
ubs . --rules=~/.config/ubs/rules
ubs . --exclude=legacy,generated,vendor
Auto-ignored: node_modules, .venv, dist, build, target, editor caches.
ubs sessions --entries 1 # View latest install session
| Tool | Integration |
|------|-------------|
| BV | --beads-jsonl=out.jsonl exports findings for Beads |
| CASS | Search past sessions for similar bug patterns |
| CM | Extract rules from UBS findings |
| Agent Mail | Notify agents of scan results |
| DCG | UBS runs inside DCG protection |
| Error | Fix |
|-------|-----|
| "Environment error" (exit 2) | ubs doctor --fix |
| "ast-grep not found" | brew install ast-grep or cargo install ast-grep |
| Too many false positives | Use --skip=N or // ubs:ignore |
| Slow scans | Scope to files: ubs <file> not ubs . |
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.