测试与覆盖率:单元/集成/功能测试、TDD、回归测试、性质测试(Hypothesis/QuickCheck)、 mock 外部依赖、行覆盖率与 Codecov。Use when the user asks to write tests, raise coverage, or choose a testing approach. 触发于「写测试/提覆盖率/选测试策略」。
How to verify AutoCSS work before it ships, in a zero-dependency architecture. Covers the air-gap test, driving the real app in a browser to observe behavior, verifying CSS-only state/visibility, and the accessibility passes. Test tooling is dev-only and never enters the shipped static shell. Use before committing any nontrivial change, or when asked to confirm something works.
Estratégia e escrita de testes production-grade: pirâmide vs troféu, unit/integration/e2e, o que testar (comportamento, não implementação), test doubles, contract e mutation testing, cobertura útil. Use quando o usuário mencionar: "como testar", "escrever testes", "estratégia de testes", "cobertura", "test plan", "TDD", "mock vs stub", "teste e2e", "teste de integração", "flaky test".
How verification works in THIS repo — the cheapest-to-costliest confidence ladder and the exact commands that work today. Carries: the real test runner + invocation, the offline-safe rule (unit tests need no env/service/network/GPU — stub the boundary), the ML confidence checks (tiny-data smoke: a forward pass + one train step on a 2-sample fixture; determinism; split-leakage; metric sanity), the live/GPU-smoke pattern (skips cleanly when its dependency is down, self-cleans), readiness checks, and environment preconditions. Load BEFORE running or writing a test, verifying a change, or claiming something works. Triggers: run tests, verify, does this work, test this change, pytest, uv run pytest, smoke test, offline test, readiness check, integration test, CI, forward-pass smoke, shape mismatch, determinism test, leakage test, overfit one batch, does the model train, cuda available.
While testing an implemented feature or fix, investigate incidental suspected bugs and file new, unrelated findings in the project's designated GitHub repository. Use during implementation testing, not as a request for a broader bug audit.
Route Apple-platform testing tasks to the correct Knowledge Contracts -- XCTestCase subclassing with test-prefixed methods and the per-test setUp()/setUpWithError()/tearDown()/tearDownWithError() lifecycle plus the XCTAssert family and XCTSkip/XCTSkipIf/XCTSkipUnless; the Swift Testing framework's @Test/#expect/#require/@Suite/Tag vocabulary; @Test(arguments:) parameterization (single-collection, two-collection Cartesian product, zip-paired) and async throws test functions in both frameworks; XCUIApplication/XCUIElement UI testing with identifier-based lookup; and XCTestExpectation for callback-based async code with no async/await entry point. Use when writing class Foo: XCTestCase, func test..., override func setUp()/setUpWithError()/tearDown()/tearDownWithError(), XCTAssertEqual/XCTAssertTrue/XCTAssertNil/XCTAssertThrowsError, XCTSkip/XCTSkipIf/XCTSkipUnless, import Testing, @Test, @Suite, #expect(_:), #require(_:), .tags(_:), @Test(arguments:), zip(...) inside @Test(arguments:), async throws test methods, XCUIApplication(), .launch(), continueAfterFailure, app.buttons["..."], .tap(), .typeText(_:), .waitForExistence(timeout:), XCTestExpectation, expectation(description:), .fulfill(), or await fulfillment(of:timeout:). v1 covers only XCTest, Swift Testing, and XCUITest as described -- no performance testing (measure { }, XCTMetric, XCTClockMetric), no Xcode Test Plans or code coverage configuration, no third-party snapshot testing, no UI test recording, no mocking/dependency-injection/test-double patterns, and no performAccessibilityAudit(). Triggers on XCTest, XCTestCase, XCTAssert, XCTSkip, Swift Testing, @Test, #expect, #require, @Suite, Tag, parameterized test, XCUITest, XCUIApplication, XCUIElement, accessibilityIdentifier, XCTestExpectation, fulfillment.
Testing patterns for behavior-driven tests. Use when writing tests, creating test factories, structuring test files, or deciding what to test. Do NOT use for UI-specific testing (see front-end-testing or react-testing skills).
IMPORTANT: load BEFORE planning, writing or changing code in a repository that has tests - features, bug fixes and refactors too, not only requests that mention tests - and before writing a plan's Tests or Verification section. Makes a green run mean the real thing works: real code before fakes, recorded live data before hand-written mocks or fake responses, live drift checks, red/green, mutation checks, and no personal data in test data or output. Also use when (1) writing, fixing, reviewing or deleting tests, coverage or TDD; (2) mock, patch, monkeypatch, fake sessions or responses, VCR, cassettes or snapshots come up; (3) code calls an external service or API (Canvas, LADOK, SharePoint, GitHub, an LLM, a database), or you probe one by hand to check a change; (4) tests are flaky, pass while the code is broken, or break on every refactor; (5) test data or output may hold names, emails, personnummer or tokens. Pytest-centred; covers literate (.nw) projects.
Use before you implement a feature, a behaviour change, or a bug fix, before you plan, write, change, port, or remove a test, when a plan, a review, or a brief asks for a test, when a test fails or flakes, when you update a snapshot or an expected value, when a test would sleep, retry, assert elapsed time, or read docs, plans, agent rules, or workflow YAML, when you add a browser spec or a test for each input, host, or platform, and when the user asks to audit tests or cut test time.
Write tests red → green, one slice at a time, at agreed seams. Use when building a feature or fixing a bug test-first, or when another skill needs code driven by tests.
Use when adding, changing, reviewing, debugging, or validating tests; when fixing bugs; when refactoring behavior; or when changing CI, fixtures, snapshots, schemas, generated outputs, test commands, or test infrastructure.
Testing strategy and coverage requirements — component-specific testing approaches, test types, coverage targets, and test organization. Use when planning test strategy, determining what types of tests to write, setting coverage goals, organizing test projects, or deciding between unit vs integration tests. Platform, language, and architecture agnostic — does not assume any specific architectural pattern or layering model.
Write and review tests that match this project's conventions, or do test-first development (TDD). Use when adding tests, asked to "test" a feature/endpoint/module, reproducing a bug with a test, or reviewing test quality. This is the central entry point for any testing in the repo; it routes to framework-specific guidance. Say "FastAPI testing" (or work on an API route / endpoint) to load the FastAPI conventions, "Playwright" or "acceptance / e2e tests" for the browser acceptance-testing conventions, or "R package testing" (testthat) for the R conventions.
Expert in creating comprehensive pytest test suites for Drift project with strict 90%+ coverage requirements. Specializes in unit tests, integration tests, mocking external APIs (Anthropic, AWS Bedrock), and coverage validation using pytest-cov. Use when writing tests, test fixtures, validating test coverage, or implementing mocking strategies for external dependencies.
Paste this prompt into any AI assistant — Claude, ChatGPT, Gemini, Copilot, or others.]
# Test Suite Generator
You are an expert software testing engineer specializing in generating comprehensive, maintainable test suites
Test-writing procedure: order, mocks, regression naming. Use when writing or expanding tests, not because testing.mdc is on. Produces the verifying test for this change; does not authorize unrelated refactors.
Write tests that catch real regressions — choosing what to test, structuring tests, testing behavior over implementation, handling databases and async, and killing flakiness. Use when adding or improving tests, setting up a test for a bug fix or new feature, deciding what to cover, or dealing with flaky/slow tests. Stack: vitest, `pnpm test`.
Pick the right PostgreSQL test flavor for a core / contrib patch — covers pg_regress .sql / .out pairs, isolationtester specs and permutations for concurrency / deadlock races, TAP (PostgreSQL::Test::Cluster) for multi-node and pg_basebackup / replication / recovery scenarios, and src/test/modules for in-tree C test modules. Spans where test files live, how to wire them into the right schedule / meson.build, and how to run a single test fast (REGRESS_OPTS, --temp-instance, PROVE_FLAGS). Use whenever adding tests to a PG patch, reviewing a patch's test coverage, picking between regress / isolation / TAP for a new feature, debugging a regression diff, or asked "where should the test for X live". Skip for pytest / unittest / Jest / Vitest / Mocha / RSpec / JUnit / Go testing / Rust cargo-test app testing, pgbench / sysbench / HammerDB performance benchmarking, end-to-end / Selenium / Playwright web testing, and load / stress testing of production PG.
Writes, fixes and reviews tests for TypeScript and JavaScript projects, which means vitest unit and DOM tests, Playwright end-to-end specs, coverage thresholds, regression tests that reproduce the bug state, and tests of Cloudflare Workers code on real bindings. Use when adding or fixing a test, a coverage gate is red, a spec is flaky or fails in CI, a bug fix needs its regression test, a test passes but you doubt it can fail, or asked "how do we test this". Not for Go tests (go-dev), Lighthouse audits or manual QA scripts.
A folder with a SKILL.md file: a name, a description of when to use it, and instructions. Claude loads a skill only when the task matches its description.
How do I use one I find here?
Copy the folder into your project's .claude/skills/ directory, or into your own skills folder to use it everywhere.
What do the warnings mean?
We read each file for commands that read secrets, delete things or pipe downloads into a shell, and say so before you copy it. No warning is not a promise that a file is safe.
Which skills worked for people?
Open a skill to see its discussion. Reports from people and their agents are coming.