tdd-patterns

tdd-patterns is a skill for Claude Code from synaptiai/synapti-marketplace. It costs 166 tokens per session (1,196 once invoked), scanned A, original, Apache-2.0.

A guide to test-driven development, or TDD, where you write a failing test, make it pass, and then improve the code. It also sets rules for useful tests and test-runner use.

In plain words
What is it for?
Use it when adding features or fixing bugs to create a failing test first, implement the smallest passing change, refactor safely, and avoid weak or implementation-specific tests.
Why use it?
It helps prove that tests check the intended behavior instead of passing for an unrelated reason.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: agent in frontmatter.

Part of the flow plugin — 33 skills, 20 commands, 10 agents shipped together

Good fit Use it when adding features or fixing bugs to create a failing test first, implement the smallest passing change, refactor safely, and avoid weak or implementation-specific tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/synaptiai/synapti-marketplace/tdd-patterns
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 synaptiai/synapti-marketplace --skill tdd-patterns
Clone the repo
git clone --depth 1 https://github.com/synaptiai/synapti-marketplace

Made for: Claude Code.

Or install flow, the plugin that ships this one along with the rest of its 33 skills, 20 commands, 10 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 tdd-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/synaptiai/synapti-marketplace/tdd-patterns/github.svg)](https://agentmods.dev/skills/synaptiai/synapti-marketplace/tdd-patterns)
Your own site
<a href="https://agentmods.dev/skills/synaptiai/synapti-marketplace/tdd-patterns"><img src="https://agentmods.dev/badge/skills/synaptiai/synapti-marketplace/tdd-patterns/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 tdd-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/synaptiai/synapti-marketplace/tdd-patterns"><img src="https://agentmods.dev/badge/skills/synaptiai/synapti-marketplace/tdd-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,196 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.00166 $0.01196
Opus 5.5 $0.00066 $0.00478
Sonnet 5.5 $0.00033 $0.00239
Haiku 4.5 $0.00017 $0.00120

Measured 1mo ago against content hash e75dabdb61b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tdd-patterns 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 1mo 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.

plugins/flow/skills/tdd-patterns/SKILL.md · 75 lines

How it starts

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

TDD Patterns

Contract

Iron law: if you did not watch the test fail, you do not know it tests the right thing. Invoked by /flow:start Phase 3 CODE step 3 (per task, before production code) and by /flow:address for behavior-changing fixes; testing.tddMode governs enforcement. Returns, per behavior, three tracked tasks: a RED test with a sourced expected value and a non-degenerate input, GREEN code, REFACTOR with all tests passing. Permitted skips: tddMode=off; tddMode=suggest with tddModeOptOut=true plus an explicit user decision; refactors (existing tests suffice); config changes without behavior change.

Where expected values come from

An expected value is derived from the spec, a reference implementation, hand computation, an existing fixture, or an external standard, and the test states which (test comment; evidence-bundle column Source of expected). Never run the implementation and paste its output as the expectation. A literal with no stated source is a finding.

Inputs must discriminate

Before testing a risky area (the task's Risk areas: rows, from the specification's ### Risk map), state the plausible wrong implementation and choose an input on which right and wrong differ. Degenerate inputs (identical elements, symmetric or palindromic data, zero, one value repeated in every slot, the simplest possible case) are not coverage of order-, position-, or value-sensitive behavior. Bias randomized inputs toward interesting state and code paths rather than one shared rejection path; prefer structured generators over raw bytes.

Red-Green-Refactor

Three tasks per behavior:

TaskCreate("RED: Failing test for {behavior}", "Sourced expectation, discriminating input, fails first.")
TaskCreate("GREEN: Implement {behavior}", "Simplest passing code.")
TaskCreate("REFACTOR: Clean up {behavior}", "All tests still pass.")

A test is RED only when (a) it fails on first run for the intended reason, (b) its expected value has a stated source, and (c) its input is not degenerate for the behavior under test. A test that passes on first write is checked by breaking the implementation deliberately and watching it fail. REFACTOR runs ALL tests after each step; new functionality is a new RED. TaskList confirms the cycle before the next behavior.

Read the full file on GitHub · 75 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. 1mo ago Changed · -4 lines e75dabdb61b0
  2. 1mo ago Changed · -105 lines · +52 tokens per session 46f9aecfcf17
  3. 1mo ago First seen · 184 lines · 114 tokens per session scan A bade84298b26

Subscribe to this mod's changes

tdd-patterns is a skill published in the GitHub repository synaptiai/synapti-marketplace (7 stars, last pushed 9d ago), licensed Apache-2.0. It adds 166 tokens to every session and 1,196 once invoked, about $0.0007 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-09-03.

Related

Other skills, from other repositories

x-qdev

A compact development workflow for a small, clearly defined code change. It keeps the requirement, initially failing tests, implementation, and real verification results in one task document, following TDD, or test-driven development.

KtKID/x-dev-pipeline · 116 tokens

validate-plan

Validate implementation plans against DRY, YAGNI, TDD principles and best practices. Use when reviewing plans from pocket-planning or another planning workflow to identify gaps, anti-patterns, and improvement opportunities before execution.

rfxlamia/pocketto · 47 tokens

implement

Use when writing or changing production code for a ClaudeHut light- or full-route task in a Java/Spring project - test-first red-green-refactor, following task.md or the approved plan and the path-scoped project rules. Preloaded into claudehut-implementer.

taipt1504/claudehut · 59 tokens

moai-run

Implement SPEC requirements using DDD/TDD methodology.

modu-ai/moai-adk · 13 tokens

ui-automation-workflows

Accessibility-first UI automation using IDB. Query accessibility tree (fast, 50 tokens) before screenshots (slow, 170 tokens). Use when automating simulator interactions, tapping UI elements, finding buttons, or testing user flows. Covers idb-ui-describe, idb-ui-tap, idb-ui-find-element patterns.

conorluddy/xclaude-plugin · 72 tokens

strict-tdd

Strict RED->GREEN->REFACTOR test-driven development with enforcement. Never write production code before a failing test. Atomic commits per TDD cycle.

a5c-ai/babysitter · 34 tokens