test-first-bugfix

test-first-bugfix is a skill for Claude Code, Codex from The-Artificer-of-Ciphers-LLC/skills-from-the-artificer. It costs 138 tokens per session (3,690 once invoked), scanned A, original, MIT.

A bug-fixing method based on test-driven development, or TDD: first write a test that shows the failure, then change the code, then check that the test passes.

In plain words
What is it for?
Use it for reported bugs, errors, unexpected behavior, and regressions—changes that accidentally break something that previously worked.
Why use it?
It prevents fixes based only on guesses and leaves a check that can catch the same bug if it returns later.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it for reported bugs, errors, unexpected behavior, and regressions—changes that accidentally break something that previously worked.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix
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.

Any agent
npx skills add The-Artificer-of-Ciphers-LLC/skills-from-the-artificer --skill test-first-bugfix
Clone the repo
git clone --depth 1 https://github.com/The-Artificer-of-Ciphers-LLC/skills-from-the-artificer

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-first-bugfix

README.md
[![agentmods](https://agentmods.dev/badge/skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix/github.svg)](https://agentmods.dev/skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix)
Your own site
<a href="https://agentmods.dev/skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix"><img src="https://agentmods.dev/badge/skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-first-bugfix

Your own site · 80×15
<a href="https://agentmods.dev/skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix"><img src="https://agentmods.dev/badge/skills/the-artificer-of-ciphers-llc/skills-from-the-artificer/test-first-bugfix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,690 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00138 $0.03690
Opus 5 $0.00069 $0.01845
Sonnet 5 $0.00028 $0.00738
Haiku 4.5 $0.00014 $0.00369

Measured 12d ago against content hash 103fdf856d60, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

test-first-bugfix 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 12d 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.

test-first-bugfix/SKILL.md · 333 lines

How it starts

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

Test-First Bug Fixing

When a user reports a bug, the instinct is to jump straight to reading code and patching it. Resist that. A fix without a reproduction test is a guess — you can't prove it works, and you can't prevent the bug from coming back. This skill enforces a disciplined sequence: understand → reproduce → fix → prove.

The Sequence

1. Understand the Bug

Before touching any code, make sure you understand what's actually broken:

  • Ask clarifying questions if the report is ambiguous
  • Identify the expected behavior vs. actual behavior
  • Note any error messages, stack traces, or reproduction steps the user provided
  • Identify which part of the codebase is likely involved (but don't start fixing yet)

2. Study the Test Setup

Before writing the reproduction test, understand how this project tests things:

  • Find the existing test framework and configuration (look for jest.config, vitest.config, pytest.ini, Package.swift test targets, .test. / .spec. / _test. files, etc.)
  • Study 2-3 existing tests near the area of the bug to understand patterns, conventions, and helpers
  • Identify if you need mocks, fixtures, test databases, or other infrastructure
  • Check for test utilities, custom matchers, or shared setup that you should reuse

This matters because a test that doesn't follow project conventions is a test the team won't maintain.

3. Write the Reproduction Test

Write a test that fails right now because of the bug. This is the most important step.

Guidelines:

  • The test should be minimal — test exactly the broken behavior, nothing more
  • Name it descriptively so the bug is obvious from the test name (e.g., test_login_fails_when_email_has_plus_sign, not test_login_bug)
  • Place it in the appropriate test file following the project's conventions
  • If a relevant test file exists, add the test there; don't create a new file unless necessary
  • When writing tests, use beforeEach/afterEach (or before/after) for setup and cleanup instead of inline try/finally blocks. This keeps test bodies focused on assertions and ensures cleanup runs even if the test throws. For Node.js node:test, use describe with before/after or beforeEach/afterEach hooks.

Read the full file on GitHub · 333 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. 12d ago First seen · 333 lines · 138 tokens per session scan A 103fdf856d60

Subscribe to this mod's changes

test-first-bugfix is a skill published in the GitHub repository The-Artificer-of-Ciphers-LLC/skills-from-the-artificer (4 stars, last pushed 10d ago), licensed MIT. It adds 138 tokens to every session and 3,690 once invoked, about $0.0007 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.