Programs Beat Prompts: How Tap Turns AI into a Compiler for Browser Automation
The Problem Every time you ask an AI agent to do something in a browser, it costs money and time. Click here, type there, extract that — the AI figures it out from scratch every single time. What i...

Source: DEV Community
The Problem Every time you ask an AI agent to do something in a browser, it costs money and time. Click here, type there, extract that — the AI figures it out from scratch every single time. What if AI only had to figure it out once? Tap: The Compiler Approach Tap is a protocol + toolchain that turns AI's interface operations into deterministic programs (.tap.js files): Forge — AI observes the page (network, DOM, a11y tree) and writes a tap program Verify — Test the tap with different inputs Run forever — The tap replays deterministically. Zero AI cost. First run: AI inspects → writes .tap.js ($0.50) Every run: .tap.js replays deterministically ($0.00) How It Works 8 core operations + 17 built-in operations = complete browser control protocol. A tap program is plain JavaScript: export default { site: "github", name: "trending", async run(tap) { await tap.nav("https://github.com/trending") return tap.eval(() => { return [...document.querySelectorAll('article.Box-row')].map(el => (