The testing assistant for AI-built apps.
Run it as an app, or hand it to your coding agent over MCP. Either way it writes the tests your app never had, and tells you when they break.
Trout are an indicator species. They only live in clean, well-oxygenated water β find one in a stream and you know the water is healthy without testing it yourself.
That is what a good test suite is: not a chore, but a signal you can read at a glance.
Coding agents ship fast. They also break things quietly, and the apps they build β Lovable, v0, Bolt, hand-rolled React on Vercel β almost never have tests. So the loop ends with "looks good to me" from the thing that just wrote the code.
TestTrout closes that loop. It reads the repository, connects to the running deployment, works out what is untested and in what order it matters, writes real tests, runs them, and reports results you can actually act on.
pip install testtrout
trout upThat starts everything: storage, a background worker, and the interface at
localhost:7411. No Docker, no daemon, no database to install β storage is SQLite
under ~/.testtrout and the worker runs in-process.
Then link a repository, from the interface or the terminal:
trout link ~/code/my-app # a folder you already have
trout link --github owner/name # cloned with your GitHub tokenLinking a local folder never modifies it. A scan starts automatically, and the Setup tab has every setting: deployments, Supabase, test accounts, model provider.
Two things make that safe and useful:
It tells you what credentials your app needs, discovered by reading your source β which variables it reaches for, what each is likely for, and the line it appears on. No re-deriving something the code already states.
A partial set gives a partial suite. With only a URL you can probe and run API tests; add an anon key and a second account and authorization tests become possible. Each blocked capability names the single next thing it needs, never "configure it properly".
Secret values are written to a gitignored .env; committed configuration holds only
env:NAME references, and a literal secret typed into a config field is rejected.
The app is one way in, not the only one. Everything it does is available as typed MCP tools and as CLI commands, so anyone who would rather not leave their editor does not have to:
pip install 'testtrout[mcp]'
trout mcp /path/to/your/projectPoint your agent at the skill in .claude/skills/, or tell it:
Use the TestTrout MCP server. Scan the repo, show me what's untested ranked by importance, draft tests for the top five, and run them.
Thirteen tools, bound to one project so an agent cannot act on the wrong repository:
scan surfaces |
Understand the codebase. No API key, no network. |
probe |
See what the deployed app actually does, in a real browser. |
intent gaps |
Rank what is untested, and say why. |
propose approve generate |
Draft, review, compile to real test files. |
run certify report |
Execute, prove determinism, read evidence. |
doctor |
What is missing, and how to fix it. |
Plus trout://surfaces, trout://intent, trout://config, trout://scenarios as
resources, so bulk state never crowds out an agent's context window.
trout scan is fully deterministic β no model, no network, safe on a repo you just
cloned. On a typical Supabase app it finds:
| Surface | Example |
|---|---|
| Screens | /orders/:id β OrderDetail, and the data it reaches |
| Data operations | supabase.from('orders').delete().eq('id', β¦) |
| RLS policies | Users manage own orders β a testable authorization claim |
| Server actions | 'use server' functions β endpoints that look like helpers |
| Route handlers | app/api/checkout/route.ts β POST |
| Third parties | Stripe, Resend β the substitution boundary |
| Schema | Tables, columns, foreign keys, RLS status |
It also tells you when a table is written from browser code with no row-level security β meaning it is world-writable through the anon key. That is usually news.
It builds a baseline, not per-PR guesses. A test derived from the code you just changed asserts the new behaviour is correct by construction β it cannot catch a regression. TestTrout certifies a suite against a working deployment first, so a failure means something.
Deterministic core, model at the edges. Scanning, ranking, execution, and failure classification never call a model. The model only interprets your intent, refines wording, and picks which observed elements to assert on. Every ranking is the sum of named contributions:
critical authorization A user cannot read another user's rows in payments 100
Β· critical surface
Β· policy: exists (select 1 from orders o where o.id = payments.order_id β¦)
Every assertion carries its provenance. derived from a policy, observed in a
real browser, or inferred by a model β and inferred alone can never block anything.
A failure is classified before it is reported. Only assertion_failure is a product
signal. Auth failures, unreachable databases, and blocked third-party calls are about
the harness, and an inconclusive run is never upgraded to a pass.
trout scan # understand the code
trout init # connect a deployment
trout gaps # what's missing, ranked, with reasons
trout run # execute, with evidence behind every resultEvery command supports --json. Full walkthrough in docs/setup.md.
Your test suite stays in your repository, committed and reviewable:
.trout/scenarios/*.yaml what each test asserts, in plain language
.trout/config.yaml deployments and env: references, never secrets
tests/trout/ generated Playwright and Vitest files
Run history, coverage over time, and the job queue live in SQLite under
~/.testtrout. That split is deliberate: the suite belongs next to the code where a
pull request can review it, and the questions files cannot answer β is this test
getting flakier, is coverage going up β belong in a database.
trout webCoverage at a glance, the ranked gap list, scenario review, run history with evidence,
live log. Same .trout/ files as the CLI β no database, nothing hosted, loopback only.
Entirely optional; the CLI and MCP are complete on their own.
The tool needs your database credentials and can drive your deployment, so the guarantees are enforced in code rather than documented:
- Production is read-only by default. Mutating requests are blocked at the network
layer unless an entrypoint is explicitly marked
disposable. The guard sits below navigation, because "just loading a page is read-only" is false β plenty of these apps write on mount. No agent, and no web click, can change that setting. - Third parties are intercepted. A test run cannot charge a card or email a customer. Unmatched outbound requests fail loudly; a mock that silently matches nothing is how a suite reports green while testing nothing.
- Secrets stay out of committed files.
.trout/config.yamlholdsenv:references only. Values live in a gitignored.env. - Nothing is hosted. Nothing leaves your machine except calls to the model provider you chose. No telemetry.
Anthropic, OpenAI, or Kimi β or any OpenAI-compatible endpoint via base_url.
model:
provider: anthropic
api_key: env:ANTHROPIC_API_KEYAnalysis never calls a model, so trout scan, trout gaps, and trout run all work
with no key at all.
React + Vite (Lovable, v0, Bolt) and Next.js App Router, in TypeScript, with Supabase, deployed anywhere reachable over HTTP. Auth via Supabase, Clerk, or NextAuth.
Deliberately narrow. Depth on one stack beats shallow coverage of many β and these codebases are regular enough that static analysis is genuinely accurate on them. Other stacks are an adapter away: see docs/adapters.md.
| β | Repository analysis, deployment probing, gap ranking |
| β | Scenario authoring, generation, execution, certification |
| β | MCP server, CLI, and a local app with storage and a worker |
| β | Change-based test selection, base-branch differential |
| β | Multi-repository: link local folders or clone with a GitHub token |
| β | Full configuration from the interface or the CLI, with credential discovery |
| π | GitHub pull-request checks |
| π | Observed coverage index (today's selection uses declared coverage) |
Adding a framework, auth provider, or test runner means implementing one protocol and registering an entry point β no fork required. See CONTRIBUTING.md and docs/adapters.md.
The full test suite runs offline with no API key. That is deliberate and worth keeping.
Apache 2.0