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.
| Artifact | Where | Use |
|---|---|---|
| Skills | skills/ in the toets repository | Task-level guidance, loaded when the task matches |
AGENTS.md | Your project root (template below) | Project rules every agent session sees |
| Offline docs | node_modules/@toets/*/docs/ | Version-matched pages, no network needed |
llms.txt | Docs site root, with llms-full.txt | Index of every page, and every page in one file |
| Errors | Test output | Each error has a code, a hint and a docs link |
| Error codes | Error code index | Every ToetsError code, generated from the sources |
| MCP server | @toets/mcp | Explore 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:
| Skill | Triggers when the agent |
|---|---|
toets-setup | adds toets to a project, adds a platform or sets up CI |
toets-write-tests | writes or changes toets tests or page objects |
toets-debug-failures | investigates a failing or flaky toets test |
toets-migrate | ports tests from Playwright, Appium / WebdriverIO or Detox |
Install all of them into your project with the skills CLI, which detects the agents you use:
npx skills add yusufyildirim/toets
npx skills add yusufyildirim/toets --skill toets-write-tests # just oneOr 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:
# 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.txtindexes every page with a one-line summary;llms-full.txtis the whole site in one file. Every page is also served as markdown: append.mdto 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 innode_modules). Agents should act on those before guessing; the error code index lists every code.