python-debugpy

Debug Python runtime failures with pdb and remote debugpy attachment.

Updated May 26, 2026
One-click install
npx skills add https://github.com/ruiyangruiyi/hermes-agent --skill python-debugpy-ruiyangruiyi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-debugpy
Source: https://github.com/ruiyangruiyi/hermes-agent/tree/main/skills/software-development/python-debugpy
Command: npx skills add https://github.com/ruiyangruiyi/hermes-agent --skill python-debugpy-ruiyangruiyi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you quickly locate bugs in Python by letting you inspect program state interactively with pdb and, when needed, attach remotely with debugpy via DAP.

Core Features & Use Cases

  • Interactive local debugging with pdb: Use breakpoint() or python -m pdb to pause execution and inspect locals, stack frames, and expressions at the exact failing line.
  • Remote/headless debugging with debugpy (DAP): Attach to long-running processes like a Hermes gateway or troubleshoot production-ish hangs without restarting.
  • Test debugging and post-mortems: Trap failing pytest tests safely and inspect exceptions at the crash site using pdb.post_mortem.

Example use case: A Hermes gateway misbehaves and you cannot restart it; you attach with debugpy, hit a breakpoint in the handler, and inspect variables and the call stack to identify the faulty code path.

Quick Start

Use the python-debugpy skill to debug a failing test by running your hermes test wrapper with --pdb so you land in a pdb prompt at the relevant failure point.

Frequently Asked Questions about python-debugpy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a running Python service without restarting it?

Use debugpy to attach a remote DAP debugger to a running Python process, enabling interactive inspection of variables and stack frames in long-lived services like a Hermes gateway without restarting.

What is the best way to inspect a Python exception at the crash site?

Use pdb post-mortem inspection to drop into an interactive prompt at the exact failing line, enabling you to inspect locals and stack frames immediately after a Python exception crash.

How do I drop into a pdb prompt when a pytest test fails?

Run your pytest test wrapper with the --pdb flag to automatically drop into a pdb prompt at the relevant failure point, allowing interactive inspection of the failing test state.

When should I use breakpoint() vs python -m pdb vs debugpy?

Use breakpoint() or python -m pdb for local interactive script debugging, and use debugpy listen/attach patterns for remote DAP attachment to long-running or headless Python processes.

Does debugpy work with pytest-xdist parallel test execution?

debugpy has known incompatibility with pytest-xdist, so you should avoid this combination and handle parallel test constraints when planning your Python debugging workflow.

Can I attach a debugger to a Python script running on a remote server?

Yes, you can attach a debugger to a remote Python script by using debugpy to listen on the server and connecting via DAP, allowing you to troubleshoot production-ish hangs remotely.