Debugging workflows for Python (pdb, debugpy), Go (delve), Rust (lldb), and Node.js, including container debugging (kubectl debug, ephemeral containers) and production-safe debugging techniques with distributed tracing and correlation IDs. Use when setting breakpoints, debugging containers/pods, remote debugging, or production debugging.
npx skills add https://github.com/ancoleman/ai-design-components --skill debugging-techniques
Provides systematic debugging workflows for local, remote, container, and production environments across Python, Go, Rust, and Node.js. Covers interactive debuggers, container debugging with ephemeral containers, and production-safe techniques using correlation IDs and distributed tracing.
Trigger this skill for:
Built-in: pdb
# Python 3.7+
def buggy_function(x, y):
breakpoint() # Stops execution here
return x / y
# Older Python
import pdb
pdb.set_trace()
Essential pdb commands:
list (l) - Show code around current linenext (n) - Execute current line, step over functionsstep (s) - Execute current line, step into functionscontinue (c) - Continue until next breakpointprint var (p) - Print variable valuewhere (w) - Show stack tracequit (q) - Exit debuggerEnhanced tools:
ipdb - Enhanced pdb with tab completion, syntax highlighting (pip install ipdb)pudb - Terminal GUI debugger (pip install pudb)debugpy - VS Code integration (included in Python extension)Debugging tests:
pytest --pdb # Drop into debugger on test failure
For detailed Python debugging patterns, see references/python-debugging.md.
Delve - Official Go debugger
Installation:
go install github.com/go-delve/delve/cmd/dlv@latest
Basic usage:
dlv debug main.go # Debug main package
dlv test github.com/me/pkg # Debug test suite
dlv attach <pid> # Attach to running process
dlv debug -- --config prod.yaml # Pass arguments
Essential commands:
break main.main (b) - Set breakpoint at functionbreak file.go:10 (b) - Set breakpoint at linecontinue (c) - Continue executionnext (n) - Step overstep (s) - Step intoprint x (p) - Print variablegoroutine (gr) - Show current goroutinegoroutines (grs) - List all goroutinesgoroutines -t - Show goroutine stacktracesstack (bt) - Show stack traceGoroutine debugging:
(dlv) goroutines # List all goroutines
(dlv) goroutines -t # Show stacktraces
(dlv) goroutines -with user # Filter user goroutines
(dlv) goroutine 5 # Switch to goroutine 5
For detailed Go debugging patterns, see references/go-debugging.md.
LLDB - Default Rust debugger
Compilation:
cargo build # Debug build includes symbols by default
Usage:
rust-lldb target/debug/myapp # LLDB wrapper for Rust
rust-gdb target/debug/myapp # GDB wrapper (alternative)
Essential LLDB commands:
breakpoint set -f main.rs -l 10 - Set breakpoint at linebreakpoint set -n main - Set breakpoint at functionrun (r) - Start programcontinue (c) - Continue executionnext (n) - Step overstep (s) - Step intoprint variable (p) - Print variableframe variable (fr v) - Show local variablesbacktrace (bt) - Show stack tracethread list - List all threadsVS Code integration:
vadimcn.vscode-lldb)launch.json for Rust projectsFor detailed Rust debugging patterns, see references/rust-debugging.md.
Built-in: node --inspect
Basic usage:
node --inspect-brk app.js # Start and pause immediately
node --inspect app.js # Start and run
node --inspect=0.0.0.0:9229 app.js # Specify host/port
Chrome DevTools:
chrome://inspectVS Code integration:
Configure launch.json:
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/app.js"
}
Docker debugging:
EXPOSE 9229
CMD ["node", "--inspect=0.0.0.0:9229", "app.js"]
For detailed Node.js debugging patterns, see references/nodejs-debugging.md.
When to use:
Basic usage:
# Add ephemeral debugging container
kubectl debug -it <pod-name> --image=nicolaka/netshoot
# Share process namespace (see other container processes)
kubectl debug -it <pod-name> --image=busybox --share-processes
# Target specific container
kubectl debug -it <pod-name> --image=busybox --target=app
Recommended debugging images:
nicolaka/netshoot (~380MB) - Network debugging (curl, dig, tcpdump, netstat)busybox (~1MB) - Minimal shell and utilitiesalpine (~5MB) - Lightweight with package managerubuntu (~70MB) - Full environmentNode debugging:
kubectl debug node/<node-name> -it --image=ubuntu
Docker container debugging:
docker exec -it <container-id> sh
# If no shell available
docker run -it --pid=container:<container-id> \
--net=container:<container-id> \
busybox sh
For detailed container debugging patterns, see references/container-debugging.md.
Golden rules:
1. Structured Logging
import logging
import json
logger = logging.getLogger(__name__)
logger.info(json.dumps({
"event": "user_login_failed",
"user_id": user_id,
"error": str(e),
"correlation_id": request_id
}))
2. Correlation IDs (Request Tracing)
func handleRequest(w http.ResponseWriter, r *http.Request) {
correlationID := r.Header.Get("X-Correlation-ID")
if correlationID == "" {
correlationID = generateUUID()
}
ctx := context.WithValue(r.Context(), "correlationID", correlationID)
log.Printf("[%s] Processing request", correlationID)
}
3. Distributed Tracing (OpenTelemetry)
from opentelemetry import trace
tracer = trace.get_tracer(__name__)
def process_order(order_id):
with tracer.start_as_current_span("process_order") as span:
span.set_attribute("order.id", order_id)
span.add_event("Order validated")
4. Error Tracking Platforms
Production debugging workflow:
For detailed production debugging patterns, see references/production-debugging.md.
| Language | Primary Tool | Installation | Best For |
|----------|-------------|--------------|----------|
| Python | pdb | Built-in | Simple scripts, server environments |
| | ipdb | pip install ipdb | Enhanced UX, IPython users |
| | debugpy | VS Code extension | IDE integration, remote debugging |
| Go | delve | go install github.com/go-delve/delve/cmd/dlv@latest | All Go debugging, goroutines |
| Rust | rust-lldb | System package | Mac, Linux, MSVC Windows |
| | rust-gdb | System package | Linux, prefer GDB |
| Node.js | node --inspect | Built-in | All Node.js debugging, Chrome DevTools |
| Scenario | Recommended Technique | Tools |
|----------|----------------------|-------|
| Local development | Interactive debugger | pdb, delve, lldb, node --inspect |
| Bug in test | Test-specific debugging | pytest --pdb, dlv test, cargo test |
| Remote server | SSH tunnel + remote attach | VS Code Remote, debugpy |
| Container (local) | docker exec -it | sh/bash + debugger |
| Kubernetes pod | Ephemeral container | kubectl debug --image=nicolaka/netshoot |
| Distroless image | Ephemeral container (required) | kubectl debug with busybox/alpine |
| Production issue | Log analysis + error tracking | Structured logs, Sentry, correlation IDs |
| Goroutine deadlock | Goroutine inspection | delve goroutines -t |
| Crashed process | Core dump analysis | gdb core, lldb -c core |
| Distributed failure | Distributed tracing | OpenTelemetry, Jaeger, correlation IDs |
| Race condition | Race detector + debugger | go run -race, cargo test |
Before debugging in production:
Python:
pytest --pdb # Drops into pdb on failure
Go:
dlv test github.com/user/project/pkg
(dlv) break TestMyFunction
(dlv) continue
Rust:
cargo test --no-run
rust-lldb target/debug/deps/myapp-<hash>
(lldb) breakpoint set -n test_name
(lldb) run test_name
Scenario: Pod with distroless image, network issue
# Step 1: Check pod status
kubectl get pod my-app-pod -o wide
# Step 2: Check logs first
kubectl logs my-app-pod
# Step 3: Add ephemeral container if logs insufficient
kubectl debug -it my-app-pod --image=nicolaka/netshoot
# Step 4: Inside debug container, investigate
curl localhost:8080
netstat -tuln
nslookup api.example.com
Scenario: API returning 500 errors
# Step 1: Check error tracking (Sentry)
# - Find error details, stack trace
# - Copy correlation ID from error report
# Step 2: Search logs for correlation ID
# In log aggregation tool (ELK, Splunk):
# correlation_id:"abc-123-def"
# Step 3: View distributed trace
# In tracing tool (Jaeger, Datadog):
# Search by correlation ID, review span timeline
# Step 4: Reproduce in staging
# Use production data (sanitized) if needed
# Add additional logging if needed
# Step 5: Fix and deploy
# Create feature flag for gradual rollout
# Deploy to canary environment first
# Monitor error rates closely
For language-specific deep dives:
references/python-debugging.md - pdb, ipdb, pudb, debugpy detailed guidereferences/go-debugging.md - Delve CLI, goroutine debugging, conditional breakpointsreferences/rust-debugging.md - LLDB vs GDB, ownership debugging, macro debuggingreferences/nodejs-debugging.md - node --inspect, Chrome DevTools, Docker debuggingFor environment-specific patterns:
references/container-debugging.md - kubectl debug, ephemeral containers, node debuggingreferences/production-debugging.md - Structured logging, correlation IDs, OpenTelemetry, error trackingFor decision support:
references/decision-trees.md - Expanded debugging decision frameworksFor hands-on examples:
examples/ - Step-by-step debugging sessions for each languageFor authentication patterns, see the auth-security skill.
For performance profiling (complementary to debugging), see the performance-engineering skill.
For Kubernetes operations (kubectl debug is part of), see the kubernetes-operations skill.
For test debugging strategies, see the testing-strategies skill.
For observability setup (logging, tracing), see the observability skill.
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take ancoleman/debugging-techniques from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip, go, docker.
Without those the skill loads but fails at the first command.