agentleFS
justincordovajustincordova/agents/skills/debugging/SKILL.md

debugging

Skill1 starsChanged 4 months agoMITView on GitHub

Use when something is broken, behaving unexpectedly, or producing wrong output. Systematic root-cause analysis methodology.

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 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.
  • 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

  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 17 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

  • +5 more from mrgoonie

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 73 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Core principle: Don't guess. Observe. Narrow the space of possible causes until the answer is obvious.

    line 12
  2. Distinctive:

    If you can't reproduce it, you can't fix it.

    line 32
  3. Distinctive:

    Add strategic logging/checkpoints, not print statements everywhere.

    line 42
  4. Distinctive:

    Check assumptions at boundaries: "Is the input what I expect here?"

    line 43
  5. Distinctive:

    Add a test that reproduces the bug first (if applicable).

    line 76
  6. Distinctive:

    Keep the fix minimal. Don't refactor while debugging.

    line 77
  7. Distinctive:

    Add a comment if the fix is non-obvious (future you will thank you).

    line 78
  8. Distinctive:

    No regressions in related functionality

    line 84
  9. Distinctive:

    If it was intermittent — can you still trigger it?

    line 85

“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

Overview

Systematic debugging: reproduce → isolate → root cause → fix → verify. Not "add print statements and hope."

Core principle: Don't guess. Observe. Narrow the space of possible causes until the answer is obvious.

When to Use

  • Something is broken or behaving unexpectedly
  • Tests are failing and you don't know why
  • Performance is degraded
  • Something works locally but not in production/ci
  • Error messages are confusing or unhelpful

The Process

1. Reproduce

Get a minimal, reliable reproduction.

  • Can you make it happen on demand?
  • What's the simplest case that triggers it?
  • Does it happen every time or intermittently?

If you can't reproduce it, you can't fix it. Stop here and gather more information.

Intermittent bugs: Timing issues, race conditions, state dependencies. Try to identify what makes it happen sometimes but not always. Note the conditions.

2. Isolate

Narrow down where the bug lives.

Binary search approach:

  • Bisect the code path. Which half contains the bug?
  • Add strategic logging/checkpoints, not print statements everywhere.
  • Check assumptions at boundaries: "Is the input what I expect here?"

Common isolation techniques:

  • Input elimination: Strip inputs to the minimum that still triggers the bug
  • Code path elimination: Comment out branches, does it still happen?
  • Version bisection: git bisect to find the commit that introduced it
  • Dependency isolation: Does it happen without that library? With a different version?

3. Root Cause

Once isolated, understand WHY.

Ask these questions:

  • What did the developer intend?
  • What actually happens?
  • At what point do those diverge?

Common root causes by category:

SymptomLikely Root Cause
Works locally, fails in CIEnvironment diff (env vars, file paths, timezone, OS)
Intermittent failuresRace condition, uninitialized state, flaky external dep
Wrong output, no errorBad assumption about data shape, off-by-one, wrong operator
Error in library codeYou're using it wrong — check the contract
Works once, fails on repeatState not reset, mutation of shared data
Performance degradationN+1 query, growing data structure, missing index

Don't stop at the symptom. "The variable was null" is a symptom. "The API returns null when the record doesn't exist and we didn't handle that case" is a root cause.

4. Fix

  • Fix the root cause, not the symptom.
  • Add a test that reproduces the bug first (if applicable).
  • Keep the fix minimal. Don't refactor while debugging.
  • Add a comment if the fix is non-obvious (future you will thank you).

5. Verify

  • The original reproduction case now works
  • Edge cases around the fix work
  • No regressions in related functionality
  • If it was intermittent — can you still trigger it?

Anti-Patterns

Don'tDo Instead
Change random things until it worksForm a hypothesis, test it
Add console.log everywhereAdd strategic checkpoints at boundaries
Fix the symptomFind and fix the root cause
Assume you know what's wrongVerify your assumptions
Refactor while debuggingFix the bug, refactor later
Skip the reproduction stepReproduce first, always
Blame the framework/libraryVerify your usage first

When to Ask for Help

  • You've been stuck for 30+ minutes on the same issue
  • You've tried two different isolation approaches and neither worked
  • The bug might be in code you don't understand (kernel, runtime, compiler)
  • You keep making the same fix and it keeps not working

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.