agentleFS
andreaswasitaandreaswasita/copilot-agents-dojo/skills/debugging/SKILL.md

debugging

Skill54 starsChanged 6 months agoMITView on GitHub

Systematic root-cause investigation for hard bugs.

81 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use media-processing, databases and 9 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.
  • mrgoonieSkill

    media-processing

    Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

    Also in 4 projects that use this

  • mrgoonieSkill

    databases

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.

    Also in 5 projects that use this

  • ShopifySkill

    profiling

    Profile Rubydex indexer performance — CPU flamegraphs, memory usage, phase-level timing. Use this skill whenever the user mentions profiling, performance, flamegraphs, benchmarking, "why is X slow", bottlenecks, hot paths, memory usage, or wants to understand where time is spent during indexing/resolution. Also trigger when comparing performance before/after a change.

    Also in 3 projects that use this

  • sarveshtaleleSkill

    test-generation

    Generate a test strategy and starter test stubs for given modules across unit, integration, and e2e layers (pytest/jest/playwright). Trigger on: generate tests, test plan, test strategy, coverage plan, test scaffolding.

    Also in 3 projects that use this

  • MicrosoftSkill

    using-skills

    Describes how to use abilities. Read before any conversation.

    Also in 3 projects that use this

  • NVIDIASkill

    deployment

    Serve a quantized or unquantized LLM checkpoint as an OpenAI-compatible API endpoint using vLLM, SGLang, or TRT-LLM. Use when user says "deploy model", "serve model", "start vLLM server", "launch SGLang", "TRT-LLM deploy", "AutoDeploy", "benchmark throughput", "serve checkpoint", or needs an inference endpoint from a HuggingFace or ModelOpt-quantized checkpoint. Do NOT use for quantizing models (use ptq) or evaluating accuracy (use evaluation).

    Also in 5 projects that use this

  • +5 more from mrgoonie

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 73 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    NOT when the failing test message already states the problem — just fix it.

    line 23
  2. Very specific:

    Use view to read the offending code path.

    line 77
  3. Distinctive:

    If you cannot articulate a hypothesis, you do not have enough evidence yet.

    line 85
  4. Distinctive:

    Add one print/log at the suspected divergence point.

    line 91
  5. Distinctive:

    Run git bisect if a recent commit is suspect.

    line 92
  6. Distinctive:

    Write a test that reproduces the bug.

    line 109
  7. Distinctive:

    Run the test. It must pass.

    line 111
  8. Distinctive:

    Run the full suite. No regressions.

    line 112
  9. Very specific:

    Search the codebase with grep for the same anti-pattern elsewhere.

    line 113
  10. Very specific:

    If the technique was non-obvious, append to tasks/lessons.md:

    line 117

“Common” is measured: kept by at least 6 in 10 of the 73 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

Debugging Skill

Investigates hard or non-obvious bugs by gathering evidence, forming a hypothesis, and narrowing the search space — never by guessing or shotgun-changing code. Complements autonomous-bug-fix with deeper diagnostic technique. Does NOT replace running the failing test and reading the actual error.

When to Use

  • The cause of a bug is not immediately obvious.
  • Intermittent or hard-to-reproduce failures.
  • Bugs spanning multiple components or layers.
  • Standard approaches ("read the error, fix the obvious") have failed.
  • Performance regressions, memory leaks, race conditions.
  • NOT when the failing test message already states the problem — just fix it.

Prerequisites

  • Ability to reproduce the failure (or evidence captured from production).
  • The view, grep, glob, and powershell Copilot tools.
  • git for history and bisect.
  • A test or repro script that exhibits the bug.

How to Run

1. Reproduce the failure. Capture the exact error and stack.
2. Gather evidence: recent commits, environment, inputs, logs.
3. Form ONE hypothesis based on evidence.
4. Test the hypothesis with the cheapest technique that disproves it.
5. Narrow the layer, then the line.
6. Write a regression test BEFORE the fix.
7. Fix the root cause, not the symptom.

Quick Reference

TechniqueUse when
git bisectBug appeared recently, clean commit history
Print / log tracingNeed to see execution flow
Minimal reproComplex system, need to isolate the variable
Breakpoint debuggingNeed to inspect state at a specific point
Diff analysis (git log, git diff)"It worked before" — something changed
Input shrinkingTest with smaller inputs until the failure stops
Bug shapeFirst place to look
Race conditionShared mutable state, missing await, missing lock
Memory leakGrowing collections, unclosed resources, retained refs
PerformanceDatabase (N+1, missing index), network (uncached calls)
IntermittentTiming, external dependencies, ordering assumptions

Procedure

Step 1: Reproduce

Capture the exact failing command and full error output via the powershell tool. If you cannot reproduce locally, debugging is guessing. Stop and build a repro first.

Step 2: Gather Evidence

Inspect:

  • Recent commits with git log --oneline -10.
  • The diff of any commit touching the failing path.
  • The full stack trace, including the "caused by" chain.
  • Environment differences if it works elsewhere.

Use view to read the offending code path. Use grep to locate related call sites.

Step 3: Form a Hypothesis

Based on evidence — not intuition — write down a single hypothesis:

"The cache is stale because invalidation runs before the write completes."

If you cannot articulate a hypothesis, you do not have enough evidence yet. Gather more.

Step 4: Disprove It Cheaply

Choose the cheapest technique that would falsify the hypothesis:

  • Add one print/log at the suspected divergence point.
  • Run git bisect if a recent commit is suspect.
  • Construct a minimal repro that isolates the variable.

Step 5: Narrow Layer → Line

Walk the request through the system:

Input → Layer A → Layer B → Layer C → Output

At each boundary, check: correct input in? correct output out? The bug lives at the boundary where correct input produces incorrect output.

Step 6: Regression Test First, Then Fix

Before changing code:

  1. Write a test that reproduces the bug. It must fail.
  2. Implement the fix.
  3. Run the test. It must pass.
  4. Run the full suite. No regressions.
  5. Search the codebase with grep for the same anti-pattern elsewhere.

Step 7: Log the Lesson

If the technique was non-obvious, append to tasks/lessons.md:

- date: 2026-05-19
  error_type: stale-cache
  trigger: "Test passed alone, failed in suite"
  root_cause: "Cache invalidated before write committed"
  fix: "Made invalidation await the write"
  rule: "All cache invalidations follow the source mutation, not lead it"

Pitfalls

  • DO NOT shotgun-change code hoping something sticks.
  • DO NOT skip the reproduction step. You cannot fix what you cannot see.
  • DO NOT blame the framework first. It is almost always your code.
  • DO NOT debug in production when local reproduction is possible.
  • DO NOT ship a fix you cannot explain. If you cannot articulate why it works, you have patched a symptom.

Verification

  • Failure was reproduced locally before any code change.
  • A regression test exists and failed prior to the fix.
  • The regression test now passes.
  • The full test suite is green.
  • The root cause is written down (commit message or tasks/lessons.md).

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.