agentsclimarketplace

Debugging

Skill justincordova/agents/skills/debugging

A structured AI coding workflow with skills, agents, and commands that make AI think before it builds.

Install
npx -y skills add justincordova/agents --skill debugging

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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

SKILL.md

3.8 KB, as published. Nobody here has run it

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

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.