Debug Pro

Provides a 7-step debugging protocol plus language-specific commands to systematically identify, verify, and fix software bugs across multiple environments.

cmanfre7

@cmanfre7

What This Skill Does

Provides a 7-step debugging protocol and language-specific commands for systematically identifying, verifying, and fixing software bugs across multiple environments. Covers JavaScript, Python, Swift, CSS, network issues, and Git bisect.

Replaces ad-hoc debugging workflows by offering a structured, repeatable methodology and ready-to-use diagnostic commands for common error patterns.

When to Use It

  • Reproduce a bug consistently before attempting to fix it
  • Isolate the root cause using binary search or git bisect
  • Add targeted logging or breakpoints to verify a hypothesis
  • Debug a Node.js application with the built-in inspector
  • Investigate a network issue using curl, dig, or lsof
  • Apply the 7-step protocol to a recurring or hard-to-find bug

Install

$ openclaw skills install @cmanfre7/debug-pro

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

# 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

# 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

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

# Xcode: Product → Profile (Instruments)

CSS / Layout

/* Outline all elements */
* { outline: 1px solid red !important; }

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

Network

# 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

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

ErrorLikely CauseFix
Cannot read property of undefinedMissing null check or wrong data shapeAdd optional chaining (?.) or validate data
ENOENTFile/directory doesn't existCheck path, create directory, use existsSync
CORS errorBackend missing CORS headersAdd CORS middleware with correct origins
Module not foundMissing dependency or wrong import pathnpm install, check tsconfig paths
Hydration mismatch (React)Server/client render different HTMLEnsure consistent rendering, use useEffect for client-only
Segmentation faultMemory corruption, null pointerCheck array bounds, pointer validity
Connection refusedService not running on expected portCheck if service is up, verify port/host
Permission deniedFile/network permission issueCheck chmod, firewall, sudo

Quick Diagnostic Commands

# 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

Related skills

EasyEDA API Skill

@yanranxiaoxi

EasyEDA Pro API skill for AI agents. Use when working with EasyEDA Pro EDA software, including PCB design, schematic editing, footprint/symbol management, an...

57.4k

Superpowers Dev Workflow

@wlshlad85

Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan → subagent executi...

1823k

Oracle

@steipete

Use the @steipete/oracle CLI to bundle a prompt plus the right files and get a second-model review (API or browser) for debugging, refactors, design checks, or cross-validation.

1719k

Smart Model Switching

@millibus

Auto-route tasks to the cheapest Claude model that works correctly. Three-tier progression: Haiku → Sonnet → Opus. Classify before responding. HAIKU (default): factual Q&A, greetings, reminders, status checks, lookups, simple file ops, heartbeats, casual chat, 1-2 sentence tasks. ESCALATE TO SONNET: code >10 lines, analysis, comparisons, planning, reports, multi-step reasoning, tables, long writing >3 paragraphs, summarization, research synthesis, most user conversations. ESCALATE TO OPUS: architecture decisions, complex debugging, multi-file refactoring, strategic planning, nuanced judgment, deep research, critical production decisions. Rule: If a human needs >30 seconds of focused thinking, escalate. If Sonnet struggles with complexity, go to Opus. Save 50-90% on API costs by starting cheap and escalating only when needed.

216.6k

Chrome

@ivangdavila

Chrome DevTools Protocol, extension Manifest V3, and debugging patterns that prevent common automation failures.

145.3k

Log Analyzer

@gitgoodordietrying

Parse, search, and analyze application logs across formats. Use when debugging from log files, setting up structured logging, analyzing error patterns, correlating events across services, parsing stack traces, or monitoring log output in real time.

56.6k