codervisor/lean-spec
Overview
This skill is a lightweight CLI for browser automation tailored to AI agents and developer workflows. It provides commands to navigate pages, capture element references, interact with form controls, take screenshots, extract data, and manage sessions across desktop and iOS simulators. It’s designed for fast, repeatable automation and debugging of web tasks.
How this skill works
The CLI opens a browser session and produces interactive snapshots that assign stable refs (e.g., @e1) to elements. Use those refs or semantic locators to click, fill, select, or extract text, then re-snapshot after navigation or DOM changes to refresh refs. It supports waiting strategies (network idle, URL patterns, element presence), session/state save & load, screenshots, PDF export, and parallel sessions or headed debugging.
When to use it
- Automating form fills, testing signup or login flows
- Scraping structured text or taking screenshots for reports
- End-to-end testing of web apps and UI regression checks
- Reproducing user flows for bug reports or demos (with recordings)
- Managing authenticated sessions across runs (save/load state)
Best practices
- Always run snapshot -i after navigation or DOM updates to get fresh refs
- Prefer semantic locators (text, role, label, testid) when refs are brittle
- Use wait --load networkidle or wait @ref before interacting with elements
- Save authentication state after first successful login to speed future runs
- Run headed mode and highlight for visual debugging when tests fail
Example use cases
- Fill and submit a signup form, then verify success message and take a screenshot
- Login once, state save to auth.json, then reuse state to run authorized scraping or API prep
- Automate multi-page data extraction: snapshot, get text, paginate, and aggregate results
- Run parallel sessions to compare two sites or environment builds simultaneously
- Record a user session (demo.webm) while interacting in headed mode for QA handoff
FAQ
Refs are invalidated when the page changes. Always run snapshot -i after navigation or major DOM updates to obtain new refs.
Can I run mobile flows?
Yes. The CLI supports an iOS simulator mode and real devices (requires macOS, Xcode, Appium). Use -p ios and --device to target devices.
How do I preserve login state between runs?
After a successful login, run state save auth.json. Later runs can load that file with state load auth.json before opening protected pages.
3 skills
This skill automates browser tasks by navigating, interacting, and extracting data to streamline web workflows for AI agents.
This skill guides LeanSpec development, helping you set up environments, follow rules, and validate changes across a Turborepo monorepo.
This skill helps you trigger, monitor, and troubleshoot GitHub Actions workflows for LeanSpec using gh CLI.