python-debugpy
하는 일
AI 에이전트가 pdb와 debugpy 같은 Python 디버깅 도구로 코드를 멈추고 상태를 살펴보도록 안내합니다. Python 코드나 서비스에서 헷갈리는 버그를 찾아야 하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Python 스크립트가 이상하게 동작해서 특정 지점의 값을 보아야 할 때.
- ✓Python 테스트가 실패해서 한 단계씩 살펴보고 싶을 때.
- ✓오래 실행되는 Python 서비스를 원격으로 디버거에 연결해야 할 때.
스킬 링크
https://github.com/openclaw/openclaw/blob/main/skills/python-debugpy/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 Python 스크립트가 잘못된 숫자를 냅니다. 알맞은 지점에서 멈추고 변수 값을 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 문제에 닿을 수 있는 가장 작은 디버거를 고릅니다. 예를 들어 pdb 세션이나 코드 안의 중단점을 씁니다. 그다음 프로그램을 한 단계씩 진행하며 값을 살펴보고 수정 방법을 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Python Debugpy
Use when Python code needs interactive debugging: hidden locals, confusing state mutation, failing tests, subprocesses, long-running services, or remote/headless attach.
Pick the smallest debugger that reaches the bad frame.
Choose
breakpoint(): local code, source edits ok, fastest path.python3 -m pdb: no source edit, launch from the beginning.python3 -m pdb -c continue: stop at an unhandled exception.debugpy: remote/headless process, DAP client, already-running PID, or service startup race.
Commands
python3 -m pdb path/to/script.py arg1
python3 -m pdb -c continue path/to/script.py
python3 -c "import debugpy" || python3 -m pip install debugpy
python3 -m debugpy --listen 127.0.0.1:5678 --wait-for-client path/to/script.py
python3 -m debugpy --listen 127.0.0.1:5678 --wait-for-client -m package.module
python3 -m debugpy --listen 127.0.0.1:5678 --pid <pid>
For source-edit attach:
import debugpy
debugpy.listen(("127.0.0.1", 5678))
debugpy.wait_for_client()
debugpy.breakpoint()
For post-mortem:
import pdb, sys
try:
run()
except Exception:
pdb.post_mortem(sys.exc_info()[2])
raise
pdb
- Flow:
n,s,r,c,q. - Stack/source:
w,u,d,a,l,ll. - Values:
p expr,pp expr,display expr. - Breakpoints:
b file.py:42,b func,b file.py:42, condition,cl <num>. - Mutate/evaluate:
!statement; full REPL:interact.
Rules
- Reproduce with the smallest command/test first.
- Disable parallel test workers for pdb; interactive stdin usually breaks inside worker pools.
- Keep
debugpyin the active env; do not add it as a project dependency unless the project already wants it. - Bind debug servers to
127.0.0.1; do not expose0.0.0.0unless isolated or tunnelled. - Use unique ports for parallel sessions.
debugpy --pidinjects into a running process; confirm the target pid before attaching.- If PID attach fails on Linux, check ptrace/container privileges before changing the target.
- Cleanup before commit:
rg -n 'breakpoint\\(|pdb\\.set_trace|debugpy\\.' --type py. - Rerun the normal project test/gate without the debugger.
PYTHONBREAKPOINT=0disablesbreakpoint().- If a process is stuck after debugger detach, confirm it is not still paused at a breakpoint.
자주 묻는 질문
코드를 바꿔야 하나요?
꼭 그렇지는 않습니다. pdb 세션은 소스를 고치지 않고 시작할 수 있지만, 코드 안의 중단점이 더 빠릅니다.
실행 중인 서비스를 디버그할 수 있나요?
예. debugpy는 실행 중인 프로세스나 시작 중인 서비스에 연결할 수 있습니다.
디버그 포트를 여는 것이 안전한가요?
스킬은 디버그 포트에 로컬 주소 127.0.0.1을 사용하므로, 자신의 컴퓨터에서만 접근할 수 있습니다.
상세 정보
작성자의 원본 설명
Debug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
repo: openclaw/openclaw
인기도
- GitHub 스타
- 394k
- 순위
- #76
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
discord-user-post
394k에이전트가 승인한 메시지를 정확한 채널을 확인한 뒤 Discord 데스크톱 앱에서 내 계정으로 올리도록 돕습니다.
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
graincrawl
394k에이전트가 저장된 Granola 회의 메모와 기록을 검색하고, 최신 상태를 확인하며, 일정 기간 동안 개수를 세도록 돕습니다.
비슷한 스킬
executing-plans
311k에이전트가 작성된 구현 계획을 현재 세션에서 단계별로 실행하고, 각 단계를 테스트한 뒤 다음으로 넘어가도록 돕습니다.
finishing-a-development-branch
311k에이전트가 완성된 코드의 테스트를 실행한 뒤, 병합, 풀 리퀘스트 열기, 브랜치 유지 중에서 고를 수 있도록 명확한 선택지를 제시하도록 돕습니다.
receiving-code-review
311k에이전트가 코드 리뷰 피드백을 신중하게 검토하도록 돕습니다. 무엇이든 바꾸기 전에 각 지적을 실제 코드와 대조합니다.