debugging-method
Debugging is the scientific method applied to a misbehaving system. You don't "stare at code until you see it"; you run controlled experiments that each rule something in or out.
$ npx -y skills add vanara-agents/skills --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Debugging is the scientific method applied to a misbehaving system. You don't "stare at code until you see it"; you run controlled experiments that each rule something in or out.
Agent definition
debugging-method.mdThe Debugging Method — Hypothesis-Driven
Debugging is the scientific method applied to a misbehaving system. You don't "stare at code until you see it"; you run controlled experiments that each rule something in or out.
The loop
observe ──> hypothesize ──> predict ──> experiment ──> compare
^ │
└──────────────────── refine ─────────────────────────┘1. **Observe.** Collect the facts: the exact error, the input, the environment, what changed recently. Resist theorizing before you have the message in front of you. 2. **Hypothesize.** Propose one *falsifiable* cause: "The total is wrong because `applyDiscount` mutates the shared `cart` array." A good hypothesis predicts something you can check. 3. **Predict.** If the hypothesis is true, what must also be true? "Then logging `cart` before and after should show it changed." 4. **Experiment.** Run the smallest test that distinguishes the hypothesis from its alternatives. Change **one variable at a time**. 5. **Compare.** Did the prediction hold? If yes, you've localized the cause. If no, the hypothesis is wrong — discard it (don't patch it) and form a new one from what you learned.
Why "one variable at a time" is non-negotiable
If you change input, code, and config simultaneously and the bug vanishes, the experiment has no signal: you cannot attribute the change. Worse, multi-change "fixes" routinely introduce new defects that hide behind the apparent success. Keep a clean control: a known-failing case you re-run after each change.
Rubber-duck and assumption auditing
Explain the failing path aloud, line by line, to an imaginary listener. The bug is usually hidden in a step you *assumed* was correct and therefore never checked. Make a list of your assumptions and verify the cheapest ones first:
- "This value is never null." → log it.
- "This branch always runs." → add a counter.
- "These two configs match." → diff them.
Confirmation before fixing
The most common mistake is editing the fix before confirming the hypothesis. Confirm first with a probe (log, assertion, debugger, unit test). Only then edit — and only the smallest surface at the **origin** of the bad state, not the place where it finally crashed.
Binary search of everything
When you can't reason your way to the cause, *search* for it. Halve the space repeatedly: comment out half the code, feed half the input, check the midpoint commit. See `bisection.md`. Each halving turns an N-step problem into log₂(N) steps — a 1,000-line search becomes ~10 checks.
Knowing when to stop
Stop and escalate (or write down what you need) when: you cannot reproduce after a bounded effort; the cause is in a third-party dependency you can't change; or two equally-likely hypotheses both survive testing and you need more instrumentation. Guessing past this point produces band-aids.
Read more
The Debugging Method — Hypothesis-Driven
Debugging is the scientific method applied to a misbehaving system. You don't "stare at code until you see it"; you run controlled experiments that each rule something in or out.
The loop
observe ──> hypothesize ──> predict ──> experiment ──> compare
^ │
└──────────────────── refine ─────────────────────────┘1. **Observe.** Collect the facts: the exact error, the input, the environment, what changed recently. Resist theorizing before you have the message in front of you. 2. **Hypothesize.** Propose one *falsifiable* cause: "The total is wrong because `applyDiscount` mutates the shared `cart` array." A good hypothesis predicts something you can check. 3. **Predict.** If the hypothesis is true, what must also be true? "Then logging `cart` before and after should show it changed." 4. **Experiment.** Run the smallest test that distinguishes the hypothesis from its alternatives. Change **one variable at a time**. 5. **Compare.** Did the prediction hold? If yes, you've localized the cause. If no, the hypothesis is wrong — discard it (don't patch it) and form a new one from what you learned.
Why "one variable at a time" is non-negotiable
If you change input, code, and config simultaneously and the bug vanishes, the experiment has no signal: you cannot attribute the change. Worse, multi-change "fixes" routinely introduce new defects that hide behind the apparent success. Keep a clean control: a known-failing case you re-run after each change.
Rubber-duck and assumption auditing
Explain the failing path aloud, line by line, to an imaginary listener. The bug is usually hidden in a step you *assumed* was correct and therefore never checked. Make a list of your assumptions and verify the cheapest ones first:
- "This value is never null." → log it.
- "This branch always runs." → add a counter.
- "These two configs match." → diff them.
Confirmation before fixing
The most common mistake is editing the fix before confirming the hypothesis. Confirm first with a probe (log, assertion, debugger, unit test). Only then edit — and only the smallest surface at the **origin** of the bad state, not the place where it finally crashed.
Binary search of everything
When you can't reason your way to the cause, *search* for it. Halve the space repeatedly: comment out half the code, feed half the input, check the midpoint commit. See `bisection.md`. Each halving turns an N-step problem into log₂(N) steps — a 1,000-line search becomes ~10 checks.
Knowing when to stop
Stop and escalate (or write down what you need) when: you cannot reproduce after a bounded effort; the cause is in a third-party dependency you can't change; or two equally-likely hypotheses both survive testing and you need more instrumentation. Guessing past this point produces band-aids.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Other agents on vanara-agents-skills.
- AGENT
Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing status codes, pagination, filtering, error envelopes, versioning, and idempotency. Produces a reviewable API contract plus an OpenAPI snippet, not
Open agent - review-notes
This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the contract-breakers first. Severity legend: **CRITICAL** (breaks clients / data risk), **HIGH** (real bug or inconsistency), **MEDIUM** (maintainability),
Open agent - contract-and-openapi
The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to structure that document and what `scripts/lint-openapi.mjs` enforces.
Open agent - design-checklist
Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting rules last. Every box is a place real APIs go wrong in production.
Open agent - versioning-and-evolution
APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add without breaking**, and version explicitly when you must break.
Open agent - pr-comment-template
Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.
Open agent

