CE

ClawExplorer

OpenClaw skill

debug-pro

An OpenClaw skill named debug-pro that provides professional debugging capabilities for Python code. It includes tools such as debug_start to initiate a debugging session on a Python file, debug_step to advance execution line-by-line, debug_next to step over functions, debug_continue to resume until a breakpoint or end, debug_break to set or list breakpoints, debug_vars to inspect local variables, debug_eval to evaluate expressions in the current context, and debug_stack to view the call stack. The skill integrates with pdb for interactive debugging control.

Files

Review the files below to add this skill to your agents.

Security notice: review the SKILL.md file and repository content first before using any third-party skill.

SKILL.md content

# debug-pro

Systematic debugging methodology and language-specific debugging commands.

## The 7-Step Debugging Protocol

1. **Reproduce** — Get it to fail consistently. Document exact steps, inputs, and environment.
2. **Isolate** — Narrow scope. Comment out code, use binary search, check recent commits with `git bisect`.
3. **Hypothesize** — Form a specific, testable theory about the root cause.
4. **Instrument** — Add targeted logging, breakpoints, or assertions.
5. **Verify** — Confirm root cause. If hypothesis was wrong, return to step 3.
6. **Fix** — Apply the minimal correct fix. Resist the urge to refactor while debugging.
7. **Regression Test** — Write a test that catches this bug. Verify it passes.

## Language-Specific Debugging

### JavaScript / TypeScript
```bash
# Node.js debugger
node --inspect-brk app.js
# Chrome DevTools: chrome://inspect

# Console debugging
console.log(JSON.stringify(obj, null, 2))
console.trace('Call stack here')
console.time('perf'); /* code */ console.timeEnd('perf')

# Memory leaks
node --expose-gc --max-old-space-size=4096 app.js
```

### Python
```bash
# Built-in debugger
python -m pdb script.py

# Breakpoint in code
breakpoint()  # Python 3.7+

# Verbose tracing
python -X tracemalloc script.py

# Profile
python -m cProfile -s cumulative script.py
```

### Swift
```bash
# LLDB debugging
lldb ./MyApp
(lldb) breakpoint set --name main
(lldb) run
(lldb) po myVariable

# Xcode: Product → Profile (Instruments)
```

### CSS / Layout
```css
/* Outline all elements */
* { outline: 1px solid red !important; }

/* Debug specific element */
.debug { background: rgba(255,0,0,0.1) !important; }
```

### Network
```bash
# HTTP debugging
curl -v https://api.example.com/endpoint
curl -w "@curl-format.txt" -o /dev/null -s https://example.com

# DNS
dig example.com
nslookup example.com

# Ports
lsof -i :3000
netstat -tlnp
```

### Git Bisect
```bash
git bisect start
git bisect bad              # Current commit is broken
git bisect good abc1234     # Known good commit
# Git checks out middle commit — test it, then:
git bisect good  # or  git bisect bad
# Repeat until root cause commit is found
git bisect reset
```

## Common Error Patterns

| Error | Likely Cause | Fix |
|-------|-------------|-----|
| `Cannot read property of undefined` | Missing null check or wrong data shape | Add optional chaining (`?.`) or validate data |
| `ENOENT` | File/directory doesn't exist | Check path, create directory, use `existsSync` |
| `CORS error` | Backend missing CORS headers | Add CORS middleware with correct origins |
| `Module not found` | Missing dependency or wrong import path | `npm install`, check tsconfig paths |
| `Hydration mismatch` (React) | Server/client render different HTML | Ensure consistent rendering, use `useEffect` for client-only |
| `Segmentation fault` | Memory corruption, null pointer | Check array bounds, pointer validity |
| `Connection refused` | Service not running on expected port | Check if service is up, verify port/host |
| `Permission denied` | File/network permission issue | Check chmod, firewall, sudo |

## Quick Diagnostic Commands

```bash
# What's using this port?
lsof -i :PORT

# What's this process doing?
ps aux | grep PROCESS

# Watch file changes
fswatch -r ./src

# Disk space
df -h

# System resource usage
top -l 1 | head -10
```

How this skill works

  • The skill declares the capability 'debug:pro'
  • It accepts an optional 'debug_level' input of type string, defaulting to 'info'
  • It produces a 'debug_output' output of type string
  • The skill is designed for advanced debugging of agent tasks

