Commit Graph

116 Commits

Author SHA1 Message Date
Sawyer Hood 45c3e37c9b Add permissions configuration section to README.md
Introduce options for users to configure permission prompts in Claude, including a YOLO mode to skip all prompts and a method to allowlist specific commands in settings.json. This enhances user control over script execution permissions.
2025-12-12 14:29:58 -08:00
Sawyer Hood 82b390a6e1 Add instructions for Amp 2025-12-10 23:31:14 -08:00
Sawyer Hood 5281e4ac95 Update marketplace.json to increment version from 1.0.0 to 1.0.1 2025-12-10 20:09:48 -08:00
Sawyer Hood 2b3f2bc1d0 Add headless mode support to dev-browser server script
Enhance the server script to accept a `--headless` flag for running the browser in headless mode. Update SKILL.md to document this new feature, improving user guidance on server startup options.
2025-12-10 20:05:11 -08:00
Sawyer Hood ec11c8ec9e Update SKILL.md to clarify the server startup process. The setup instructions now specify using a startup script that automatically installs dependencies and Chromium, improving user experience and ensuring proper server operation. 2025-12-10 17:42:38 -08:00
Sawyer Hood 5775a33693 Update SKILL.md to include dependency installation step before starting the dev-browser server. This change ensures users install necessary dependencies for proper server operation. 2025-12-10 17:28:31 -08:00
Sawyer Hood 6159b0e4d5 Remove recommendation against using ARIA snapshots for source-available sites in SKILL.md. This change clarifies that direct selectors should be prioritized when source code is accessible, enhancing documentation consistency. 2025-12-09 11:19:38 -08:00
Sawyer Hood 56f19aa074 Merge pull request #1 from SawyerHood/aria-snapshot-refactor
Implement ARIA snapshots, remove LLM Tree
2025-12-09 10:59:54 -08:00
Sawyer Hood 34e828f369 Run prettier
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 10:58:32 -08:00
Sawyer Hood 9bac1e32a2 Emphasize using direct selectors over ARIA snapshots for source-available code
When source code is available, direct selectors are faster, more reliable, and
avoid the overhead of snapshot generation. Update documentation to explicitly
discourage ARIA snapshot usage when code is known.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 10:57:23 -08:00
Sawyer Hood e1a8432408 Enhance install-dev.sh to dynamically locate the claude command
Updated the installation script to check for the claude command in common locations, improving robustness. The script now uses a variable for the claude command, ensuring consistent usage throughout the installation process.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-12-09 10:50:49 -08:00
Sawyer Hood 6993e2f3c2 Update SKILL.md to clarify when to use ARIA snapshots
Changed wording to indicate ARIA snapshots are useful when you don't
know the page layout, rather than being the recommended approach for
all AI automation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 10:43:01 -08:00
Sawyer Hood 3f62ff4f94 Fix claude command not found in install-dev.sh
The script now checks multiple locations for the claude command:
1. PATH (if available)
2. ~/.claude/local/claude (local installation)
3. /usr/local/bin/claude (global installation)

This fixes the issue where shell aliases aren't available in scripts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 10:33:13 -08:00
Sawyer Hood 14eedbeb76 Replace LLM Tree with ARIA Snapshot for element discovery
This refactors dev-browser to use Playwright-compatible ARIA snapshots
instead of the custom LLM Tree approach for element discovery.

Changes:
- Add getAISnapshot() - returns YAML accessibility tree with refs
- Add selectSnapshotRef() - gets ElementHandle by ref (e.g., "e5")
- Refs persist on window.__devBrowserRefs across connections
- Remove getLLMTree() and getSelectorForID() from client
- Remove /tree and /selector server endpoints
- Delete src/dom/ directory (8500+ lines removed)
- Update SKILL.md documentation

