diagnose

diagnose is a skill for Claude Code, Codex from MCKRUZ/claude-code-sdlc. It costs 62 tokens per session (444 once invoked), scanned A, original, MIT.

A bug-fixing procedure that first reproduces a problem with a test, then applies a minimal fix and checks that the test passes.

In plain words
What is it for?
Use it for reported bugs: create a failing test, find the cause, fix it, run related tests, and keep the test to prevent the bug returning.
Why use it?
It prevents guessed fixes by showing the bug before code changes and proving that it is gone afterward.

Skill for Claude CodeCodex

Part of the claude-code-sdlc plugin — 9 skills, 28 commands, 20 agents shipped together

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/mckruz/claude-code-sdlc/diagnose
Any agent
npx skills add MCKRUZ/claude-code-sdlc --skill diagnose
Clone the repo
git clone --depth 1 https://github.com/MCKRUZ/claude-code-sdlc

Made for: Claude Code, Codex.

Or install claude-code-sdlc, the plugin that ships this one along with the rest of its 9 skills, 28 commands, 20 agents.

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/mckruz/claude-code-sdlc/diagnose.svg)](https://agentmods.dev/skills/mckruz/claude-code-sdlc/diagnose)
Your own site
<a href="https://agentmods.dev/skills/mckruz/claude-code-sdlc/diagnose"><img src="https://agentmods.dev/badge/skills/mckruz/claude-code-sdlc/diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 444 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.00062 $0.00444
Opus 5 $0.00031 $0.00222
Sonnet 5 $0.00012 $0.00089
Haiku 4.5 $0.00006 $0.00044

Measured 4d ago against content hash d4a6a6d563ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.

harness/skills/diagnose/SKILL.md · 34 lines

What it actually says

Diagnose (bug-fix procedure)

A fix isn't done when the code changes — it's done when a test that failed because of the bug now passes. This procedure is mandatory for bug fixes; it makes the fix provable, not asserted.

Procedure

  1. Reproduce as a failing test FIRST. Write the smallest test that fails because of the bug, and watch it fail. Do not touch the production code yet. A bug you can't reproduce, you can't prove you fixed.
  2. Find the root cause. If it's obvious, name it. If it isn't, hand off to the debugger agent — it works in an isolated context, eliminates hypotheses, and returns the root cause + repro without burning your main context.
  3. Fix the cause, minimally. The smallest change that addresses the root cause — not the symptom, not a refactor the bug didn't require. If the real fix needs a gated path, stop and escalate (it's a new spec).
  4. Prove it. Run the failing test — it must now pass. Run the surrounding suite — nothing else went red. The Stop hook will block the turn on red tests anyway; beat it to the check.
  5. Guard against recurrence. Keep the reproducing test in the suite so the bug can't silently return; if the bug class is broad, add the obvious sibling cases.

Done when

  • A test existed that failed because of the bug, and now passes.
  • The fix is the minimal change at the root cause, inside the spec's bounds.
  • The full suite is green and the reproducing test is committed.
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. 4d ago First seen · 34 lines · 62 tokens per session scan A d4a6a6d563ec

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository MCKRUZ/claude-code-sdlc (4 stars, last pushed 6d ago), licensed MIT. It adds 62 tokens to every session and 444 once invoked, about $0.0003 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.