Automated full-stack quality verification after development. Real execution by default -- mock is the last resort. Deliverability is judged by external calls (HTTP requests, CLI invocations, browser interactions), not by internal function calls passing in isolation.
Default realism level is L2: internal services run for real, only uncontrollable external dependencies (third-party APIs, paid services) may be mocked.
Downgrade signals (auto-detected from user intent):
Realism level definitions:
LevelDescriptionMock RatioL0All dependencies mocked100%L1Core service real, databases mocked<=50%L2Internal services real, external deps mocked<=30%L3All services real (sandbox/test accounts)0%
Execute phases sequentially. Each phase produces required artifacts for the next.
text
Phase 0: Environment Awareness
v
Phase 1: Test Design (with anti-pattern scan)
v
Phase 2: Execution & Evaluation
v
Phase 3: Feedback & Fix Loop (if gates fail)
v
Phase 4: Validation & Output
This skill starts services, runs migrations, and makes network calls. Before execution:
Gather project context and determine feasibility before designing tests.
Identify:
For each dependency service, classify:
Verify:
Output: Environment Report -- language, framework, test runner, realism level, service availability, any blockers, consistency gaps.
Design test scenarios systematically using the test taxonomy. Do NOT write test code before completing analysis.
Before writing any test code, complete:
If test code references modules/imports not in the actual codebase -> hallucinated dependency. Remove and use actual project references.
Map each requirement to test scenarios:
Anti-pattern check: If >80% of scenarios are happy path -> Happy Path Obsession detected. Add error, boundary, and exception scenarios until >=30% target error scenarios.
For each scenario, apply the appropriate taxonomy category. Load detailed guidance from references/test-taxonomy.md when needed.
CategoryPurposeExampleMFT (Minimum Functionality)Verify each decision branch/leaf node worksEach code path returns correct resultINV (Invariance)Same logical request -> same result, different phrasings"show data" = "display info" = "list records"DIR (Directional Expectation)Vary one input -> predict output directionLarger input -> larger output (monotonic)
Coverage rule: Each of the 3 categories MUST have >=1 test. Taxonomy coverage = 100% is a hard gate.
For every input parameter, identify and cover:
Classify each scenario based on realism level:
After designing all scenarios:
Run the pre-execution checklist. Load detailed guidance from references/anti-patterns.md when needed.
Anti-PatternCheckActionHappy Path Obsession>80% scenarios are normal flowAdd error/boundary testsWeak Assertionsassert(result != null), assert(status == 200) without bodyReplace with specific value checksLeap-to-CodeTest code written before structure analysisRedo analysis firstHallucinated DependenciesReferences non-existent modules/importsReplace with actual referencesMissing TraceabilityGeneric test names ( test_1, test_func)Rename to describe specific behavior
Rule: Each test name MUST describe the specific behavior being tested (e.g., test_submit_empty_form_returns_422). Each test MUST link to the requirement it validates.
Fix all detected anti-patterns before proceeding to Phase 2.
Start services in dependency order with health checks:
text
for each service in dependency_order:
start service
wait_for_health_check (port/ping/readiness endpoint)
if health_check fails:
report blocker, downgrade realism level
Prepare test data using project's existing seed/migration mechanisms when available.
System boot validation -- before running any tests, verify the system itself is deliverable:
Run tests with coverage enabled. The test suite MUST include an E2E layer validated through external calls (HTTP requests to running services, CLI invocations, or browser interactions -- not internal function imports). Load execution templates from references/real-e2e-templates.md when designing this layer.
Compute all 4 layers of metrics. Load detailed definitions from references/metrics.md when needed.
Design Quality (computed after test design, before execution):
MetricFormulaThresholdScenario Coveragecovered requirements / total requirementsMUST = 100%Taxonomy Coveragecategories with >=1 test / 3MUST = 100%Boundary Value Coveragecovered boundary points / total identifiedSHOULD >= 90%Data Feature Coveragecovered data dimensions / total identifiedSHOULD >= 85%
Execution Quality (computed after test run):
MetricFormulaThresholdPass Ratepassed tests / total testsSHOULD >= 95%Code Coveragestatements covered / total statementsSHOULD >= 80%Assertion Densitytotal assertions / total testsSHOULD >= 2.0Weak Assertion Ratioweak assertions / total assertionsSHOULD <= 10%Test Realism Ratioreal tests / total testsMUST >= 70%
Delivery Quality (computed from test results):
MetricFormulaThresholdExpectation Match Ratefully matching tests / total tests (core: MUST 100%)Core: MUST=100%, Overall: SHOULD>=95%Boundary Handling Ratepassing boundary tests / total boundary testsSHOULD >= 90%Regression Safetystill-passing tests / previously-passing testsMUST = 100%Business Flow CoverageE2E-verified business flows / total identified business flowsMUST = 100%
Iteration Efficiency (computed during fix loop):
MetricFormulaThresholdFix Convergence Ratenewly passing / previous failures<20% for 2 rounds -> STOPFix Introduction Ratenewly failing / total fix attempts>30% -> STOP
Triggered when hard gate metrics are not met.
Structure the report as JSON. Load schema from references/feedback-schema.md when needed.
Key sections:
"pass" | "fix_and_retry" | "stop_and_report"Address the largest failure cluster first (most affected tests) -- highest probability of improving overall pass rate.
ConditionThresholdActionMax iterations5 roundsStop, report current stateNo convergence<20% convergence rate for 2 consecutive roundsStop, suggest fundamental issueRegression>30% fix introduction rate in any roundStop, suggest wrong fix approach
text
while round <= 5 AND not converged_stop AND not regression_stop:
read feedback report -> identify largest failure cluster
apply targeted fix to code/tests
re-run full test suite (or failed-only if convergence is high)
compute new metrics
generate new feedback report
check exit conditions
record iteration in fix history
Run ALL hidden tests (not exposed during fix loop):
Generate final quality report:
"PASS" (all hard gates met) or "FAIL" (hard gates not met) with specific reasonsOutput test scripts that can run independently in CI/CD:
MetricThresholdScenario Coverage= 100%Taxonomy Coverage= 100%Test Realism Ratio>= 70%Expectation Match (core)= 100%Regression Safety= 100%Business Flow Coverage= 100%
MetricThresholdBoundary Value Coverage>= 90%Data Feature Coverage>= 85%Pass Rate>= 95%Code Coverage>= 80%Assertion Density>= 2.0Weak Assertion Ratio<= 10%Boundary Handling Rate>= 90%
Load these files as needed during the workflow:
references/metrics.md -- Complete definitions for all 14 metrics: calculation formulas, threshold rationale, and what it means when a metric is not met. Load when computing or interpreting metrics.
references/test-taxonomy.md -- Detailed guidance for MFT/INV/DIR test categories with pseudocode examples, plus systematic boundary value analysis methods. Load during Phase 1 test design.
references/feedback-schema.md -- Full JSON Schema for feedback reports with a populated example. Load when generating feedback reports in Phase 3.
references/anti-patterns.md -- Detailed detection methods and fix strategies for all 5 anti-patterns: Happy Path Obsession, Weak Assertions, Leap-to-Code, Hallucinated Dependencies, Missing Traceability. Load during Phase 1 anti-pattern scan or Phase 3 feedback.
references/real-e2e-templates.md -- Environment preparation scripts and real E2E test templates for HTTP API, CLI tools, and Browser automation. Load during Phase 2 environment preparation and test execution.