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 3 of 6
Test first, then make it pass
builds on: Describing a task: goal, context, constraints, check, Spotting tests bent to pass, Verifying before you accept a change
1. Ask for **only** a test that states the right behaviour. Read it: does it say what you mean?
2. Run it. It must **fail**, and for the right reason: the wrong result, not a typo or a missing import.
3. Commit the test, so any later change to it shows up in `git diff`.
4. Ask: "Make it pass. Don't edit the test. Done = the whole suite exits 0."
5. Check that the test file is unchanged (`git diff --stat HEAD` must not list it), then rerun the tests yourself.
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.
- exits 0
- A command finished with exit code 0, which means success. Any other number means something failed.
- suite
- Short for test suite: all the tests in a project, run together, for example by typing `pytest`.
- commit
- A saved snapshot of your project in git that you can compare against or return to later.
- git diff
- Shows what changed in your files compared with a saved snapshot, line by line.
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