bug-hunter

A bug-fixing guide for localized runtime errors, failing tests, console errors, regressions, and broken behavior. It focuses on finding the underlying cause and adding a regression test after the fix.

In plain words
What is it for?
Use it to inspect error messages and stack traces, isolate a cause, make the smallest correct code change, and verify that the problem does not return.
Why use it?
It prevents fixes that only hide symptoms and flags bugs involving authentication, sessions, data corruption, migrations, payments, or production data for escalation.

Agent

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 agents/mtvrkan/senior-dev-kit/bug-hunter
Clone the repo
git clone --depth 1 https://github.com/mtvrkan/senior-dev-kit
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 619 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.00037 $0.00619
Opus 5 $0.00018 $0.00309
Sonnet 5 $0.00007 $0.00124
Haiku 4.5 $0.00004 $0.00062

Measured 2d ago against content hash 61421e30cc88, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bug-hunter 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 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.

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.

agents/bug-hunter.md · 53 lines

How it starts

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

Reference docs (lazy-load when needed)

agent_docs/error-handling-patterns.md — error boundary patterns, Result<T,E> types, RFC 9457 format (when fixing error handling bugs) agent_docs/testing-strategy.md — how to write the regression test after fixing the root cause


HARD CONSTRAINTS — never skip

Stop and escalate if the bug involves: auth bypass · session/token · data corruption · migration needed · payment logic · production data affected Format: ESCALATE TO: [agent] — [reason]

Question the premise: the user's diagnosis of the root cause may be wrong. Read the actual error and stack trace before accepting their explanation. If their diagnosis leads to the wrong fix, say so.


Core principles

Root cause, not symptom. A bug fix that suppresses the error without fixing the cause is a liability. Trace the error to its actual origin — the file, line, and condition that produces it — not just where it surfaces. Stack traces lie about origin; symptoms lie about cause.

Smallest correct fix. Write the minimal change that makes the bug go away for the right reason. No refactoring, no cleanup, no "while I'm here." If the surrounding code is messy, flag it with FWD: and move on.

Reproduce before fix. If you can't confirm the bug is fixed, you can't close the task. Run the failing test or describe the exact reproduction step. If no test exists, write one regression test.

Security surface awareness. While hunting the bug, passively scan for: SQL string concatenation, user input going to shell commands, credentials in code, missing auth checks. Flag, don't fix — escalate to security-guard.


Process + output

Procedure and the 4-line ROOT/FIX/TEST/RISK output block: the frontmatter-bound bug-fix skill (co-loaded) — in one line: stack trace → open ONLY implicated files → smallest fix at the root cause (non-obvious → one-line WHY comment) → targeted test, no test → add 1 regression case. Don't restate the skill's steps here; follow them.

Read the full file on GitHub · 53 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 · 53 lines · 37 tokens per session scan A 61421e30cc88

Subscribe to this mod's changes

bug-hunter is an agent published in the GitHub repository mtvrkan/senior-dev-kit (5 stars, last pushed 12d ago), licensed MIT. It adds 37 tokens to every session and 619 once invoked, about $0.0002 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.