tdd-workflow

A test-driven development workflow, where requirements become failing tests, then implementation, then cleanup. TDD means writing tests before the code they verify.

In plain words
What is it for?
Use it to turn acceptance criteria into tests, run the fail-then-pass cycle, and refactor while preserving the required behavior.
Why use it?
It keeps tests tied to documented behavior and prevents changing tests simply to make incorrect code pass.

Skill for Claude CodeCodex

Part of the dev-practices plugin — 9 skills, 9 agents shipped together

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.

agentmods
npx agentmods add skills/postindustria-tech/agentic-toolkit/tdd-workflow
Any agent
npx skills add postindustria-tech/agentic-toolkit --skill tdd-workflow
Clone the repo
git clone --depth 1 https://github.com/postindustria-tech/agentic-toolkit

Made for: Claude Code, Codex.

Or install dev-practices, the plugin that ships this one along with the rest of its 9 skills, 9 agents.

Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,177 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00126 $0.02177
Opus 5 $0.00063 $0.01089
Sonnet 5 $0.00025 $0.00435
Haiku 4.5 $0.00013 $0.00218

Measured 2d ago against content hash 55a52b76431a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd-workflow 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (examples/javascript-tdd-example.js, examples/python-tdd-example.py), 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.

plugins/dev-practices/skills/tdd-workflow/SKILL.md · 339 lines

How it starts

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

TDD Workflow Skill

Overview

This skill is typically used as part of the broader development workflow managed by the beads plugin (/beads:workflow). TDD is the core implementation practice within Step 3 (Claim & Work) of the beads workflow, providing the requirements → tests → implementation cycle.


GOLDEN RULE: Tests Are Grounded in Requirements

Core Principle: Tests are derived from requirements documentation, not implementation details or guesswork.

When implementation doesn't match tests: Implementation is wrong.

When tests seem illogical: Requirements need clarification with the user.

NEVER adjust tests to match code - tests define the contract that code must fulfill.


The 4-Step TDD Loop

Step 1: Write Failing Test First

Ground test in requirements:

  1. Review requirements documentation for acceptance criteria
  2. Identify specific, testable requirement
  3. Write test that validates that requirement
  4. Run test - verify it FAILS (proving test is actually testing something)

Pattern - Arrange, Act, Assert:

def test_feature_behavior():
    """Test feature behavior.

    Requirement: [Reference to requirement document]
    Given [precondition], when [action], then [expected outcome].
    """
    # Arrange - Set up test conditions from requirements
    input = prepare_test_input()

    # Act - Execute behavior under test
    result = function_under_test(input)

    # Assert - Verify requirement is met
    assert result == expected_value_from_requirements

Verify test FAILS: A test that passes before implementation exists is either:

  • Testing nothing (false positive)
  • Testing existing code (not new functionality)

Step 2: Implement Minimum Code to Pass Test

Write ONLY enough code to make the test pass:

  • Implement exactly what requirements specify
  • No extra features
  • No premature optimization
  • No "nice to have" additions

Anti-patterns to avoid:

  • Adding features not in requirements
  • Optimizing before it works
  • Implementing "obvious" future features
  • Over-engineering the solution

Read the full file on GitHub · 339 lines

Files

What ships with it

5 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. 2d ago First seen · 339 lines · 126 tokens per session scan A 55a52b76431a

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository postindustria-tech/agentic-toolkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 126 tokens to every session and 2,177 once invoked, about $0.0006 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.

Related

Other skills, from other repositories

agent-integration

Run all three agent integration phases sequentially: research, write-tests, and implement using E2E-first TDD (unit tests written last). For individual phases, use /agent-integration:research, /agent-integration:write-tests, or /agent-integration:implement. Use when the user says "integrate agent", "add agent…

entireio/cli · 89 tokens

engram-testing-coverage

TDD and coverage standards for Engram. Trigger: When implementing behavior changes in any package.

Gentleman-Programming/engram · 25 tokens

code-assist

Guides implementation of code tasks using test-driven development in an Explore, Plan, Code, Commit workflow. Acts as a Technical Implementation Partner and TDD Coach — following existing patterns, avoiding over-engineering, and producing idiomatic, modern code.

mikeyobrien/ralph-orchestrator · 53 tokens

tdd

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

GreyDGL/PentestGPT · 33 tokens

css-design-tdd

Test-driven CSS design system modifications. Run checks before/after CSS changes to verify token usage, variable definitions, fallbacks, and consistency. Use when modifying CSS tokens, fixing design inconsistencies, or auditing CSS architecture.

xiaolai/vmark · 49 tokens

mobiai-mobile-tdd

You MUST use this before writing any implementation code for a mobile feature, bug fix, refactor, or behavior change. Tests come before implementation — no exceptions.

ArisGuimera/MobiAI-Core · 38 tokens