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: refactoring safely with an agent card 5 of 6

Catching a quietly edited test

builds on: Workflow: having the agent write tests, Tests as the definition of done, Doing a bigger change plan-first, step by step, Branches for risky or alternative attempts
`git diff e8d3a90 -- tests/` shows what changed in `tests/` since the pinning commit. It should print nothing. Here the expected total lost its comma: a step changed the output and the agent bent the test to match. If `git diff 9a02b18 -- tests/` shows the same change, it came in step 3. Have the agent restore the assertion and redo step 3 until that test passes unchanged. Then, in `git diff e8d3a90`, a `-def build_report(...)` line replaced by a different `+def` means the interface changed. A lone `+def` for a new helper like `format_row` is fine.
$ git log --oneline
c41d7e2 Step 3: split out totals
9a02b18 Step 2: extract format_row
5be1f03 Step 1: rename local variables
e8d3a90 Add tests pinning build_report
$ git diff e8d3a90 -- tests/
--- a/tests/test_report.py
+++ b/tests/test_report.py
@@ -41 +41 @@
-    assert total == "1,204.50"
+    assert total == "1204.50"
Terms on this card
pinning commit
The commit that saves the pinning tests before any refactor step. Later checks compare against it.
commit
A saved snapshot of your project in git that you can compare against or return to later.
diff
A listing of exactly which lines were removed (-) and added (+) between two versions of files.
assertion
A line in a test stating what must be true, e.g. `assert total == "1,204.50"`. If it isn't true, the test fails.
helper
A small function split out of a bigger one to do part of its work, e.g. `format_row`.
Learn this step by step on Bytewise
Lesson goal: Refactor safely by making sure tests cover the behaviour first, then asking for behaviour-preserving changes in small committed steps on a branch. Check that no test or public interface was quietly changed. · the whole lesson