/doctrine:tddfrom doctrine
Test-driven development discipline covering the red-green-refactor cycle, testing pyramid proportions, Fowler's test-double taxonomy, and FIRST test properties. Use when building features test-first or deciding what kind of test to write.
Ships in doctrine. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TDD is a design discipline, not a testing habit. Kent Beck's rule is absolute: no production code is written except to make a failing test pass, and no more of it than the test requires. The test comes first because it forces the interface to be designed from the caller's side before an implementation exists to bias the design.
One cycle, repeated, never skipped:
Each cycle is a vertical slice: one behaviour, one test, one minimal implementation, then the next cycle picks the next behaviour. Writing a batch of tests up front for behaviour that doesn't exist yet is not TDD; it's testing an imagined shape, and the tests go insensitive to what implementation actually teaches you as you build.
console.log someone has to eyeball.Structure each test Arrange, Act, Assert: set up the preconditions, perform the one action under test, assert the outcome. A test with multiple Act/Assert blocks is testing multiple behaviours and should be split.
The expected value in an assertion must come from an independent source of truth (a known-good literal, a worked example, a spec), never recomputed by the same logic the test is exercising. A test that derives its expected value the way the code does can never disagree with a bug in that logic; it passes by construction.
Reach for the narrowest double that makes the test possible, in this order of preference:
| Double | What it does | Use it when |
|---|---|---|
| Dummy | passed in but never actually used, just fills a parameter slot | the collaborator is required by the signature but irrelevant to this test |
| Stub | returns canned answers to calls made during the test | the code under test needs a dependency to return a specific value to reach the branch being tested |
| Fake | a working, simplified implementation (in-memory DB instead of a real one) | a stub's canned answers aren't enough because the test needs realistic, stateful behaviour, but the real dependency is too slow or heavy |
| Spy | a stub that also records how it was called | the test needs to assert on an interaction (was this called, with what) in addition to controlling the return value |
| Mock | pre-programmed with expectations about the calls it will receive, fails the test itself if unmet | the test's whole point is the interaction (an email got sent, an event got published): not the resulting state |
Mocking a collaborator you don't own the interaction contract for, or mocking three levels deep into a call chain, is a sign the seam is wrong, not that you need a fancier double; reach for /codebase-design to find the right seam before adding another layer of mocks.
Most tests are fast, isolated unit tests; fewer are integration tests that exercise a real seam between components (a real database, a real HTTP call to a test server); fewest are end-to-end tests that drive the whole system as a user would. Push a test as far down the pyramid as it can go while still being a true test of the behaviour; an inverted pyramid (mostly e2e, few unit) is slow to run and slow to diagnose when it fails, because a red e2e test names a symptom, not a cause.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tdd, red-green-refactor, testing-pyramid, test-doubles, first-properties
34 skills in this plugin
/api-design-standardsAPI design discipline grounded in the Microsoft/Google REST guidelines, resource and URL conventions, a chosen versioning strategy, what counts as a backward-compatible vs breaking change, and consumer-driven contract testing. Use when designing a new API endpoint, changing an existing API's request/response shape, deciding how to version an API, or asking whether a change to a public interface is breaking./architecture-diagramProduce a software architecture diagram at the right level of zoom, using diagram as code so it can be shown inline, saved, or committed as the user or active workflow authorizes. Use when the user wants to draw, extract, or visualize a project's architecture, a component or request flow, a data flow, or a decision path a design principle hinges on./capacity-estimationTurn a vague performance requirement into arithmetic before the architecture is chosen, size concurrency with Little's Law, and label every input as measured, derived, or assumed. Use when a design calls itself "scalable" or "fast" without a number, when choosing between one machine and a distributed system, when sizing a thread pool, connection pool, queue, or instance count, or when someone asks how much traffic, storage, or bandwidth a system will need./codebase-designModule design discipline from John Ousterhout's A Philosophy of Software Design, depth as the metric (a lot of functionality behind a simple interface), information hiding vs. leakage, the concrete red flags that mark a shallow module, and comparing at least two designs before committing. Use when designing a new module or class, deciding where an interface boundary (seam) should go, reviewing a design for unnecessary complexity, or asking whether something should be split or merged./code-reviewCode review discipline: the approval bar is "improves code health," not "perfect," Fowler's code-smell catalog gives design/complexity concerns a name instead of a vague feeling, and small PRs keep review depth from degrading. Use when reviewing a pull request or diff, requesting a review, deciding whether a change is blockable, or leaving review feedback./code-style-lintDiscipline for code style and static analysis, adopt the ecosystem's established formatter as the non-negotiable source of truth, enforce it at pre-commit and CI rather than in review, and treat linting (real defects) as a separate concern from formatting (appearance). Use when setting up a new project's tooling, when a code review comment is about whitespace/naming/formatting instead of behavior, or when the user asks how to configure a linter or formatter.npx claudepluginhub aethrox/doctrine --plugin doctrineOther plugins' skills for the same job