test-first-bugs

test-first-bugs is a skill for Claude Code, Codex from jamditis/claude-skills-journalism. It costs 35 tokens per session (1,427 once invoked), scanned A, original, MIT.

A test-first workflow for fixing software bugs. It requires writing a failing automated test that shows the problem before changing the code.

In plain words
What is it for?
Use it when code fails, shows an error, or a user reports a bug. It covers reproducing the problem, trying fixes, and running the affected test and full test suite.
Why use it?
It helps prevent a fix from breaking again and provides clear evidence that the bug is resolved.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: mentions subagents.

Part of the dev-toolkit plugin — 13 skills shipped together

Good fit Use it when code fails, shows an error, or a user reports a bug. It covers reproducing the problem, trying fixes, and running the affected test and full test suite.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamditis/claude-skills-journalism/test-first-bugs
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 jamditis/claude-skills-journalism --skill test-first-bugs
Clone the repo
git clone --depth 1 https://github.com/jamditis/claude-skills-journalism

Made for: Claude Code, Codex.

Or install dev-toolkit, the plugin that ships this one along with the rest of its 13 skills.

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-bugs

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamditis/claude-skills-journalism/test-first-bugs/github.svg)](https://agentmods.dev/skills/jamditis/claude-skills-journalism/test-first-bugs)
Your own site
<a href="https://agentmods.dev/skills/jamditis/claude-skills-journalism/test-first-bugs"><img src="https://agentmods.dev/badge/skills/jamditis/claude-skills-journalism/test-first-bugs/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-bugs

Your own site · 80×15
<a href="https://agentmods.dev/skills/jamditis/claude-skills-journalism/test-first-bugs"><img src="https://agentmods.dev/badge/skills/jamditis/claude-skills-journalism/test-first-bugs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00035 $0.01427
Opus 5 $0.00017 $0.00714
Sonnet 5 $0.00007 $0.00285
Haiku 4.5 $0.00003 $0.00143

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

Security

Grade A, and why

test-first-bugs 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 10d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (examples/js-bug-test.js, examples/python-bug-test.py, scripts/find-tests.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

dev-toolkit/skills/test-first-bugs/SKILL.md · 227 lines

How it starts

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

Test-first bug fixing

Enforce a disciplined bug-fixing workflow that prevents regression and parallelizes fix attempts.

Core workflow

When a bug is reported, follow these steps in order:

Phase 1: Reproduce and document

  1. Understand the bug, Gather details about expected vs actual behavior
  2. Identify the test location, Determine where tests live in the project (check for tests/, __tests__/, spec/, *.test.*, *.spec.* patterns)
  3. Write a failing test, Create a test that demonstrates the bug

Phase 2: Fix with subagents

  1. Launch fix subagents, Use the Task tool with subagent_type=general-purpose to attempt fixes
  2. Run the test, Verify the fix by running the specific test
  3. Iterate if needed, If test still fails, launch additional subagents with new approaches

Phase 3: Verify and complete

  1. Run full test suite, Ensure no regressions were introduced
  2. Report success, Confirm the bug is fixed with passing test as proof

Writing the failing test

Test naming convention

Name the test to describe the bug:

# Python (pytest)
def test_user_login_fails_when_email_has_uppercase():
    ...

# Python (unittest)
def test_should_handle_empty_input_without_crashing(self):
    ...
// JavaScript (Jest/Vitest)
it('should not crash when input array is empty', () => { ... });
test('handles special characters in username', () => { ... });
// TypeScript
describe('UserService', () => {
  it('returns null when user not found instead of throwing', () => { ... });
});

Test structure

Every bug reproduction test follows this pattern:

def test_bug_description():
    # 1. ARRANGE - Set up the conditions that trigger the bug
    input_data = create_problematic_input()

    # 2. ACT - Perform the action that causes the bug
    result = function_under_test(input_data)

    # 3. ASSERT - Verify the expected (correct) behavior
    assert result == expected_value  # This should FAIL initially

Read the full file on GitHub · 227 lines

Files

What ships with it

6 files 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. 10d ago First seen · 227 lines · 35 tokens per session scan A 078ad06bf0d4

Subscribe to this mod's changes

test-first-bugs is a skill published in the GitHub repository jamditis/claude-skills-journalism (389 stars, last pushed 3d ago), licensed MIT. It adds 35 tokens to every session and 1,427 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-30.

Related

Other skills, from other repositories

lsp-refactoring

Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification. Use for safe, large-scale refactoring with precision.

ArabelaTso/Skills-4-SE · 46 tokens

vibe-slice-migrator

Progressively migrates legacy prototype routes and features to a clean architecture layer slice-by-slice, verifying them against characterization tests, running purity/drift checks, and executing completion certifications.

richfrem/agent-plugins-skills · 44 tokens

fixing-bugs

Fix a bug using strict TDD — UNDERSTAND → REPRODUCE (RED) → VERIFY RED → FIX → VERIFY GREEN → VALIDATE → REFACTOR. Use when the user reports a bug, asks to fix something, mentions a Sentry/error/regression, or pastes a stack trace. Bugs require a failing test that proves the bug existed before any code change. For…

Cristhianzl/claude-skills-czl · 105 tokens

triage-issue

Invoked helper skill for deep bug diagnosis, usually delegated from /qa when a reported issue needs root-cause analysis and a TDD fix plan before implementation. Use when the cause is unclear, the bug is a regression, or the user explicitly wants diagnosis. Not for lightweight QA intake (use /qa) or already-clear…

chrislacey89/skills · 77 tokens

self-correcting-loop

Use when generated or modified ABAP code has syntax errors, ATC findings, test failures, or activation issues. Runs an iterative fix-check-fix loop until the code is clean, tested, and activated. Equivalent to a persistent development TDD cycle.

vigneshbarani24/sap-superpowers · 57 tokens

test-first-bugfix

Test-driven bug fixing — reproduce before you fix. Use this skill whenever the user reports a bug, describes unexpected behavior, says something is broken, mentions a regression, or asks you to fix an error. This includes phrases like "this is broken", "X doesn't work", "there's a bug in", "getting an error when", "it…

The-Artificer-of-Ciphers-LLC/skills-from-the-artificer · 138 tokens