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.

135 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use remove-ai-slops, ssr 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.
  • DevNewbie1826Skill

    remove-ai-slops

    Remove AI-generated code slop from branch changes or an explicit file list while preserving behavior, including junk tests (prose pins, source greps, copied inventories, mock echoes), each proven by its class rule before a cut. Use when asked to remove slop, clean AI code, deslop, clean up generated code, strip slop, prune junk tests, or review generated-code cleanup. Start by locking behavior with regression tests, then use the workflow and category references.

    Also in 3 projects that use this

  • JetBrainsSkill

    ssr

    Create or modify IntelliJ Structural Search and Replace patterns.

    Also in 3 projects that use this

  • truongtv22Skill

    Problem-Solving Techniques

    Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

    Also in 4 projects that use this

  • 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 6 projects that use this

  • mrgoonieSkill

    mcp-management

    Manage Model Context Protocol (MCP) servers - discover, analyze, and execute tools/prompts/resources from configured MCP servers. Use when working with MCP integrations, need to discover available MCP capabilities, filter MCP tools for specific tasks, execute MCP tools programmatically, access MCP prompts/resources, or implement MCP client functionality. Supports intelligent tool selection, multi-server management, and context-efficient capability discovery.

    Also in 6 projects that use this

  • DevNewbie1826Skill

    programming

    MUST USE for work on Python, Rust, TypeScript, JavaScript, or Go source files and project manifests, and whenever a test or spec file is written, reshaped, reviewed, or deleted. Triggers: write or edit code; add, change, or delete a test; test authoring gate; junk tests; new project; Go HTTP service (gin lane); Bubble Tea TUI; CJK IME; Connect-Go RPC; sqlc or pgx; branded IDs; exhaustive matching; unsafe Rust; Miri; oversized file; refactoring; logging, log levels, structured logging, or observability; arena, allocator, bumpalo, const fn, const generics, compile-time programming, zero-allocation APIs, bitfields, repr, scope guards, errdefer-style cleanup, Zig-like patterns, zero-copy parsing, packed data, or FFI; Rust public API design or macros.

    Also in 3 projects that use this

  • +6 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 122 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 122 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.