browser

Provides a comprehensive and mandatory training guide for effectively utilizing browser automation tools, specifically Playwright, for research, debugging, and autonomous validation.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/felipebarcelospro/igniter-js/browser
Clone the repo
git clone --depth 1 https://github.com/felipebarcelospro/igniter-js

Made for: Cursor.

Per session 7,925 This file is loaded in full into every session.
When invoked 7,925 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.07925 $0.07925
Opus 5 $0.03963 $0.03963
Sonnet 5 $0.01585 $0.01585
Haiku 4.5 $0.00792 $0.00792

Measured today against content hash 8607094e6d32, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

browser scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

apps/starter-nextjs/.cursor/rules/browser.mdc · 438 lines

How it starts

The opening of the file, as written. The whole thing — 438 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Browser Tools: Comprehensive Training & Best Practices

This rule provides a comprehensive and mandatory training guide for effectively utilizing browser automation tools, specifically Playwright, for research, debugging, and autonomous validation. It emphasizes integrating browser capabilities with other MCP tools for a holistic development workflow.

1. Core Principles of Browser Tool Usage

1.1 Strategic Intent

  • Autonomous Validation: Browser tools are critical for end-to-end testing of front-end implementations, mimicking user interactions.
  • Dynamic Research: Access real-time, external information, documentation, and community insights from the web.
  • Interactive Debugging: Visualize and interact with the application during development, identifying UI/UX issues.
  • Market Analysis: Stay updated with technology trends, competitor solutions, and best practices.

1.2 Browser Environment

  • Isolated Execution: Each browser session is isolated to prevent interference.
  • Configurable Viewport: Adjust screen size for responsive testing (e.g., mobile, tablet, desktop) using browser_resize.
  • Network Awareness: Monitor network requests and console messages for debugging using browser_network_requests and browser_console_messages.
  • Ephemeral Sessions: Browser sessions can close unexpectedly due to timeouts or internal issues. Always be prepared to re-initialize by navigating to a known URL to regain a stable state.

2. Browser Toolset & Core Capabilities

The following Playwright-based tools are available for browser interaction:

Tool Description Key Use Cases
browser_navigate Navigate to a specified URL. Access documentation, external websites, specific application pages. Crucial for re-initializing browser state after failures.
browser_snapshot Capture an accessibility snapshot of the current page. Understand page structure, identify actionable elements, verify UI state. Essential for dynamic content.
browser_click Perform a click on a web element. Interact with buttons, links, checkboxes, forms. Use ref for precision, or descriptive element name.
browser_type Type text into an editable element. Fill out forms, search bars, input fields. Often combined with browser_press_key({ key: "Enter" }) for submission.
browser_fill_form Fill multiple form fields efficiently. Automate complex form submissions.
browser_select_option Select an option in a dropdown. Interact with <select> elements.
browser_press_key Simulate a key press (e.g., "Enter", "Tab", "ArrowDown"). Keyboard navigation, triggering key-based events, submitting forms where explicit buttons are not easily clickable.
browser_hover Hover over a web element. Test hover-dependent UI elements (e.g., tooltips, dropdowns).
browser_drag Perform a drag-and-drop action. Test draggable components.
browser_take_screenshot Capture a screenshot of the current page or specific element. Visual debugging, documenting UI states, visual regression testing.
browser_console_messages Retrieve all console messages (logs, warnings, errors). Debug client-side errors, inspect application logs, understand JavaScript execution issues.
browser_network_requests Retrieve all network requests (XHR, fetch, document loads). Analyze API calls, monitor network performance, debug backend communication issues.
browser_evaluate Execute JavaScript expression on page or element. Advanced interactions, data extraction from complex DOM structures, inspecting JavaScript variables for debugging.
browser_wait_for Wait for text to appear or disappear, or for a specified time to pass. Synchronize actions with dynamic content loading, ensure elements are ready for interaction.
browser_resize Resize the browser window to specific dimensions. Responsive design testing across various screen sizes (mobile, tablet, desktop).
browser_tabs Manage browser tabs (list, new, close, select). Open new tabs for parallel research, isolate workflows, switch contexts.
browser_handle_dialog Handle browser dialogs (alerts, prompts, confirms). Automate interactions with pop-ups that block normal page interaction.
browser_file_upload Upload one or multiple files to input fields. Test file upload functionalities.
browser_close Close the current page. Clean up browser sessions.

Read the full file on GitHub · 438 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 438 lines · 7,925 tokens per session scan A 8607094e6d32

Subscribe to this mod's changes

browser is a cursor rule published in the GitHub repository felipebarcelospro/igniter-js (242 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 7,925 tokens to every session, about $0.0396 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.