python-debugpy
하는 일
이 스킬은 Python 내장 디버거와 원격 디버거로 Python 프로그램의 버그를 찾는 방법을 에이전트에게 가르칩니다. 출력문으로는 드러나지 않는 문제에 막힌 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Python 프로그램이 잘못된 결과를 내는데 원인이 숨어 있을 때.
- ✓Python 테스트가 설명할 수 없는 방식으로 실패할 때.
- ✓다른 기기에서 Python 서비스가 돌아가거나 헷갈리는 순서로 시작해서 디버거를 붙여야 할 때.
스킬 링크
https://github.com/EKKOLearnAI/ekko-studio/blob/main/packages/ekko-agent/skills/python-debugpy/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 Python 스크립트가 잘못된 합계를 냅니다. 한 단계씩 따라가면서 어느 값이 잘못되는지 찾도록 도와주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 해당 작업에 가장 단순한 디버거를 고르고, 변수를 확인할 수 있도록 올바른 줄에서 프로그램을 멈춥니다. 실행 중인 프로그램에는 로컬 포트로 원격 디버거를 연결합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Python Debugging
Use when Python code needs interactive debugging: hidden locals, confusing state mutation, failing tests, subprocesses, long-running services, or remote attach.
Choose the smallest debugger that reaches the bad frame:
breakpoint(): local code where source edits are acceptable.python3 -m pdb: launch from the beginning without editing source.python3 -m pdb -c continue: stop at an unhandled exception.debugpy: remote/headless processes, DAP clients, an existing PID, or startup races.
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>
Source-edit attach:
import debugpy
debugpy.listen(("127.0.0.1", 5678))
debugpy.wait_for_client()
debugpy.breakpoint()
Post-mortem inspection:
import pdb
import sys
try:
run()
except Exception:
pdb.post_mortem(sys.exc_info()[2])
raise
pdb commands
- Flow:
n,s,r,c,q. - Stack and 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>. - Evaluate or mutate:
!statement; full REPL:interact.
Rules
- Reproduce with the smallest command or test first.
- Disable parallel test workers for pdb; worker pools usually break interactive stdin.
- Keep
debugpyin the active environment. Do not add it as a project dependency unless the project needs it. - Bind debug servers to
127.0.0.1; expose them only on an isolated network or through a secure tunnel. - Treat PID attach as process injection. Avoid security-sensitive or production targets unless explicitly approved.
- On Linux, check ptrace and container privileges before changing a target when PID attach fails.
- Before committing, run
rg -n 'breakpoint\\(|pdb\\.set_trace|debugpy\\.' --type pyand remove accidental breakpoints. - Rerun the normal project test gate without the debugger.
자주 묻는 질문
코드를 바꿔야 하나요?
항상 그렇지는 않습니다. 스킬은 코드를 고치지 않고도 디버거에서 프로그램을 시작할 수 있지만, 로컬 작업에서는 소스에 중단점 줄을 넣기도 합니다.
이미 실행 중인 프로그램도 디버그할 수 있나요?
네. 디버거는 프로세스 ID로 기존 프로세스에 연결할 수 있습니다.
사후 디버깅이란 무엇인가요?
프로그램이 충돌한 순간에 디버거를 열어, 그 시점의 상태를 확인할 수 있게 하는 것입니다.
상세 정보
작성자의 원본 설명
Debug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote or headless attach.
repo: EKKOLearnAI/ekko-studio
인기도
- GitHub 스타
- 12k
- 순위
- #11575
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
1password
12k에이전트가 1Password CLI로 명령과 설정 파일에 필요한 비밀 값을 가져오되, 채팅, 로그, 저장 파일에는 보이지 않게 하도록 돕습니다.
apple-notes
12k에이전트가 memo 명령줄 도구를 사용해 Mac에서 Apple 메모를 만들고, 검색하고, 읽고, 편집하고, 옮기거나 삭제하도록 돕습니다.
apple-reminders
12k에이전트가 remindctl 도구를 사용해 Mac의 Apple 미리 알림과 미리 알림 목록을 보고, 만들고, 수정하고, 완료하거나 삭제하도록 돕습니다.
document-to-action-items
12k에이전트가 문서, 회의 녹취록 또는 메모 묶음을 작업, 담당자, 마감일, 결정 사항이 정리된 명확한 표로 바꾸도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.