Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions skills/test-driven-development/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion skills/writing-plans/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down