debug

A disciplined method for investigating bugs that are unclear, recurring, intermittent, or difficult to reproduce.

In plain words
What is it for?
Use it to debug crashes, flaky tests, unexplained behavior, and bugs that return after earlier fixes.
Why use it?
It requires a repeatable failing check before theories or fixes, helping distinguish the real cause from a temporary symptom.

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

Made for: Claude Code, Codex.

Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,462 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.00063 $0.01462
Opus 5 $0.00032 $0.00731
Sonnet 5 $0.00013 $0.00292
Haiku 4.5 $0.00006 $0.00146

Measured 2d ago against content hash 9576bbaec725, 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.

cheapest rung that gives you that: a failing test · a `curl` · a CLI invocation with a saved
skills/debug/SKILL.md · 89 lines

How it starts

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

MasterMind: Debug

Hard bugs are lost by guessing and patching symptoms. This is the disciplined loop that finds the actual cause. Bug: $ARGUMENTS. Grounded in ~/.mastermind/engineering/core/rigor.md and ~/.mastermind/engineering/core/agent-loop.md.

The cardinal rule: understand the mechanism before you change a line. A fix you can't explain is a coincidence, not a fix.

The six phases

  1. Build the feedback loop. This phase is the skill: the rest is mechanical once it exists.

    You need one command you have already run at least once, whose invocation and output you can paste. It has to be red-capable (it fails right now, because of this bug), deterministic, fast enough to run repeatedly, and runnable by you without a human driving a UI. Reach for the cheapest rung that gives you that: a failing test · a curl · a CLI invocation with a saved snapshot · a headless browser script · a replayed captured request · a throwaway harness · a property/fuzz loop · a bisection harness · a differential run against a known-good version.

    No red-capable command, no phase 2. If you catch yourself reading code to build a theory before that command exists, stop and go build it, theorising over a bug you cannot trigger is the single most expensive habit in debugging. This same command is your definition of "fixed." If it still won't reproduce after honest effort: stop: a bug you can't reproduce earns a fix only once it does, and never claim it's fixed. Ship instrumentation instead (logging/assertions at the suspect boundaries) so the next occurrence is diagnosable, state explicitly what you ruled out and how, and hand back with that evidence. "I couldn't reproduce it" is the honest answer, and usually a faster route to the real cause than three speculative patches.

  2. Localize. Bisect the space: git bisect across commits, binary-search the code path, add instrumentation/logs at boundaries. Read the actual code and the actual data/state at the failure point rather than theorizing from memory. Narrow to the smallest region that still reproduces.

Read the full file on GitHub · 89 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 89 lines · 0 tokens per session scan A 9576bbaec725

Subscribe to this mod's changes

debug is a skill published in the GitHub repository mehrad-dm/mastermind (24 stars, last pushed 2d ago), licensed MIT. It adds 63 tokens to every session and 1,462 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

docker-extend

Use when: User wants to extend Docker with custom tools, personalize the Docker environment, or set up user-specific Docker customization. Triggers: 'extend docker', 'docker-extend', 'add tools to docker', 'customize docker', 'add my tools to the container', 'personalize docker setup', 'docker user setup', 'install…

coleam00/Archon · 118 tokens

write-zot-themes

Help the user create, install, or package zot themes, including theme-only extensions.

patriceckhart/zot · 23 tokens

database-migrations

Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate). Use when planning or implementing database schema changes.

mturac/everything-openai-codex · 61 tokens

python-patterns

Python-specific design patterns and best practices including protocols, dataclasses, context managers, decorators, async/await, type hints, and package organization. Use when working with Python code to apply Pythonic patterns.

mturac/everything-openai-codex · 45 tokens

python-testing

Python testing best practices using pytest including fixtures, parametrization, mocking, coverage analysis, async testing, and test organization. Use when writing or improving Python tests.

mturac/everything-openai-codex · 35 tokens

docker-patterns

Docker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration. Use when setting up containerized development environments or reviewing Docker configurations.

mturac/everything-openai-codex · 40 tokens