
cypress-tap
Drives a running Cypress open-mode session through cypress tap to run and rerun specs, wait for fresh results, inspect reporter and command logs, and query or rewind the app under test through DOM, accessibility, styles, and snapshots. Use when authoring or debugging Cypress e2e or component specs, discovering selectors, diagnosing failures, or verifying test behavior without GUI interaction. Not for one-shot headless runs. Requires Cypress 15.21+, a Chromium-family browser, and a running cypress open session.
- Installs
- 2.7K
- Last 24h
- +43
- Trending rank
- #3677
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/cypress-io/ai-toolkit --skill cypress-tap- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads cypress-tap automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Driving Cypress with cypress tap
cypress tap controls an already-running cypress open session. Use it to iterate on specs,
inspect the reporter and command log, and read the app under test without GUI interaction.
Use cypress run instead for a one-shot headless batch.
Core loop
npx cypress tap sessions # confirm a session; note pid if several exist
npx cypress tap status # baseline startedAt + spec
npx cypress tap run cypress/e2e/foo.cy.ts # async — returns immediately
# poll status until passed|failed for your spec with a changed startedAt
npx cypress tap reporter
npx cypress tap reporter --test-id r3 # one test: log, network, stubs, error
run is asynchronous. A stale verdict matches a fresh one on every field except startedAt,
and a watcher rerun of the selected spec can advance startedAt without running your file.
Gate on startedAt, spec, and a terminal status. Do not wait to observe running — fast
specs can finish between polls. Copy-paste poller:
session-lifecycle.md. JSON field helpers:
json-recipes.md.
In poll loops, prefer ./node_modules/.bin/cypress tap … over npx cypress tap … when the
project pins Cypress.
Prerequisites
- Confirm from package metadata or the lockfile that the resolved Cypress is 15.21.0+ and
contains
tap. Do not usetap --helpto probe an unknown older build; prereleases below the version floor may attempt session discovery instead of printing help. - The session must use Electron, Chrome, Chromium, or Edge. Firefox and WebKit are unsupported.
cypress openand any configuredbaseUrldev server must already be running.- The cwd chooses both the Cypress binary and the automatically selected session. When the
target project pins an older Cypress, run
tapfrom a compatible checkout and pass--session <pid>on every call.
Route by task
- Start, select, or poll a session: read session-lifecycle.md.
- Run a spec or read its results: read session-lifecycle.md and reading-results.md.
- Author or inspect a spec: read recipes.md and reading-the-app.md.
- Diagnose a failure: read recipes.md, reading-results.md, and reading-the-app.md.
- Command failure, hang, wrong project, or surprising output: read troubleshooting.md.
- Parse
--jsonor script a poll: read json-recipes.md. - One noninteractive batch: use
cypress run, nottap.
Read only the references required for the current task.
Core commands
sessions: reachable sessions, project roots, testing types, and browsers; JSON adds support and renderer health.status: lifecycle stage, selected spec, run identity, counts, build error, and active pin.specs: runnable project-relative spec paths for the session's testing type.run <spec>: dispatches a spec and returns immediately.reporter: spec overview and test ids; with--test-id, the complete test attempt.command: one command-log row with network data, snapshots, and console properties.pin: rewinds the app frame to a command snapshot.dom,aria,inspect: read the settled app or currently pinned snapshot.
All commands accept --session <pid>, --json, and --timeout <ms>. On a confirmed supported
build, use npx cypress tap <command> --help for command-specific flags. Help is generated from
the live session contract — when help and this skill disagree, trust help.
The non-negotiable verdict rule
run confirms dispatch, not execution, and returns before the new run starts. During that gap,
status and app reads can still return the previous run's plausible verdict and page.
For every explicit run:
- Read the current
startedAt. - Dispatch exactly one spec.
- Poll one
status --jsonresponse at a time. - Accept only
passedorfailedfor the expectedspecwith a non-empty, changedstartedAt.startedAtis null only when no run has ever started for that spec in the session — a build failure on first selection. A build that fails on rerun or on a watcher rebuild still advancesstartedAt, so it takes the normal path. Keep the null fallback (a changed observable baseline, or a precedingloading/runningobservation) for the first-selection case only. - Bound the loop and fail if no matching fresh verdict arrives.
Saving the active spec triggers an automatic watcher run. After editing, either use that run or let it settle before taking a baseline and dispatching another. Never intentionally put two runs in flight.
Blank and partial payloads from a successful status call occur transiently. Treat missing
fields as "keep waiting," not as a state change. A nonzero status exit is a command failure,
not a partial read: stop polling and report it.
Only passed and failed are verdicts. A build failure is failed with the diagnostic in
status.error, possibly before any tests exist. status is the only surface that carries that
diagnostic — reporter renders a failed build as an empty spec.
Critical correctness rules
- Target the intended session. If several sessions exist, or auto-selection behaves oddly,
inspect
sessionsand pass--session <pid>on every call. Auto-selection can choose another project or an unresponsive session. E2e and component testing use separate sessions: they can share aprojectRootbut expose differentspecslists, and onlystatusnames which session answered — other commands carry no pid in their output. - Preserve the binary location. Cwd controls
npxresolution on every call. When the project pins an older Cypress, run commands from a compatible checkout and pass--session <pid>. - Do not parse failed commands. Check the exit code before parsing JSON. Supported-build
failures generally use stderr, but older compatibility failures may use stdout. An ambiguous
selector is the intentional exception: it exits
1and lists matches on stdout. - Do not discard dispatch stdout while checking compatibility. An older Cypress may print
Unknown command "tap"and usage text to stdout; redirecting it hides the cause. - Redirect potentially large JSON.
reporter --test-id --jsonandcommand --jsoncan be hundreds of kilobytes. Save them to a file and parse the file. - Check truncation before concluding absence.
domandariacap output. Narrow the selector or raise the limit when(output truncated)appears. - Sanity-check the live frame before concluding absence. A trailing pending/skipped test
can leave the settled runner on a blank placeholder while app reads still exit
0. Confirm a known app anchor. If the frame is blank, pin a snapshot from the last real command and read that state instead. - Read results before editing or deleting the spec. Results and snapshots live in the Cypress app's memory and can disappear on rerun, restart, rename, or deletion.
- Clear pins. After inspecting a command snapshot, run
pin --clear; otherwise later app reads continue to describe the pinned past. An exit-0cleared:falseresult is a benign no-op even if human output saysFAILED TO CLEAR PIN. - Use the right reader for live state. Use
ariafor current form-control values:domandinspectcan show the initial HTMLvalueattribute, andinspectmay omit the accessibility value. Usedomfor exact live-region, toast, status, and label text becauseariamay omit descendant text. - Chain broad selector probes with
;, not&&. Fordom/aria/inspect, zero matches exit0while ambiguity exits1. A broad probe that enumerates matches is the useful outcome;&&drops every follow-up command after the first ambiguous selector. - A passing verdict is not a full proof. After green, read
reporter --test-idand confirm intercept match counts, stub usage, and that requests you care about were stubbed. See reading-results.md and json-recipes.md.
Output contract
- Human output is for reading;
--jsonis for parsing and may contain much more data. Default rendering is usually better for one-off debugging: it inlines code frames and interleaves network events in log order. - Exit
0is not success of your goal.tapdoes not start Cypress. With no session,statusisnot connectedat exit0;sessionsprints guidance instead of JSON. Selector misses, emptyspecs, and unknown--sessionpids can also exit0. Branch on fields, not silence. statusexits0for known lifecycle stages, includingnot connected. Discovery, compatibility, unsupported-browser, and renderer failures exit1, sometimes with no stdout; a poller must fail fast on that nonzero exit.dom,aria, andinspectrequire exactly one selected element. Ambiguity exits1with candidate selectors. A miss is not a CLI failure:domandinspectreportfound:false;ariareturns an empty tree both for a miss and for an element with no accessibility node.- Failures are prose without stable error codes. Branch on exit status, not message text.
Performance defaults
- Prefer one
reporter --test-idread over onecommandcall per row. - After a fresh verdict and live-frame sanity check, independent app reads may run concurrently.
- If bounded status polling fails, inspect
sessionsforrendererResponsive: false; restart a wedged renderer instead of increasing--timeout.
Route by symptom
| Symptom | Read |
|---|---|
| Poll hangs or verdict may not be mine | session-lifecycle.md |
| Edited a file; unsure what reran | session-lifecycle.md (file watcher) |
| JSON key empty or guessed wrong | json-recipes.md |
Column / e row / test id meaning | reading-results.md |
Test count ≠ expected its | reading-results.md, recipes.md (component) |
| Failure triage or pin looks wrong | recipes.md, reading-the-app.md |
Exit 1 but output looked fine | troubleshooting.md |
FAQ
What does the cypress-tap skill do?
Drives a running Cypress open-mode session through cypress tap to run and rerun specs, wait for fresh results, inspect reporter and command logs, and query or rewind the app under test through DOM, accessibility, styles, and snapshots. Use when authoring or debugging Cypress e2e or component specs, discovering selectors, diagnosing failures, or verifying test behavior without GUI interaction. Not for one-shot headless runs. Requires Cypress 15.21+, a Chromium-family browser, and a running cypress open session.
How do I install cypress-tap?
Run npx skills add https://github.com/cypress-io/ai-toolkit --skill cypress-tap in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cypress-tap/ (personal) or .claude/skills/cypress-tap/ (project).
Which AI agents can use cypress-tap?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is cypress-tap safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains cypress-tap?
It is published by cypress-io in cypress-io/ai-toolkit. It has 2,727 recorded installs.
More from cypress-io/ai-toolkit
cypress-author
cypress-io/ai-toolkit
Creates, updates, and fixes Cypress tests (E2E/end-to-end and component tests). Use when the user asks to create tests, add tests, write tests, update tests, test this file/component, new spec, or fix a failing or flaky test. Apply even when the user does not say 'Cypress' (e.g. 'create tests for this file'). Prefer cypress-explain when the user only wants to explain or review tests without changing code.
cypress-docs
cypress-io/ai-toolkit
Search and extract Cypress information from official documentation (docs.cypress.io, cypress.io); prefer LLM markdown under /llm/ and refuse unverified API or behavior claims.
cypress-explain
cypress-io/ai-toolkit
Explains Cypress tests (E2E and component tests), and answers questions about Cypress use and behavior. Use when the user asks to explain how a test works, explain how Cypress works, review or critique a test without writing code. Apply even when the user does not say 'Cypress' (e.g. 'explain this test'). Prefer the cypress-author skill when the user wants to create, fix, or update tests.
cypress-cloud-cli
cypress-io/ai-toolkit
Runs the cy-cloud CLI to inspect Cypress Cloud organizations, projects, runs, specs, tests, failure screenshots, and Test Replay data. Use when the user mentions Cypress Cloud, cy-cloud, cypress-cloud-cli, a Cloud run or test URL, failing or flaky Cypress tests, Test Replay, run triage, Cloud artifacts, or asks why a recorded test failed.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work