test-first

test-first is a skill for Claude Code, Codex from white1024/agent-nextup. It costs 56 tokens per session (849 once invoked), scanned A, original, MIT.

A test-first development method that writes a failing behaviour test before the code, then makes it pass in small steps. TDD means test-driven development: using tests to guide implementation.

In plain words
What is it for?
Use it when adding a feature or fixing a reproducible bug. It helps choose test boundaries and build one tested behaviour slice at a time.
Why use it?
It catches misunderstandings and regressions while the change is being built, rather than only after the code is finished. Testing at public boundaries also keeps tests useful when internal code changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding a feature or fixing a reproducible bug. It helps choose test boundaries and build one tested behaviour slice at a time.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/white1024/agent-nextup/test-first"><img src="https://agentmods.dev/badge/skills/white1024/agent-nextup/test-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 849 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.00056 $0.00849
Opus 5.5 $0.00022 $0.00340
Sonnet 5.5 $0.00011 $0.00170
Haiku 4.5 $0.00006 $0.00085

Measured 4d ago against content hash 0c5f9bcde776, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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

crates/nextup-core/skills/test-first/SKILL.md · 68 lines

How it starts

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

test-first — red, then green, one slice at a time

Goal: every behaviour this task adds is pinned by a test that was seen failing first, at a seam that survives the internals being rewritten.

Read the task before writing anything: its description says what it delivers and how anyone will know it works. That "how" is your first test.

1. Agree the seams

A seam is a public boundary where behaviour can be observed without reaching inside — a function's interface, an endpoint, a command's output. Tests live at seams.

  • Propose the seams for this task. Prefer ones that already exist, and the highest one that still exercises the behaviour; fewer is better.
  • Give each a line on what a test there catches and what it misses.
  • Confirm them with the human before the first test is written.

Done when the seams are agreed.

2. Loop: one slice per cycle

  1. Red: write one test for the next piece of behaviour, run it, and watch it fail for the reason you expect. A test that has never failed has never proved anything. If you forced the red by changing code or a fixture, compare against the untouched copy to prove the change landed before you trust the red.
  2. Green: write only enough code to pass it. Run that test file and the type checker.
  3. Take the next slice. Each test answers what the last cycle taught you — tracer bullets, not a batch written up front.

Run the full suite once at the end.

3. What makes a test worth keeping

  • Through the interface: it calls what a caller calls and asserts what a caller sees, so it keeps passing when the internals are rewritten.
  • Independent expected values: a known literal, a worked example, the spec — never a value recomputed the way the code computes it.
  • Mocks only at system boundaries: external services, time, randomness. Your own modules run for real.
  • Named for the capability: "a user can export a report as CSV", rather than the function it happens to call.

Refactoring belongs to review, once the suite is green.

Read the full file on GitHub · 68 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. 4d ago First seen · 68 lines · 56 tokens per session scan A 0c5f9bcde776

Subscribe to this mod's changes

test-first is a skill published in the GitHub repository white1024/agent-nextup (2 stars, last pushed 5d ago), licensed MIT. It adds 56 tokens to every session and 849 once invoked, about $0.0002 per session on Opus 5.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-10-19.

Related

Other skills, from other repositories

bad-case-to-dpo

A guide to turning failed production agent runs into training and evaluation data. It explains how to find the first mistake, create preference examples for DPO (Direct Preference Optimization), and check that a fix does not damage other tasks.

bojieli/ai-agent-book · 168 tokens

tdd

Test-driven development with red-green-refactor loops around vertical slices (tracer bullets), not horizontal layers. Use when asked to "use TDD", "write test-first", "red-green-refactor", "build this with tests", or when a feature has a clear observable contract. The discipline complement to the test/add-tests skills…

open-gsd/gsd-pi · 73 tokens

building

Use when writing production code test-first: the RED-GREEN-REFACTOR cycle, false-RED detection, vertical slicing, scope escalation, test process discipline, and code generation patterns.

romiluz13/cc10x · 43 tokens

08-debug

Reproduce and fix a known bug, or find an unknown root cause by hypothesis validation. Use when the user wants to fix a bug, find why something breaks, or reopen a stuck investigation. Not for building a feature or reviewing a diff.

ai-driven-dev/framework · 52 tokens

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code. Enforces red-green-refactor cycle with strict rules.

peintune/runjam · 29 tokens

spec-as-source

Use when a user or project explicitly adopts OpenSpec spec-as-source, fenced Gherkin specifications as executable acceptance tests, or acceptance-test-first OpenSpec tasks.

intent-driven-dev/intent-driven-template · 36 tokens