본문으로 건너뛰기
Skillpedia
테스트48k · #4354

debugging-code

하는 일

프로그래밍 코드의 오류를 찾도록 돕습니다. 프로그램을 멈추고, 변수 값을 보고, 한 줄씩 실행하며 무슨 일이 일어나는지 이해할 수 있습니다.

사용하는 경우

  • ✓프로그램이 충돌하거나 오류를 던질 때.
  • ✓프로그램의 출력이 잘못되었을 때.
  • ✓코드가 특정 지점에 어떻게 도달했는지 이해해야 할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/debugging-code/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/debugging-code/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 Python 코드를 디버그하도록 도와주세요: `my_script.py`”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 특정 지점에서 코드 실행을 멈춥니다. 그러면 변수 값 같은 현재 상태를 살펴보고, 실행을 한 단계씩 제어할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Interactive Debugger

When to Use

Use this skill when you need interactively debug source code — set breakpoints, step through execution line by line, inspect live variable state, evaluate expressions against the running program, and navigate the call stack to trace root causes. Use when a program crashes, raises unexpected exceptions, produces...

Use when a program crashes, produces wrong output, or you need to understand exactly how execution reached a particular state — and running it again with more print statements won't give you the answer fast enough.

You can pause a running program at any point, read live variable values and the call stack at that exact moment, step forward line by line or jump to the next breakpoint, and evaluate arbitrary expressions against the live process — all without restarting.

Setup

This skill uses dap, a CLI tool that background daemon to interact with the debugger via the DAP Protocol, maintain the debugger state, so you can simply interact with it with multiple calls.

If dap isn't installed (check: command -v dap), install it NOW. Ask/notify the user before proceeding to install it.

From Homebrew (macOS)

brew install AlmogBaku/tap/dap

Installer script:

bash scripts/install-dap.sh

Install from sources:

go install github.com/AlmogBaku/debug-skill/cmd/dap@latest

This tool is open-sourced and available on GitHub, maintained and follows best practices.

Supports natively Python, Go, Node.js/TypeScript, Rust, C/C++, and any other language that supports DAP.

If a debugger backend is missing or fails to start, see references/installing-debuggers.md

For all commands and flags: dap --help or dap <cmd> --help.

Starting a Session

dap debug <file> launches the program under the debugger. Backend is auto-detected from the file extension.

Choose your starting strategy based on what you know:

  • Have a hypothesis — set a breakpoint where you expect the bug: dap debug script.py --break script.py:42
  • Conditional breakpoint — only stop when a condition is met: dap debug script.py --break "script.py:42:x > 5" ( always quote specs with conditions)
  • Multi-file app — breakpoints across modules: --break src/api/routes.py:55 --break src/models/user.py:30
  • No hypothesis, small program — walk from entry: dap debug script.py --stop-on-entry (avoid for large projects — startup code is noisy; bisect with breakpoints instead)
  • Exception, location unknown — dap debug script.py --break-on-exception raised (Python) / all (Go/JS)
  • Remote process — dap debug --attach host:port --backend <name>
  • Process already running (stuck server, live issue) — attach without restarting: dap debug --pid <PID> --backend <name>

    macOS + Go gotcha: dlv --pid requires SIP disabled (csrutil disable). Prefer starting the program under the debugger instead or attaching to a remote debugger!

Session isolation: --session <name> keeps concurrent agents from interfering. Tip: You might want to use your session id(${CLAUDE_SESSION_ID}) if available.

Run dap debug --help for all flags, backends, and examples.

The Debugging Mindset

Reach for a debugger when reading source alone can't validate the root cause. A debugger lets you observe what does happen: actual values, actual path, actual state. When that diverges from what should happen, you've found your bug.

Two strikes, rethink. If two hypotheses fail at the same location, your mental model is wrong. Re-read the code, form a completely different theory with different breakpoints.

Escalate gradually. Start with dap eval to test a quick hypothesis. Use conditional breakpoints to filter noise. Fall back to full breakpoints + stepping only when you need interactive control.

Mimic the user journey. If you're debugging a user flow, set breakpoints along the path you expect the code to take. If you expected compute() to be called, but it never is, then the bug is in the caller — not compute(), but whatever was supposed to call it.

Set breakpoints instead of prints. When you feel the urge to print something, set a breakpoint instead.

Know Your State

Every dap execution command returns full context automatically: current location, source, locals, call stack, and output. At each stop, ask:

  • Do the local variables have the values I expected?

…

자주 묻는 질문

이 도구는 어떻게 설치하나요?

macOS에서는 Homebrew(`brew install AlmogBaku/tap/dap`), 설치 스크립트(`bash scripts/install-dap.sh`), 또는 소스 컴파일(`go install github.com/AlmogBaku/debug-skill/cmd/dap@latest`)로 설치할 수 있습니다.

어떤 프로그래밍 언어를 지원하나요?

Python, Go, Node.js/TypeScript, Rust, C/C++ 및 DAP 프로토콜을 사용하는 다른 언어를 지원합니다.

'중단점'이란 무엇인가요?

코드에서 실행을 잠시 멈추도록 설정한 지점입니다. 이 지점에서 프로그램의 상태를 살펴볼 수 있습니다.

상세 정보

작성자의 원본 설명

Interactively debug source code — set breakpoints, step through execution line by line, inspect live variable state, evaluate expressions against the running program, and navigate the call stack to trace root causes.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4354
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