/myflow:tddfrom MyFlow
Use during design and planning to shape testable interfaces, seams, and verification strategy; use during implementation when a plan needs a test-first behavior cycle
Ships in MyFlow. 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 practice with a testing side effect. A test is a small, executable design conversation: it describes the behavior a caller needs, exposes the interface and seam that behavior requires, and gives us a regression check once the design is implemented.
TDD is not the same as unit testing. Unit testing means having tests for a unit, regardless of when they were written. TDD means using a failing behavior example to design the interface and implementation before writing production code. The valuable result is a module with a small, useful interface, clear dependencies, and tests that exercise behavior rather than implementation details.
Use TDD primarily during Design and Plan:
During Implement, follow the TDD decisions and verification map in the accepted plan. Invoke this skill again only when the plan has not specified a seam or behavior, or when implementation reveals that the planned interface is not workable. Do not reopen settled design merely to repeat the loop.
TDD may be unnecessary for throwaway prototypes, generated code, and configuration-only changes. For legacy behavior, write a characterization or regression test at the best available public seam before changing it.
When exploring a repository, read CONTEXT.md if it exists and respect applicable ADRs so the interface vocabulary, test locations, and dependency conventions match the codebase.
A seam is the interface where a test observes behavior without reaching inside the module. Tests and callers should cross the same seam.
Before writing a test, record and, during collaborative planning, confirm:
Use public interfaces, not private methods, internal collaborators, call counts, or side channels. If a test needs to reach inside, first ask whether the seam is in the wrong place or the module is too shallow. Use codebase-design as the vocabulary when the interface, depth, or seam is itself a design question: module, interface, seam, adapter, depth, leverage, and locality.
Prefer designs that:
A test that requires mocking an unrelated internal dependency is design feedback. Simplify the interface or move the seam before adding more test machinery.
Work in a vertical slice: one behavior, one failing test, one minimal implementation.
Write one clear test through the agreed public interface. Use a real example and an independent expected result. Name the behavior, not the implementation.
test("returns the saved account by id", async () => {
const accounts = new InMemoryAccounts();
const service = new AccountService(accounts);
await service.save({ id: "a-1", name: "Ada" });
expect(await service.get("a-1")).toEqual({ id: "a-1", name: "Ada" });
});
Run the narrowest relevant test command. Confirm that it fails because the behavior is missing, not because of a typo, invalid setup, or broken test runner. A test that already passes is not a useful red step; revise it or choose the next missing behavior.
Do not add a separate “break it on purpose” step. The intended behavior should be absent until the implementation is written, so the first execution supplies the necessary evidence.
Write the smallest production change that makes the failing behavior pass. Pass dependencies into the code under test. Do not add speculative options, unrelated refactors, or test-only production methods.
Confirm the new test passes, then run the affected suite and the project checks required by the plan. If a test fails, fix the implementation or revisit the design; do not weaken the test to fit the code.
Remove duplication and improve names only while behavior remains green. Larger architectural refactors belong in the plan or review, not hidden inside a red → green cycle. Repeat with the next behavior.
Prefer real implementations, simple fixtures, and in-memory adapters where they make the behavior clearer. A fake is acceptable when it is a small, meaningful adapter with behavior the test genuinely needs; do not build elaborate test-only worlds.
Mocks are exceptional, not the default:
Integration tests with real components are often simpler and more trustworthy than a large collection of mocks. Test the behavior of the subject, never the behavior or existence of a mock. Read mocking.md and testing-anti-patterns.md before introducing a double.
Do not leave test intent buried in individual test files. During Design or Plan, add a concise verification map to the stage artifact or handoff:
## Verification Map
| Acceptance criterion | Observable behavior / seam | Test level | Test location or name | Status |
|---|---|---|---|---|
| Account can be retrieved after saving | `AccountService` public interface | integration | `account-service.test.ts`: returns the saved account | planned |
### Explicitly not tested
- Real database failover — covered by the database adapter's integration environment, not this change.
The map is a coverage summary, not a replacement for tests. It should make clear:
Keep the map synchronized with the plan's success criteria as slices change. At handoff, include the test commands, changed test paths, current red/green evidence, and any uncovered criteria.
Before a slice is complete:
Do not turn these gates into a demand for one unit test per function. Choose tests for meaningful behavior and risk. A well-designed integration test can be better evidence than many isolated tests.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub don-smith/myflow --plugin myflow21 skills in this plugin
/closeUse after a passing MyFlow Verify report to make proportionate closeout decisions, preserve continuity, and decide delivery with the developer./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./code-reviewUse when reviewing a branch, commit range, pull request, or work-in-progress change against its specification and repository standards./commitCreate structured atomic commits. Use when the user asks to commit, or when Implement has completed a plan phase whose automated success criteria are green./designResolve material architectural decisions for a MyFlow workstream and write a standalone design artifact only when Scope or Plan requires structural design. Use after Scope and selected research/specialists, before Plan./diagnosing-bugsUse when behavior is broken, failing, flaky, unexpectedly slow, or otherwise differs from its expected result, before proposing a durable fix.