test-harness

Define and run deterministic test suites across unit, integration, browser, and production stages.

579|76|Updated Oct 29, 2026
Ready to run
npx skills add https://github.com/phuryn/product-engineering --skill test-harness-phuryn
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: test-harness
Source: https://github.com/phuryn/product-engineering/tree/main/ai-shipping/skills/test-harness
Command: npx skills add https://github.com/phuryn/product-engineering --skill test-harness-phuryn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Green test runs often lie—they pass against the wrong database, a stale fixture, or missing preconditions, proving nothing about the product in use. This Skill arranges harnesses so each stage tests what it claims to test, establishes what each suite fakes, and keeps passing runs honest with rules learned from production bugs. ## Core Features & Use Cases - Multi-layer Harness Architecture: Coordinates unit tests (pure modules), integration tests (real database), browser tests (authenticated and public journeys), visual captures, and smoke tests (deployed URLs). - Coverage Mapping: Records which runs executed, their exit codes, what was tested, and what remains uncovered—with reasoning for gaps. - Gate Orchestration: Runs the full test sequence locally before promotion: typecheck, unit + integration, e2e (public), e2e (authenticated), then visual and smoke outside the gate. - Use Case: Your backend deploys with a schema change, frontend passes all tests locally, but breaks in production because the authenticated browser suite shares test accounts with a background worker. This Skill names that shared state, scopes it correctly, and prevents the collision. ## Quick Start Ask an AI to run the full gate locally before promoting: run typecheck, then test, then e2e, then e2e:auth, read the exit code from the log (not the printed count), and add the result to the coverage map with the date and any flakes you see.

Frequently Asked Questions about test-harness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent my test suite from passing against the wrong database or stale fixture?▼

Pin every optional configuration in the shared `webServer` environment module—analytics IDs, demo records, feature flags—so one test assertion means the same thing on every machine. Before each suite run, seed the real preconditions (sign-in accounts, workspace setup, schema state) and reset everything those accounts own afterward, so each run starts from nothing and leaves nothing.

What makes a harness prove something real versus just passing against fakes?▼

Write down what each harness fakes before adding it. Unit tests fake the database; integration tests fake identity; browser suites may fake mail. If every harness fakes the same side, a bug survives undetected—add one harness with both sides real. Coverage is surfaces crossed (unit, integration, browser), not matrices (width × theme × role) multiplied into noise.

Why does my test pass locally but fail after deploy?▼

Read the exit code from the log, not the printed counts—a suite can report all tests passed and exit 1 on an unhandled rejection. Check preconditions: if a change added something the product must do before it starts (a feature flag, a consent row), every harness launching a real instance must seed it. Check environmental state: a background worker or parallel session signing in as a test account writes into what your assertions expect.

How do I test sign-in correctly when my identity provider is real?▼

Sign in through the provider's own component, not a programmatic backdoor, and wait for the identity provider's event (like `prepare_first_factor` on Clerk) before filling fields. Test on a machine with no saved credential—a machine already signed in passes a broken sign-in because the old credential is read. Create test accounts with a testing token fetched in `globalSetup` before any browser opens.

What should I do if a test fix passes but doesn't fix the user's symptom?▼

After two fixes that pass their checks but leave the symptom unchanged, stop fixing—your model of the problem is wrong. Get one observation that tells the explanations apart: a screenshot from their run, a log line, or an answer to a question you can verify in a minute. Ask after the second failed fix, not the fifth, then reproduce the original symptom in a test before the next fix lands.

Why should I avoid flaky tests and what counts as a flake?▼

Judge a suite on a series, not one run—a green run that flakes on the next is not a pass. Log the flake in the backlog on first appearance with the step name; on the second appearance, its fix is due. A suite that has never been green reports nothing and hides the next real red, so delete obsolete checks instead of leaving them red.