From 32a06838249f81017010a8a10fdeab597a511ca1 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Mon, 17 Aug 2026 23:05:07 +0200 Subject: [PATCH] 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) --- AGENTS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 1b33ed3..a2eeb94 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 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 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