Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计异常

debugging-techniques调试技术

Agent Skill

debugging-techniques 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

720

周安装

30

GitHub Stars

350

下载量

240
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:debugging-techniques(调试技术)
来源仓库:https://github.com/ancoleman/ai-design-components
仓库路径:skills/debugging-techniques
安装命令:
npx skills add https://github.com/ancoleman/ai-design-components --skill debugging-techniques
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill debugging-techniques

简介

该技能提供跨语言(Python/Go/Rust/Node.js)的远程调试工作流。

  • 适用于容器化部署或生产环境问题的安全诊断场景。
  • 通过 GitHub 仓库安装,需配置对应语言的调试器连接参数。
  • 建议使用关联 ID 追踪分布式调用链,避免在生产环境直接设断点。
  • debugging-techniques 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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

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:

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

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

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

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:

{
  "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.

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:

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

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.

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

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

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

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

Workflow 3: Kubernetes Pod Debugging

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

Workflow 4: Production Error Investigation

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

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.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.68%
按下载量换算83

Claude

28.14%
按下载量换算68

Cursor

18.47%
按下载量换算44

Gemini CLI

10.55%
按下载量换算25

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/ancoleman/ai-design-components --skill debugging-techniques 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills