feat: stagecraft --http mode and native download in .js skills#908
Merged
Conversation
- stagecraft run --http connects to a running playwright-repl --http
server instead of launching a fresh browser; supports existing user
sessions with cookies/auth intact
- In --http mode, prefers .js skill over .pw if both exist, sending
the script via POST /run-script (single round-trip, full Playwright API)
- download-bill.js rewritten as a top-level script using
page.waitForEvent('download') + download.saveAs(path); agent gets
back the saved file path in the response
- {{variable}} substitution applied to .js scripts before sending,
same pattern as .pw template variables
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- start-recording / stop-recording / pause-recording / discard-recording now work when the agent sends them via POST /run to playwright-repl --http - Commands are recorded with ref-to-locator resolution (SessionManager feeds snapshot YAML from each `snapshot` result for stable locators) - relay interactive loop (playwright-repl --relay) gets the same recording support, with a red ⏺ indicator in the prompt while recording Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- discoverSkills() now merges builtin skills (packages/stagecraft/skills/)
with user skills (~/.stagecraft/skills/ or --skills-dir override);
user skills with the same name override builtins
- SkillInfo gains a `source` field ('builtin' | 'user')
- stagecraft list shows [user] tag next to user-owned skills
- AGENT.md: Phase 2 recording guide for AI agents — setup, snapshot
discipline for ref-to-locator resolution, .pw vs .js skill choice,
directory layout, and command reference table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #829 (partial — known issues #1 and #2)
Summary
stagecraft run --httpconnects to a runningplaywright-repl --httpserver instead of launching a fresh Playwright browser, so skills run against the user's real Chrome session (cookies, auth, Rogers login intact)--httpmode, if the skill has a.jsfile it is sent viaPOST /run-scriptas a single round-trip;.pwfallback sends commands one-by-one viaPOST /rundownload-bill.jsrewritten as a top-level awaitable script usingpage.waitForEvent('download')+download.saveAs(path)— no extension plumbing needed, agent gets back the saved file path{{variable}}substitution works in.jsscripts the same as.pwtemplatesUsage
Test plan
stagecraft run download-rogers-bill --httperrors clearly when server is not runningstagecraft run download-rogers-bill --http --variable periods='[...]' --variable savePath=...navigates to Rogers, checks periods, downloads PDF to the specified pathstagecraft run download-rogers-bill(no--http) still works with fresh browser via direct modestagecraft liststill shows the skill🤖 Generated with Claude Code