Get the FREE Ultimate OpenClaw Setup Guide →

debug-issue

npx machina-cli add skill gologo13/agent-skills/debug-issue --openclaw
Files (1)
SKILL.md
1.6 KB

Debug Issue

Overview

Help debug the current issue in the code by walking through the debugging process systematically and providing clear, actionable solutions.

Steps

  1. Problem Analysis
    • Identify the specific problem or error
    • Understand the expected vs actual behavior
    • Trace the execution flow to find the root cause
  2. Debugging Strategy
    • Add appropriate logging statements
    • Suggest debugging tools and techniques
    • Identify key variables and states to monitor
    • Recommend breakpoint locations
  3. Solution Approach
    • Propose potential fixes with explanations
    • Consider multiple solution approaches
    • Evaluate trade-offs of different approaches
    • Provide step-by-step resolution plan
  4. Prevention
    • Suggest ways to prevent similar issues
    • Recommend additional tests or checks
    • Identify code patterns that could be improved

Debug Issue Checklist

  • Identified the specific problem or error
  • Understood expected vs actual behavior
  • Traced execution flow to find root cause
  • Added appropriate logging statements
  • Proposed potential fixes with explanations
  • Evaluated trade-offs of different approaches
  • Provided step-by-step resolution plan
  • Suggested ways to prevent similar issues
  • Recommended additional tests or checks

Source

git clone https://github.com/gologo13/agent-skills/blob/main/skills/debug-issue/SKILL.mdView on GitHub

Overview

This skill walks you through debugging a current code issue with a structured, actionable process. It covers problem analysis, debugging strategy, a solution approach, and prevention steps to avoid recurrence. The goal is to make debugging clear, repeatable, and efficient.

How This Skill Works

The workflow starts with Problem Analysis to identify the exact error and the root cause. It then applies a Debugging Strategy using targeted logging, tools, and breakpoint placement to observe key variables. Finally, the Solution Approach outlines potential fixes, evaluates trade-offs, and yields a step-by-step resolution plan plus Prevention tips.

When to Use It

  • When a feature misbehaves after a recent change and the bug is reproducible
  • When tests fail or flaky tests occur and you need to locate the root cause
  • When expected behavior diverges from actual behavior and tracing is required
  • When there are multiple potential fixes and you want to evaluate trade-offs
  • When preparing a fix and you want a clear plan before making code changes

Quick Start

  1. Step 1: Reproduce the issue and define the expected vs actual behavior
  2. Step 2: Instrument with logs, trace key variables, and place meaningful breakpoints
  3. Step 3: Propose fixes, implement them, verify with tests, and document prevention

Best Practices

  • Clearly define expected vs actual behavior before starting
  • Add targeted logging around the suspected area and capture key states
  • Identify and monitor key variables and states with controlled breakpoints
  • Document the chosen fix, the reasoning, and any alternatives considered
  • Validate with targeted tests, edge cases, and regression checks

Example Use Cases

  • Null reference error after a backend API change and input validation missing
  • Timeouts caused by an expensive DB query or slow external service
  • Off-by-one error in array processing leading to incorrect results
  • Intermittent failures due to a race condition in async code
  • Memory growth from missing cleanup in exception paths

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers