Debugging Techniques logo

Debugging Techniques

Community
ancoleman
debugging-techniques

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.

Overview

Publisherancoleman
Repositoryai-design-components
Skill namedebugging-techniques
Stars
523
Forks
73
Bundled files
9
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ancoleman on GitHub. Read the source before you install it.

Installation

Install the Debugging Techniques AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ancoleman/ai-design-components.git /tmp/ai-design-components
mkdir -p .claude/skills
cp -r /tmp/ai-design-components/skills/debugging-techniques .claude/skills/debugging-techniques
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debugging Techniques in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debugging Techniques on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debugging Techniques is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Debugging Techniques

Purpose

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.

When to Use This Skill

Trigger this skill for:

  • Setting breakpoints in Python, Go, Rust, or Node.js code
  • Debugging running containers or Kubernetes pods
  • Setting up remote debugging connections
  • Safely debugging production issues
  • Inspecting goroutines, threads, or async tasks
  • Analyzing core dumps or stack traces
  • Choosing the right debugging tool for a scenario

Quick Reference by Language

Python Debugging

Built-in: pdb

python
# 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 line
  • next (n) - Execute current line, step over functions
  • step (s) - Execute current line, step into functions
  • continue (c) - Continue until next breakpoint
  • print var (p) - Print variable value
  • where (w) - Show stack trace
  • quit (q) - Exit debugger

Enhanced 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:

bash
pytest --pdb  # Drop into debugger on test failure

For detailed Python debugging patterns, see references/python-debugging.md.

Go Debugging

Delve - Official Go debugger

Installation:

bash
go install github.com/go-delve/delve/cmd/dlv@latest

Basic usage:

bash
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 function
  • break file.go:10 (b) - Set breakpoint at line
  • continue (c) - Continue execution
  • next (n) - Step over
  • step (s) - Step into
  • print x (p) - Print variable
  • goroutine (gr) - Show current goroutine
  • goroutines (grs) - List all goroutines
  • goroutines -t - Show goroutine stacktraces
  • stack (bt) - Show stack trace

Goroutine debugging:

bash
(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.

Rust Debugging

LLDB - Default Rust debugger

Compilation:

bash
cargo build  # Debug build includes symbols by default

Usage:

bash
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 line
  • breakpoint set -n main - Set breakpoint at function
  • run (r) - Start program
  • continue (c) - Continue execution
  • next (n) - Step over
  • step (s) - Step into
  • print variable (p) - Print variable
  • frame variable (fr v) - Show local variables
  • backtrace (bt) - Show stack trace
  • thread list - List all threads

VS Code integration:

  • Install CodeLLDB extension (vadimcn.vscode-lldb)
  • Configure launch.json for Rust projects

For detailed Rust debugging patterns, see references/rust-debugging.md.

Node.js Debugging

Built-in: node --inspect

Basic usage:

bash
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:

  1. Open chrome://inspect
  2. Click "Open dedicated DevTools for Node"
  3. Set breakpoints, inspect variables

VS Code integration: Configure launch.json:

json
{
  "type": "node",
  "request": "launch",
  "name": "Launch Program",
  "program": "${workspaceFolder}/app.js"
}

Docker debugging:

dockerfile
EXPOSE 9229
CMD ["node", "--inspect=0.0.0.0:9229", "app.js"]

For detailed Node.js debugging patterns, see references/nodejs-debugging.md.

Container & Kubernetes Debugging

kubectl debug with Ephemeral Containers

When to use:

  • Container has crashed (kubectl exec won't work)
  • Using distroless/minimal image (no shell, no tools)
  • Need debugging tools without rebuilding image
  • Debugging network issues

Basic usage:

bash
# 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 utilities
  • alpine (~5MB) - Lightweight with package manager
  • ubuntu (~70MB) - Full environment

Node debugging:

bash
kubectl debug node/<node-name> -it --image=ubuntu

Docker container debugging:

bash
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.

Production Debugging

Production Debugging Principles

Golden rules:

  1. Minimal performance impact - Profile overhead, limit scope
  2. No blocking operations - Use non-breaking techniques
  3. Security-aware - Avoid logging secrets, PII
  4. Reversible - Can roll back quickly (feature flags, Git)
  5. Observable - Structured logging, correlation IDs, tracing

Safe Production Techniques

1. Structured Logging

python
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)

go
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)

python
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

  • Sentry - Exception tracking with context
  • New Relic - APM with error tracking
  • Datadog - Logs, metrics, traces
  • Rollbar - Error monitoring

Production debugging workflow:

  1. Detect - Error tracking alert, log spike, metric anomaly
  2. Locate - Find correlation ID, search logs, view distributed trace
  3. Reproduce - Try to reproduce in staging with production data (sanitized)
  4. Fix - Create feature flag, deploy to canary first
  5. Verify - Check error rates, review logs, monitor traces

For detailed production debugging patterns, see references/production-debugging.md.

Decision Framework

Which Debugger for Which Language?

LanguagePrimary ToolInstallationBest For
PythonpdbBuilt-inSimple scripts, server environments
ipdbpip install ipdbEnhanced UX, IPython users
debugpyVS Code extensionIDE integration, remote debugging
Godelvego install github.com/go-delve/delve/cmd/dlv@latestAll Go debugging, goroutines
Rustrust-lldbSystem packageMac, Linux, MSVC Windows
rust-gdbSystem packageLinux, prefer GDB
Node.jsnode --inspectBuilt-inAll Node.js debugging, Chrome DevTools

Which Technique for Which Scenario?

ScenarioRecommended TechniqueTools
Local developmentInteractive debuggerpdb, delve, lldb, node --inspect
Bug in testTest-specific debuggingpytest --pdb, dlv test, cargo test
Remote serverSSH tunnel + remote attachVS Code Remote, debugpy
Container (local)docker exec -itsh/bash + debugger
Kubernetes podEphemeral containerkubectl debug --image=nicolaka/netshoot
Distroless imageEphemeral container (required)kubectl debug with busybox/alpine
Production issueLog analysis + error trackingStructured logs, Sentry, correlation IDs
Goroutine deadlockGoroutine inspectiondelve goroutines -t
Crashed processCore dump analysisgdb core, lldb -c core
Distributed failureDistributed tracingOpenTelemetry, Jaeger, correlation IDs
Race conditionRace detector + debuggergo run -race, cargo test

Production Debugging Safety Checklist

Before debugging in production:

  • Will this impact performance? (Profile overhead)
  • Will this block users? (Use non-breaking techniques)
  • Could this expose secrets? (Avoid variable dumps)
  • Is there a rollback plan? (Git branch, feature flag)
  • Have we tried logs first? (Less invasive)
  • Do we have correlation IDs? (Trace requests)
  • Is error tracking enabled? (Sentry, New Relic)
  • Can we reproduce in staging? (Safer environment)

Common Debugging Workflows

Workflow 1: Local Development Bug

  1. Insert breakpoint in code (language-specific)
  2. Start debugger (dlv debug, rust-lldb, node --inspect-brk)
  3. Execute to breakpoint (run, continue)
  4. Inspect variables (print, frame variable)
  5. Step through code (next, step, finish)
  6. Identify issue and fix

Workflow 2: Test Failure Debugging

Python:

bash
pytest --pdb  # Drops into pdb on failure

Go:

bash
dlv test github.com/user/project/pkg
(dlv) break TestMyFunction
(dlv) continue

Rust:

bash
cargo test --no-run
rust-lldb target/debug/deps/myapp-<hash>
(lldb) breakpoint set -n test_name
(lldb) run test_name

Workflow 3: Kubernetes Pod Debugging

Scenario: Pod with distroless image, network issue

bash
# 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

Workflow 4: Production Error Investigation

Scenario: API returning 500 errors

bash
# 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

Additional Resources

For language-specific deep dives:

  • references/python-debugging.md - pdb, ipdb, pudb, debugpy detailed guide
  • references/go-debugging.md - Delve CLI, goroutine debugging, conditional breakpoints
  • references/rust-debugging.md - LLDB vs GDB, ownership debugging, macro debugging
  • references/nodejs-debugging.md - node --inspect, Chrome DevTools, Docker debugging

For environment-specific patterns:

  • references/container-debugging.md - kubectl debug, ephemeral containers, node debugging
  • references/production-debugging.md - Structured logging, correlation IDs, OpenTelemetry, error tracking

For decision support:

  • references/decision-trees.md - Expanded debugging decision frameworks

For hands-on examples:

  • examples/ - Step-by-step debugging sessions for each language

Related Skills

For 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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Debugging Techniques AI skill do?

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.

Why use Debugging Techniques on TypingMind?

Because you install it once and use it with any model. Debugging Techniques is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debugging Techniques in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ancoleman/ai-design-components/tree/main/skills/debugging-techniques. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Debugging Techniques?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debugging Techniques?

As many as you like. As long as a model supports skills, you can use Debugging Techniques with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debugging Techniques AI skill free?

Yes. It is published on GitHub by ancoleman under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