python-debugpy
できること
このスキルは、Pythonの組み込みデバッガーとリモートデバッガーを使って、Pythonプログラムのバグを見つける方法をエージェントに教えます。print文では分からない問題で行き詰まっている開発者向けです。
使う場面
- ✓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 Notes)を作成、検索、読み取り、編集、移動、削除できるよう支援します。
apple-reminders
12kエージェントが、remindctlツールを使って、Macのリマインダーとリマインダーのリストを一覧表示、作成、編集、完了、削除できるよう支援します。
document-to-action-items
12kエージェントが、文書、会議の書き起こし、メモを、タスク、担当者、期限、決定事項の明確な表に変換できるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。