Agent skill

TDD

by wbern in wbern/agent-instructions

Remind agent about TDD approach and continue conversation. An agent skill from wbern/agent-instructions.

MITAuto-check passedTesting & QA

Install TDD

skills CLI
$ npx skills add wbern/agent-instructions --skill tdd -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wbern/agent-instructions tdd --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wbern/agent-instructions.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/tdd .claude/skills/tdd && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd
GitHub stars
167
Token cost
~1.3k tokens
SKILL.md length
746 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Remind agent about TDD approach and continue conversation. An agent skill from wbern/agent-instructions.

  • Works in 3 steps: Red Phase: Write ONE failing test that… → Green Phase: Write MINIMAL code to make… → Refactor Phase: Improve code structure…
  • Tasks that involve Test-driven development
  • SKILL.md covers General Guidelines, Plan File Restriction, TDD Fundamentals and Continue Conversation
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

TDD is an agent skill from wbern/agent-instructions. Remind agent about TDD approach and continue conversation

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test-driven development. The repository describes itself as: Claude Instructions Repository. The licence is MIT.

When your agent uses it

  • Tasks that involve Test-driven development

Example prompts

  • “/tdd”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Red Phase: Write ONE failing test that describes desired behavior
  2. Green Phase: Write MINIMAL code to make the test pass
  3. Refactor Phase: Improve code structure while keeping tests green

What it can do on your machine

Read from SKILL.md and the folder at commit 0743a53. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TDD loads about 1.3k tokens when it runs. Until then it costs about 15 tokens; SKILL.md has 746 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~15
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wbern/agent-instructions at commit 0743a53, republished under its MIT licence (© wbern). 746 words, ~1,283 tokens.

