plugins/autonomous-dev/skills/debugging-workflow/SKILL.md
Systematic debugging methodology — reproduce, isolate, bisect, fix, verify. Use when diagnosing failures, tracing errors, or investigating unexpected behavior. TRIGGER when: debug, error, traceback, stack trace, bisect, breakpoint, failing test, unexpected behavior. DO NOT TRIGGER when: writing new features, code review, documentation, refactoring.
npx skillsauth add akaszubski/autonomous-dev debugging-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematic methodology for diagnosing and fixing bugs. Follow these phases in order — do not skip ahead.
Before anything else, reproduce the failure reliably.
# Good: run the failing test with verbose output
python -m pytest tests/path/test_file.py::test_name -xvs 2>&1
# Good: reproduce with minimal script
python -c "from module import func; func(failing_input)"
Narrow down where the failure originates.
git bisect start, git bisect bad, git bisect good <known-good-commit># Quick tracing without debugger
import traceback
traceback.print_stack() # Print call stack at any point
# Targeted print debugging
def suspect_function(data):
print(f"DEBUG: data type={type(data)}, len={len(data) if hasattr(data, '__len__') else 'N/A'}")
print(f"DEBUG: data={data!r:.200}") # First 200 chars of repr
# Drop into debugger at specific point
import pdb; pdb.set_trace() # stdlib
import ipdb; ipdb.set_trace() # enhanced (if available)
breakpoint() # Python 3.7+ (uses PYTHONBREAKPOINT env var)
Debugger commands: n (next), s (step into), c (continue), p expr (print), w (where/stack), u/d (up/down stack)
Identify the root cause, not just the symptom.
| Category | Example | Fix Pattern |
|----------|---------|-------------|
| Wrong type | str where int expected | Add type check or convert |
| Wrong state | Object not initialized | Fix initialization order |
| Race condition | File read before write completes | Add synchronization |
| Missing check | None not handled | Add guard clause |
| Stale data | Cache not invalidated | Fix cache lifecycle |
| Wrong assumption | API changed behavior | Update to match reality |
Don't stop at the first explanation:
KeyError: 'name'parse_config()parse_config() include 'name'? → The config file format changedApply the minimum change that addresses the root cause.
Confirm the fix is complete and doesn't introduce new issues.
# Run the specific failing test
python -m pytest tests/path/test_file.py::test_name -xvs
# Run the full test suite
python -m pytest --tb=short
# Run with coverage to verify the fix path is exercised
python -m pytest --cov=module --cov-report=term-missing tests/path/test_file.py
| Pitfall | Why It's Wrong | What To Do Instead | |---------|---------------|-------------------| | Fix without reproducing | You might fix the wrong thing | Always reproduce first | | Fix the symptom | Bug will recur in different form | Find root cause | | Large refactor as "fix" | Introduces new bugs | Minimal change only | | No regression test | Bug will come back | Test is part of the fix | | Skip full test suite | Fix broke something else | Always run full suite |
development
GenAI-first testing with structural assertions, congruence validation, and tier-based test structure. Use when writing tests, setting up test infrastructure, or validating coverage. TRIGGER when: test, pytest, coverage, TDD, test patterns, congruence, validation. DO NOT TRIGGER when: production code implementation, documentation, config-only changes.
development
One topic, one home. Routes content to its canonical store (CLAUDE.md, PROJECT.md, MEMORY.md, docs/, memory/) and audits for duplication. TRIGGER when: auditing CLAUDE.md/PROJECT.md/MEMORY.md sizes, deduplicating docs, applying the content-allocation pattern to a new repo, running /align --content. DO NOT TRIGGER when: implementing features, writing tests, routine code edits, debugging.
testing
Prompt engineering patterns for writing agent prompts and skill files — constraint budgets, register shifting, HARD GATE patterns, anti-personas. Use when writing or reviewing agents/*.md or skills/*/SKILL.md. TRIGGER when: agent prompt, skill file, prompt engineering, model-tier compensation, HARD GATE, prompt quality. DO NOT TRIGGER when: user-facing docs, README, CHANGELOG, config files.
testing
JSON persistence, atomic writes, file locking, crash recovery, and state versioning patterns. Use when implementing stateful libraries or features requiring persistent state. TRIGGER when: state persistence, atomic write, file locking, crash recovery, checkpoint. DO NOT TRIGGER when: stateless utilities, pure functions, config reads, documentation.