docs(skill): cut the e2e skill in half and point to the docs for full API tables

Merged
MI
4d ago
+1517-3976

What

The bundled e2e skill (skills/e2e/) is 48% smaller: 229,314 bytes to 119,501. Each reference keeps the rules agents get wrong and ends its API sections with a pointer such as Full reference: docs/reference/screen.mdx., a page the installed package ships in node_modules/e2e/docs/ and that is online at https://e2e.com/docs/. All eight topic files stay, so npx e2e guide <topic>, the MCP e2e://guide/<topic> resources, and the copies e2e upgrade and e2e init refresh in projects keep working.

Filemain (bytes)this PR (bytes)Change
SKILL.md91139383+3%
references/setup.md3657013958-62%
references/writing-tests.md5702528529-50%
references/agent.md2661812871-52%
references/mcp.md2981015015-50%
references/running.md230476415-72%
references/debugging.md2131010054-53%
references/explore.md86656120-29%
references/bug-bash.md1715617156+0%
Total229314119501-48%

Why

Follow-up to #2157, which shortened SKILL.md but left 220 KB of references. @okwasniewski asked to cut the skill down to the essentials and point to the docs for the rest. Most of the cut text repeated the docs pages: option tables, flag lists, the full error-code table, every browser method.

How it works

  1. Each reference keeps its judgment and gotchas and replaces API catalogues with two or three lines plus a docs pointer. Before a section became a pointer, the named page was checked for the dropped facts. A fact the page lacks stays in the skill, for example COLLECTION_ERROR for a fixture that does not destructure its first parameter (writing-tests.md), and "Exit 2 is deterministic: never retry it" (running.md).
    A review against the source restored six facts the first cut got wrong or dropped:
    • writing-tests.md: toContainText([...]) allows extra matches; { visible: true } goes on the query, since filter() refuses it; setNetwork('online') restores the network.
    • agent.md: act also gets pixels as an opening screenshot when the screen lists no interactive node, and when tree capture times out.
    • agent.md, debugging.md: re-recording after REPLAY_STALE needs cache.strict off, not only no --strict-cache.
    • explore.md: per-step budgets default to 40.
  2. Each trimmed reference opens with one line saying what a docs/<path>.mdx pointer means, since e2e guide <topic> and e2e://guide/<topic> print a topic without SKILL.md. SKILL.md says the same where it used to list node_modules/e2e/docs/.
  3. Text that #2157's evals tuned is unchanged: SKILL.md's workflow, audit, and rules, and in writing-tests.md "A complete file", "Structure", "Start near the screen under test", and "Habits". The verbatim blocks scripts/check-docs-examples.ts checks (e2e.setup.config.ts, todos.e2e.ts, project-settings.e2e.ts) are unchanged.
  4. Every heading quoted from elsewhere ("Structure", "Feedback", "Flaky tests", "Tools", "Rerunning a test while you fix it", "Each test owns its starting state", "Subscriptions and API keys") still exists. agent.md drops its "Beyond the built-in agent" heading, which nothing quotes; its content moved into "Make the agent yours".
  5. bug-bash.md is unchanged: it is the procedure an agent follows step by step, and it loads only for a bug bash. migrate-to-e2e and create-verification-skill are out of scope.
  6. plugins/e2e/skills/ is regenerated by pnpm plugins:sync; .changeset/trim-e2e-skill-references.md is a patch for e2e, which ships the skill.

Verified

Ran it locally: yes

  • On ed470c34d: pnpm check passes, and the seven test files that read the skill (skill, cli-guide unit and integration, mcp-server, init-agent-instructions, cli-upgrade, cli-init) pass, 340 tests. On c3bdf8295, which differs only in skill Markdown: pnpm --filter e2e run test:unit, 254 files, 4,959 tests passed, 2 skipped.
  • All 36 docs/*.mdx pages the skill names exist in docs/ and in the built package's docs/. https://e2e.com/docs/reference/screen, reference/web, reference/cli, fixtures, authentication, and integrations return 200; integrations/index returns 404, so that pointer gives the working URL.
  • npx e2e guide writing-tests from a project linked to the built package prints 28,529 bytes on this branch and 57,025 on main.

Writer eval: Bookshelf with 15 mutants

Fresh Claude Haiku 5.5 writers, two on main's skill (74e2abea8) and two on this branch's (a4d5747f3, before the review fixes that restore qualifiers and the six facts above), wrote the Bookshelf suite from the same brief (only the project path and ports differ), with no model configured. Each suite ran three times on the clean shop, once against each of 15 single-fault mutants, and each test alone, with --retries 0 (the harness from #2157's evals).

SkillRunTests (stable)Mutants killedPass aloneWriter tokensTool calls
main120 (20)15/1520/20146,01814
main220 (20)14/15 (M1 survived)20/20150,36324
this PR120 (20)15/1520/20138,95615
this PR219 (19)15/1519/19143,27124

All four Remove tests act on a later row and check the first one, so M3 (Remove deletes the first row) dies in each. Both writers on this branch opened docs pages through the pointers (reference/screen, expect, web, request, cli).

Limits: n=2 per arm, Haiku only. With no model configured, writers never needed agent.md, mcp.md, or most of setup.md, so the eval covers SKILL.md and writing-tests.md, not the whole skill. Writer tokens barely moved, so this PR claims fewer bytes loaded, not a lower cost per task.

For maintainers

27 open pull requests edit these reference files, most adding API detail inside sections this PR shrinks (#2300, #2296, #2294, #2259, #2258, #2255, #2253, #2252, #2251, #2238, #2237, #2231, #2194, #2191, #2178, #2177, #2173, #2134, #2132, #2116, #2115, #2114, #2113, #1948, #1822, #1797, #1644). After this merges, each gets a conflict whose resolution keeps the docs edit and drops or shortens the skill line. AGENTS.md still says a behavior change updates skills/e2e/ "when the changed surface is described there". Do you want that rule narrowed, or a size check on the skill? Neither is in this PR.

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.

šŸ¤– Generated with Claude Code