bug-review
This skill should be used when the user asks to "find bugs", "check for bugs", "review for errors", "find logical errors", "check for null references", "find edge cases", "check for race conditions", "debug this code", or wants to identify potential bugs in code.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Bug Detection Code Review Skill
Identify logical errors, null reference issues, race conditions, off-by-one errors, and other potential bugs through targeted bug-focused code review.
Agent Configuration
Uses bug-detection-agent (Opus in thorough/quick modes, Sonnet in gaps mode). See ${CLAUDE_PLUGIN_ROOT}/shared/review-workflow.md for authoritative model configuration.
Bug Categories Checked
Null/Undefined References (Major to Critical):
- Accessing properties on potentially null objects
- Missing null checks after database lookups
- Optional chaining gaps
- Nullable type misuse
Off-by-One Errors (Minor to Major):
- Array index bounds (
<=vs<) - Fence post errors in counting
- Pagination calculations
- Loop termination conditions
Async/Promise Issues (Major to Critical):
- Unhandled promise rejections
- Race conditions between async operations
- Floating promises (missing await)
- TOCTOU (time-of-check to time-of-use)
Type Coercion Bugs (Major):
- Loose equality (
==) vs strict (===) - String/number confusion
- Truthy/falsy misunderstandings
- Type narrowing gaps
State Management (Major to Critical):
- Mutating shared objects
- Stale closure captures
- React state update issues
- Redux action misuse
Error Handling (Major):
- Swallowed exceptions
- Wrong error type caught
- Missing error propagation
- Incomplete cleanup in finally
Auto-Validated Patterns
High-confidence patterns that skip validation. For full definitions, see ${CLAUDE_PLUGIN_ROOT}/shared/validation-rules.md.
Bug patterns: empty_catch_block, missing_await, null_dereference
Bug Investigation Mode
When investigating a specific bug:
- Ask for reproduction steps or stack trace
- Focus on code paths mentioned in error
- Include related error handling code
- Read recent git commits touching affected files
False Positives
Apply all rules from ${CLAUDE_PLUGIN_ROOT}/shared/false-positives.md.
Bug-specific additions - do NOT flag:
- Guarded elsewhere (null check in caller)
- Framework guarantee (framework ensures non-null)
- Intentional behavior (documented as expected)
- Unreachable conditions (requires impossible state)
Reproduction Conditions
For each bug, describe:
- Preconditions: What state must exist?
- Trigger: What action causes the bug?
- Frequency: How often can this occur?
- Impact: What goes wrong?
Example: "When two users simultaneously withdraw from the same account (concurrent requests), and the balance check passes for both before either write completes, the second write overwrites the first, resulting in only one deduction being recorded."
Example Output
See examples/example-output.md for a sample showing:
- Race condition with transaction fix
- Null reference with optional chaining fix
- Unhandled promise with try/catch fix
Related Components
See ${CLAUDE_PLUGIN_ROOT}/agents/bug-detection-agent.md for the agent definition.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!