docs(agents): say that an agent commits only its own work

The working tree is shared. An agent that reaches for `git add -A` sweeps up
whatever the user or another agent left there and signs it, which puts work in
the log nobody reviewed and breaks the one-coherent-change rule right below it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Lucas Winther
2026-08-17 23:05:07 +02:00
co-authored by Claude Opus 5
parent 83ec0312d6
commit 32a0683824
+7
View File
@@ -376,6 +376,13 @@ to an open page). Four things hold it up:
- **Commit straight to `main`.** This is a solo repo and its history is a single line; do not open a - **Commit straight to `main`.** This is a solo repo and its history is a single line; do not open a
branch for a change unless asked for one. Committing still waits to be asked. branch for a change unless asked for one. Committing still waits to be asked.
- **Only ever commit your own work.** Stage the files you changed, by path, and nothing else. The
working tree may already hold edits, untracked fixtures or a half-finished experiment that someone
else — the user, or another agent — put there and has not decided about yet; `git add -A`, `git
commit -a` and `git stash` all sweep those into your change or out of sight. Authorship in the log
then says you wrote something you never read, and the commit stops being the one coherent change
the bullet below asks for. If unrelated changes are in the way, say what you see and leave them
alone.
- **Commits are self-contained and succinct.** One coherent change per commit, typechecking and - **Commits are self-contained and succinct.** One coherent change per commit, typechecking and
passing tests on its own — a feature spanning layers splits as model → store → UI → docs, each passing tests on its own — a feature spanning layers splits as model → store → UI → docs, each
step green by itself, even when that means widening a type in the model commit that only the UI step green by itself, even when that means widening a type in the model commit that only the UI