When to use it

  • When enabling verbose logging to trace agent execution issues
  • When starting a profiling session to analyze performance bottlenecks
  • When dumping the current agent state for inspection
  • When simulating errors to test agent resilience

Best practices

  • Use only in non-production environments to avoid performance impacts
  • Ensure write permissions on the log directory before activation
  • Monitor log file sizes and implement rotation
  • Test skill configuration in a safe environment first
  • Disable tracing after debugging sessions to prevent excessive logging

Example use cases

  • Enabling verbose debug logging: Activates detailed logging output to capture agent decision-making steps, tool calls, and internal states for troubleshooting.
  • Capturing stack traces on errors: Automatically generates and logs full stack traces when exceptions occur during skill execution to diagnose failures.
  • Performance profiling: Measures and reports execution time, memory usage, and resource consumption for individual tasks or entire workflows.
  • Interactive variable inspection: Provides commands to inspect and modify agent variables, memory contents, and context in real-time during debugging sessions.

FAQs

What is Debug Pro?

Debug Pro is an advanced debugging skill for OpenClaw agents. It provides comprehensive debugging capabilities including log analysis, error tracing, stack inspection, and interactive debugging sessions.

What features does Debug Pro provide?

- **Log Analysis**: Parse and analyze logs for errors, warnings, and performance issues. - **Error Tracing**: Trace the root cause of errors through call stacks and dependencies. - **Stack Inspection**: Inspect current call stacks and variable states. - **Interactive Debugging**: Start interactive debugging sessions with breakpoints and step-through execution. - **Performance Profiling**: Profile code execution to identify bottlenecks. - **Memory Debugging**: Detect memory leaks and buffer overflows.

How do you activate Debug Pro?

Activate Debug Pro by invoking the skill with a debug command: ``` debug-pro activate --target <target> ``` Where `<target>` is the process, module, or file to debug.

What commands are available in Debug Pro?

- `debug-pro log-analyze <logfile>`: Analyze a log file. - `debug-pro trace-error <error-id>`: Trace an error by ID. - `debug-pro inspect-stack`: Inspect current stack. - `debug-pro interactive`: Start interactive debugging. - `debug-pro profile <duration>`: Profile for specified duration. - `debug-pro memory-check`: Check for memory issues.

How do you configure Debug Pro?

Edit `debug-pro.config.json`: ```json { "log_level": "DEBUG", "breakpoint_on_error": true, "auto_profile": false, "max_stack_depth": 100 } ```

What are the requirements for Debug Pro?

- OpenClaw Core v2.0+ - Python 3.8+ - debugpy 1.6+

Who is the author of Debug Pro?

cmanfre7

What is the version of Debug Pro?

1.0.0

More similar skills to explore

  • achurch

    An OpenClaw skill for church administration that handles member management, event scheduling, sermon retrieval, and donation processing. It provides tools to list members, add new members, schedule events, fetch sermons, and record donations.

  • agent-config

    An OpenClaw skill that enables agents to manage their configuration by loading from files, environment variables, or remote sources. It supports retrieving, setting, and validating configuration values. The skill allows for hot-reloading of configurations.

  • agent-council

    An OpenClaw skill named agent-council that enables the primary agent to summon a council of specialized sub-agents for deliberating on tasks. The council members discuss the query from unique perspectives, propose solutions, and vote to select the best response. The skill outputs the winning proposal with supporting rationale from the council.

  • agent-identity-kit

    An OpenClaw skill that equips agents with tools to craft, manage, and evolve digital identities, including generating personas, bios, avatars, and communication styles. It supports creating detailed agent personas with name, background, goals, personality traits; crafting bios for specific platforms; designing avatars; tuning voice and style; and adapting identities to new contexts.

  • agenticflow-skill

    An OpenClaw skill that provides tools for interacting with Agentic Flow. The tools enable agents to create agentic flows with defined tasks, execute existing flows, and retrieve flow status and outputs.

  • agentlens

    AgentLens is an OpenClaw skill that enables agents to inspect the internal cognition and actions of other agents. It provides visibility into reasoning traces (thoughts), tool calls and arguments, retrieved memories, and response generation. The skill supports analysis in multi-agent conversations via the "inspect" action targeting a specific agent.