
Flow2Skill
PythonPlaywrightAI AgentsWorkflow CompilerpytestLocal First
The Challenge
Browser agents are valuable when a path is unknown, but rediscovering a browser workflow that already succeeded adds cost, latency, and variation. A raw recorder script is not enough because it can preserve sensitive values, omit a mechanical success condition, or hide unsupported behavior.
The Solution
Flow2Skill treats Playwright codegen as source material for a strict compiler. It parses the recording without importing or executing it, protects captured values, rejects unsupported constructs, classifies mutating actions, and emits inspectable JSON and YAML contracts, a portable SKILL.md, and a standalone pytest proof.
System Architecture
Demonstration to Proof Compiler
Flow2Skill preserves a browser workflow that already worked, then makes both the procedure and its success condition inspectable.
01Human Demonstration
Playwright codegenCapture one successful synchronous browser flow.
explicit successRequire an executable assertion or a supplied success text.
02Strict Compiler
AST allowlistParse the recording without importing or executing its Python.
fail closedReject dynamic expressions, control flow, unknown calls, and unsupported selector shapes.
03Protected Contract
runtime variablesReplace protected values with compiler-owned F2S variables.
risk gatesMark browser mutations for review and high-impact actions for approval.
04Portable Outputs
agent skillExport a readable SKILL.md for agent runtimes.
pytest proofExport a standalone browser regression test with a mechanical pass condition.
One demonstration becomes five inspectable artifactsProtected values stay outside generated bundlesReplay requires explicit live and side effect flags
- ✓Strict AST compiler for synchronous Playwright Python recordings
- ✓Fingerprint validated JSON and YAML workflow contracts
- ✓Portable SKILL.md plus a standalone Playwright and pytest proof
- ✓Default protection for typed, asserted, echoed, and URL carried values
- ✓Fail closed rejection of dynamic expressions, control flow, unknown calls, and missing assertions
- ✓Review gates for mutations and approval gates for high impact actions
- ✓Loopback Studio with Host, origin, token, body size, and path checks
- ✓Public v0.1.0 package, real browser demo, and 46 passing local tests