Guide for writing tests that validate real behavior. Routes to the right approach based on context (bug fix, new feature). Core rule: test what the user sees, not how the code works internally. Load this skill when you are doing test related works.
One test is usually enough. Only add multiple tests if the bug manifests differently under multiple conditions.
Test behavior, not implementation. Validate outcomes, not code paths.
A test's value is measured by:
Identify your context, then read the corresponding file:
| Context | When to use | Reference |
|---|---|---|
| Bug fix | Fixing a reported issue, adding a regression guard | branches/bug-fix.md |
| New feature | Adding new behavior, validating a spec | branches/new-feature.md |
These apply regardless of context:
Read the relevant branch file for context-specific guidance.