Watch · Hands-On Guide, Exercise 4

Pair Programming with an Agent

2:30 · Hands-On Guide

Made by AI agents — script drafted from the book, AI narration, animation written as code — and steered by the author, Rasmus Bornhøft Schlünsen.

Transcript

What the film says

Picture a wall of postcards. Every place you dream of going, each one on its own card. Add a destination, edit it, mark it as visited, delete the ones you've changed your mind about. Now build that app from scratch, without writing a single line of code yourself. That's exercise four: pair programming with an agent.

You start with an empty folder, and before any code, you write the house rules. A short agents dot M D file: one index dot html file, no frameworks, data saved in the browser, and change only what I ask for. Agents start every session with a blank memory, so they read this file every time.

Then describe the app, the way you'd explain it to a friend. But don't let the agent start typing. In plan mode, it answers with a plan instead of code. Read it. This is the cheapest moment to change your mind. Want a field for the best season to visit? Say so now. Then approve it.

The agent writes the whole app into one file. Before you open it, ask the agent to walk you through the code. How are destinations stored? How does the delete button know which card to remove? Always review before you run.

Now open it in your browser. Type Kyoto. Cherry blossoms in spring. Click add, and a card appears. Add a few more, refresh the page, and they're still there. It works, so save a checkpoint: your first commit.

Now make it yours. Ask for a search bar, colour coded badges, or a stamp that says been there. After each change, look at the diff. Is it the size you expected? Did it touch anything you didn't ask about? Try it in the browser. Like it? Commit. Don't? Restore, and you're back at your checkpoint. One change, one review, one commit.

And sometimes, something breaks. You click delete, and the card just sits there. That's normal. Describe the problem, ask the agent to diagnose it, and review the fix. Debugging by conversation. When you're happy, push it all to GitHub.

You brought the vision. The agent brought the code. You don't need to write JavaScript to build a JavaScript app. You need to know what you want, and how to check you got it. Describe, review, iterate, and understand enough to stay in control. Next up: exercise five, going live.