~/ai_assets_directory_
Copilot Agent verified · tested by us 38.7k stars · whole github/awesome-copilot repo
debug.agent.md

Debug Mode Agent

Runs a four-phase debugging workflow: reproduces the bug first, traces the root cause, applies a minimal fix, then verifies with tests instead of guessing at a patch.

Overview

Debug Mode turns Copilot into a structured debugging assistant instead of one that jumps straight to a patch. It works through four phases: assessing the problem, investigating the root cause, applying a fix and verifying it, refusing to move to the next phase until the current one holds up.

How it works

  1. It reads the error messages and stack traces first, then reproduces the bug before touching any code, documenting expected versus actual behavior.
  2. It traces the execution path, checks recent git history for the change that likely introduced the bug, and ranks hypotheses by likelihood before picking one to test.
  3. It makes a targeted, minimal change instead of a broad rewrite, weighing edge cases and side effects along the way.
  4. Finally, it reruns the original reproduction steps plus the wider test suite, then reports the root cause and any preventive changes.

Examples

"Debug why the checkout API returns a 500 only when the cart has
more than 10 items."

Installation

You need VS Code with the GitHub Copilot extension.

  1. Create the agents folder and download the file into your repo:
    mkdir -p .github/agents
    curl -o .github/agents/debug.agent.md \
      https://raw.githubusercontent.com/github/awesome-copilot/main/agents/debug.agent.md
    
  2. Reload VS Code, or open a new Copilot Chat; custom agents under .github/agents/ are picked up automatically.
  3. Pick this agent from the mode picker in Copilot Chat and describe a bug to confirm it reproduces it before proposing a fix.

Related assets