agentleFS
chuckplayerchuckplayer/claude-agent-pack/skills/debug/SKILL.md

debug

Skill8 starsChanged 35 days agoMITView on GitHub

Diagnose and fix a failing test, error, or unexpected behavior. Routes to the appropriate engineer based on the error context. Lighter than /implement — no worktree isolation, no full pipeline ceremony. Trigger this when someone says: something is broken, fix this error, my test is failing, why is this not working, I'm getting an exception, this is throwing an error, debug this, why does this crash. Do NOT use when the root cause is already known and the fix is small — use /hotfix instead. Do NOT use for architectural changes — use /implement instead.

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-discord, add-slack and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    add-discord

    Add Discord bot channel integration via Chat SDK.

    Also in 11 projects that use this

  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 11 projects that use this

  • +10 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 15 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Ask for (or extract from what the user provided):

    line 12
  2. Distinctive:

    If the user has already provided all of this, skip asking and proceed.

    line 18
  3. Distinctive:

    Run git branch --show-current.

    line 22
  4. Distinctive:

    Before routing to an engineer:

    line 26
  5. Distinctive:

    Read the files mentioned in the error or stack trace.

    line 27
  6. Distinctive:

    If a test is failing, read the test file and the code it exercises.

    line 28
  7. Very specific:

    Check memory//*.md (if the directory exists) for any known-issues entries that match the symptom.

    line 29
  8. Distinctive:

    If the error is localized to one layer, select based on file type:

    line 34
  9. Distinctive:

    Multi-layer errors: If the error spans layers (e.g., a frontend test failing because a backend API is broken), route to the layer …

    line 43
  10. Distinctive:

    After the engineer returns:

    line 53
  11. Distinctive:

    Run the failing test or repro steps to confirm the fix works.

    line 54
  12. Distinctive:

    If the fix introduces new failures, loop back to the engineer with the new errors.

    line 55
  13. Distinctive:

    Run code-reviewer on the changed files only.

    line 59
  14. Very specific:

    Run the project's test suite (dotnet test, npm run test, or pytest) and confirm all tests pass.

    line 78
  15. Distinctive:

    Fixing the symptom, not the root cause: Always state your root-cause hypothesis before routing to an engineer.

    line 91
  16. Distinctive:

    Fix breaks other tests: After the engineer returns, run the full test suite (or at minimum the suite for the changed module), not just the …

    line 93
  17. Distinctive:

    Hypothesis not passed to the engineer: If you route to an engineer without a clear hypothesis, the engineer will re-investigate from …

    line 94

“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debug

Diagnose and fix the error, failing test, or unexpected behavior the user described.

1. Gather context

Ask for (or extract from what the user provided):

  • The error message or stack trace (exact text preferred)
  • The file(s) involved, if known
  • How to reproduce the problem (command, test name, steps)
  • Whether the error is new (regression) or has existed for a while

If the user has already provided all of this, skip asking and proceed.

2. Confirm the working branch

Run git branch --show-current. If the branch is main or master, warn the user and ask whether to create a fix branch before making changes. Do not create or switch branches automatically — just ask.

3. Read before acting

Before routing to an engineer:

  • Read the files mentioned in the error or stack trace.
  • If a test is failing, read the test file and the code it exercises.
  • Check memory/**/*.md (if the directory exists) for any known-issues entries that match the symptom.
  • Form a hypothesis about the root cause. State it explicitly.

4. Route to the appropriate engineer

If the error is localized to one layer, select based on file type:

File typeEngineer
.cs / .NETcsharp-engineer
.ts / .vuefrontend-engineer
.ts in an MCP servermcp-engineer
SQL / migrationdatabase-engineer

Multi-layer errors: If the error spans layers (e.g., a frontend test failing because a backend API is broken), route to the layer containing the root cause first. Fix that layer, verify the downstream symptom resolves, then return here if the downstream layer also needs changes.

Pass the engineer:

  • The error message and stack trace
  • The files to read and modify
  • Your root-cause hypothesis
  • How to verify the fix (the test command or repro steps)

5. Verify the fix

After the engineer returns:

  • Run the failing test or repro steps to confirm the fix works.
  • If the fix introduces new failures, loop back to the engineer with the new errors.

6. Lightweight review

Run code-reviewer on the changed files only.

Skip security-reviewer and performance-reviewer unless:

  • The fix touches auth, authorization, data access, or secrets → invoke security-reviewer
  • The fix touches a hot path → invoke performance-reviewer

State your reasoning either way.

7. Wrap up

Report:

  • Root cause (confirmed or best explanation)
  • What was changed and why
  • Whether any follow-up work is needed (e.g., the fix revealed a broader pattern issue)

This skill is diagnosis-and-fix, not full pipeline delivery. Do not run test-engineer, merge-reviewer, or git-engineer unless the user asks.

If the user asks to commit the fix, apply these minimum gates before git-engineer commits:

  1. Run the project's test suite (dotnet test, npm run test, or pytest) and confirm all tests pass. If any fail, loop back to the engineer before proceeding.
  2. Route through merge-reviewer as the commit gate — do not use git-engineer Mode B directly. merge-reviewer will run the test suite (Step 0b), apply the gate checklist, and produce the commit.

The purpose of /debug is speed of diagnosis. The purpose of committing is permanence. Once the user decides to commit, the same safety guarantees as /implement apply.

One guarantee that deliberately does not apply: the plan gate. This skill passes no plan_id, so merge-reviewer's gate 4a reports "not applicable" and neither the acceptance bars nor the ## Deviations checks run. Plan consumption is opt-in per invocation, and a diagnosis has no plan because it skipped planning. Do not add plan_id handling here without first deciding who would write the plan and when.

Gotchas

  • Fixing the symptom, not the root cause: Always state your root-cause hypothesis before routing to an engineer. If the hypothesis turns out to be wrong after the fix, loop back — do not close out just because the immediate error is gone.
  • Multi-layer errors: A frontend error that says "404 Not Found" is often a backend routing bug, not a frontend bug. Read the network request and the backend logs before deciding which layer to fix. Route to the root-cause layer first.
  • Fix breaks other tests: After the engineer returns, run the full test suite (or at minimum the suite for the changed module), not just the originally failing test. A fix that breaks three other tests is not a fix.
  • Hypothesis not passed to the engineer: If you route to an engineer without a clear hypothesis, the engineer will re-investigate from scratch. Save time by passing the exact error, the files involved, and your best theory.
  • Unclear hot path: Tight loops over large collections, endpoints under high traffic, and database queries in critical flows (login, checkout, search) all qualify. If uncertain, include performance-reviewer — it is faster than explaining why you skipped it.
  • Escalating too quickly to /implement: Debug is the right skill for most errors. Only escalate to /implement if the fix requires new files, new dependencies, or an architectural change that is out of scope for a targeted patch.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.