AI Integration
TWD produces structured, deterministic output that AI agents can parse and act on autonomously. Every test run returns the same pass/fail signals for the same inputs — no flakiness, no ambiguity. Whether you want your AI assistant to write better tests, generate tests from browser interactions, or run tests autonomously, TWD has you covered.
Claude Code Plugin
The fastest way to get AI-powered TWD testing is with the Claude Code plugin. It gives Claude two capabilities: an interactive setup wizard and an autonomous testing agent.
claude plugin marketplace add BRIKEV/twd-ai
claude plugin install BRIKEV/twd-ai| Command | What it does |
|---|---|
/twd:setup | Analyzes your project, asks configuration questions, and generates .claude/twd-patterns.md |
twd skill | Autonomous agent — writes tests, runs them via twd-relay, fixes failures, and re-runs until green |
The agent works in a forked context — your main conversation stays clean while tests are written, run, and fixed. If a test still fails after 3 fix attempts, it's marked as it.skip so it doesn't block the rest.
Read the full Claude Code Plugin guide
Other AI Tools
For Cursor, Copilot, Windsurf, and other AI tools, use the Agent Skills CLI:
npx skills add BRIKEV/twd-aiThis copies TWD context into your AI tool's configuration file (.cursorrules, .github/copilot-instructions.md, etc.).
Features at a Glance
1. AI Context
Teach your AI assistant (Claude, Cursor, Copilot, Windsurf) how to write correct TWD tests by providing a comprehensive prompt with API reference, patterns, and common pitfalls.
Best for: Getting AI to write correct TWD tests on the first try.
Read the AI Context & Prompts guide
2. AI Remote Testing (twd-relay)
A WebSocket bridge that lets AI agents trigger test runs and stream results back, without launching a browser automation tool. Your Vite dev server is already running with TWD loaded -- the relay just connects to it.
Best for: AI agents that need to run tests, read failures, and iterate.
Read the AI Remote Testing guide
3. Claude Code Plugin — Autonomous Testing
When you install the TWD plugin, Claude Code can automatically invoke the testing agent when it detects the task is relevant. For example:
- You ask: "Add a search filter to the orders page"
- Claude implements the feature
- Claude sees the
twdskill and spawns it as a sub-agent - The agent writes tests, runs them via
npx twd-relay run, reads failures, fixes, and re-runs until green - Claude continues with your task
You can also set up your project interactively with /twd:setup.
Read the full Claude Code Plugin guide
How They Work Together
You can use these features independently or combine them:
AI Context & Prompts → AI writes better tests (any AI tool)
AI Remote Testing → AI runs tests and reads results (any AI tool)
Claude Code Plugin → AI writes, runs, and fixes tests autonomouslyA typical workflow:
- Plugin / Skills install TWD context into your AI agent
- The TWD agent writes tests, runs them via twd-relay, and fixes failures
- The autonomous validation loop continues until all tests pass
MCP Integration
TWD also provides an experimental MCP server that works with Playwright MCP to generate test code from browser automation data. This is an early feature — if you're interested, check the TWD MCP package for details.