Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Tests as the definition of done
card 2 of 6
Turn 'done' into a pass
builds on: Describing a task: goal, context, constraints, check, Spotting tests bent to pass, Verifying before you accept a change
In words, "done" is a judgement call, so the agent stops when its own account *sounds* finished. A test turns done into a command: `pytest` exits 0 or it doesn't. The agent can run it after every edit and keep going until it passes. That is a goal it can check itself. For you, a pass on a test you agreed on beforehand is evidence, not a claim. The catch: the test must fail first, or it proves nothing.
Terms on this card
- test
- A small piece of code that runs part of your program with a known input and checks that the result is what you expect.
- pytest
- A popular Python tool that finds and runs your tests, then reports which passed and which failed.
- exits 0
- A command finished with exit code 0, which means success. Any other number means something failed.
- command
- A line of text that tells the computer to run a program, typed in a terminal, for example `python src/cart.py`.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
Lesson goal: Turn 'done' into a command that passes, for example by having a failing test written first and then making it pass without editing it. Explain why this gives the agent a goal it can check itself and gives you evidence. ·
the whole lesson