Skip to content

Working with agents ​

Most toets tests are written and maintained by coding agents, so toets ships its knowledge in forms agents load cheaply. An agent with no prior context should be able to set up toets, write a correct cross-platform test and debug a failure from these alone.

ArtifactWhereUse
Skillsskills/ in the toets repositoryTask-level guidance, loaded when the task matches
AGENTS.mdYour project root (template below)Project rules every agent session sees
Offline docsnode_modules/@toets/*/docs/Version-matched pages, no network needed
llms.txtDocs site root, with llms-full.txtIndex of every page, and every page in one file
ErrorsTest outputEach error has a code, a hint and a docs link
Error codesError code indexEvery ToetsError code, generated from the sources
MCP server@toets/mcpExplore a running app with the same primitives as tests

Skills ​

Four skills in the open agent skills format, each short and linking to pages here instead of repeating them:

SkillTriggers when the agent
toets-setupadds toets to a project, adds a platform or sets up CI
toets-write-testswrites or changes toets tests or page objects
toets-debug-failuresinvestigates a failing or flaky toets test
toets-migrateports tests from Playwright, Appium / WebdriverIO or Detox

Install all of them into your project with the skills CLI, which detects the agents you use:

sh
npx skills add yusufyildirim/toets
npx skills add yusufyildirim/toets --skill toets-write-tests   # just one

Or copy skills/<name>/ from the repository into your agent's skills folder (for example .claude/skills/ or .agents/skills/). Skills refer to docs pages by slug, such as concepts/focus: the page at /concepts/focus on this site.

AGENTS.md template ​

Drop this into your project's AGENTS.md (or merge it into the one you have) and fill in the comment:

md
# E2E tests (toets)

TV end-to-end tests live in `e2e/` and run with toets on Playwright Test.

- Fast loop: `npx playwright test --project=web`
- All platforms: `npx playwright test`
- Report: `npx playwright show-report`

<!-- Add how to build and start the app for each platform, e.g. `npm run web` on port 8080. -->

## Rules

- No click. Move focus with `app.focus.pressUntilFocused(Key.X, locator)` (or `navigateTo`, `app.remote.press`), assert `toBeFocused()`, then press `Key.SELECT`.
- Locate by test ID (`app.getByTestId`). Add a missing test ID to the app instead of matching layout or volatile text.
- Never sleep or poll by hand: assertions retry. Anchor a negative assertion on a positive one first.
- Platform gaps are capabilities: `test(name, requires('key.color'), fn)`, never `if (platform === ...)`.
- Page objects live in `e2e/pages/`, take `app`, expose locators and actions, and do not assert beyond waiting until loaded.
- Data-dependent tests mock the network with `app.network.use(...)` before `app.launch()`.
- When a test fails, read the error's `Hint:`, its `Docs:` page and the failure dump before changing the test. Skipped platforms and their reasons are in `toets-report/parity.md`.

## Docs

Installed toets packages ship version-matched docs in `node_modules/@toets/*/docs/`; every error code is in `node_modules/@toets/core/docs/errors.md`. The docs site has the same pages plus `llms.txt` and `llms-full.txt`. The toets agent skills cover setup, writing tests, debugging failures and migrating.

Docs for agents ​

  • Prefer the offline copy in node_modules: it matches the installed version.
  • llms.txt indexes every page with a one-line summary; llms-full.txt is the whole site in one file. Every page is also served as markdown: append .md to its URL.
  • Errors are docs too. A failing test prints ToetsError: [CODE] what happened, the likely cause and fix (Hint:) and the page to read (Docs:, with its offline path in node_modules). Agents should act on those before guessing; the error code index lists every code.