Block VI · Coding with agents · Lesson 32

Code like a pro with AI: plan, tests and review

You'll learn the workflow that avoids fragile code: plan before writing, write the tests first, work in parallel with worktrees and automatically review every change before accepting it.

Go to the course

What you'll see in this lesson

  1. The workflow that prevents fragile code

    The teams that work best with agents always repeat the same cycle: plan, tests, code, review and commit.

  2. Plan mode: first it reads and proposes, then it touches

    In plan mode the agent explores the code and presents you a plan, but changes nothing until you approve it.

  3. Big tasks: interview and specification

    Before a big feature, ask the agent to interview you and put everything in writing in a file.

  4. Tests first: the agent knows when it's done

    With TDD (test-driven development) you write the tests first, check that they fail, and only then write the code.

  5. Give the agent something it can check

    Anything that returns «pass» or «fail» works: tests, build, linter or a screenshot compared with the design.

  6. Several sessions in parallel with git worktrees

    A worktree is another working copy of the same repository, in its own folder and branch: each agent works in its own.

  7. Automatic review before accepting each change

    A reviewer with a clean context finds bugs the agent that wrote the code can't see.

  8. Small commits: every step, a way back

    Commit every time something works and passes the tests: one change, one commit, one clear message.

  9. Summary: the professional workflow with agents

    Plan, tests, verification, parallel work, review and small commits: slower at first, much faster in the end.

Tools and concepts

Sign in with your Google account to access this lesson and the whole course.

Go to the courseSee the full syllabus

More lessons in this block