Test First
do-test-first · always_apply: no
Content
Tests prove behavior. You cannot claim a scenario, class, or method is implemented until tests pass.
- New code structure: follow playbook rule Skeletons First (
do-skeletons-first) (docstrings, types, stubs). - Write tests before implementation. Do not write tests whose only purpose is to hit
NotImplementedError—write assertions that should pass once real behavior exists. - Cover success (returns) and failure (
raises, errors, edge cases) for each unit of behavior. - If implementation contradicts docstring, ask the user which wins.
- Use
docs/features/to align scenarios with tests. - Order: method-level → API → integration. For integration, follow playbook rule Not Mock In Integration Tests (
do-not-mock-in-integration-tests). - Red–green: make the test fail, then implement until green.
- Use pytest; avoid mocks unless unavoidable.
Layout (never put tests in repo root):
| Kind | Path |
|---|---|
| Unit | tests/unit/ |
| Integration | tests/integration/ |
| API | tests/api/ |
| E2E | tests/e2e/ |
| Service | tests/services/ |
Details
- Slug:
do-test-first- Always apply:
- No
- Created:
- Apr 20, 2026
- Updated:
- Sep 22, 2026
Playbook
Activities 4
- Implement Backend Build Feature
- Implement Frontend Build Feature
- Implement Feature Acceptance Tests Build Feature
- Implement Journey Certification Tests Build Feature