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.
Workflow: fixing a bug from an error message
card 2 of 6
Make the bug visible, then make it go away
builds on: Giving the right context: files, errors, examples, Tests as the definition of done
The agent can only fix what it can see happen. If you give it the exact error and the command that triggers it, it can rerun the failure instead of guessing. Capturing that failure as a test that expects the *right* result turns 'fixed' into something it can check. The test fails now, for the reason you saw, and must pass afterwards. Knowing the **root cause** (why the code reaches that line in a bad state) lets you judge whether the fix targets the cause or only hides the symptom.
Terms on this card
- root cause
- The underlying reason a bug happens, as opposed to the line where it finally shows up as a crash.
- symptom
- The visible effect of a bug, such as a crash or a wrong number. Hiding it does not remove the cause.
- command
- A line of text that tells the computer to run a program, typed in a terminal, for example `python src/cart.py`.
- test
- A small piece of code that runs part of your program and checks the result matches what's expected, reporting pass or fail.
- 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: Fix a bug end to end. Give the exact error and how to reproduce it, have it reproduce the failure as a test first, review the root-cause explanation, apply the minimal fix, and confirm the test passes and nothing else broke. ·
the whole lesson