What problem does it solve? Deciding where a backend test belongs and why the suite fails is hard in a four-layer test architecture with a 100% coverage gate on the platform layer. This Skill guides writing unit, integration, API, and migration tests for a FastAPI/Postgres backend using anyio, and diagnoses coverage-gate and test-suite failures. ## Core Features & Use Cases - Layer Selection: Routes each test to the right layer — unit tests with mocked repositories, integration tests against a real Postgres for schema guarantees, API tests for route permission wiring, and E2E via a separate skill. - anyio Conventions: Enforces pytestmark = pytest.mark.anyio instead of pytest-asyncio, with the correct fixtures (client, mock_db_session, mock_redis) from conftest. - Coverage Gate Diagnostics: Explains the 100% platform-layer gate, the two ways a module silently drops out of coverage, and how to read gaps as untested branches. - Use Case: A bug fix needs a regression test — the Skill helps you name the behaviour, assert the consequence, cover the refusal path, and place the test in the correct layer so make test passes. ## Quick Start Write a unit test for the agent registry service that verifies publishing an agent with an unknown capability is refused.