Claude Code Build Night · Part 4 · Coming soon

Ship a Feature

Add one feature to a live app, with tests that prove it works.

How the night runs.

We add Favorites to What's for Dinner on screen, one prompt at a time. Follow along on your own app or just watch.

  1. 01

    Feedback

    Let what testers said pick one feature.

  2. 02

    Spec

    Acceptance criteria and a test plan in SPEC.md.

  3. 03

    Tests

    Failing tests first, then code until they pass.

  4. 04

    Ship

    Review, preview on a phone, merge when green.

The deck.

Every slide from the night, free to share. Open it full size to step through.

Ship a Feature · slidesOpen full size →

Tonight's example.

Testers kept scrolling their history for the same dinner. So tonight it gets Favorites.

SPEC.mdWhat's for Dinner

What's for Dinner

Save the dinners you'd make again. Find them in one tap.

The one jobKeep the dinners I'd make again one tap away.

  • Vitest
  • Playwright
  • Claude Code subagents
  • GitHub
  • Vercel previews
  • Neon branches
Done when
  • Every new test failed before the code existed
  • Saving twice keeps one copy
  • Another account can't see my favorites
  • Checked on a phone through the Vercel preview
  • Merged with every check green
Copy the feature section
## Feature: Favorites

### Feedback
"I made the shakshuka three times. Every time I had to scroll through my history to find it."
Three testers asked for some version of this, more than any other request. One asked for meal plans; that waits until Part 8.

### The one job
Keep the dinners I'd make again one tap away.

### Out of scope
- No folders, tags, ratings or notes
- No sharing favorites with anyone
- No editing a saved recipe
- Everything already under Out of scope in SPEC.md stays out

### Screen
1. A heart on every dinner card, in new results and in "Your dinners". Tap to save, tap again to remove.
2. A "Favorites" list above "Your dinners": saved dinners, newest saved first.
3. Empty state: "Tap the heart on a dinner you'd make again."

### Data
One new table, favorites: id, user_id, dinner_id, recipe_index (0, 1 or 2), created_at.
Unique on (user_id, dinner_id, recipe_index), so saving twice keeps one copy.

### Acceptance criteria
- [ ] Tapping the heart saves the dinner, and it shows at the top of Favorites without a reload
- [ ] Tapping the heart again removes it from Favorites
- [ ] Saving the same dinner twice keeps one copy
- [ ] Favorites are still there after a refresh, and after signing out and back in
- [ ] Another account can't see or change my favorites
- [ ] At phone width the heart is easy to tap and nothing overflows

### Test plan
Vitest (logic in lib/favorites.ts, no network or database):
- toggling adds a favorite when it's absent and removes it when it's present
- toggling the same dinner twice in a row leaves one or zero copies, never two
- the list sorts newest saved first
- a recipe_index outside 0-2 is rejected

Playwright (end to end, iPhone 13 device, against localhost):
- sign up, find dinners, heart one, see it in Favorites, reload, still there
- un-heart it and it's gone
- a second account sees the empty state

By hand:
- the Vercel preview on a real phone before merging

### Ship checklist
- [ ] Every new test failed before the code existed
- [ ] Every test passes
- [ ] A fresh subagent reviewed the diff against this section, and its findings are fixed or answered
- [ ] Pull request open, Vercel preview checked on a phone
- [ ] Tests run on the pull request in GitHub Actions; checks green, then merge

The prompts.

