| name | actionbook |
| description | This skill should be used when the user needs to automate multi-step website tasks. Activates for browser automation, web scraping, UI testing, or building AI agents. Provides complete action manuals with step-by-step instructions and verified selectors. |
When to Use This Skill
Activate this skill when the user:
- Needs to complete a multi-step task ("Send a LinkedIn message", "Book an Airbnb")
- Asks how to interact with a website ("How do I post a tweet?")
- Builds browser-based AI agents or web scrapers
- Writes E2E tests for external websites
- Navigates to any new page during browser automation
- Wants to control their existing Chrome browser (Extension mode)
Browser Modes
Actionbook supports two browser control modes:
| Mode | Flag | Use Case |
|---|
| CDP (default) | (none) | Launches a dedicated browser instance via Chrome DevTools Protocol |
| Extension | --extension | Controls the user's existing Chrome browser via a Chrome Extension + WebSocket bridge |
When to use Extension mode:
- The user wants to operate on their already-open Chrome (with existing logins, cookies, tabs)
- The task requires interacting with pages that need the user's real session state
- The user explicitly mentions their Chrome browser, extension, or existing tabs
When to use CDP mode (default):
- Clean browser environment is preferred
- Headless automation or CI/CD
- Profile-based session isolation is needed
All actionbook browser commands work identically in both modes. The only difference is adding --extension flag (or setting ACTIONBOOK_EXTENSION=1).
How to Use
Phase 1: Get Action Manual
actionbook search "arxiv search papers"
actionbook get "arxiv.org:/search/advanced:default"
Phase 2: Execute with Browser (CDP mode — default)
actionbook browser open "https://arxiv.org/search/advanced"
actionbook browser fill "#terms-0-term" "Neural Network"
actionbook browser select "#terms-0-field" "title"
actionbook browser click "#date-filter_by-2"
actionbook browser fill "#date-year" "2025"
actionbook browser click "form[action='/search/advanced'] button.is-link"
actionbook browser wait-nav
actionbook browser text
actionbook browser close
Phase 2 (alt): Execute with Extension mode
Extension mode uses identical browser commands — just add --extension. But you must follow the full lifecycle below.
actionbook --extension browser open "https://arxiv.org/search/advanced"
actionbook --extension browser fill "#terms-0-term" "Neural Network"
actionbook --extension browser select "#terms-0-field" "title"
actionbook --extension browser click "#date-filter_by-2"
actionbook --extension browser fill "#date-year" "2025"
actionbook --extension browser click "form[action='/search/advanced'] button.is-link"
actionbook --extension browser wait-nav
actionbook --extension browser text
actionbook --extension browser close
actionbook extension stop
Action Manual Format
Action manuals return:
- Page URL - Target page address
- Page Structure - DOM hierarchy and key sections
- UI Elements - CSS/XPath selectors with element metadata
- ID: button_advanced_search
- Description: Advanced search navigation button
- Type: link
- Allow Methods: click
- Selectors:
- role: getByRole('link', { name: 'Advanced Search' }) (confidence: 0.9)
- css: button.button.is-small.is-cul-darker (confidence: 0.65)
- xpath: //button[contains(@class, 'button')] (confidence: 0.55)
Action Search Commands
actionbook search "<query>"
actionbook search "<query>" --domain site.com
actionbook search "<query>" --url <url>
actionbook search "<query>" -p 2 -s 20
actionbook get "<area_id>"
actionbook sources list
actionbook sources search "<query>"
Extension Setup & Management
Commands for managing the Chrome Extension bridge:
actionbook extension install
actionbook extension path
actionbook extension serve
actionbook extension stop
actionbook extension status
actionbook extension ping
Setup flow (one-time):
actionbook extension install — extract extension files and register native messaging host
- Open
chrome://extensions → enable Developer mode → Load unpacked → select the path from actionbook extension path
actionbook extension serve — start bridge (keep running)
- Extension auto-connects via native messaging (no manual token needed in most cases). If auto-pairing fails: copy token from
serve output → paste in extension popup → Save
Connection check before automation:
actionbook extension status
actionbook extension ping
Browser Commands
All browser commands below work in both CDP and Extension mode.
For Extension mode, add --extension flag or set ACTIONBOOK_EXTENSION=1.
Navigation
actionbook browser open <url>
actionbook browser goto <url>
actionbook browser back
actionbook browser forward
actionbook browser reload
actionbook browser pages
actionbook browser switch <page_id>
actionbook browser close
actionbook browser restart
actionbook browser connect <endpoint>
Interactions (use CSS selectors from Action Manual)
actionbook browser click "<selector>"
actionbook browser click "<selector>" --wait 1000
actionbook browser fill "<selector>" "text"
actionbook browser type "<selector>" "text"
actionbook browser select "<selector>" "value"
actionbook browser hover "<selector>"
actionbook browser focus "<selector>"
actionbook browser press Enter
Get Information
actionbook browser text
actionbook browser text "<selector>"
actionbook browser html
actionbook browser html "<selector>"
actionbook browser snapshot
actionbook browser viewport
actionbook browser status
Wait
actionbook browser wait "<selector>"
actionbook browser wait "<selector>" --timeout 5000
actionbook browser wait-nav
Screenshots & Export
actionbook browser screenshot
actionbook browser screenshot output.png
actionbook browser screenshot --full-page
actionbook browser pdf output.pdf
JavaScript & Inspection
actionbook browser eval "document.title"
actionbook browser inspect 100 200
actionbook browser inspect 100 200 --desc "login btn"
Cookies
actionbook browser cookies list
actionbook browser cookies get "name"
actionbook browser cookies set "name" "value"
actionbook browser cookies set "name" "value" --domain ".example.com"
actionbook browser cookies delete "name"
actionbook browser cookies clear
Global Flags
actionbook --json <command>
actionbook --headless <command>
actionbook --verbose <command>
actionbook -P <profile> <command>
actionbook --cdp <port|url> <command>
actionbook --extension <command>
Guidelines
- Search by task description, not element name ("arxiv search papers" not "search button")
- Use Action Manual selectors first - they are pre-verified and don't require snapshot
- Prefer CSS ID selectors (
#id) over XPath when both are provided
- Fallback to snapshot when selectors fail - use
actionbook browser snapshot then CSS selectors from the output
- Re-snapshot after navigation - DOM changes invalidate previous state
- Extension mode: follow the full lifecycle — pre-flight → connect → execute → cleanup (see Extension Mode Lifecycle)
- Extension mode: verify extension is installed before starting bridge; prefer auto-pair over manual token
- Extension mode: always run
browser close before stopping the bridge to release the debug connection
- Extension mode: the user's real browser is being controlled — avoid destructive actions (clearing all cookies, closing all tabs) without confirmation
- Extension mode: L3 operations (some cookie/storage modifications) may require manual approval in the extension popup
Fallback Strategy
When Fallback is Needed
Actionbook stores pre-computed page data captured at indexing time. This data may become outdated as websites evolve:
- Selector execution failure - The returned CSS/XPath selector does not match any element
- Element mismatch - The selector matches an element with unexpected type or behavior
- Multiple selector failures - Several selectors from the same action fail consecutively
Fallback Approaches
When Action Manual selectors don't work:
- Snapshot the page -
actionbook browser snapshot to get the current accessibility tree
- Inspect visually -
actionbook browser screenshot to see the current state
- Inspect by coordinates -
actionbook browser inspect <x> <y> to find elements
- Execute JS -
actionbook browser eval "document.querySelector(...)" for dynamic queries
When to Exit
If actionbook search returns no results or action fails unexpectedly, use other available tools to continue the task.
Examples
End-to-end with Action Manual
actionbook search "airbnb search" --domain airbnb.com
actionbook get "airbnb.com:/:default"
actionbook browser open "https://www.airbnb.com"
actionbook browser fill "input[data-testid='structured-search-input-field-query']" "Tokyo"
actionbook browser click "button[data-testid='structured-search-input-search-button']"
actionbook browser wait-nav
actionbook browser text
actionbook browser close
Extension mode: Operate on user's Chrome
actionbook extension status
actionbook --extension browser open "https://github.com/notifications"
actionbook --extension browser wait-nav
actionbook --extension browser text ".notifications-list"
actionbook --extension browser screenshot notifications.png
Extension Mode Lifecycle (CRITICAL)
When using Extension mode, always follow this complete lifecycle: pre-flight → connect → execute → cleanup.
1. Pre-flight: Ask user about extension installation
Before any technical checks, ask the user whether they have the Actionbook Chrome Extension installed.
- User confirms installed → proceed to Step 2 (Connect).
- User says not installed → run the installation flow:
actionbook extension install
actionbook extension path
Then guide the user to load it in Chrome:
- Open
chrome://extensions → enable Developer mode
- Click "Load unpacked" → select the extension directory
- After user confirms loaded → proceed to Step 2
Limitation: The CLI can only verify that extension files exist locally. There is no way to detect whether Chrome has actually loaded the extension until a connection is attempted in Step 2.
2. Connect: Start bridge, auto-pair with retry
Start the bridge server and attempt auto-pairing. Retry up to 3 times before considering manual fallback.
actionbook extension serve
sleep 3
actionbook extension ping
sleep 5
actionbook extension ping
sleep 5
actionbook extension ping
Only after all 3 auto-pair attempts fail, escalate based on the error:
- "Extension not connected" → Ask user to verify the extension is enabled in
chrome://extensions and retry
- "Invalid token" → Only now provide the token from
serve output for manual paste in the extension popup
- Other errors → Check
actionbook extension status for diagnostics
IMPORTANT: Do NOT expose the session token prematurely. The token is a last-resort fallback — most users will connect successfully via auto-pair within 3 attempts.
3. Execute: Browser automation
actionbook --extension browser open "https://example.com"
4. Cleanup: Release debug connection, THEN stop bridge
actionbook --extension browser close
actionbook extension stop
actionbook extension status
WARNING: Skipping Step 1 and directly killing the bridge process will leave Chrome showing "Actionbook is debugging this browser". Always release the debug connection before stopping the bridge.
Extension mode: Troubleshooting
actionbook extension serve
actionbook extension ping
actionbook extension serve
Deep-Dive Documentation
For detailed patterns and best practices: