modules/home/programs/cli-agents/shared/skills/bug-finder/SKILL.md
Find bugs and verify correctness in code changes. Use when reviewing a PR, staged diff, or specific code the user points at. Hunts for logic errors, security flaws, race conditions, resource leaks, and API misuse. Produces evidence-based findings with concrete failure scenarios. Does NOT flag style, formatting, or naming issues.
npx skillsauth add not-matthias/dotfiles-nix bug-finderInstall 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.
Find bugs. Verify correctness. Ignore style.
Iron law: never report a bug without a concrete trigger, a real failure mode, and a severe consequence.
Hard cap: 15 findings max per review. If you find more, keep only the highest severity. Inflation erodes trust.
Hunt these (ordered by severity):
Ignore these (they belong to linters and minimal-diff):
Adapt to what the user gives you:
gh pr diff. Read the PR description. Identify what the change is supposed to do.git diff --staged (or git diff for unstaged). Understand the intent from recent commits or user description.Before hunting, identify the critical paths — code that handles auth, payments, data writes, user input, or concurrency. These get the most scrutiny.
Scope rule for diff-based reviews: only flag issues in changed or new code. Pre-existing issues in untouched code are out of scope unless the change makes them reachable in a new way.
Walk through the code change systematically. For each issue found, record:
file:line)The failure scenario is mandatory. If you cannot construct one, the finding is not real — drop it.
Boundary analysis:
Feynman technique — for each non-obvious function or block, ask:
Flow-divergence analysis — look for two code paths that should behave identically but don't. Check: do both paths handle errors the same way? Do both paths update the same state? If one path has a guard, should the other?
For language-specific pitfalls, consult the references:
Re-examine every finding. For each one, ask:
Common false-positive anti-patterns — drop findings that match these:
Drop any finding that fails the skeptic check. False positives waste the user's time and erode trust.
Assign severity to surviving findings:
| Severity | Meaning | Examples | |----------|---------|---------| | CRITICAL | Will break in production. Data loss, security breach, crash. | SQL injection, use-after-free, auth bypass | | HIGH | Likely to break under realistic conditions. | Race condition on shared state, missing null check on user input | | MEDIUM | Breaks under edge cases or degrades correctness. | Off-by-one in pagination, resource leak on error path | | LOW | Unlikely to cause user-visible issues but still wrong. | Redundant check, minor perf issue on cold path |
Output findings sorted by severity (worst first). One line per finding:
file:line — [CRITICAL] Description. Breaks when: scenario.
file:line — [HIGH] Description. Breaks when: scenario.
End with a summary line:
N findings: X critical, Y high, Z medium, W low
If zero findings survive the skeptic pass, say so:
No issues found.
Issue: Too many findings — review feels noisy.
Issue: User disagrees with a finding.
Issue: Not enough context to judge correctness.
documentation
Save notes, journal entries, and research to the personal-notes Obsidian vault (personal-vault-v2). Use when the user asks to 'save note', 'save to notes', 'write to personal notes', 'save to daily notes', 'note this down', or wants to persist findings/analysis to their personal vault.
documentation
Use whenever the user asks to address, fix, resolve, review, or respond to pull-request comments or review feedback.
development
Apply Not Matthias's Rust-first personal coding style. Use whenever the user explicitly asks to apply or review their code style, make Rust match their preferences, perform a style pass, or simplify/refactor according to their conventions. Inspect only task-touched code, honor local project conventions first, and make only safe opt-out style edits.
development
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.