diff --git a/skills/test-driven-development/SKILL.md b/skills/test-driven-development/SKILL.md index 4320d8879a..211d3a48f7 100644 --- a/skills/test-driven-development/SKILL.md +++ b/skills/test-driven-development/SKILL.md @@ -119,13 +119,17 @@ npm test path/to/test.test.ts ``` Confirm: -- Test fails (not errors) +- Test fails (not errors) — a **behavior assertion** rejects wrong output - Failure message is expected -- Fails because feature missing (not typos) +- Fails because the feature's behavior is wrong or missing (not typos) **Test passes?** You're testing existing behavior. Fix test. -**Test errors?** Fix error, re-run until it fails correctly. +**Test errors?** (import/module-not-found, missing symbol, syntax, collection, +setup) Fix the error and re-run until the test fails correctly. Structural +load failures only prove the surface is not runnable — they are **not** +evidence that the behavior assertion works. Get an importable negative +control under the assertion before treating RED as proven. ### GREEN - Minimal Code diff --git a/skills/writing-plans/SKILL.md b/skills/writing-plans/SKILL.md index dd2702b8ba..4958812993 100644 --- a/skills/writing-plans/SKILL.md +++ b/skills/writing-plans/SKILL.md @@ -103,7 +103,22 @@ def test_specific_behavior(): - [ ] **Step 2: Run test to verify it fails** Run: `pytest tests/path/test.py::test_name -v` -Expected: FAIL with "function not defined" +Expected: FAIL with a **behavior assertion** rejecting the wrong result +(e.g. `AssertionError: assert actual == expected`), not a load/import error. + +**RED evidence (required for claiming the test works):** +- **Behavioral RED** — the test runs far enough to execute its assertion and + fails because the observable result is wrong. This is the only evidence that + the behavior check has teeth. +- **Structural RED** — `ImportError` / `ModuleNotFoundError` / missing symbol / + syntax / collection / setup error. This only proves the surface is absent or + not loadable. **Do not** plan or report structural RED as proof that a + behavior assertion detects incorrect results. +- If Step 2 hits structural failure first: get past load/setup (minimal + importable stub or negative-control return value as needed), re-run, and + record behavioral RED before implementing the real logic — unless the plan + explicitly states why behavioral RED is impossible for this technology. + Aligns with `test-driven-development` (fails, not errors). - [ ] **Step 3: Write minimal implementation**