tdd-workflow

tdd-workflow is a skill for Claude Code from personamanagmentlayer/pcl. It costs 97 tokens per session (2,006 once invoked), scanned A, original, Apache-2.0.

A test-first development procedure called TDD, or test-driven development. It repeats three steps: write a failing test, make it pass with the simplest code, then improve the code while keeping the tests passing.

In plain words
What is it for?
It helps add features, fix bugs, and refactor code when tests should be written before or alongside the implementation.
Why use it?
It gives new behavior and bug fixes a clear safety loop and helps detect regressions during refactoring.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit It helps add features, fix bugs, and refactor code when tests should be written before or alongside the implementation.

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

Made for: Claude Code.

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-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/tdd-workflow.svg)](https://agentmods.dev/skills/personamanagmentlayer/pcl/tdd-workflow)
Your own site
<a href="https://agentmods.dev/skills/personamanagmentlayer/pcl/tdd-workflow"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/tdd-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,006 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.00097 $0.02006
Opus 5 $0.00048 $0.01003
Sonnet 5 $0.00019 $0.00401
Haiku 4.5 $0.00010 $0.00201

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

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.

stdlib/workflows/tdd-workflow/SKILL.md · 237 lines

How it starts

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

TDD Workflow

A procedure, not a body of knowledge. Follow the loop step by step; the value of TDD comes from the discipline of the sequence, not from knowing what it is.

When to Use This Skill

  • The user asks for TDD, test-driven development, or "tests first"
  • New behaviour is being added to code that already has a test suite
  • A bug has been reported and the fix should not regress
  • Existing code must be changed but has no tests to protect it
  • The user wants confidence that a refactor preserved behaviour

Do not use this loop for exploratory spikes meant to be thrown away, or for code whose correct behaviour is not yet known. Explore first, then restart the loop against what you learned.

Core Concepts

The Loop

One cycle, three states, in this order and no other:

  1. Red — write one failing test that states the next increment of desired behaviour. Run it. Confirm it fails, and fails for the reason you expect.
  2. Green — write the simplest change that makes it pass. Not the best change; the simplest. Run the whole suite.
  3. Refactor — improve the code and the test with the suite green. Run after every structural change. Never change behaviour here.

The cycle is short by design: minutes, not hours. A long cycle means the increment was too large — shrink it.

Why Red Must Be Observed

A test that has never failed proves nothing. It may assert a tautology, target the wrong unit, or be silently skipped. Watching it fail, and reading the failure message, is the only evidence that the test is connected to the behaviour you intend to build.

The Increment

Each cycle should encode exactly one decision: one branch, one validation, one edge case. If you cannot state the next test in a sentence, the increment is too big.

Characterisation Tests

For untested legacy code, invert the loop. You do not know the intended behaviour, so first pin down the actual behaviour with tests that assert what the code does today — bugs included. Only then change it. These tests are scaffolding: some are deleted once the real behaviour is specified.

Read the full file on GitHub · 237 lines

Files

What ships with it

2 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 · 237 lines · 97 tokens per session scan A 64017691b998

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository personamanagmentlayer/pcl (40 stars, last pushed today), licensed Apache-2.0. It adds 97 tokens to every session and 2,006 once invoked, about $0.0005 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-09-05.