Sample

Entries marked Sample show the format only. They are not the owner’s experience, results or recommendations.

Workflow

Workflow: review a code change suggested by an assistant

Read the diff before running it, run the tests before and after, and keep the change small enough to explain in one sentence.

SampleWritten to demonstrate the format. It does not describe the owner’s experience, results or recommendations.

Published
Updated
Reading time
2 min

A coding assistant can produce a working-looking change faster than it can be reviewed. This workflow keeps review in control: nothing is merged that has not been read, tested and explained.

Step 1: start from a clean state

Commit or stash your own work first, so the assistant's change is the only difference.

Shell
git status --short
git stash push -m "before assistant change"

git status --short prints nothing.

Step 2: run the tests before the change

Record the result. A change cannot be judged against a baseline you never saw.

Shell
python3 -m unittest discover -s tests

Step 3: read the whole diff

Read every line, including files you did not expect to change. Ask the assistant to explain any line you cannot explain yourself.

Diff
-    total = sum(items)
+    total = sum(item.amount for item in items if item.amount is not None)

Step 4: run the tests again and compare

The same tests should pass, plus any new ones. A test that was removed or weakened needs a reason.

Every test that passed in step 2 still passes, and no test was deleted without an explanation.

Step 5: write the one-sentence summary

If the change cannot be described in one sentence, split it. The sentence becomes the commit message.

SignalWhat to do
Diff touches unrelated filesAsk for a smaller change
New dependency appearsStop and review it separately
Tests were edited to passTreat as a failed review

See the project's own contribution notes (external site) for team-specific rules.

Tools in this note

Dates on this page are written by the author in the note file. “Updated” appears only when the note was actually revised.