Search

PythonReactSEOPDF
GitHub Skill

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.

JesseNaranjo☆ 1 Repository stars0 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill instructions

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.

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-01-20
Index updated
2026-01-26
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!