pluginagentmarketplace/custom-plugin-python
Overview
This skill teaches practical Python debugging using pdb, IDE debuggers, logging, profiling, and error analysis. I guide you from basic breakpoint debugging to production-safe tools like py-spy and structured logging. You will learn to reproduce, inspect, and fix bugs faster and with less disruption to production.
How this skill works
I cover core pdb commands, breakpoints(), post-mortem and remote debugging, plus enhancements like pdb++. I walk through IDE workflows for VS Code and PyCharm: conditional breakpoints, watches, and call stack navigation. I also teach logging setup, profiling with cProfile/line_profiler/memory_profiler, and techniques for analyzing tracebacks and integrating error monitoring.
When to use it
- When you need to step through code to find logic errors or inspect state.
- When investigating production issues without stopping services (py-spy, remote pdb).
- When performance problems require CPU or memory profiling.
- When tracebacks are unclear and you need structured error context.
- When setting up logging and monitoring to reduce future debugging time.
Best practices
- Start with a minimal reproducible example before deep debugging.
- Use conditional breakpoints and watch expressions to limit noise.
- Prefer structured logging and appropriate log levels over print debugging.
- Profile with representative workloads and compare before/after changes.
- Use post-mortem debugging and error monitoring to capture issues in production.
Example use cases
- Step through a failing unit test with pdb to inspect local variables and call flow.
- Attach py-spy to a production process to collect flame graphs without downtime.
- Configure VS Code breakpoints with conditions to skip noisy iterations in a loop.
- Use cProfile and line_profiler to identify a slow function and optimize hotspots.
- Integrate Sentry or a similar service to capture tracebacks and context for uncaught exceptions.
FAQ
No. pdb and py-spy provide powerful CLI debugging and profiling; IDEs add convenience but are optional.
Is print() debugging ever acceptable?
Yes for quick checks, but structured logging and breakpoints scale better and are safer in production.
10 skills
This skill helps you master Python debugging with pdb and IDE tools, enabling efficient issue resolution, profiling, and robust log-based troubleshooting.
This skill helps you build high-performance APIs with FastAPI, enabling async endpoints, automatic docs, and type-safe request handling.
This skill helps you master Python type hints and mypy checks to improve code quality, IDE support, and static analysis.
This skill helps you master pytest testing with fixtures, mocking, and CI/CD integration to improve code quality and test coverage.
This skill helps you master Python packaging with Poetry, from dependency management to publishing and project structure.
This skill helps you master asynchronous programming with asyncio to write concurrent, efficient I/O-bound code and build scalable async applications.
This skill helps you build production-ready Django apps quickly by guiding model design, authentication, REST APIs, and deployment best practices.
This skill helps you optimize Python performance through profiling, memory management, and high-performance techniques for faster, scalable code.
This skill helps you master Python fundamentals by guiding syntax, data types, OOP, and standard library use for clean, efficient code.
This skill helps you analyze and visualize data with Pandas, NumPy, and Matplotlib, enabling data cleaning, transformation, and insightful exploration.