This repository (Asymmetric-al/core)
These repo-owned sections are intentionally kept on top of the vendored
Matt Pocock TDD skill. If upstream refreshes replace this file, reconcile this overlay
before running bun run skills:sync.
TDD is the default workflow for substantive Core implementation. Do not wait for the user to type /tdd or /TDD. /tdd and /TDD resolve to this same workflow.
Triggers
- Implementing a feature, bug fix, or behavior-changing refactor.
- The user mentions TDD,
/tdd, /TDD, or red-green-refactor.
- Changing executable behavior, types, migrations, RLS, or generated-file
contracts.
Do not invent an artificial RED test for documentation-only edits,
formatting-only edits, exact generated-mirror updates, or provenance-only
metadata.
Workflow
- Understand the expected behavior from the request, existing tests, and
nearest public or architectural seam.
- Inspect current implementation and tests. Use an established public seam
without waiting for the user to approve an obvious seam.
- Add or update a test that expresses the desired behavior or reproduces the
bug.
- Run it and confirm it fails for the expected reason when that is meaningful.
- Make the smallest correct implementation change.
- Run the focused test until it is green.
- Refactor where justified while tests remain green. Refactoring is part
of Core's loop after green.
- Run broader relevant validation. Verify runtime or browser behavior when the
change is user-visible.
Prefer characterization tests before changing poorly understood legacy
behavior. Prefer tests that prove behavior at a stable seam over
implementation-coupled tests.
Checklist
The vendored Matt Pocock body below is kept for provenance. These lines are
non-operative in Core and must not override the overlay:
- "Refactoring is not part of the loop."
- "Test only at pre-agreed seams" / confirm seams with the user before writing
a test.
- "No production code without a failing test first" for documentation-only,
formatting-only, exact generated-mirror, or provenance-only work.
Test-driven development.
When to Use
When the user wants to build a new feature or fix a bug.
The Process
- Write a failing test
- Implement the code to make the test pass
- Repeat
That's it.
Rules
- No production code without a failing test first.
- No extra features beyond what the test requires.
- Refactoring is not part of the loop. That's a separate process.
Test Design
- Test only at pre-agreed seams. Before writing any test, write down the seams under test and confirm them with the user.
- Tests should be independent of implementation details.
- Tests should be as nested as possible, following the one-assertion-per-test pattern.
- Tests should cover as few files as possible, ideally one file per test, following the one-behavior-per-test pattern.
- Tests should be as fast as possible, following the fast-tests pattern.
- Tests should be as isolated as possible, following the isolated-tests pattern.
- Tests should be as repeatable as possible, following the repeatable-tests pattern.
- Tests should be as self-checking as possible, following the self-checking-tests pattern.
- Tests should be as timely as possible, following the timely-tests pattern.
Examples
it("should return a list of users", () => {
const users = getUsers();
expect(users).toEqual(["user1", "user2", "user3"]);
});
it("should return a list of users", () => {
const users = getUsers();
expect(users).toEqual(["user1", "user2", "user3"]);
});
1---2name: tdd3description: Test-driven development for substantive feature, bug-fix, and behavior-changing work. Use automatically when implementing features, fixing bugs, or changing behavior (red → green → refactor). Also use when the user mentions TDD, /tdd, /TDD, or red-green-refactor. Do not use for documentation-only, formatting-only, exact generated-mirror, or provenance-only changes.4---56## This repository (Asymmetric-al/core)78These repo-owned sections are intentionally kept on top of the vendored9Matt Pocock TDD skill. If upstream refreshes replace this file, reconcile this overlay10before running `bun run skills:sync`.1112TDD is the default workflow for substantive Core implementation. Do not wait for the user to type `/tdd` or `/TDD`. `/tdd` and `/TDD` resolve to this same workflow.1314### Triggers1516- Implementing a feature, bug fix, or behavior-changing refactor.17- The user mentions TDD, `/tdd`, `/TDD`, or red-green-refactor.18- Changing executable behavior, types, migrations, RLS, or generated-file19 contracts.2021Do **not** invent an artificial RED test for documentation-only edits,22formatting-only edits, exact generated-mirror updates, or provenance-only23metadata.2425### Workflow26271. Understand the expected behavior from the request, existing tests, and28 nearest public or architectural seam.292. Inspect current implementation and tests. Use an established public seam30 without waiting for the user to approve an obvious seam.313. Add or update a test that expresses the desired behavior or reproduces the32 bug.334. Run it and confirm it fails for the expected reason when that is meaningful.345. Make the smallest correct implementation change.356. Run the focused test until it is green.367. Refactor where justified while tests remain green. Refactoring **is** part37 of Core's loop after green.388. Run broader relevant validation. Verify runtime or browser behavior when the39 change is user-visible.4041Prefer characterization tests before changing poorly understood legacy42behavior. Prefer tests that prove behavior at a stable seam over43implementation-coupled tests.4445### Checklist4647- [ ] Substantive behavior change used TDD (or a documented exception)48- [ ] `/tdd` and `/TDD` were treated as this same workflow49- [ ] Established seams were used without blocking on user approval50- [ ] Refactor happened only after green, if at all51- [ ] Docs/format/mirror/provenance work did not invent a fake RED test5253The vendored Matt Pocock body below is kept for provenance. These lines are54**non-operative in Core** and must not override the overlay:5556- "Refactoring is not part of the loop."57- "Test only at pre-agreed seams" / confirm seams with the user before writing58 a test.59- "No production code without a failing test first" for documentation-only,60 formatting-only, exact generated-mirror, or provenance-only work.6162---6364Test-driven development.6566## When to Use6768When the user wants to build a new feature or fix a bug.6970## The Process71721. Write a failing test732. Implement the code to make the test pass743. Repeat7576That's it.7778## Rules7980- **No production code** without a failing test first.81- **No extra features** beyond what the test requires.82- **Refactoring is not part of the loop.** That's a separate process.8384## Test Design8586- Test only at pre-agreed seams. Before writing any test, write down the seams under test and confirm them with the user.87- Tests should be independent of implementation details.88- Tests should be as nested as possible, following the [one-assertion-per-test](https://www.betterspecs.org/#single) pattern.89- Tests should cover as few files as possible, ideally one file per test, following the [one-behavior-per-test](https://www.betterspecs.org/#one-behavior) pattern.90- Tests should be as fast as possible, following the [fast-tests](https://www.betterspecs.org/#slow) pattern.91- Tests should be as isolated as possible, following the [isolated-tests](https://www.betterspecs.org/#isolation) pattern.92- Tests should be as repeatable as possible, following the [repeatable-tests](https://www.betterspecs.org/#repeatable) pattern.93- Tests should be as self-checking as possible, following the [self-checking-tests](https://www.betterspecs.org/#self-checking) pattern.94- Tests should be as timely as possible, following the [timely-tests](https://www.betterspecs.org/#timely) pattern.9596## Examples9798```ts99it("should return a list of users", () => {100 const users = getUsers();101 expect(users).toEqual(["user1", "user2", "user3"]);102});103```104105```ts106it("should return a list of users", () => {107 const users = getUsers();108 expect(users).toEqual(["user1", "user2", "user3"]);109});110```