test-driven-development

test-driven-development is a skill for Claude Code from tranhieutt/software_development_department. It costs 31 tokens per session (1,689 once invoked), scanned A, original, MIT.

A strict test-driven development workflow, where TDD means writing a failing behavior test, making it pass with the smallest implementation, and then improving the code.

In plain words
What is it for?
Use it to develop features one behavior at a time through failing tests, minimal implementations, and refactoring.
Why use it?
It requires observable behavior to be proven through a public interface before implementation is accepted, reducing assumptions and unverified changes.

Skill for Claude Code

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

Good fit Use it to develop features one behavior at a time through failing tests, minimal implementations, and refactoring.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tranhieutt/software_development_department/test-driven-development
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 tranhieutt/software_development_department --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/tranhieutt/software_development_department

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 test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/tranhieutt/software_development_department/test-driven-development.svg)](https://agentmods.dev/skills/tranhieutt/software_development_department/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/test-driven-development"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/test-driven-development.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,689 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.00031 $0.01689
Opus 5 $0.00015 $0.00844
Sonnet 5 $0.00006 $0.00338
Haiku 4.5 $0.00003 $0.00169

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

Security

Grade A, and why

test-driven-development 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 4d 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.

.claude/skills/test-driven-development/SKILL.md · 150 lines

How it starts

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

Test-Driven Development (TDD)

Purpose

TDD acts as the ultimate truth verifier. It prevents Agents from blindly inserting implementation code based on assumptions. By strictly enforcing the RED-GREEN-REFACTOR cycle, we guarantee that all code changes are demonstrably functional and logically sound before moving on to the next task.

Good tests verify observable behavior through the system's public interface: commands, APIs, UI interactions, exported functions, or other supported entry points. They must not couple to private helpers, internal call order, temporary data structures, or implementation-only collaborators. A refactor that preserves behavior should not break the test.

TDD here is strictly vertical. One behavior slice, one failing test, one minimum implementation. Bulk test authoring is not "getting ahead"; it is horizontal slicing and usually produces brittle tests for imagined behavior.


Workflow (Strict Process)

ABSOLUTE DIRECTIVE: Under NO circumstances are you allowed to write the final implementation logic before a test has explicitly failed in the terminal environment.

PRECONDITION: TDD is an execution workflow, not a planning bypass. Before writing the RED test, confirm the applicable using-sdd pre-code gate is satisfied:

  • Fast Gate for a tiny explicit fix
  • Spec Gate for an approved spec task
  • Plan Gate for an approved implementation-plan task
  • Override Gate when the user explicitly accepted skipping the normal gate

If no gate is satisfied, stop and request the missing approval or clarification.

1. RED Phase (Write the Failing Test)

  • Read the specification for the current atomic task.
  • Select exactly one behavior for the next vertical slice. Do not write a batch of tests for imagined future behavior.
  • Create or modify the appropriate test file (e.g., *.test.ts, *_test.go, test_*.py) to assert the expected behavior through the public interface.
  • EXECUTE: Use the terminal to run the test suite.
  • GATE: Capture the terminal output. You MUST see the test FAIL. If the test passes immediately, your test is flawed or asserting the wrong state.

Read the full file on GitHub · 150 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. 4d ago First seen · 150 lines · 31 tokens per session scan A b086e99641f5

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository tranhieutt/software_development_department (72 stars, last pushed 3mo ago), licensed MIT. It adds 31 tokens to every session and 1,689 once invoked, about $0.0002 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.