debug

A step-by-step method for finding the root cause of software problems across different kinds of codebases.

In plain words
What is it for?
Use it for bugs, crashes, hangs, slow or flaky behaviour, memory problems, regressions, and failures that happen only in CI or production.
Why use it?
It prevents changing code based only on a symptom or guess. Reproducing the problem and changing one thing at a time provides evidence for the diagnosis.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ujjwal502/debugduck/debug
Any agent
npx skills add ujjwal502/debugduck --skill debug
Clone the repo
git clone --depth 1 https://github.com/ujjwal502/debugduck

Made for: Claude Code, Codex.

Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,718 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00142 $0.03718
Opus 5 $0.00071 $0.01859
Sonnet 5 $0.00028 $0.00744
Haiku 4.5 $0.00014 $0.00372

Measured yesterday against content hash 862abbded831, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/debug/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Debug

A debugging procedure that works the same way in every codebase, because it operates on evidence and search space, not on framework trivia.

The failure mode this exists to prevent: reading a symptom, pattern-matching a plausible cause, editing code, and declaring victory. That produces fixes that don't hold, fixes for bugs that were never there, and three new bugs. Follow the phases.

If the user asks you to "add logs", "instrument this", "trace the flow", or "put console.log everywhere from A to Z" — go straight to references/trace-first.md and follow that protocol. It is phase 3 of this procedure done properly: map the path, predict every checkpoint, instrument in one pass, then stop and wait for the output instead of guessing a fix.


Prime directives

  1. Reproduce before you diagnose. Diagnose before you fix. No repro means no feedback signal, and every subsequent step is guesswork wearing a lab coat.
  2. The bug is where the evidence points, not where it would be convenient. Your intuition is a hypothesis generator, never a conclusion.
  3. One variable at a time. Change one thing, observe, record. Simultaneous changes destroy causality — if it starts working you won't know why, which is barely better than broken.
  4. Binary search beats reading. Halve the search space — in code, in git history, in the input, in the config, in the timeline. Ten halvings cover a thousand candidates.
  5. A root cause explains 100% of the observed evidence. If your theory doesn't explain every detail — including the weird ones you'd rather ignore — it is incomplete, not close.
  6. Prove the fix by toggling it. Revert the fix, watch the bug return; reapply it, watch it go. Anything less and you may have fixed nothing, or fixed it by accident.
  7. Never suppress a symptom you don't understand. Empty catch blocks, try/except: pass, retries, ?. chains, timeout bumps, and # type: ignore are how a small bug becomes a silent one that resurfaces later, further from its cause.
  8. State what you know vs. what you assume. Label every claim [observed], [inferred], or [assumed]. Most long debugging sessions are one unexamined [assumed] wearing an [observed] badge.

Read the full file on GitHub · 277 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 277 lines · 142 tokens per session scan A 862abbded831

Subscribe to this mod's changes

debug is a skill published in the GitHub repository ujjwal502/debugduck (4 stars, last pushed 24d ago), licensed MIT. It adds 142 tokens to every session and 3,718 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

test-driven-development

Drives development with tests. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.

addyosmani/agent-skills · 50 tokens

ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

addyosmani/agent-skills · 45 tokens

documentation-and-adrs

Records decisions and documentation. Use when making architectural decisions, changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

addyosmani/agent-skills · 43 tokens

idea-refine

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or…

addyosmani/agent-skills · 75 tokens

source-driven-development

Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.

addyosmani/agent-skills · 40 tokens

chinese-git-workflow

国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 69 tokens