Skip to content

About

Records successful agent browser exploration as reusable Playwright workflows, with step-level AI or human takeover.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Playwright Script Recorder

Evidence-first Playwright CLI recorder for AI-assisted browser workflows.

Skill entry:

skills\playwright-script-recorder\SKILL.md

Install

npm install -g playwright-script-recorder@latest
pwsr install-browser chromium
pwsr doctor
pwsr gates

If you use the bundled workspace installer instead, it installs the recorder CLI and downloads the bundled Playwright chromium browser for you:

powershell -ExecutionPolicy Bypass -File .\skills\playwright-script-recorder\scripts\install-cli.ps1

The installer auto-selects the newest bundled tarball under assets\npm\, so it does not need a version bump on each release. Pass -NoAutoNode to skip the automatic winget Node.js install, or -SkipBrowserInstall to skip the browser download.

The node scripts\record.js fallback in this checkout only works against a built sibling checkout of the Playwright fork (or PLAYWRIGHT_RECORDER_PLAYWRIGHT_SRC pointing at one). It is a developer-only path; for normal use, prefer pwsr record.

Recording defaults to headed mode. Pass --headless before -- to override.

Record

pwsr record --dir runs\my-task -- -s=my-task open https://example.com --browser=chromium
pwsr record --strict=full --dir runs\my-task -- -s=my-task click e3
pwsr record --strict=locators-only --dir runs\my-task -- -s=my-task click e5
pwsr record --dir runs\my-task -- -s=my-task --raw snapshot
pwsr record --dir runs\my-task -- -s=my-task --raw generate-locator e6

The recorder should open a visible browser by default. Use --headless before -- only when you explicitly want headless recording.

For tab-heavy exploration, label important tabs and select them by label instead of remembering numeric indexes:

pwsr record --dir runs\my-task -- -s=my-task tab-new --label source https://example.com/source
pwsr record --dir runs\my-task -- -s=my-task tab-select --label source

Tab labels are stored in runs\my-task\tab-labels.json, and new raw.jsonl records include before/after active tab evidence for review. Close labeled tabs with tab-close --label <name> once they are no longer needed. Advanced opt-in cleanup flags exist for known-safe cases, but normal recording should prefer explicit tab-close / close commands.

If the runtime supports subagents, use a main-agent orchestration pattern for exploration: the main agent splits the target journey into smaller exploration slices, delegates each slice to a subagent with its own run directory, validates each slice with pwsr validate-slice, then reviews the returned evidence and turns the successful combined flow into the reusable workflow. Subagents should gather evidence, not independently declare the whole task complete.

Source fallback:

node scripts\record.js --dir runs\my-task -- -s=my-task --raw snapshot

Run Reusable Workflows

Prepared resumable workflows are executable through pwsr:

pwsr run --run-dir runs\create-record --input data\item.json workflows\create-record\create-record.workflow.js
pwsr run --session my-task --run-dir runs\create-record --input data\item.json workflows\create-record\create-record.workflow.js
pwsr validate-runtime runs\create-record
pwsr completion init runs\create-record --profile workflow
pwsr validate-completion runs\create-record

pwsr run loads a pwsr workflow definition and preserves the runner's pause/resume behavior. With --session, it runs against the same live browser session used by pwsr record -s=<name>, so AI or manual recorded intervention can take over the same page between workflow runs.

Review

pwsr review runs\my-task
pwsr status runs\my-task

This writes runs\my-task\summary.md from raw.jsonl. Every pwsr record call also refreshes recorded.playwright.js and recorded.actions.json in the run directory.

Initialize the reusable workflow from those recorded artifacts:

pwsr workflow init runs\my-task --out workflows\my-task\my-task.workflow.js

Patch the scaffold for parameters, waits, assertions, resume/skip behavior, and completion verification, while preserving its recorded-step source metadata. Do not reconstruct the flow from summary.md.

About

Records successful agent browser exploration as reusable Playwright workflows, with step-level AI or human takeover.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages