Example prompt
Use the Libretto skill. Go on LinkedIn and scrape the first 10 posts for content, who posted it, the number of reactions, the first 25 comments, and the first 25 reposts.Your agent opens a browser window for you to log in, then takes over: exploring the feed, identifying selectors, prototyping interactions, and assembling the final workflow file.
How the agent works
Opens a headed browser
The agent starts with:Headed mode keeps the browser window visible so you can log in before the agent begins exploring.
Reviews the site's security posture
Before choosing how to capture data, the agent reads the site-security reference and checks for bot detection, monkey-patched fetch, and challenge pages. This determines whether to use direct
fetch() calls, passive network interception, or DOM extraction.Takes a snapshot to understand the page
Uses exec to prototype interactions
The agent tests selectors and interaction patterns before committing them to code:Short
exec calls let the agent validate each step against the live page without writing and re-running a full script each time.Writes the workflow file
Once the agent has a working path, it generates a TypeScript file that exports a
workflow() instance:When to use this approach
- You’re automating a site for the first time and don’t know its structure
- The task is self-contained and clearly scoped (“get the first 10 posts”)
- You want a working script with minimal back-and-forth
- You don’t need to demonstrate the workflow manually first
Tips
Make sure your coding agent has the Libretto skill installed before starting. Run
npx libretto init in your project root to set up the workspace and configure snapshot analysis if you haven’t already.Related guides
Interactive script building
Show the agent your workflow manually and let it turn your actions into code.
Convert to network requests
Speed up an existing browser script by switching to direct API calls.