Lesson 4 · Matt Pocock's Skills

Build: One Ticket, One Run

/implement runs the build, /tdd keeps it honest, and /code-review checks it two ways.

Your win for this lesson

You can watch an /implement run and tell whether it's going right. You can spot a test that grades nothing, put a review finding on the right axis, and fix the common ways a run stalls.

0. Warm-up

These mix Lessons 1–3, applied to a feature you haven't seen. That makes them harder on purpose.

This lesson's example is a new ticket. The spec has already agreed one seam: the reset service's request(email) entry point.

  1. 03A user who asks for a 4th password-reset email within an hour sees "try again later", and no email is sent.Blocked by: 02

1. Idea one: /implement builds, it never re-plans

/implement builds work that has already been decided. "It never reopens the plan. There is no interview, no clarifying round." That's the difference from typing "build this" into a fresh agent, which tends to redesign the work while it builds it.[1] The whole skill is six lines long.[2] One run takes five steps:

  1. Fetch the ticket, state its title, and work out the seams.
  2. Drive /tdd at the pre-agreed seams, one red → green slice at a time.
  3. Typecheck often, and run single test files as it goes.
  4. Run the full suite once, at the end.
  5. Run /code-review, then commit to the current branch.

That's one ticket per run. Then /clear, and start the next. Three things it does not do:[1]

Burned 150k tokens on one ticket? That's normal for a non-trivial ticket, which goes over 100k. If it keeps happening, the fix is upstream: split the ticket.[1]

2. Idea two: /tdd is red → green at agreed seams

A seam is "the public boundary you test at: the interface where you observe behavior without reaching inside." The rule has no exceptions: "No test is written at an unconfirmed seam."[3] In the full flow, the seams were agreed in /to-spec. If they weren't agreed anywhere, the run quietly turns into "just write the code," and nothing warns you.[1]

The loop: write one failing test, then only enough code to pass it, then the next test. There's no refactor phase, even though the skill's description still says "red-green-refactor". The step was removed in June 2026, because agents almost never did it and because review works better in its own session. Refactoring now belongs to /code-review.[4]

Correction to earlier lessons

Lesson 1 and the Skill Map said "red → green → refactor". I've updated both. This is why the course re-reads the skill files before teaching from them.

A test worth keeping, and one that grades nothing

// KEEP: behaviour through the agreed seam, literal expectations
test("a 4th reset request within an hour is refused", async () => {
  const mail = fakeMailer();                       // system boundary
  const resets = makeResetService({ clock: fakeClock(), mail });
  for (let i = 0; i < 3; i++) await resets.request("kyu@example.com");

  expect(await resets.request("kyu@example.com")).toBe("try-again-later");
  expect(mail.sent).toHaveLength(3);
});

// TAUTOLOGICAL: the expected value is computed the way the code computes it
test("remaining resets", async () => {
  const expected = RESET_LIMIT - attempts.length;
  expect(resets.remaining("kyu@example.com")).toBe(expected);
});

The skill names three anti-patterns, and each has a tell:[3]

Anti-patternThe tell
Implementation-coupledIt breaks when you rename an internal function, even though behaviour didn't change. Look for mocked internal collaborators, asserted call counts, or a database query used to check the result.
TautologicalThe expected value restates the code, so it passes by construction. Expected values must come from "a known-good literal, a worked example, the spec."
Horizontal slicingA batch of tests landed before any implementation. It's the Lesson 3 mistake again, made at the scale of tests.

Mock at system boundaries only: external APIs, time, randomness, and sometimes the filesystem or the database. Never mock your own modules.[5] In the test above, the mailer and the clock are faked, and the rate limiter inside the reset service is real.

3. Idea three: /code-review checks two separate axes

The review compares git diff <fixed-point>...HEAD against two questions. Each runs in its own subagent, so neither sees the other's reasoning:[6]

StandardsSpec
AsksIs it built right?Is it the right thing?
ReadsThe repo's documented standards (CODING_STANDARDS.md, CONTRIBUTING.md, and so on) plus a smell baselineThe originating ticket or spec
FindsDocumented breaches, which can be hard violations, and smells, which are always judgement callsMissing or partial requirements, scope creep, and requirements implemented wrongly
CitesThe rule and its file, or the named smell plus the hunkThe spec line

The two reports are never merged or re-ranked. Code can follow every standard and still build the wrong thing, and a blended verdict would let the passing axis hide the failing one.[6] The smell baseline is twelve code smells from chapter 3 of Fowler's Refactoring: Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, and Refused Bequest. The repo always overrides the baseline.

Field notes from the guide

These come from real reports collected in the skill's guide.[7]

4. Practice

Drill A: keep the test, or throw it out?

All of these are tests for ticket 03.

Drill B: fake it, or use the real one?

Drill C: which axis finds it?

The spec for the reset limit says "3 reset emails per hour per account; the 4th request shows 'try again later'."

Drill D: the run went wrong

Drill E: from memory

Write the five steps of an /implement run, then the three /tdd anti-patterns.

  1. Fetch the ticket, state its title, and work out the seams
  2. /tdd at the pre-agreed seams, one red → green slice at a time
  3. Typecheck often, and run single test files
  4. Run the full suite once, at the end
  5. /code-review, then commit to the current branch

Anti-patterns: implementation-coupled, tautological, and horizontal slicing.

Optional: feel it for real (20 min)

Use the git-log CLI tickets from Lesson 3's optional exercise. Copy implement, tdd, codebase-design (which tdd needs) and code-review into ~/.claude/skills/. The code-review copy will shadow Claude Code's built-in one until you delete it. Then:

  1. Create a branch, then run /implement 01.
  2. Watch for three things: it names the seams and waits, a single test goes red before any code exists, and the run ends in a commit.
  3. Close ticket 01 yourself, run /clear, then run /code-review main. Check that you get two separate blocks, Standards and Spec.

Primary source

Read tdd/SKILL.md and its tests.md (5 minutes in total). Then read the "Common questions" sections of the implement and code-review guides, which are field reports from people running these skills. For the background, chapter 3 of Fowler's Refactoring is the smell baseline.

Stuck on something?

Ask me in Claude Code. Good questions: "where would the seam be in my BullMQ worker?", "show me an implementation-coupled test from a real codebase", or "how do I fork code-review so it stops clashing with the built-in?"

The Build Card has all of this on one page. See also the Planning Card and the Skill Map.

Related ideas