Every prompt from the deck, in order. Open one, copy it, paste it into Claude Code, Codex or any coding agent.

  1. 01
    Let feedback pick the feature
    Read SPEC.md, then read FEEDBACK.md, where I pasted what testers told me, one note per line.
    
    1. Group the notes by what the person was trying to do, and count each group.
    2. For each group, say in one line whether it fits The one job in SPEC.md or something under Out of scope.
    3. Recommend one feature we can build and ship tonight: the biggest group that fits the one job. Say what you'd leave out.
    
    Don't write any code. Stop and wait for me to pick.
  2. 02
    Write the feature spec
    We're adding one feature: Favorites. Read SPEC.md first.
    
    Interview me about it one question at a time and wait for each answer. Cover what the person taps, what they see, what happens on a second tap, what data we keep, and who can see it.
    
    Then add a section to the end of SPEC.md called "Feature: Favorites" with: Feedback, The one job, Out of scope, Screen, Data, Acceptance criteria (checkboxes, each one something a test can check), Test plan (which checks are Vitest unit tests for logic, which are Playwright end-to-end tests at phone width, and which I check by hand), and a Ship checklist.
    
    Don't change the rest of SPEC.md. Stop and wait for my OK before writing any code.
  3. 03
    Set up the tests
    Read SPEC.md, especially Feature: Favorites. Set up testing one step at a time and stop after each step.
    
    1. Install Vitest following the Next.js Vitest guide:
    npm install -D vitest @vitejs/plugin-react jsdom @testing-library/react @testing-library/dom vite-tsconfig-paths
    Add vitest.config.mts and a "test" script that runs vitest.
    2. Tell me to run this in my own terminal, because it asks questions:
    npm init playwright@latest
    Wait until I tell you it's done.
    3. In playwright.config, add a project that uses the iPhone 13 device, and a webServer that starts npm run dev.
    4. Add a PostToolUse hook to .claude/settings.json with the matcher Edit|Write that runs npx vitest run. If the tests fail, it exits with code 2 and writes the failure summary to stderr so you see it. Follow code.claude.com/docs/en/hooks-guide. Tell me to restart Claude Code so the hook loads, and wait.
    
    Don't write any feature code yet.
  4. 04
    Red first, with Matt Pocock's /tdd
    If you don't have Matt Pocock's skills yet, I'll install them in my terminal:
    claude plugin install mattpocock-skills@claude-plugins-official
    Wait until I tell you it's done, and tell me to restart Claude Code if you can't see the tdd skill.
    
    Read SPEC.md, especially Feature: Favorites. Use the tdd skill.
    
    1. Propose the seams under test: lib/favorites.ts for the logic, and the Favorites flow in the browser. Wait for my OK.
    2. Write the first Vitest test from the Test plan, run it, and show me it fails for the right reason.
    3. Write the Playwright test for the main flow (heart a dinner, see it in Favorites, reload, still there), run it, and show me it fails.
    
    Don't write any feature code yet. Stop when both are red.
  5. 05
    Green, one slice at a time
    Read SPEC.md, especially Feature: Favorites. Keep using the tdd skill.
    
    First, create a git branch called feature/favorites. Then create the favorites table from the Data section.
    
    List the slices that get every acceptance criterion to pass, in order, and wait for my OK. For each slice:
    1. Write one failing test, run it, and show me it's red.
    2. Write only enough code to make it pass, then run all the tests.
    3. Tell me what to open at localhost:3000 and wait for me before the next slice.
    
    If something in the spec is unclear, ask me instead of guessing. Don't add anything under Out of scope. Commit after each green slice.
  6. 06
    Green isn't done
    Read the acceptance criteria under Feature: Favorites in SPEC.md.
    
    1. Run the full Playwright suite on the iPhone 13 project and save a screenshot of Favorites with three saved dinners and of the empty state.
    2. Go through every acceptance criterion and tell me which test covers it, or that it needs a check by hand.
    3. Give me a short list of things to try myself in the browser at phone width: long dinner names, ten favorites, a fast double tap on the heart.
    
    Fix anything that fails, one issue at a time, and show me each fix.
  7. 07
    A fresh pair of eyes
    Review this feature before it ships.
    
    Start a fresh subagent that hasn't seen our conversation. Give it only SPEC.md and the output of git diff main...feature/favorites. Ask it to review the diff adversarially against Feature: Favorites: missed acceptance criteria, anything under Out of scope that crept in, another account reaching my favorites, and tests that would pass even if the code were wrong. Ask for findings only, with file and line.
    
    When it reports, check each finding against the code yourself. For each real one, write a failing test, then fix it. Tell me which findings you rejected and why. Don't push yet.
  8. 08
    Preview, then merge
    Read SPEC.md. Get Feature: Favorites ready to merge, and stop after each step.
    
    1. Preview deployments use the Vercel project's Preview environment variables, not Production. Create a Neon branch called preview for the preview database, with the new favorites table. Then give me the steps to set these for Preview in the Vercel dashboard myself: DATABASE_URL (the preview branch) and BETTER_AUTH_SECRET (a new value, not the production one). Never print secrets in chat. Wait until I tell you it's done.
    2. Better Auth rejects sign-ins from origins it doesn't trust, and every preview has its own URL. Read better-auth.com/docs/reference/options and update the auth config: use the dynamic baseURL with allowedHosts for this project's preview hosts only (a pattern scoped to our project name on vercel.app, never all of *.vercel.app) plus production and localhost. The docs say allowedHosts entries are added to trustedOrigins automatically; use trustedOrigins directly if our version doesn't support that.
    3. Write .github/workflows/test.yml so every pull request runs the tests. Follow playwright.dev/docs/ci-intro: actions/checkout and actions/setup-node at the versions it shows, npm ci, npx vitest run, npx playwright install --with-deps, then npx playwright test. The Playwright tests sign up real accounts, so create a Neon branch called ci and tell me to add DATABASE_URL (the ci branch) and BETTER_AUTH_SECRET as GitHub Actions repository secrets myself. Wait until I tell you it's done.
    4. Push feature/favorites and open a pull request with gh pr create. In the description, paste the acceptance criteria with each one ticked, and the review findings you fixed.
    5. Wait for the Vercel preview deployment and give me its URL so I can sign in and check Favorites on my phone. Wait until I tell you it works.
    6. Run gh pr checks --watch. The checks must include the test workflow and the Vercel deployment. If anything fails, fix it and push again.
    7. When every check is green, ask me before you merge. After the merge, confirm the production deploy and tick the Ship checklist in SPEC.md.

The toolkit.

Everything that turns one feature into a merged, tested change, one job each.

Bring your app. Leave with a tested feature.

Date to be announced. Dates go out in the Discord first.

Harbor at dusk · Phoenix, Arizona