kata-python-debug

Diagnose Python bugs by writing a failing regression test and verifying fixes with ruff and mypy.

Updated Sep 3, 2025
One-click install
npx skills add https://github.com/guardiatechnology/design-system --skill kata-python-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kata-python-debug
Source: https://github.com/guardiatechnology/design-system/tree/main/.claude/skills/kata-python-debug
Command: npx skills add https://github.com/guardiatechnology/design-system --skill kata-python-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you systematically diagnose and fix Python application bugs by turning reports into a reproducible failing test, then tracing the failure to its true root cause.

Core Features & Use Cases

  • Reproduce with a failing test: Identifies the entry point and creates a minimal regression test that fails, ensuring the bug is truly understood.
  • Isolate the root cause: Traces data flow from trigger to failure, narrows to unit-level reproduction when possible, and categorizes the root cause (logic, validation, race, mapping, or infrastructure).
  • Apply and verify the fix: Implements a minimal, targeted fix and confirms it passes the regression test, the full suite, plus Ruff and mypy checks.

Quick Start

Follow the workflow to write a minimal failing regression test for the reported Python bug, then use the stack trace and data-flow tracing to implement the smallest root-cause fix and verify with tests and lint/type checks.

Frequently Asked Questions about kata-python-debug

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

FAQPage Schema
How do I debug Python bugs using a test-driven approach?

To debug Python bugs using a test-driven approach, you write a minimal failing regression test that reproduces the reported issue, then implement a targeted fix to make it pass. This ensures the bug is truly understood before changes are made.

What is the best way to find the root cause of a Python application failure?

The best way to find the root cause of a Python application failure is to trace data flow from the trigger to the failure point. This process narrows the issue to a unit-level reproduction and categorizes it as logic, validation, race, mapping, or infrastructure.

How do I verify a Python bug fix without chasing symptoms?

To verify a Python bug fix without chasing symptoms, you implement a minimal targeted correction and run the regression test alongside the full test suite. You also verify code quality by passing Ruff and mypy checks.

Does this debugging workflow require stack traces and reproducible failures?

Yes, this debugging workflow requires stack traces and reproducible failures across endpoints, functions, and events. These behavioral expectations are necessary to create the minimal failing regression test that starts the process.

Can I use Ruff and mypy to validate my Python bug fixes?

Yes, you can use Ruff and mypy to validate your Python bug fixes. After applying the minimal fix to pass the regression test and full test suite, these linters and type checkers confirm the code maintains quality standards.

Why should I write a failing regression test before fixing Python code?

You should write a failing regression test before fixing Python code to guarantee the bug is accurately reproduced. This test isolates the true root cause and prevents symptom-chasing by providing a clear, measurable target for the minimal fix.