tdd

tdd is a skill for Claude Code, Codex from jmstar85/oh-my-githubcopilot. It costs 38 tokens per session (915 once invoked), scanned A, a copy of tdd, MIT.

A Test-Driven Development workflow. TDD means writing a test for the next behavior first, making it fail, writing only enough code to pass it, and then cleaning up the code.

In plain words
What is it for?
It helps build features one behavior at a time, run the failing-test and passing-test cycle, keep existing tests green, and refactor with test coverage in place.
Why use it?
It makes the intended behavior explicit before implementation and helps detect regressions as the code changes.

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

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 915 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00038 $0.00915
Opus 5 $0.00019 $0.00458
Sonnet 5 $0.00008 $0.00183
Haiku 4.5 $0.00004 $0.00092

Measured 3d ago against content hash 74d5bd64f8c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.

Origin

This is a copy

100% identical to tdd — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.github/skills/tdd/SKILL.md · 104 lines

How it starts

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

TDD — Test-Driven Development

THE IRON LAW: Write the failing test FIRST. Always.

The Red-Green-Refactor Cycle

RED   → Write a failing test for the NEXT behavior
GREEN → Write ONLY enough code to make it pass (no extras)
REFACTOR → Clean up code quality (tests must stay green after every change)
REPEAT

Step-by-Step Protocol

1. RED Phase

  1. Identify the smallest next behavior to implement
  2. Write a test that describes that behavior as a named it() / test() / def test_
  3. Run the test — it MUST FAIL. If it passes, the test is wrong.
  4. Confirm the failure message is the RIGHT failure (not a syntax error)
// Example: RED — test fails because function doesn't exist yet
it('returns an empty array for an empty input', () => {
  const result = parseItems([]);
  expect(result).toEqual([]);  // FAILS: parseItems is not defined
});

2. GREEN Phase

  1. Write the MINIMUM code to make the test pass
  2. Do not add extra logic, default parameters, or "nice-to-haves"
  3. Run ALL tests — the new test must pass; existing tests must not break
// Example: GREEN — just enough to pass
function parseItems(input: string[]): string[] {
  return [];  // only enough for the current test
}

3. REFACTOR Phase

  1. Look at the code — can it be cleaner without changing behavior?
  2. Apply simplification patterns (see /ai-slop-cleaner and /coding-standards)
  3. Run tests after EVERY change. If tests break, undo immediately.

TDD Gate — When to Stop

Situation Action
Code written before test STOP. Delete production code. Write test first.
Test passes on first run (no prior code) The test is wrong — fix it to fail first.
Multiple behaviors in one test STOP. One test, one behavior.
Skipping refactor to go faster Go back. Clean up before next feature.

Naming Tests as Specifications

Tests are executable documentation. Name them as complete sentences:

// BAD
it('test1', ...)
it('works with empty', ...)

// GOOD
it('returns empty array when input is empty', ...)
it('throws ValidationError when email is missing @', ...)
it('sends exactly one email when user registers', ...)

Read the full file on GitHub · 104 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. 3d ago First seen · 104 lines · 38 tokens per session scan A 74d5bd64f8c3

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository jmstar85/oh-my-githubcopilot (153 stars, last pushed 3mo ago), licensed MIT. It adds 38 tokens to every session and 915 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to tdd, differing in 0 lines, and is treated as a copy.