mr-onion

Mr Onion — what it actually does

Living doc. Last reviewed 2026-10-31, against main at b38c622 (Phase 39 complete). Reviewed at every phase completion (WORKING_AGREEMENTS.md). Point new readers here first; README.md is the how-to, docs/decisions/product-roadmap.md the phase-by-phase ledger, docs/test-plan/ the case-by-case status (indexed from TEST_PLAN.md).

In one paragraph

Mr Onion is a test automation assistant for websites. Give it a base URL and it crawls the site, groups its pages into page types, inspects one page of each type, writes a Playwright TypeScript suite from what it actually found, runs it in Chromium, and returns a report that says what was tested, how, and — just as prominently — what wasn’t tested and why. The suite is plain Playwright you can keep and run without Mr Onion. The core needs no AI and no API key. It is a local, single-user tool today: a Next.js app on the tester’s machine, not a hosted service.

The ideas it is built on

What a run does

  1. Crawl and select. Pages are grouped into page types by address pattern, split only by form signature; Standard tests one page per type, up to 8 (Phase 40).
  2. Inspect. Each selected page is read in a real browser so every check targets real elements: controls, forms, links, landmarks, outbound requests.
  3. Generate. The template writes the suite. Optionally, a local model (Ollama) fills areas the template left empty, and, opt-in per site, Claude Code or a local model writes tests for coverage gaps; model-written tests are labelled and kept apart.
  4. Run. Chromium only, at one of three gates:
    • read-only (default): nothing that changes data; a request guard blocks non-GET traffic;
    • interactive: forms and flows, when the run switches it on;
    • active: data-changing and attack-shaped tests, only behind an ownership confirmation (Phase 43, locked, not built).
  5. Report. Execution, defects, coverage, performance, accessibility, usability and SEO, with an HTML export. Runs persist and two runs of the same site can be diffed test by test.

Two kinds of run

Measured: on the local Toolshop copies, with 37 known bugs in reach, Standard alone finds 30 (TFP-207, 2026-10-16); Standard plus Comprehensive security and accessibility finds 33 (Phase 41 Gate B).

Reuse instead of regeneration (Phase 42)

Site suites, run history and candidates hold one site’s details, so they live in Mr Onion’s local data folder (%LOCALAPPDATA%\MrOnion on Windows; MRONION_DATA_DIR overrides), never in the repo.

Architecture

 Browser UI (src/app/page.tsx)
      │  fetch
      ▼
 Next.js API routes (src/app/api/*)          one Node process, loopback only
  crawl · introspect · generate · run · runs · runs/diff · candidates
  site-settings · site-ownership · save-suite · health
      │
      ├─ src/lib/introspect, selection   crawl, page types, inspection (Playwright)
      ├─ src/lib/generate                 template generator, Comprehensive sets
      ├─ src/lib/gap-writer, candidates,  gap tests, candidate pool, promotion
      │  library, site-suites
      ├─ src/lib/run                      job queue, gates, request guard, host limits,
      │                                   child Playwright runs with a minimal environment
      ├─ src/lib/report                   coverage, summary, diff, HTML export
      └─ src/lib/storage                  data folder: runs/, site-suites/, candidates/
      │
      ▼
 Chromium (Playwright) ──► target site          optional: Ollama (local model),
                                                 Claude Code CLI (gap writer)

Where it’s going

In order (product-roadmap.md, deferred-work-register.md):

Relationship to skills/

A parallel track, not a replacement: skills/ packages the testing and engineering judgment behind Mr Onion as an installable Claude Code plugin (mr-onion-skills, 12 skills under skills/testing/ and skills/engineering/), usable without the app. skills/proposed/ holds SRE and DORA skills under review, four of them being adopted (TFP-236). Rewriting TestForge as skills only was considered and declined (docs/REIMAGINING.md, REIMAGINING-RESPONSE.md).