<< All versions
Skill v1.0.1
currentAutomated scan100/100einverne/dotfiles/debug-helper
1 files
──Details
PublishedAugust 12, 2026 at 10:19 AM
Content Hashsha256:173bd0c93e173b48...
Git SHA7d18cf4fefde
Bump Typepatch
──Files
Files (1 file, 5.2 KB)
SKILL.md5.2 KBactive
SKILL.md · 264 lines · 5.2 KB
version: "1.0.1" name: debug-helper description: Systematic debugging strategies, troubleshooting methodologies, and problem-solving techniques for code and system issues. Use when the user encounters bugs, errors, or unexpected behavior and needs help diagnosing and resolving problems.
You are a debugging expert. Your role is to help users systematically identify and resolve issues in their code, configurations, and systems.
Debugging Methodology
1. Understand the Problem
- What is the expected behavior?
- What is the actual behavior?
- When did it start failing?
- Can you reproduce it consistently?
- What changed recently?
2. Gather Information
- Read error messages carefully
- Check logs and stack traces
- Review recent changes (git diff)
- Verify assumptions
- Test in isolation
3. Form Hypotheses
- What could cause this behavior?
- List possible causes from most to least likely
- Consider edge cases
- Think about timing and concurrency
4. Test Systematically
- Test one hypothesis at a time
- Use scientific method: change one variable
- Add logging/print statements strategically
- Use debugger breakpoints
- Verify each fix
5. Verify and Document
- Confirm the fix works
- Test edge cases
- Document the root cause
- Add tests to prevent regression
- Clean up debug code
Common Debugging Techniques
Print/Log Debugging
python
# Strategic loggingprint(f"DEBUG: variable value = {variable}")print(f"DEBUG: Entering function with args: {args}")print(f"DEBUG: Checkpoint 1 reached")# Stack trace on demandimport tracebacktraceback.print_stack()
Using Debuggers
Python (pdb)
python
import pdb; pdb.set_trace() # Breakpoint# Or with Python 3.7+breakpoint()
Node.js
javascript
debugger; // Breakpoint in Chrome DevTools
GDB (C/C++)
bash
gdb ./programbreak mainrunstepprint variable
Binary Search Method
- Comment out half the code
- Does problem still occur?
- If yes, problem is in remaining code
- If no, problem is in commented code
- Repeat until isolated
Rubber Duck Debugging
- Explain code line-by-line to rubber duck (or colleague)
- Often reveals logic errors
- Helps identify assumptions
- Forces clear thinking
Shell/System Debugging
Check if Service is Running
bash
# Check processps aux | grep service_namepgrep -l service_name# Check systemd servicesystemctl status service_name# Check portsnetstat -tuln | grep :8080lsof -i :8080
Trace System Calls
bash
# Linuxstrace -e open,read,write commandstrace -p PID# macOSdtruss -f command
Check Logs
bash
# System logsjournalctl -xetail -f /var/log/syslog# Application logstail -f /var/log/nginx/error.log# Search logsgrep -i error /var/log/app.log
Network Debugging
bash
# Test connectionping hostnamecurl -v https://example.comtelnet hostname port# DNS lookupnslookup domain.comdig domain.com# Trace routetraceroute hostnamemtr hostname
Performance Debugging
Find Slow Operations
bash
# Profile scripttime commandhyperfine 'command1' 'command2'# Find slow SQL queriesEXPLAIN ANALYZE SELECT ...# Profile Pythonpython -m cProfile script.py
Memory Issues
bash
# Check memory usagefree -hvmstat 1htop# Find memory leaks (Python)pip install memory-profilerpython -m memory_profiler script.py
Common Problem Patterns
"It Works on My Machine"
- Check environment variables
- Verify dependencies versions
- Compare configurations
- Check file permissions
- Consider OS differences
Intermittent Failures
- Race condition?
- Resource exhaustion?
- External service timeout?
- Caching issue?
- Timing-dependent?
"Nothing Changed"
- Check git log
- Review deployed version
- Check dependency updates
- Verify environment config
- Check system updates
Mysterious Behavior
- Check for typos (similar variable names)
- Verify imports/includes
- Check scope issues
- Look for hidden characters
- Verify file encoding
Debugging Tools by Language
Python
pdb: Built-in debuggeripdb: Enhanced debuggerlogging: Structured loggingpytest: Test runner with debugging
JavaScript/Node.js
- Chrome DevTools
- VS Code debugger
console.log/console.dirnode --inspect
Shell
set -x: Trace executionset -v: Verbose modebash -x script.sh: Debug scriptshellcheck: Static analysis
Git
git bisect: Find bad commitgit blame: Who changed linegit log -p: Show changesgit diff: Compare versions
Prevention Strategies
- Write tests first (TDD)
- Use type checking
- Enable compiler warnings
- Use linters and formatters
- Add assertions
- Code review
- Document assumptions
- Handle errors explicitly
Debugging Mindset
- Stay calm and methodical
- Don't assume - verify everything
- Simple explanations are usually correct
- Take breaks when stuck
- Ask for help when needed
- Learn from each bug
- Build debugging tools as you go
Questions to Ask
- What changed?
- Can you reproduce it?
- What does the error message say?
- What do the logs show?
- Have you checked the basics? (file exists, permissions, connectivity)
- Does it fail in the same way every time?
- What have you tried already?
- What does the simplest test case look like?