Files
holocron/plugins/bin/skills/tdd
Defame1297 4f49b2a249 refactor(bin): move non-spec root files into references/ across four skills
grill-with-docs, improve-codebase-architecture, tdd, and triage kept
non-spec markdown files at their skill root, in violation of
skill-audit's file-structure.md rule (only SKILL.md/README.md belong
at the root; everything else lives in scripts/, references/, assets/
or tests/). A root-level file is invisible to the ADR-0020
dangling-reference gate, which only resolves unqualified
`references/...` pointers.

- Moved and renamed to lowercase-kebab-case under references/:
  grill-with-docs (ADR-FORMAT.md, CONTEXT-FORMAT.md),
  improve-codebase-architecture (DEEPENING.md, INTERFACE-DESIGN.md,
  LANGUAGE.md), tdd (five files, casing was already fine), triage
  (AGENT-BRIEF.md, OUT-OF-SCOPE.md).
- Updated every in-skill link to the new references/ paths, including
  link text that still showed the old uppercase filenames.
- Fixed improve-codebase-architecture/SKILL.md's cross-skill citation
  of grill-with-docs's two files to the sanctioned possessive form
  with the references/ segment included.
- Updated all four skills' README.md file tables to match.
- Regenerated the flat content mirror via
  scripts/sync-plugin-content.sh --all.

Fixes #122.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDj6F7SPXzh3FtPN78dZ88
2026-09-09 19:59:02 +00:00
..

tdd

Test-driven development as a strict red-green-refactor loop, one behaviour at a time.

What it does

Two convictions drive this skill. The first is about what a test is for: tests verify behaviour through public interfaces, not implementation details. A good test reads like a specification ("user can checkout with valid cart") and survives refactors because it does not care about internal structure. The warning sign for a bad one is precise — the test breaks when you refactor but behaviour has not changed.

The second is an explicit anti-pattern: do not write all the tests first, then all the implementation. Horizontal slicing treats RED as "write every test" and GREEN as "write every implementation", and it produces tests of imagined behaviour — tests of the shape of things, insensitive to real change, committed to before the implementation was understood. The correct shape is vertical: one test → one implementation → repeat, each cycle informed by what the last one taught you.

The workflow is four stages: plan (confirm the interface and which behaviours matter, with the user — you cannot test everything), fire a tracer bullet (one test proving the path works end to end), loop incrementally one behaviour at a time, then refactor once everything is green. Refactoring while RED is forbidden.

Codebase exploration uses the project's domain glossary, so test names and interface vocabulary match the project's language, and ADRs in the area are respected.

Usage

/tdd

Describe the feature or bug. Expect the skill to ask what the public interface should look like and which behaviours matter most before any code is written. For diagnosing an existing bug rather than building test-first, use diagnose; for throwaway exploratory code, use prototype.

Files

File Purpose
SKILL.md Philosophy, the horizontal-slicing anti-pattern, the four-stage workflow, and the per-cycle checklist
references/tests.md Cited from Philosophy: worked good and bad test examples
references/mocking.md Cited from Philosophy: mock at system boundaries only, and what not to mock
references/deep-modules.md Cited from stage 1: what a deep module is (small interface, large implementation) and why it is the design to aim for
references/interface-design.md Cited from stage 1: designing interfaces for testability, starting with accepting dependencies rather than creating them
references/refactoring.md Cited from stage 4: the refactor-candidate checklist — duplication, long methods, shallow modules, feature envy, primitive obsession