What problem does it solve? Writing and maintaining tests in a large monorepo is error-prone: tests break on refactors, mocks are misused, database tests behave differently across environments, and running the full suite wastes time. This Skill provides concrete Vitest conventions, mock patterns, and environment-specific guidance so tests are written correctly the first time. ## Core Features & Use Cases - Vitest conventions and commands: Run targeted test files instead of the full 3000+ test suite, with separate commands for client-db (PGlite) and server-db (Postgres) modes. - Mock patterns: Prefer vi.spyOn over vi.mock, compose UI stubs over importOriginal, and mock at boundaries like database, network, and Electron IPC. - Specialized reference guides: Detailed instructions for database model testing, Zustand store actions, Electron IPC, desktop controllers, and agent runtime E2E tests. - Use Case: After adding a new repository under packages/database/src/repositories/, use this Skill to generate a sibling integration test with getTestDB(), user-isolation checks, and BM25 guards via describe.skipIf(!isServerDB). ## Quick Start Ask the agent to write a Vitest test for a specific source file following the project's testing conventions.