Skip to content

Commit 5c66b16

Browse files
committed
docs(agents): add test value guidelines
1 parent 7bc7f82 commit 5c66b16

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

home/AGENTS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ Avoid these patterns unless explicitly approved:
7575
- Before running a remote or container batch, verify every required executable in that environment. Do not assume host tools or the host `PATH` exist there; stop and report missing requirements.
7676
- Use the supported tool-discovery mechanism when capability availability is unclear.
7777

78+
## Test Value
79+
80+
Before adding or materially expanding a test, inspect the relevant code and existing tests, then identify:
81+
82+
1. The observable behavior, regression, boundary, failure mode, or cross-component contract the test protects.
83+
2. A plausible real-world defect that would make the test fail.
84+
3. The gap in existing tests that leaves that defect unprotected.
85+
86+
If you cannot identify all three, do not add the test.
87+
88+
- Exercise the narrowest stable boundary that exposes the defect. Name the test for the behavior it actually exercises.
89+
- Assert an observable output, state transition, persisted or emitted effect, or specific error.
90+
- Do not use successful execution or shallow proxies—such as type or non-empty checks, inheritance, constructibility, signatures, source-text presence, snapshots, or mock calls—as the sole evidence unless that fact or interaction is itself the contract.
91+
- Prefer real collaborators or lightweight fakes. Mock external or nondeterministic boundaries only when needed; assert interactions only when they are the contract.
92+
- Do not duplicate the same branch and outcome at another layer unless the added test proves a distinct integration risk.
93+
- Do not add tests only to increase coverage, mirror production files, or preserve implementation structure.
94+
- Apply the deletion test before finishing; remove the test if its absence would not materially weaken regression protection.
95+
7896
## Verification
7997

8098
- Turn the request into a verifiable result and define the smallest relevant checks before editing.

0 commit comments

Comments
 (0)