From ee6aadc258e493e1fd2030f781c70fa214745cad Mon Sep 17 00:00:00 2001 From: hill Date: Wed, 30 Sep 2026 16:27:19 +0200 Subject: [PATCH] Update AGENTS.md with test-first approach Clarify the importance of writing regression tests before fixing bugs. --- AGENTS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 965909839..0bf5d5e6f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -68,6 +68,9 @@ so an example built from input no one would ever write teaches nothing and puts an obscure bug on a billboard. The test: would a first-time reader of this object want this example? If no, it is a unittest. See the `writing-docs` skill. +- **Fix a bug test-first.** Write the regression test before changing the code, run it, + and see it fail for the reason the bug describes, not on an import error or a typo. + Then fix it and see it pass. A test that passed before the fix does not test the fix. - Never commit `forceSource=True` to a test or doctest (it reparses from source every run and slows the suite for everyone). The ONLY exception is the one test that exercises `forceSource` itself. If you hit a stale-parse problem while developing: