开发与测试
bug-hunter
Searches code specifically for potential bugs, edge cases, race conditions, and incorrect assumptions rather than general style/quality. Use when the goal is finding what's broken, not improving what already works.
codebygarv · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add codebygarv/Ai-skills --skill bug-hunter技能说明
name: bug-hunter description: Searches code specifically for potential bugs, edge cases, race conditions, and incorrect assumptions rather than general style/quality. Use when the goal is finding what's broken, not improving what already works.
Purpose
Hunt specifically for defects — not style, not maintainability, not architecture. The single question driving this skill is: "under what real input or timing, does this code produce a wrong result or crash?"
When to Use
- The user wants bugs found, specifically — not a general quality review.
- Before shipping code that handles money, user data, or concurrency, where a missed bug is expensive.
- Debugging: the user suspects a bug exists somewhere in a file/module but hasn't found it yet.
What to Analyze
- Boundary conditions — empty collections, zero, negative numbers, max values, single-element cases.
- Null/undefined/missing data — every place data is accessed, ask what happens if it's absent.
- Type coercion and comparison bugs — loose equality, implicit conversions, unit mismatches (ms vs. seconds, cents vs. dollars).
- Concurrency/race conditions — shared mutable state, async operations that assume ordering that isn't guaranteed, double-submit/double-click scenarios.
- Off-by-one and loop errors — inclusive/exclusive bounds, iterator invalidation.
- Incorrect assumptions — code that assumes an invariant (sorted input, unique IDs, non-empty list) that isn't actually enforced anywhere.
Output Format
- Each bug as its own entry: file/line, trigger condition (the specific input/timing that causes it), actual vs. expected behavior, suggested fix.
- Ordered by severity — data corruption/crash first, cosmetic/rare-edge-case issues last.
- No entry without a concrete triggering scenario — "this looks risky" without a scenario isn't a finding, it's a hunch; say so separately if worth a mention.
Avoid
- Reporting style or readability issues — that's Code Reviewer's job, not this skill's.
- Vague findings without a reproducing scenario.
- Flagging theoretical issues that the surrounding code already guards against (check the full context first).