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 4 of 6
The discount bug, done properly
builds on: Describing a task: goal, context, constraints, check, Spotting tests bent to pass, Verifying before you accept a change
You type: "Add a test `test_ten_percent_code` to `tests/test_cart.py`: code SAVE10 on a 20.00 cart gives 18.00. Only the test, change nothing else."
You read the test. It checks exactly that. You run it, and it fails: the total is 20.0 instead of 18.0. That is your bug, caught by a command. The test is now the finish line. You commit it and hand over the fix, as shown on the next card.
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.
- commit
- A saved snapshot of your project in git that you can compare against or return to later.
- command
- A line of text that tells the computer to run a program, typed in a terminal, for example `python src/cart.py`.
- tests
- Small pieces of code that run your program's code and check it gives the expected results.
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