tdd-cycle

A step-by-step method for test-driven development (TDD), where you write a failing test, make it pass with minimal code, then improve the code without changing its behavior.

In plain words
What is it for?
Use it to implement shell-code tests with Bashunit, update the related task file, run quality checks, and work through tests one at a time.
Why use it?
It prevents code from being written without a clear test and checks that each failure has the expected cause. It also keeps a record of progress and test results.

Skill for Claude CodeCodex

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

Made for: Claude Code, Codex.

Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 396 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.00016 $0.00396
Opus 5 $0.00008 $0.00198
Sonnet 5 $0.00003 $0.00079
Haiku 4.5 $0.00002 $0.00040

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

Security

Grade A, and why

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

.claude/skills/tdd-cycle/SKILL.md · 50 lines

What it actually says

TDD Cycle

Execute a complete Red -> Green -> Refactor cycle.

Workflow

1. Verify Task File

Check for .tasks/YYYY-MM-DD-*.md. If missing, create one before proceeding.

2. RED — Write Failing Test

  1. Show test inventory from task file, ask which test to implement
  2. Study patterns from existing tests (unit -> assert_test.sh, doubles -> doubles_test.sh)
  3. Write the failing test following Arrange-Act-Assert
  4. Run: ./bashunit path/to/test.shmust fail
  5. Verify failure is for the RIGHT reason (not syntax error or wrong setup)
  6. Update task file: current red bar + logbook entry

3. GREEN — Make It Pass

  1. Write minimal code in src/ — only enough for THIS test
  2. Run: ./bashunit path/to/test.shmust pass
  3. Update task file: check off test + logbook entry

4. REFACTOR — Improve Code

  1. Improve readability, naming, extract duplication — no behavior changes
  2. Run tests after each change
  3. Quality checks: make sa && make lint
  4. Full suite: ./bashunit tests/
  5. Update task file with refactoring notes

5. Next Test

Show updated test inventory. Ask if continuing or done.

Critical Rules

  • Never skip RED — always verify test fails first
  • Minimal code in GREEN — resist feature creep
  • All tests green during REFACTOR — revert if broken
  • Update task file after each phase
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 · 50 lines · 16 tokens per session scan A 8a8d485a66f6

Subscribe to this mod's changes

tdd-cycle is a skill published in the GitHub repository TypedDevs/bashunit (424 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 396 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

x-nets

Enhanced netstat module with cached data and structured output. View network connections, routing tables, and interface statistics in interactive or TSV/CSV formats. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 69 tokens

x-mankier

Search and browse man pages from ManKier.com. Command line interface for ManKier man page repository. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 62 tokens

x-osv

CLI for Google OSV database. Query vulnerabilities for packages, scan local projects for vulnerable dependencies. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill). Required Tool: Install osv-scanner for project scanning (see https://github.com/google/osv-scanner).

x-cmd/x-cmd · 72 tokens

rule

Skill "rule" from x-cmd/x-cmd, covering rule — rules to rule, 核心命令, 规则文件格式, 示例 and 验证规则文件格式.

x-cmd/x-cmd · 0 tokens

wikipedia

Search and read Wikipedia via x wkp — MediaWiki API, no API key, zero install; query, extract, suggest, and DDG route in one module. Load for wiki, wikipedia, encyclopedia lookup, article summary.

x-cmd/x-cmd · 49 tokens

cve

Look up CVE records via x cve — cached, zero-API-key, daily xz TSV. Load for cve, vulnerability id, kev, epss, nvd, cvelist, or security advisory.

x-cmd/x-cmd · 49 tokens