test-driven-fix

test-driven-fix is a skill for Claude Code, Codex from abdullah1854/MCPGateway. It costs 65 tokens per session (1,610 once invoked), scanned A, original, MIT.

A test-first bug-fixing process that reproduces a problem with a failing automated test, then guides the fix until the tests pass.

In plain words
What is it for?
Use it to fix bugs in projects with automated tests, verify each change, and run the full test suite after the fix.
Why use it?
It reduces guesswork and helps show that the fix addresses the actual bug without breaking existing behavior.

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/abdullah1854/mcpgateway/test-driven-fix
Any agent
npx skills add abdullah1854/MCPGateway --skill test-driven-fix
Clone the repo
git clone --depth 1 https://github.com/abdullah1854/MCPGateway

Made for: Claude Code, Codex.

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 test-driven-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/abdullah1854/mcpgateway/test-driven-fix.svg)](https://agentmods.dev/skills/abdullah1854/mcpgateway/test-driven-fix)
Your own site
<a href="https://agentmods.dev/skills/abdullah1854/mcpgateway/test-driven-fix"><img src="https://agentmods.dev/badge/skills/abdullah1854/mcpgateway/test-driven-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,610 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.00065 $0.01610
Opus 5 $0.00032 $0.00805
Sonnet 5 $0.00013 $0.00322
Haiku 4.5 $0.00006 $0.00161

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

Security

Grade A, and why

test-driven-fix 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 5d 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/skills/test-driven-fix/SKILL.md · 188 lines

How it starts

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

Test-Driven Fix Protocol

When This Skill Activates

  • "Write a test first", "fix with TDD", "test-driven fix"
  • "Reproduce with a test", "make the tests pass"
  • Bug fixes where a test suite already exists
  • Iterative fix cycles where verification is automated
  • After 2+ failed fix attempts on the same bug (escalation)

Anti-Hallucination Rules (NEVER violate)

Rule Description
TEST MUST FAIL FIRST Never skip the "reproduce" step. The test MUST fail before you fix anything, proving it captures the bug
MINIMAL FIX ONLY Fix the bug, not the neighborhood. Don't refactor, don't add features, don't "improve" surrounding code
NO BLIND RETRIES If a fix doesn't work, DIAGNOSE why before trying again. Never retry the same approach
EVIDENCE AT EVERY STEP Show test output at each phase. User should see: failing test → diagnosis → fix → passing test
FULL SUITE AFTER FIX After your fix passes the targeted test, run the FULL test suite. No regressions allowed
3-ATTEMPT LIMIT If 3 fix attempts fail, STOP and escalate to the user with findings so far

The Loop: REPRODUCE → DIAGNOSE → FIX → VALIDATE

Phase 1: REPRODUCE (Write or Identify Failing Test)

If tests already exist:

# Run existing tests to identify failures
npm test          # or: bun test, pytest, cargo test, etc.

# Isolate the specific failing test
npm test -- --grep "test name"

If no test captures the bug, write one:

// The test MUST:
// 1. Set up the exact conditions that trigger the bug
// 2. Assert the EXPECTED behavior (what should happen)
// 3. FAIL with the current code (proving it catches the bug)

describe('BugDescription', () => {
  it('should [expected behavior] when [condition]', () => {
    // Arrange: set up the bug conditions
    const input = /* exact input that triggers the bug */;

    // Act: run the code
    const result = functionUnderTest(input);

    // Assert: what SHOULD happen (this will fail now)
    expect(result).toBe(expectedValue);
  });
});

Read the full file on GitHub · 188 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. 5d ago First seen · 188 lines · 65 tokens per session scan A c189debf2611

Subscribe to this mod's changes

test-driven-fix is a skill published in the GitHub repository abdullah1854/MCPGateway (15 stars, last pushed 2mo ago), licensed MIT. It adds 65 tokens to every session and 1,610 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-30.