api-design
REST API design best practices covering versioning, error handling, pagination, and OpenAPI documentation. Use when designing or implementing REST APIs or HTTP…
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
$ npx -y skills add akaszubski/autonomous-dev --skill debugging-workflow --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/debugging-workflowContext preview
The summary Claude sees to decide when to auto-load this skill.
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
name: debugging-workflow description: "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." allowed-tools: [Read, Grep, Glob, Bash]
Systematic methodology for diagnosing and fixing bugs. Follow these phases in order — do not skip ahead.
Before anything else, reproduce the failure reliably.
1. **Get the exact error** — full traceback, not a summary 2. **Find the minimal reproduction** — smallest input/command that triggers it 3. **Confirm it's consistent** — run 3 times. Flaky? Note the frequency 4. **Record the environment** — Python version, OS, relevant config
# 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.
1. Start at the exception/error location 2. Walk up the call stack — who called this function with what args? 3. Find the **first wrong value** — where did correct data become incorrect?
# 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: 1. Why did the test fail? → `KeyError: 'name'` 2. Why is 'name' missing? → The dict comes from `parse_config()` 3. Why doesn't `parse_config()` include 'name'? → The config file format changed 4. Why did the format change? → A migration script ran but didn't update the schema 5. Why didn't the schema update? → The migration has no test → **Root cause**
Apply 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
1. Does the original error still occur? → Must be NO 2. Do all existing tests still pass? → Must be YES 3. Is there a regression test for this bug? → Must be YES 4. Could this bug occur elsewhere? → Search for similar patterns
| 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 |
A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.
Repo: akaszubski/autonomous-dev
REST API design best practices covering versioning, error handling, pagination, and OpenAPI documentation. Use when designing or implementing REST APIs or HTTP…
Subprocess safety, GitHub CLI integration, retry logic, authentication, rate limiting, and timeout handling. Use when integrating external APIs or CLI tools.…
File-by-file architecture planning with ADR format, dependency ordering, and testability gates. Use when designing system architecture or creating ADRs.…
10-point code review checklist covering correctness, tests, error handling, type hints, naming, security, and performance. Use when reviewing PRs or evaluating…
One topic, one home. Routes content to its canonical store (CLAUDE.md, PROJECT.md, MEMORY.md, docs/, memory/) and audits for duplication. TRIGGER when:…
Documentation standards enforcing Keep a Changelog format, README structure, ADR templates, and Google-style docstrings. Use when writing CHANGELOG entries,…