tdd

tdd is a skill for Claude Code, Codex from open-gsd/gsd-pi. It costs 73 tokens per session (1,457 once invoked), scanned A, original, MIT.

A test-driven development workflow that builds software through small behavior-focused steps. TDD means writing a test that fails, making it pass, and then cleaning up the code before continuing.

In plain words
What is it for?
Use it for bug fixes, new module interfaces, API endpoints, and other features with a clear expected result. It is designed for vertical slices, meaning each step delivers a small end-to-end piece.
Why use it?
It turns a feature or bug fix into a sequence of observable decisions and checks. Tests describe the public behavior, so the code can be reorganized without changing what the tests verify.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

GSD Pi is a command-line coding agent and project workflow system that plans, implements, verifies, and tracks software work through milestones, tasks, Git worktrees, and stored project notes. It is for developers who want structured, longer-running agent sessions using different model providers. The catalogue entries extend GSD Pi with skills and agents.

open-gsd/gsd-pi · 1,198 stars · on GitHub · opengsd.net

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/open-gsd/gsd-pi/tdd
Any agent
npx skills add open-gsd/gsd-pi --skill tdd
Clone the repo
git clone --depth 1 https://github.com/open-gsd/gsd-pi

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/open-gsd/gsd-pi/tdd.svg)](https://agentmods.dev/skills/open-gsd/gsd-pi/tdd)
Your own site
<a href="https://agentmods.dev/skills/open-gsd/gsd-pi/tdd"><img src="https://agentmods.dev/badge/skills/open-gsd/gsd-pi/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,457 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.1 $0.00073 $0.01457
Opus 5 $0.00036 $0.00728
Sonnet 5 $0.00015 $0.00291
Haiku 4.5 $0.00007 $0.00146

Measured 2d ago against content hash a7caac31e398, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tdd 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.

src/resources/skills/tdd/SKILL.md · 113 lines

How it starts

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

Invocation points:

  • Task plan calls out behavior with a clear external contract (pure function, API endpoint, module boundary)
  • Bug fix — write the failing repro test first, then fix
  • Refactor into a new module — write the tests against the new interface first

Do not use this skill for:

  • Exploratory spikes (use /gsd start spike — no production code ships)
  • Pure UI polish where visual verification beats unit tests
  • Scripts that run once and are deleted

<core_principle> TESTS VERIFY BEHAVIOR THROUGH PUBLIC INTERFACES, NOT IMPLEMENTATION DETAILS. A good test reads like a specification and survives refactors. A test that mocks internals or asserts private state fails every time you clean up the code — that is a bad test pretending to be a good one.

VERTICAL SLICES, NOT HORIZONTAL LAYERS. Writing all tests upfront ("horizontal slicing") produces tests for behavior you imagined, not behavior the code actually exhibits. One tracer bullet at a time: write one test, make it pass, learn, write the next.

NEVER REFACTOR WHILE RED. Refactoring without a passing test means you are guessing whether you broke something. Get to green first. Then clean up. Then go red again for the next slice. </core_principle>

Step 1: Confirm the interface

Before writing anything:

  1. What is the public interface? (function signature, HTTP route, module exports)
  2. Which behaviors matter most? List them in order of how badly you'd want to know if they broke.
  3. What does a "caller" look like? Write one example call in prose.

If the user has not supplied these, ask — one round, 1–3 questions.

Read the full file on GitHub · 113 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. 2d ago First seen · 113 lines · 73 tokens per session scan A a7caac31e398

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository open-gsd/gsd-pi (1,198 stars, last pushed yesterday), licensed MIT. It adds 73 tokens to every session and 1,457 once invoked, about $0.0004 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-03.