Skip to content
Back to skills

Tdd

ASecurity

The loop is red → green, where red is a failing oracle case, not a hand-written expectation. This skill defines what makes an oracle case worth keeping, where oracle points go, the anti-patterns, and the loop rules. It assumes the repository method (spec/inventory, corpus, tools/) and the override rules of [integrations/skills/cleanroom-reimplementation](../cleanroom-reimplementation/SKILL.md).

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 28, 2026
developmentgotestingdebuggingrefactoring

Works with

  • cli

Security analysis

A100/100

Scanned November 28, 2026

npx -y skills add climashscape/agentic-cleanroom --skill tdd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tdd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/climashscape-tdd/badge)](https://www.skillsdirectory.com/skills/climashscape-tdd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
<!-- Adapted from mattpocock/skills (MIT), path skills/engineering/tdd, retrieved 2026-10-09 -->
---
name: tdd
description: Test-driven development where the failing test is a failing oracle. Use when building or fixing behavior test-first under clean-room rules, when the user mentions "red-green-refactor", "golden master", "corpus case", "oracle first", or when working the implement step of the cleanroom-reimplementation loop.
---

# Oracle-first TDD

The loop is red → green, where red is a failing oracle case, not a
hand-written expectation. This skill defines what makes an oracle case
worth keeping, where oracle points go, the anti-patterns, and the loop
rules. It assumes the repository method (spec/inventory, corpus,
tools/) and the override rules of
[integrations/skills/cleanroom-reimplementation](../cleanroom-reimplementation/SKILL.md).

## What a good oracle case is

- It verifies observed behavior through the public surface: the output
  file, the rendered frame, the CLI stdout. Never internals.
- Its expected value comes from an independent source of truth: a
  reference-produced recording pinned with `tools/corpus.py`, or an
  acceptance criterion in the feature spec. It is never recomputed by
  the code under test, and never derived from the reference's source
  (that would breach R1).

## Oracle points: where checks go

An **oracle point** is a pinned public boundary where behavior is
compared without reaching inside the implementation. Work only at
oracle points declared in the feature spec's testing decisions; give
each a one-line note on what it catches and what it misses. Prefer the
fewest, highest oracle points: one end-to-end golden beats five
internal snapshots. A new oracle point is a spec decision, not a
debugging convenience.

## Anti-patterns

- **Implementation-coupled**: asserting internal state or side channels
  instead of public outputs, or taking expected values from the
  reference's code or decompilation. Tell: the check breaks on refactor
  while observed behavior is unchanged — or worse, it "passes" because
  it encodes contamination.
- **Tautological**: recording goldens with your own implementation as
  the runner, or recomputing expected bytes the way the code does. It
  passes by construction and turns the ratchet into theater (failure
  catalogue #12). Goldens are recorded from the reference once, then
  read-only.
- **Horizontal slicing**: implementing the whole feature and running
  all oracles at the end. Work in vertical slices instead: one EARS
  requirement line → one oracle case red → minimal implementation →
  green → next line.

## Rules of the loop

- **Red before green.** Run the comparison
  (`tools/golden_master.py compare`, `tools/pixel_diff.py`, or a corpus
  case) and watch this specific case fail before writing implementation
  code.
- **One slice per cycle.** One requirement, one oracle case, one
  minimal implementation.
- **Refactoring is not part of the loop.** It happens after green, and
  a refactor may not lower any floor: re-run
  `tools/inventory_parity.py check` and `tools/ratchet.py` after it.

## References

- Verification families and oracle table: `docs/05-verification.md`
- Spec idioms and EARS lines: `docs/03-specifications.md`
- Failure catalogue rows 1 (fake completion) and 12 (metric gaming):
  `docs/10-failure-modes.md`
- Tool usage: `tools/README.md`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.