From 913eb50b9ed6d82a17d6ca6fdf590a966cfcc26d Mon Sep 17 00:00:00 2001 From: James Manuel Date: Mon, 24 Aug 2026 23:28:31 +0200 Subject: [PATCH] docs: close a testing-trigger gap for existing-file behavior changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit-discipline rules covered a new unit, a changed function signature, and a bug fix, but not a new interactive element or render branch added to a file that already has specs with no signature change — exactly the shape of gaps found in three recently reviewed PRs (#126, #127, #130). Add that as its own trigger, and fold an extraction-timing signal into the existing "Extraction is its own commit" bullet rather than as a separate paragraph, which read as contradicting it. Co-Authored-By: Claude Sonnet 5 Signed-off-by: James Manuel --- AGENTS.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 8442ac8..4a49c06 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,6 +45,10 @@ as the fix. Without one, nothing stops the bug from coming back next time this code is touched, and the fix reads as untested even in a file that already has specs. +A new interactive element or render branch in a file that already has specs +still needs a test — assert on the rendered effect, not the prop passed into +a mock. If two instances could receive the same input, test that case too. + A red test means one of three things: the code is wrong, the behavior it pins changed on purpose, or the test itself is wrong — asserting on a mock instead of real behavior, or flaky. Only the last two justify touching the @@ -132,7 +136,9 @@ Two things follow: or leave it inline until one emerges. - **Extraction is its own commit** when you're separating duplication or responsibilities that predate your change. A unit that exists only because of - the feature you're building belongs in the feature commit. + the feature you're building — including a component that finally gets split + up because your addition is what tipped it over — belongs in the feature + commit, not a dedicated cleanup PR to get to later. ## Never loosen a security check