The ARIA snapshot approach provides:
- Semantic roles (button, link, heading) instead of raw HTML
- Stable refs that survive across script executions
- Compact output focused on interactive elements
- Matches Playwright's internal _snapshotForAI format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 10:30:39 -08:00
Sawyer Hood 2c87679222 Add development installation script
Adds install-dev.sh to simplify local plugin development by removing
existing marketplace/plugin installations and reinstalling from the
current directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 09:53:17 -08:00
Sawyer Hood 448c2d5919 Add guidance for plain JS in page.evaluate and tsx type-checking behavior
Clarifies that page.evaluate() callbacks must use plain JavaScript (not
TypeScript) since they run in the browser, and notes that tsx transpiles
without type-checking so type errors won't prevent execution.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 17:09:28 -08:00
Sawyer Hood cde88c7c1a Move benchmarks section after usage in README
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 16:43:28 -08:00
Sawyer Hood d27223cbe8 Add Ready message and improve Playwright installation check
- Server now prints "Ready" when fully started
- SKILL.md updated to instruct users to wait for Ready message
- Improved Chromium detection to check for actual chromium directories
  rather than just the cache folder existing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 16:33:58 -08:00
Sawyer Hood 9cf074088d Add benchmark comparison to README
Show performance comparison between Dev Browser, Playwright MCP, and
Playwright Skill across time, cost, and turns metrics. Link to the
dev-browser-eval repo for methodology.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 16:26:45 -08:00
Sawyer Hood 667efe9e01 Update CI workflow to set working directory for dev-browser during dependency installation and Playwright browser setup 2025-12-05 15:11:17 -08:00
Sawyer Hood f6e8dac453 Remove dev-browser.md file as part of project restructuring 2025-12-05 14:46:46 -08:00
Sawyer Hood 572469ef8e Update README.md with links to Playwright MCP and Playwright skill; adjust CI workflow paths for dev-browser 2025-12-05 14:46:04 -08:00
Sawyer Hood 0680516b85 Update README.md to enhance descriptions of Playwright MCP, Direct Playwright scripts, and Dev Browser
This commit revises the README.md file to provide more detailed descriptions of the Playwright MCP, Direct Playwright scripts, and Dev Browser approaches. The updates clarify the tradeoffs and context efficiency of each method, improving the overall understanding of the plugin's capabilities for developers.
2025-12-05 14:30:49 -08:00
Sawyer Hood 218c6e1a79 Revise README.md to introduce Dev Browser plugin for Claude Code
This commit updates the README.md file to provide a comprehensive overview of the Dev Browser plugin, detailing its purpose, unique features, installation steps, and usage examples. The enhancements aim to clarify the plugin's functionality and improve the onboarding experience for developers integrating browser automation into their workflows.
2025-12-05 14:27:44 -08:00
Sawyer Hood 5206ad2e25 Remove todo.md file as part of project cleanup 2025-12-05 13:53:59 -08:00
Sawyer Hood 9e863b4f06 Update SKILL.md to refine browser automation descriptions and enhance usage examples
This commit revises the SKILL.md file to clarify the description of browser automation tasks, emphasizing user-triggered actions and providing a more comprehensive list of trigger phrases. Additionally, it updates various code examples and sections to improve readability and usability, ensuring developers have clear guidance on executing scripts and managing browser interactions. These enhancements aim to streamline the developer experience and improve the overall documentation for the dev-browser package.
2025-12-04 21:20:24 -08:00
Sawyer Hood 4b5ac9512f Update SKILL.md to enhance script execution guidance and inline usage examples
This commit revises the SKILL.md file to provide clearer instructions on executing scripts inline using heredocs, eliminating the need for temporary file creation for one-off automation tasks. It also emphasizes when to write scripts to the `tmp/` directory and updates various code examples to reflect the new inline execution format. These changes aim to improve developer experience and streamline the automation process.
2025-12-04 20:59:37 -08:00
Sawyer Hood 62717a90ad Add bun.lock file to manage dependencies and workspace configuration
This commit introduces a new bun.lock file for the browser-skill project, establishing a lockfile version and defining the workspace structure. It includes a comprehensive list of devDependencies such as @types/bun, husky, lint-staged, prettier, and typescript, along with their respective versions. This addition aims to enhance dependency management and ensure consistent installations across development environments.
2025-12-04 14:28:30 -08:00
Sawyer Hood 6a5225279e Move dev-browser package into skill folder, add @ path alias
- Move all source from packages/dev-browser/src to skills/dev-browser/src
- Remove monorepo workspaces configuration
- Add @/* path alias via package.json imports and tsconfig paths
- Update all imports to use @/client.js and @/index.js
- Update SKILL.md and CLAUDE.md documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 14:27:49 -08:00
Sawyer Hood a100530b20 Refactor error handling in client.ts and update SKILL.md for improved guidance
This commit enhances error handling in the `client.ts` file by introducing more robust checks and clearer error messages. Additionally, the SKILL.md file is updated to reflect these changes, providing developers with better guidance on handling errors during browser automation tasks. These improvements aim to enhance the reliability of the dev-browser package and support developers in troubleshooting issues effectively.
2025-12-03 17:05:31 -08:00
Sawyer Hood ba601a3fae Enhance dev-browser setup process and improve SKILL.md documentation
This commit updates the SKILL.md file to clarify the setup process for the dev-browser server, emphasizing automatic installation of Chromium and the creation of necessary directories. Additionally, the start-server.ts script is modified to check for existing Playwright browser installations and install Chromium if not found, improving the user experience. These changes aim to streamline the initial setup and enhance the overall documentation for better developer guidance.
2025-12-03 16:55:49 -08:00
Sawyer Hood 0f1cd6829b Update dev-browser workspace overrides and enhance SKILL.md documentation
This commit modifies the workspace overrides for the `dev-browser` package in both `package.json` and `bun.lock`, ensuring correct resolution within the workspace. Additionally, the SKILL.md file is significantly updated to improve clarity on setup, script writing, and the overall functionality of the browser automation tool. Key enhancements include clearer instructions, improved examples, and a more structured approach to documenting the automation process. These changes aim to enhance developer experience and usability of the dev-browser features.
2025-12-03 16:49:25 -08:00
Sawyer Hood d87576fe65 Update SKILL.md to enhance browser automation documentation and clarify usage guidelines
This commit revises the SKILL.md file for the dev-browser package, improving the description of browser automation capabilities and providing clearer instructions for setup and script writing. Key changes include a more detailed description of automation tasks, restructured sections for better readability, and updated examples to reflect best practices. These enhancements aim to improve developer understanding and usability of the dev-browser features.
2025-12-03 16:28:08 -08:00
Sawyer Hood fe799d69fb Remove deprecated files and update marketplace configuration for dev-browser
This commit deletes outdated files related to the dev-browser package, including the `TODO.md`, `package.json`, `plugin.json`, and `start-server.ts`, as part of a cleanup effort. Additionally, the marketplace configuration is updated to reflect the new name and email for the owner, along with adjustments to the plugin source and description. These changes streamline the project structure and improve clarity in the marketplace setup.
2025-12-03 16:02:12 -08:00
Sawyer Hood decabcab50 Add workspace overrides for dev-browser in package.json and bun.lock
This commit introduces workspace overrides for the `dev-browser` package in both `package.json` and `bun.lock`. The changes ensure that the `dev-browser` dependency resolves correctly within the workspace, enhancing the development experience. Additionally, the `dev-browser` package's dependency declaration is updated to use a wildcard version, simplifying version management. These updates aim to improve the consistency and reliability of package resolutions across the project.
2025-12-03 15:30:57 -08:00
Sawyer Hood 63006c09f5 Implement waitForPageLoad function and update SKILL.md for improved page loading handling
This commit introduces the `waitForPageLoad` function in the `client.ts` file, which enhances page load handling by checking the document's ready state and monitoring network requests. The SKILL.md file is updated to incorporate this new function, replacing previous loading methods with `waitForPageLoad` in various examples. These changes aim to improve the reliability of page interactions and provide clearer guidance for developers on managing page load states.
2025-12-03 15:16:38 -08:00
Sawyer Hood 9b1fd43192 Enhance CSS selector escaping in serialize.ts to handle identifiers starting with digits
This commit updates the `escapeSelector` function in `serialize.ts` to improve CSS selector escaping. It now correctly escapes special characters and handles identifiers that start with digits by converting them to a hex format. These changes enhance the robustness of selector handling in the dev-browser package.
2025-12-03 15:03:40 -08:00
Sawyer Hood 4e493b4649 Refactor SKILL.md and TypeScript logic for improved loading and selector handling
This commit updates the SKILL.md file to change the page load state from "networkidle" to "load" and introduces a timeout to allow dynamic content to finish loading. Additionally, it refines the TypeScript logic in the `index.ts` file by updating the structure of the `PageEntry` interface to include separate maps for CSS selectors and backend node IDs. The selector resolution process is enhanced to prefer backend node IDs for reliability, with fallbacks to CSS selectors when necessary. These changes aim to improve the clarity and functionality of the dev-browser package.
2025-12-03 15:01:56 -08:00
Sawyer Hood e61e1d3d91 Refactor DOM extraction logic to improve clarity and maintainability
This commit simplifies the DOM extraction process in the `extract.ts` file by removing outdated browser global declarations and replacing the `extractDOMScript` function with a direct reference to `extractDOMScriptSource`. This change enhances the clarity of the code and reduces complexity, making it easier to understand and maintain. Additionally, the extraction logic for processing iframes has been streamlined, ensuring consistent handling of DOM elements across different contexts.
2025-12-03 14:48:33 -08:00
Sawyer Hood cfe66f7943 Refactor SKILL.md to improve documentation structure and clarity
This commit reorganizes the SKILL.md file by removing outdated screenshot examples and introducing a new section on inspecting page state. It adds detailed explanations for taking screenshots and using the LLM tree for structured DOM inspection, along with example code snippets. The documentation now provides clearer guidance on when to use different methods for debugging and interacting with web elements, enhancing usability for developers.
2025-12-03 14:26:14 -08:00
Sawyer Hood fa84862fc8 Update getLLMTree method to return string instead of GetLLMTreeResponse
This commit modifies the `getLLMTree` method in the `DevBrowserClient` interface and its implementation to return a string representing the DOM tree instead of the previous `GetLLMTreeResponse` type. This change simplifies the response structure, focusing on the essential data needed for further processing. Additionally, the method now extracts the `tree` property from the response, enhancing clarity and usability in handling the LLM tree data.
2025-12-03 14:22:47 -08:00
Sawyer Hood 3537767878 Remove deprecated dump-hn-tree script and associated output file
This commit deletes the `dump-hn-tree.ts` script and its generated output file `hn-tree.txt` from the dev-browser package. The removal is part of a cleanup effort to eliminate unused or outdated code, streamlining the project and improving maintainability. This change reflects a shift in focus towards more relevant functionalities within the package.
2025-12-03 14:19:30 -08:00
Sawyer Hood b04298a0c4 Refactor TypeScript checks in CI workflow
This commit simplifies the TypeScript check step in the CI workflow by consolidating the checks into a single job. The previous separate checks for the root and dev-browser have been merged into one, streamlining the process and improving maintainability. This change aims to enhance the efficiency of the CI pipeline while ensuring consistent type checking across the project.
2025-12-03 10:03:34 -08:00
Sawyer Hood 61f2883dd2 Enhance dev-browser with new accessibility features and testing utilities
This commit introduces new functionalities aimed at improving accessibility and testing within the dev-browser package. Key changes include:

- Implementation of methods to retrieve the accessibility tree of the current page, enhancing the ability to interact with web elements for accessibility purposes.
- Addition of new test cases to ensure the reliability and functionality of the accessibility features.
- Updates to existing documentation to reflect the new capabilities and usage guidelines.

These enhancements aim to improve the overall accessibility of web applications and ensure robust testing practices within the dev-browser environment.
2025-12-03 10:01:31 -08:00
Sawyer Hood 4aa0c809b7 Refactor DOM utility functions for improved type safety and clarity
This commit enhances the type safety and clarity of various DOM utility functions within the dev-browser package. Key changes include:

- Updated function signatures to use more specific types, such as `BrowserElement`, `BrowserNode`, and `BrowserShadowRoot`, improving type checking and reducing potential runtime errors.
- Added non-null assertions to ensure that the code handles potentially undefined values more safely.
- Refactored test cases to align with the updated function signatures, ensuring consistency and reliability in testing.

These improvements aim to enhance code maintainability and reduce the likelihood of errors during DOM manipulation.
2025-12-03 09:58:46 -08:00
Sawyer Hood 16d77681f3 Enhance dev-browser with linting and formatting tools
This commit introduces several development tools to improve code quality and maintainability within the dev-browser package. Key changes include:

- Addition of `husky` for managing Git hooks, ensuring that pre-commit checks are enforced.
- Integration of `lint-staged` to run linters on staged files, promoting consistent code style.
- Implementation of `prettier` for automatic code formatting, enhancing readability and reducing style discrepancies.
- Updates to the `package.json` and `bun.lock` files to include the new dependencies and scripts for formatting and linting.

These enhancements aim to streamline the development process and maintain high code quality standards across the project.
2025-12-03 09:51:35 -08:00
Sawyer Hood a641f8ef6d Implement LLM tree extraction and selector resolution in dev-browser
This commit introduces new functionalities for extracting the LLM-friendly DOM tree and resolving CSS selectors for elements within the dev-browser package. Key changes include:

- Addition of `getLLMTree` and `getSelectorForID` methods in the `DevBrowserClient` interface for fetching the DOM tree and corresponding selectors.
- Implementation of server endpoints to handle requests for LLM tree extraction and selector resolution, enhancing the API's capabilities.
- Updates to the TypeScript types to support the new functionalities, including `GetLLMTreeResponse` and `GetSelectorResponse`.
- Enhancements to the DOM utility functions to facilitate backend node ID resolution for persistent element identification.

These updates improve the interaction with web pages and enhance the overall usability of the dev-browser package.
2025-12-03 09:49:08 -08:00
Sawyer Hood a52a5361d0 Refactor dev-browser DOM serialization and testing utilities
This commit refines the DOM serialization and testing capabilities within the dev-browser package. Key updates include:

- Enhancements to the `serializeNode` function for improved handling of various DOM elements.
- Modifications to the `dump-hn-tree` script to better reflect the current serialization format.
- Updates to existing tests to align with the new serialization behavior, ensuring accurate representation of interactive elements.

These changes aim to improve the accuracy and usability of DOM representations, further enhancing the integration with testing frameworks.
2025-12-03 09:08:07 -08:00
Sawyer Hood 3185809619 Enhance dev-browser DOM serialization and testing capabilities
This commit introduces significant improvements to the DOM serialization process within the dev-browser package. Key changes include:

- Addition of a new `dump-hn-tree` script for dumping the DOM tree structure.
- Implementation of a flat output format for serialized DOM trees, focusing on meaningful nodes while omitting structural elements.
- Updates to tests to reflect the new serialization behavior, ensuring that only interactive elements are outputted and that text content is preserved.
- Enhancements to the `serializeNode` function to improve handling of scrollable containers and shadow DOM elements.

These updates enhance the usability and accuracy of DOM representation, facilitating better integration with LLM outputs and improving overall testing reliability.
2025-12-03 09:05:58 -08:00
Sawyer Hood 7ababc3328 Enhance dev-browser with DOM extraction and testing utilities
This commit introduces a comprehensive set of features for DOM extraction and manipulation within the dev-browser package. Key additions include:

- New modules for extracting and processing the DOM tree, including visibility and interactivity checks.
- Implementation of compound component generation for complex input types.
- Integration of Playwright for DOM extraction, enabling robust testing capabilities.
- Addition of Vitest configuration and test cases to ensure functionality and reliability of the new features.

These enhancements improve the overall usability and testing framework of the dev-browser, facilitating better interaction with web pages and ensuring accurate representation of the DOM structure.
2025-12-02 20:27:37 -08:00