Download SKILL.mdSave it as .claude/skills/tdd/SKILL.md (or your agent's skills folder).
name
tdd
description
Remind agent about TDD approach and continue conversation

TDD Reminder

General Guidelines

Output Style
  • Never explicitly mention TDD in code, comments, commits, PRs, or issues
  • Write natural, descriptive code without meta-commentary about the development process
  • The code should speak for itself - TDD is the process, not the product

Beads is available for task tracking. Use mcp__beads__* tools to manage issues (the user interacts via bd commands).

Plan File Restriction

NEVER create, read, or update plan.md files. Claude Code's internal planning files are disabled for this project. Use other methods to track implementation progress (e.g., comments, todo lists, or external tools).

TDD Fundamentals

The TDD Cycle

The foundation of TDD is the Red-Green-Refactor cycle:

  1. Red Phase: Write ONE failing test that describes desired behavior

    • The test must fail for the RIGHT reason (not syntax/import errors)
    • Only one test at a time - this is critical for TDD discipline
      • Exception: For browser-level tests or expensive setup (e.g., Storybook *.stories.tsx), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
    • Adding a single test to a test file is ALWAYS allowed - no prior test output needed
    • Starting TDD for a new feature is always valid, even if test output shows unrelated work
    • For DOM-based tests, use data-testid attributes to select elements rather than CSS classes, tag names, or text content
    • Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (waitFor, findBy*, event-based sync) instead and rely on global test configs for timeout settings
  2. Green Phase: Write MINIMAL code to make the test pass

    • Implement only what's needed for the current failing test
    • No anticipatory coding or extra features
    • Address the specific failure message
  3. Refactor Phase: Improve code structure while keeping tests green

    • Only allowed when relevant tests are passing
    • Requires proof that tests have been run and are green
    • Applies to BOTH implementation and test code
    • No refactoring with failing tests - fix them first
Core Violations
  1. Multiple Test Addition

    • Adding more than one new test at once
    • Exception: Initial test file setup or extracting shared test utilities
  2. Over-Implementation

    • Code that exceeds what's needed to pass the current failing test
    • Adding untested features, methods, or error handling
    • Implementing multiple methods when test only requires one
  3. Premature Implementation

    • Adding implementation before a test exists and fails properly
    • Adding implementation without running the test first
    • Refactoring when tests haven't been run or are failing
Critical Principle: Incremental Development

Each step in TDD should address ONE specific issue:

  • Test fails "not defined" → Create empty stub/class only
  • Test fails "not a function" → Add method stub only
  • Test fails with assertion → Implement minimal logic only
Show full SKILL.md (284 more words)Show less
Optional Pre-Phase: Spike Phase

In rare cases where the problem space, interface, or expected behavior is unclear, a Spike Phase may be used before the Red Phase. This phase is not part of the regular TDD workflow and must only be applied under exceptional circumstances.

  • The goal of a Spike is exploration and learning, not implementation.
  • The code written during a Spike is disposable and must not be merged or reused directly.
  • Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the Red Phase.
  • A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
General Information
  • Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
  • It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
  • In the refactor phase, it is perfectly fine to refactor both test and implementation code. That said, completely new functionality is not allowed. Types, clean up, abstractions, and helpers are allowed as long as they do not introduce new behavior.
  • Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
  • Provide the agent with helpful directions so that they do not get stuck when blocking them.

Continue Conversation

User arguments:

TDD: $ARGUMENTS

End of user arguments

Please continue with the user input above, applying TDD approach.

© wbern, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/tdd of wbern/agent-instructions.

Open the folder on GitHubat commit 0743a53

Compare with similar skills

TDD next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TDD compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD this skillwbern/agent-instructions167—~1.3kAutomated safety check: PassMIT
TDDfossasia/eventyay-interpretation1.6k28 repos~1.1kAutomated safety check: PassApache-2.0
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT
Test Driven Developmentfarm-fe/farm5.6k49 repos~2.5kAutomated safety check: PassMIT
Tapd Story PipelineTencentBlueKing/bk-bcs840—~2.6kAutomated safety check: PassCustom licence

Similar skills

  • TDD

    fossasia/eventyay-interpretation

    Test-driven development. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 28 repos~1.1k tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • A skill your agent uses when implementing any feature or bugfix, before writing implementation code

    5.6k GitHub starsUsed in 49 repos~2.5k tokens
    Testing & QAAuto-check passed
  • Tapd Story Pipeline

    TencentBlueKing/bk-bcs

    单需求实现流水线——把一个 TAPD 需求从零推进到代码提交。自动串联技术澄清、 开发计划、任务拆分、TDD 实现、架构/安全校验、代码提交六个阶段。

    840 GitHub stars~2.6k tokensUpdated 13 days ago
    Testing & QAAuto-check passed
  • Absolute Init

    maddhruv/absolute

    One-time setup for absolute: interview how you want it to behave (output style, autonomy, TDD strictness, spec dir, families) + detect the stack once, then write .absolute.config.json (project…

    218 GitHub starsUsed in 1 repo~3k tokens
    Testing & QAAuto-check passed

Categories

Questions about TDD

What does TDD do?

Remind agent about TDD approach and continue conversation. An agent skill from wbern/agent-instructions. TDD is an agent skill from wbern/agent-instructions.

When should I use TDD?

TDD fits situations like: tasks that involve Test-driven development.

How do I install TDD in Claude Code?

Run `npx skills add wbern/agent-instructions --skill tdd -a claude-code`. Or copy the skill folder (.claude/skills/tdd in wbern/agent-instructions) into .claude/skills/tdd in your project. Claude Code loads it when a task matches its description.

How do I install TDD in Codex?

Run `npx skills add wbern/agent-instructions --skill tdd -a codex`. Or copy the skill folder (.claude/skills/tdd in wbern/agent-instructions) into .agents/skills/tdd in your project. Codex loads it when a task matches its description.

Can I use TDD in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wbern/agent-instructions --skill tdd -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd, .gemini/skills/tdd, .github/skills/tdd and .opencode/skills/tdd in your project.

What does TDD need to run?

SKILL.md names no scripts, command-line tools or credentials: TDD is instructions for the agent only.

Does TDD access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is TDD safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TDD use?

TDD is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TDD use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TDD?

Skills that share tags, products or a category with TDD: TDD (fossasia/eventyay-interpretation, 1.6k stars), TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars), TDD (sanity-io/sanity, 6.4k stars) and Test Driven Development (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD?

wbern (a GitHub user) maintains it in wbern/agent-instructions, which has 167 GitHub stars. The repository was last updated on June 1, 2026.

Source: wbern/agent-instructions on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.