test-first

test-first is a skill for Claude Code from claude-world/director-mode-lite. It costs 42 tokens per session (452 once invoked), scanned A, original, MIT.

A test-first development workflow called Test-Driven Development (TDD): write a failing test, add the smallest code that passes, then clean up the code.

In plain words
What is it for?
Use it when adding a feature or fixing behavior that should be driven by tests. It guides the Red-Green-Refactor cycle one small change at a time.
Why use it?
It makes the expected behavior explicit before implementation and helps catch normal, edge-case, and invalid-input problems during development.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the director-mode-lite plugin — 36 skills, 14 agents shipped together

Good fit Use it when adding a feature or fixing behavior that should be driven by tests. It guides the Red-Green-Refactor cycle one small change at a time.

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

Made for: Claude Code.

Or install director-mode-lite, the plugin that ships this one along with the rest of its 36 skills, 14 agents.

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/claude-world/director-mode-lite/test-first.svg)](https://agentmods.dev/skills/claude-world/director-mode-lite/test-first)
Your own site
<a href="https://agentmods.dev/skills/claude-world/director-mode-lite/test-first"><img src="https://agentmods.dev/badge/skills/claude-world/director-mode-lite/test-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 452 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.00042 $0.00452
Opus 5 $0.00021 $0.00226
Sonnet 5 $0.00008 $0.00090
Haiku 4.5 $0.00004 $0.00045

Measured 8d ago against content hash f31bb149e0bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 8d 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.

skills/test-first/SKILL.md · 85 lines

What it actually says

Test-Driven Development

Implement TDD for: $ARGUMENTS

Quick Steps

  1. Write a failing test
  2. Run test, confirm failure
  3. Write minimal code to pass
  4. Refactor while keeping tests green
  5. Repeat

Red Phase - Write Failing Test

Test Design Principles

  • Test one specific behavior
  • Test name describes expected result
  • Test should fail (feature doesn't exist yet)

Must Test

  • Normal case
  • Edge cases
  • Error cases
  • Invalid input

Example

// auth/login.test.ts
it('should return JWT token for valid credentials', async () => {
  const res = await request(app)
    .post('/auth/login')
    .send({ email: '[email protected]', password: 'password123' })

  expect(res.status).toBe(200)
  expect(res.body.token).toBeDefined()
})

Green Phase - Minimal Implementation

Implementation Principles

  • Write ONLY enough code to pass the test
  • Don't optimize yet
  • Don't worry about elegance
  • Just make it work

Refactor Phase - Clean Up

Refactoring Checklist

  • Is there code duplication?
  • Are variable names clear?
  • Are functions too long?
  • Is the logic too complex?

Refactoring Rules

  • Keep tests passing
  • Change one thing at a time
  • Run tests frequently

Test Quality Checklist

  • Unit tests cover core logic
  • Integration tests cover interactions
  • Test names clearly describe intent
  • Tests are independent and repeatable
  • Tests run fast (unit tests < 100ms)
  • Edge cases are covered

Follow TDD strictly. No shortcuts.

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. 8d ago First seen · 85 lines · 42 tokens per session scan A f31bb149e0bd

Subscribe to this mod's changes

test-first is a skill published in the GitHub repository claude-world/director-mode-lite (81 stars, last pushed 7d ago), licensed MIT. It adds 42 tokens to every session and 452 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

ctrl-c-v-tdd

Test-pattern doctrine. Tests are copyable from /.claude/patterns/tests/, three categories: input boundary, contract, effect. Make sure to consult this skill whenever code changes touch a boundary where someone else's code meets yours, even if the user doesn't say "test" or "TDD" — Claude tends to ship untested…

Huangleyang125207/ctrl-c-v-code-skills · 371 tokens

linked-intent-dev

Guide for linked-intent development (LID). Consult for ALL code changes. Walks changes through a mode-aware six-phase workflow (HLD → LLD → EARS → intent-narrowing edge audit → tests-first → code) with mandatory stops between each phase. Bugs walk the arrow like any other change — no short-circuit. Enforces cascade…

jszmajda/lid · 87 tokens

mutation-campaign-configuration

Use when the user mentions mewt, muton, or mutation testing and asks to initialize, scope, estimate, configure, validate, or optimize a campaign before execution. Writes only the TOML config and validates readiness without generating mutants or touching source. Not for running the campaign: use mewt run separately.

OutlineDriven/odin-claude-plugin · 68 tokens

spec-driven

Use when starting a project or feature, requirements are unclear, or a change crosses modules. Produces an approved six-area spec, plan, tasks, and an offensive-first TDD implementation. Not for implementation from existing specs — use spec-driven-implementation.

OutlineDriven/odin-claude-plugin · 54 tokens

tdd

Use when asked to develop a fix or feature test-first, plan a multi-step TDD build, or work red-to-green in slices. Writes attacks before implementation, probes the suite with mutations, and advances one vertical slice at a time. Not for hardening existing code without a change; use tests-adversarial. Not for deleting…

OutlineDriven/odin-claude-plugin · 80 tokens

mutation-triage-genotoxic

Use when a mutation campaign has produced surviving mutants that need triage. Classifies each mutant as false-positive, missing-test, genotoxic, or removable using a coverage map, and proposes which tests to write or dead code to remove. Not for configuring or running campaigns: use mutation-campaign-configuration.

OutlineDriven/odin-claude-plugin · 68 tokens