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 3 of 6
The five steps of a bug fix
builds on: Giving the right context: files, errors, examples, Tests as the definition of done
1. **Evidence:** paste the exact error output, the command that triggers it, and what should happen instead.
2. **Reproduce:** ask for a test that expects the correct result and fails now. Check that it fails with *your* error, not a typo or an import problem.
3. **Root cause:** have the agent explain it before changing code. Check it against the stack trace.
4. **Smallest fix:** leave the test untouched.
5. **Confirm:** run the new test and the whole suite, read the diff, and rerun your command.
Terms on this card
- stack trace
- The general name for a traceback: the list of function calls that were active when an error happened, with file names and line numbers.
- root cause
- The underlying reason a bug happens, as opposed to the line where it finally shows up as a crash.
- reproduce
- Make a bug happen again on purpose, reliably, so you can see it fail and later see it fixed.
- diff
- A line-by-line listing of what changed in files: removed lines marked '-', added lines marked '+'.
- command
- A line of text that tells the computer to run a program, typed in a terminal, for example `python src/cart.py`.
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