Agent skill

dispatching-systematic-debugging

Use when encountering bugs, test failures, unexpected behavior, errors, or performance problems - dispatches systematic-debugging-agent that enforces 4-phase process (root cause investigation, pattern analysis, hypothesis testing, implementation) to prevent quick-fix attempts and ensure proper debugging

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/zgagnon/skills/tree/main/dispatching-systematic-debugging

SKILL.md

Dispatching Systematic Debugging

Core principle: Debug systematically, not randomly. Dispatch the debugging agent instead of proposing quick fixes.

When to Dispatch

Always dispatch systematic-debugging-agent when:

  • Test failures
  • Bugs or errors
  • Unexpected behavior
  • Performance problems
  • Build failures
  • Integration issues

Especially when:

  • Fix seems "obvious"
  • Under time pressure
  • Already tried multiple fixes
  • Don't fully understand the issue

How to Dispatch

Use Task tool with subagent_type='systematic-debugging-agent':

typescript
Task(
  subagent_type='systematic-debugging-agent',
  prompt=`
    Bug: [What's broken]
    Error: [Error messages, stack traces]
    Context: [Recent changes, environment, what you've tried]
    Goal: [What should happen instead]
  `
)

What the Agent Does

The systematic-debugging-agent maintains full 4-phase process throughout debugging:

  1. Phase 1: Root Cause Investigation - Gathers evidence before proposing fixes
  2. Phase 2: Pattern Analysis - Compares against working examples
  3. Phase 3: Hypothesis Testing - Tests one hypothesis at a time
  4. Phase 4: Implementation - Creates failing test, then implements fix

Agent enforces:

  • NO fixes without root cause investigation first
  • NO skipping phases (even for "simple" bugs)
  • Failing test required before implementation
  • Return to Phase 1 after 3 failed fixes

Red Flags - Dispatch Agent Instead

If you catch yourself thinking:

  • "Quick fix for now, investigate later"
  • "Just try changing X and see if it works"
  • "I can see the problem, let me fix it"
  • "Skip the process, this is simple"
  • "One more fix attempt without investigation"

ALL of these mean: STOP. Dispatch systematic-debugging-agent.

Why Agent Pattern

Problem: Skill instructions fade from context after 20+ tool calls, agents forget process and revert to quick-fix mode.

Solution: Agent maintains full debugging process in context throughout entire session. Agent identity IS systematic debugging.

Benefits:

  • No context dilution (agent "born" with full process)
  • Automatic discipline enforcement
  • Clear start (dispatch) and end (fixed + verified) boundaries
  • Process maintained through 50+ tool calls

After Agent Returns

Agent returns when:

  • ✅ Bug fixed and verified
  • ✅ All tests passing
  • ✅ Root cause documented

You can continue with fixed code.

Common Mistakes

DON'T:

  • Propose fixes before dispatching agent
  • Skip agent for "simple" bugs
  • Ignore agent's investigation process
  • Manually skip phases "to save time"

DO:

  • Dispatch immediately when bug encountered
  • Trust agent's systematic process
  • Let agent complete all 4 phases
  • Learn from agent's investigation approach

Expand your agent's capabilities with these related and highly-rated skills.

zgagnon/skills

sharpening-the-knife

Use when discovering a useful technique, pattern, or insight during work - pause to capture it as a skill before the knowledge evaporates, preventing the "I'll remember this" trap that causes expertise loss

0 0
Explore
zgagnon/skills

incremental-tdd

Use when implementing features or refactoring with TDD - enforces writing ONE test at a time, implementing minimal code to pass, then repeating, preventing batch test writing that defeats incremental design discovery

0 0
Explore
zgagnon/skills

discovery-tree-workflow

Use when planning and tracking work - creates visible, emergent work breakdown using TypeScript API with just-in-time planning and hierarchical task trees

0 0
Explore
zgagnon/skills

using-jj

Use when working with Jujutsu (jj) version control for task management and change tracking - provides workflows for examine-commit-work-squash cycle, checkpointing progress, and managing working copies

0 0
Explore
zgagnon/skills

test-watch-focused-patterns

Use when developing tests or refactoring test suites - run tests in watch mode with focused file patterns to get instant feedback on specific test files without running the entire suite

0 0
Explore
zgagnon/skills

wishful-thinking-programming

Use when building features with unknowns or uncertainties - start from well-understood parts (business logic, UX, pure functions), write code as if ideal collaborators exist, use mocks to define APIs through usage, preventing analysis paralysis from trying to understand everything upfront

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results