Playwright Test Prompt
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
Required fields one at a time, invalid formats, business rules at their exact boundaries — validation tested the way users break it.
Validation logic accumulates rules until nobody knows what's enforced — and tests that assert "invalid input fails" without saying which rule caught it. This setup generates validation tests for form logic with Jest: required fields tested missing one at a time (each with its own test), invalid formats against the patterns the code claims to enforce, invalid state transitions, and business rule violations at their exact boundaries — plus the edge-case section's six input groups, because validation is where edge cases live.
One rule, one test
Required fields missing one at a time — a combined test that fails tells you nothing about which rule broke.
Test the claimed formats
The email regex, the date pattern, the ID shape — each format the code claims gets a passing and failing case.
Sit on the boundaries
Business rules tested AT their limits — the 18 in "must be 18+" gets tests at 17, 18, and 19.
So a failure names the broken rule. The Validation coverage area specifies "Required fields missing — one at a time, each with its own test," because a combined test that fails tells you nothing about which rule caught it. Paired with output names that "complete the sentence 'it ...'," a red test becomes a one-line diagnosis rather than a hunt.
It tests what's there. TESTING OBJECTIVE says "Generate tests only — do not modify the implementation," and NON-GOALS add "Do not invent requirements — test only specified or clearly implied behavior." It checks formats against "the patterns the code claims to enforce" and business rules at their exact boundaries, listing unresolved behavior under ASSUMPTIONS and GAPS instead of inventing policy.
Jest. FRAMEWORK GUIDANCE returns one runnable Jest file: mock at the module boundary with jest.mock, reset mocks in beforeEach for independence, test async with async/await and expect(...).resolves/.rejects, and group tests in describe blocks whose names complete "it ...". You still run the file and confirm the assertions in your own suite.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
Mock the dependencies, test the business logic, one behavior per test — the unit testing contract that bans plumbing tests.
Test the two failure directions — does the agent refuse what it must, and does it stay helpful on the benign requests it shouldn't over-refuse?
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Build test generation prompts — unit, integration, or E2E — with framework modes and edge-case coverage rules.
The full path to a support agent you can put in front of customers — write its instructions, ground it in your docs, route and handle tickets, then evaluate and cost-control it before it goes live.
The full path to a retrieval system that returns grounded answers — understand the corpus, chunk and ground it, extract and classify the metadata, then evaluate that retrieval actually works.
The full path to automation that survives the real world — wire the integrations and triggers, design the control API, move the data through validated stages, evaluate the AI steps, then deploy.
The full path to a support operation, not just a bot — stand up the knowledge base, route the tickets, add the AI agent, integrate your stack, close the feedback loop, evaluate, and deploy.