debug

A structured debugging workflow for reproducing, isolating, diagnosing, and fixing software bugs. It can use Draft project context and code-relationship helpers when available.

In plain words
What is it for?
Investigating bugs, tracing affected modules and callers, identifying root causes, and implementing fixes.
Why use it?
It replaces guesswork with a documented investigation of where a bug occurs and why.

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/drafthq/draft/debug
Any agent
npx skills add drafthq/draft --skill debug
Clone the repo
git clone --depth 1 https://github.com/drafthq/draft

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,640 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00038 $0.02640
Opus 5 $0.00019 $0.01320
Sonnet 5 $0.00008 $0.00528
Haiku 4.5 $0.00004 $0.00264

Measured 2d ago against content hash e36cbaaf4bf7, 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 1 finding 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 2d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

3. Use `curl`/`wget` to fetch any URLs mentioned (dashboards, error pages, API responses)
skills/debug/SKILL.md · 223 lines

How it starts

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

Debug

You are conducting a structured debugging session following systematic investigation methodology.

MANDATORY GRAPH LOOKUP (read before Isolate/Diagnose)

First resolve the bundled helpers:

# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
# is not exported into skill Bash). See core/shared/tool-resolver.md.
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"

When draft/graph/schema.yaml exists, this skill must follow the graph-first lookup contract in core/shared/graph-query.md §Mandatory Lookup Contract. During Steps 3–4 (Isolate, Diagnose):

  1. Locate the suspect file's module via "$DRAFT_TOOLS/graph-arch.sh" --repo . before tracing data flow.
  2. Use "$DRAFT_TOOLS/graph-callers.sh" --repo . --symbol <fn> to enumerate call sites of suspect functions — not grep.
  3. Use "$DRAFT_TOOLS/graph-impact.sh" --repo . --file <path> to size the blast radius before proposing a fix.
  4. Run "$DRAFT_TOOLS/hotspot-rank.sh" --repo . to know whether the file is high-fanIn (any fix needs extra caution).

Filesystem grep is reserved for source-text scans (literal error strings, stack-trace symbols when the graph misses). Use the fallback sentence on graph miss.

Red Flags — STOP if you're

See shared red flags — applies to all code-touching skills.

Skill-specific:

  • Making code changes before reproducing the bug
  • Guessing at the cause instead of tracing data/control flow
  • Trying multiple fixes simultaneously ("shotgun debugging")
  • Skipping reproduction steps because "I think I know the issue"
  • Writing tests without asking the developer first (bug/RCA contexts)

Read the full file on GitHub · 223 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. 2d ago First seen · 223 lines · 38 tokens per session scan A e36cbaaf4bf7

Subscribe to this mod's changes

debug is a skill published in the GitHub repository drafthq/draft (40 stars, last pushed 13d ago), licensed MIT. It adds 38 tokens to every session and 2,640 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.