diagnose

diagnose is a skill for Claude Code from datit309/supergraph. It costs 59 tokens per session (995 once invoked), scanned A, original, MIT.

A structured debugging skill that investigates an unknown cause through six phases: reproduce the problem, test ranked explanations, make a focused fix, and add a regression test. Regression tests are checks that prevent a fixed bug from returning.

In plain words
What is it for?
Use it when a bug exists, tests fail unexpectedly, or software behaves incorrectly and the cause is unclear.
Why use it?
It replaces guess-and-check changes with a repeatable feedback loop and evidence-based diagnosis.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the supergraph plugin — 44 skills, 7 agents, 6 hooks, 1 plugin shipped together

Good fit Use it when a bug exists, tests fail unexpectedly, or software behaves incorrectly and the cause is unclear.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/datit309/supergraph/diagnose
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.

Any agent
npx skills add datit309/supergraph --skill diagnose
Clone the repo
git clone --depth 1 https://github.com/datit309/supergraph

Made for: Claude Code.

Or install supergraph, the plugin that ships this one along with the rest of its 44 skills, 7 agents, 6 hooks, 1 plugin.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/datit309/supergraph/diagnose/github.svg)](https://agentmods.dev/skills/datit309/supergraph/diagnose)
Your own site
<a href="https://agentmods.dev/skills/datit309/supergraph/diagnose"><img src="https://agentmods.dev/badge/skills/datit309/supergraph/diagnose/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagnose

Your own site · 80×15
<a href="https://agentmods.dev/skills/datit309/supergraph/diagnose"><img src="https://agentmods.dev/badge/skills/datit309/supergraph/diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 995 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00059 $0.00995
Opus 5.5 $0.00024 $0.00398
Sonnet 5.5 $0.00012 $0.00199
Haiku 4.5 $0.00006 $0.00100

Measured 3mo ago against content hash 9955c4191ef0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diagnose 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 3mo 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.

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.

plugins/supergraph/skills/diagnose/SKILL.md · 126 lines

How it starts

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

/supergraph:diagnose

Systematic debugging. Never guess and patch — build a feedback loop, prove the hypothesis, fix once.

Announce: "🐛 /supergraph:diagnose — building feedback loop..."

Setup

Read .supergraph-env for test/lint commands (if exists):

[ -f .supergraph-env ] && source .supergraph-env

This sets $TEST_CMD, $FOCUSED_TEST_CMD, $LINT_CMD. If absent, detect from project config (package.json → jest/vitest, pubspec.yaml → flutter test, etc.) same as /supergraph:scan.

Phases

Phase 1 — Build Feedback Loop

Before touching any code, establish a fast, deterministic way to observe the bug.

# Identify the smallest command that shows the failure
$TEST_CMD --grep "<failing test name>"   # focused test run
# or
<minimal repro command>

Goal: failure visible in < 5 seconds. If not, slim down the repro. Do NOT skip this phase. Debugging without a feedback loop is guessing.

Phase 2 — Reproduce Cleanly

  • Run the feedback loop 3 times — confirm it fails consistently
  • Capture exact error output, stack trace, exit code
  • Note any flakiness → treat as separate bug before continuing
  • Add a failing regression test if one doesn't exist:
    test("<bug description>", () => { ... }) // RED
    

Phase 3 — Hypothesize (3-5 ranked theories)

List falsifiable hypotheses, ordered most-to-least likely:

1. [Most likely] — [reason] — [how to falsify]
2. [Second]      — [reason] — [how to falsify]
3. [Third]       — [reason] — [how to falsify]

Rules:

  • Each hypothesis must be falsifiable (observable test to disprove it)
  • No implementation yet — only theories
  • Use graph context if available:
    search_graph(project=CBM_PROJECT, name_pattern=<suspect>)
    trace_path(project=CBM_PROJECT, direction="inbound")
    trace_path(project=CBM_PROJECT, direction="outbound")
    

Phase 4 — Instrument (one variable at a time)

Test hypothesis #1 first. Change ONE thing to observe ONE signal:

  • Add targeted log/assertion near the suspect code
  • Run feedback loop → confirm or refute
  • Remove instrumentation after each test — never accumulate debug logs
  • If refuted → move to hypothesis #2
  • Stop when hypothesis is confirmed

Read the full file on GitHub · 126 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. 3mo ago First seen · 126 lines · 59 tokens per session scan A 9955c4191ef0

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository datit309/supergraph (23 stars, last pushed 8d ago), licensed MIT. It adds 59 tokens to every session and 995 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

diagnose compared with skills from other repositories

diagnose next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
diagnosedatit309/supergraphSkill238d agoMITA59Claude Code
bug-fixkardebadas/claude-pluginSkill316d agoApache-2.0A74Claude Code
bug-investigatekardebadas/claude-pluginSkill316d agoApache-2.0A83Claude Code
diagnose-projectgaelic-ghost/socketSkill113mo agoApache-2.0A39Claude Code
xcode-build-run-workflowgaelic-ghost/socketSkill113mo agoApache-2.0A67Claude Code, Codex
xcode-debugger-mcp-workflowgaelic-ghost/socketSkill113mo agoApache-2.0A70Claude Code, Codex
safari-mcp-workflowgaelic-ghost/socketSkill113mo agoApache-2.0A48Claude Code, Codex