From workflows
Use when writing, reviewing, or refactoring test code. Triggers on Vitest tests, React Testing Library usage, MSW handlers, Playwright E2E tests, pytest fixtures, test structure decisions, or coverage configuration. Contains 46 testing rules across 12 categories.
npx claudepluginhub brite-nites/brite-claude-plugins --plugin workflowsThis skill uses the workspace's default tool permissions.
Testing patterns and conventions for Vitest, React Testing Library, MSW, Playwright, and pytest. Contains 46 rules across 12 categories, prioritized by impact. Focuses on patterns that produce reliable, maintainable tests — test isolation, mock boundaries, query priorities, meaningful coverage, E2E best practices, and Python testing fundamentals.
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
Testing patterns and conventions for Vitest, React Testing Library, MSW, Playwright, and pytest. Contains 46 rules across 12 categories, prioritized by impact. Focuses on patterns that produce reliable, maintainable tests — test isolation, mock boundaries, query priorities, meaningful coverage, E2E best practices, and Python testing fundamentals.
Reference these guidelines when:
| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Test Structure | CRITICAL | struct- | 5 |
| 2 | Mocking Strategy | HIGH | mock- | 4 |
| 3 | Vitest Patterns | HIGH | vitest- | 5 |
| 4 | React Testing Library | HIGH | rtl- | 4 |
| 5 | MSW & API Mocking | MEDIUM-HIGH | msw- | 3 |
| 6 | Fixtures & Factories | MEDIUM | fixture- | 4 |
| 7 | Coverage & CI | MEDIUM | ci- | 4 |
| 8 | Snapshot Testing | LOW-MEDIUM | snap- | 3 |
| 9 | Playwright Fundamentals | HIGH | pw- | 4 |
| 10 | Playwright CI & Advanced | MEDIUM | pw- (shared) | 3 |
| 11 | pytest Fundamentals | HIGH | pytest- | 4 |
| 12 | pytest Advanced Patterns | MEDIUM | pytest- (shared) | 3 |
struct-arrange-act-assert — Follow AAA pattern: setup, execute, verify in every teststruct-single-concept — Each test verifies one behavior, not multiple assertions on different thingsstruct-descriptive-names — Test names describe behavior: "shows error when email is invalid", not "test1"struct-test-isolation — Tests must not depend on other tests' state or execution orderstruct-no-logic — No conditionals, loops, or try/catch in tests — tests are straight-line codemock-boundaries — Mock at system boundaries (network, filesystem, time), not internal modulesmock-reset — Reset mocks between tests to prevent state leakagemock-minimal — Mock the minimum needed — over-mocking makes tests pass when code is brokenmock-type-safety — Mocked return values must match the real type signaturevitest-vi-mock — Use vi.mock for module mocking, vi.spyOn for method spyingvitest-test-each — Use test.each for parameterized tests instead of loopsvitest-setup-teardown — Use beforeEach/afterEach for per-test setup, beforeAll/afterAll for expensive shared setupvitest-in-source — Use in-source testing for pure utility functions with no side effects and no more than 3 dependenciesvitest-fake-timers — Use vi.useFakeTimers for time-dependent code, always restore afterrtl-query-priority — Query by role > label > text > testId. Avoid container.querySelectorrtl-user-event — Use userEvent over fireEvent for realistic user interaction simulationrtl-async-queries — Use findBy for elements that appear asynchronously, waitFor for assertionsrtl-avoid-implementation — Test behavior, not implementation — don't assert on state or propsmsw-handlers — Define default handlers in a shared handlers file, override per-test for edge casesmsw-server-setup — Use setupServer in test setup, resetHandlers in afterEach, close in afterAllmsw-response-assertions — Assert on rendered output from API responses, not on whether fetch was calledfixture-factories — Use factory functions that return valid defaults with optional overridesfixture-no-shared-mutation — Never mutate shared fixture objects — create fresh instances per testfixture-realistic-data — Use realistic data shapes, not placeholder strings like "test" or "abc"fixture-builders — Use builder pattern for complex objects with many optional fieldsci-meaningful-coverage — Measure branch coverage, not just line coverage. Target 80% as a floor, not a ceilingci-parallel-execution — Run tests in parallel by default; isolate tests that need serial executionci-flaky-quarantine — Quarantine flaky tests immediately, fix root cause, don't retry-and-ignoreci-test-splitting — Split test suites across CI workers by file for faster pipelinessnap-inline-small — Use inline snapshots for small outputs (< 10 lines), file snapshots for largesnap-avoid-large — Never snapshot entire component trees — snapshot the specific output that matterssnap-review-updates — Review every snapshot update in diffs — never blindly run --updatepw-page-objects — Encapsulate page interactions in page object classes; expose behaviors, not selectorspw-selectors — Prefer getByRole > getByLabel/getByText > getByTestId > CSS (mirrors rtl-query-priority)pw-test-isolation — Each test gets a fresh browser context; no shared mutable state (cross-ref struct-test-isolation)pw-fixtures — Use test.extend for custom fixtures; compose fixtures; use { scope: 'worker' } for expensive setuppw-network-mocking — Use page.route() to intercept/stub network requests for deterministic E2E testspw-visual-regression — Screenshot specific components with toHaveScreenshot() + explicit thresholds (cross-ref snap-review-updates)pw-ci-config — Browser projects, retries, trace: 'on-first-retry', artifact upload, --shard (cross-ref ci-test-splitting)pytest-fixtures — Fixture scope (function/class/module/session), yield for teardown, fixture composition, autouse sparinglypytest-parametrize — @pytest.mark.parametrize for data-driven tests, indirect fixtures, ids for readable outputpytest-conftest — conftest.py layering and discovery rules, scope-appropriate placement, keep test-specific fixtures localpytest-mocking — monkeypatch for env vars/attrs/dicts, pytest-mock's mocker fixture, preference hierarchy vs raw unittest.mockpytest-async — anyio for async tests, @pytest.mark.anyio, async fixtures, strict mode. Cross-ref: python-best-practices test-async-client for FastAPI-specific patternspytest-markers — Custom markers, marker registration in pyproject.toml, --strict-markers, filterwarningspytest-xdist — Parallel execution with pytest-xdist, --dist loadscope/loadfile, worker-safe fixtures. Cross-ref: ci-parallel-executionFor FastAPI-specific test patterns (async test clients, dependency overrides, database isolation), see the python-best-practices skill. The pytest rules here cover general patterns applicable to any Python project.
For ESLint test plugins (eslint-plugin-testing-library, eslint-plugin-vitest, eslint-plugin-playwright) and other tooling, see the code-quality skill.
For the complete guide with all rules expanded and code examples: AGENTS.md