Skip to main content
The test-strategy-document skill produces a comprehensive testing strategy and QA execution plan for any product, service, or feature set. It applies Mike Cohn’s Testing Pyramid to distribute tests for maximum speed and coverage, defines explicit mocking boundaries for every external dependency, establishes measurable code-coverage and mutation-score thresholds, and generates a full CI/CD runsheet with step-by-step quality gates. This is an always-core skill — every project benefits from a documented test strategy before development or refactoring begins, because a strategy produced after the fact describes what happened rather than governing what should happen.
Type: Workflow  ·  Estimated time: 2–4 hours  ·  Frameworks: Mike Cohn Testing Pyramid, BDD/Gherkin, Pact contract testing, SAST/DAST  ·  Output file: 15-test-strategy.md  ·  Inclusion: Always-core — every project

Best for

New codebase QA framework

Establish a testing architecture from scratch — toolchain selection, pyramid distribution, environment strategy — before the first PR lands.

Critical feature release QA plan

Define the specific test coverage, acceptance criteria, and CI gates that must pass before a high-risk feature ships.

Mocking contracts for third-party APIs

Define which external APIs get a real sandbox, which get a WireMock contract, and which get a stub — and document why.

CI/CD test pipeline definition

Produce the exact YAML runsheet — static analysis, unit tests, integration tests, mutation scores — that enforces quality on every push.

What it produces

The skill outputs 15-test-strategy.md, a document that serves as the definitive testing contract for the project:
  • Quality objectives and numeric gates — coverage percentage, mutation score index, static analysis level, E2E success rate, all enforced by named CI tools
  • Testing pyramid with toolchain — unit / integration / E2E distribution ratios with named test runners for each layer
  • Mocking matrix — every external integration mapped to its mocking strategy and sandbox endpoint
  • Database isolation strategy — transactional rollback, fresh containers, or seeded snapshots — consistent across local and CI environments
  • Performance testing plan — load, stress, soak, and spike test definitions with k6/Locust/JMeter profiles and pass/fail thresholds
  • Contract testing specification — Pact consumer/provider contracts or Dredd/Schemathesis OpenAPI verification setup
  • Test data management rules — fixtures vs. factories vs. seeds, and the sensitive data policy that governs all environments
  • Security scanning gates — SAST, DAST, dependency scanning, and secrets detection, each with the severity level that blocks a build
  • BDD acceptance scenarios — Gherkin Given-When-Then for every critical user path, ready to drive E2E automation
  • Flaky test handling policy — quarantine rules, retry limits, resolution SLAs
  • Environment architecture diagram — local, CI, staging, and production provisioning strategy as a Mermaid graph
  • CI/CD runsheet — complete GitHub Actions / GitLab CI YAML snippet with every quality gate in order

How to invoke it

Include your tech stack and critical external integrations in the invocation. For example: test-strategy-document payment processing module — PHP 8.3 / PHPUnit, connects to bank API and Stripe. The more context provided, the fewer clarifying questions and the more actionable the mocking matrix.

Example scenarios

Key concepts

The Agile Testing Pyramid

The skill enforces the Cohn pyramid distribution rather than letting teams accidentally build an inverted pyramid of slow, brittle E2E tests:
Each layer has a defined execution speed target:

Mocking boundaries — never mock what you don’t own

The strategy distinguishes between three types of test double:
  • Mocks — verify behaviour by asserting specific calls to external interfaces
  • Stubs — provide hardcoded values to isolate components under test
  • Fakes — simplified working implementations (e.g., SQLite in-memory for repository tests)
For third-party vendor APIs, the rule is clear: never mock internal implementation details of a system you don’t own. Instead use the vendor’s official sandbox endpoint (for integration/E2E layers) or a WireMock/recorded-response server (for unit and contract layers) that can be updated when the real API changes.

Performance testing layers

Performance testing is a distinct test layer, not a one-off exercise. The skill defines four test types with pass/fail thresholds:

Contract testing — catching breaking changes before production

For systems with internal or external API boundaries, Pact consumer-driven contracts or Dredd/Schemathesis OpenAPI verification catch breaking changes before they reach production:
  • The consumer defines what it expects from the provider in a contract file
  • The provider verifies it satisfies every consumer contract in CI
  • Any response shape change that violates a contract fails the build — not a production incident

Security scanning in CI

Security gates are integrated into the CI pipeline by default, not bolted on later:

BDD / Gherkin acceptance scenarios

The skill produces Given-When-Then scenarios in user-visible terms, not API mechanics. These scenarios map directly to E2E automation scripts and serve as the acceptance criteria for each critical user flow.

Flaky test policy

Flaky tests erode confidence in the entire test suite. The generated strategy includes a formal policy:

Interview process

The skill reads all prior .engineering-docs/ documents to load known context before asking anything. It then asks a maximum of 2–3 targeted questions via tool calls:

Output structure

Handoff

Reads from: Feeds into:

Quality gate

Before marking the document final, the agent verifies five gates:
1

Pyramid distribution defined with numeric targets

Unit, integration, and E2E layers each have a specific percentage target — not just “mostly unit tests.”
2

Every external integration has a named mocking strategy

The mocking matrix names the specific tool or sandbox endpoint for each dependency. “Mock the HTTP calls” is not sufficient.
3

Database isolation strategy is explicitly stated

The same strategy must apply consistently across local development and CI. Divergence between environments is the most common source of “works on my machine” failures.
4

CI/CD runsheet includes static analysis, unit, integration, and at least one higher-level gate

The runsheet must include static analysis, unit tests, integration tests, and either mutation testing or E2E tests. A runsheet with only unit tests is not a complete quality gate.
5

Coverage thresholds are numeric and CI-enforced

Every metric target (coverage %, mutation score index, Lighthouse accessibility score) must have a specific numeric value and be enforced by a named CI check — not just documented as a goal.