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.
npx agentmods add skills/abdullah1854/mcpgateway/test-driven-fixnpx skills add abdullah1854/MCPGateway --skill test-driven-fixgit clone --depth 1 https://github.com/abdullah1854/MCPGatewayWrote 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.
[](https://agentmods.dev/skills/abdullah1854/mcpgateway/test-driven-fix)<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>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.
| Model | Per session | Once 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 |
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.
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);
});
});
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.
- 5d ago First seen · 188 lines · 65 tokens per session scan A c189debf2611
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.
Other skills, from other repositories
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.
rust-testing
Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.
tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
contract
Outcome-driven Cortex function development — declares a behavioral contract before generation begins, enforces evidence-tiered proof before $ship, and defends against the self-oracle evaluation failure mode.
sdk
The hard rules for editing @kortix/sdk (packages/sdk) — a PUBLISHED npm package with constraints no other package in this repo has: TDD is mandatory (failing test first, gates run and pasted every turn, explicit shippable YES/NO/NOT YET); exported names INCLUDING types are a public API contract and renaming one is a…
blast-radius
Trace ServiceNow configuration dependencies — what artifacts touch a given field, what calls a script include, table/app-level config inventory. Use before deletes, renames, or refactors.