Skip to main content
prompt GP ChatGPT

web_script — Claude Code prompt: what it does, how to install

The web_script Claude Code prompt runs JavaScript to handle several tasks on the current web page. It can read list entries, move through results, or fill multiple fields in one call.

Apache-2.0 ★ 9,488 updated 2026-11-16

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/web_script.md
Open on GitHub

What web_script does

The prompt runs an async JavaScript function that reads page data and acts through mika. It can collect visible text and element details, click and type, scroll, navigate, or wait for a text match or a time interval. The return includes the result, logs, and outcomes for each action.

Browser globals such as document, window, and fetch are unavailable; the script has plain JavaScript and mika. Clicks and typing require ref values from the latest mika.snapshot(), and each mika call must be awaited. A navigation that loads another page ends the script. Actions use the same execution and recording path as regular calls, including sending, ordering, deleting, and paying.

What it helps with

  • collect text from many list entries
  • page through results and read items
  • fill several form fields in one call

Example prompts for the agent

  • Collect the names and links of every item in the current list.
  • Page through the results and gather the text from each entry.
  • Fill several form fields with the values from this data.

How to install web_script

Manually: put the files in place

.claude/commands/web_script.md

Questions about web_script

How do I install web_script in Claude Code?

Add the command file at .claude/commands/web_script.md. Then use the prompt for multi-step work on the current web page.

What does web_script do?

It runs JavaScript that reads page data and performs several actions through mika, such as filling fields or moving through result lists.

What are web_script’s limitations?

The script cannot access the DOM or browser globals such as document and fetch. Loading a new page ends execution, and action, read, and time limits use {{max_actions}}, {{max_reads}}, and {{max_seconds}}.

Source text

web_script.md · Apache-2.0
Run a JavaScript program against the current web page to do repetitive multi-step work in one call: read many list items, page through results, fill several fields. Not for a single action: use web_tap/web_type_text for that. code is the body of an async function; return a JSON-serialisable value. The script has no DOM: document, window, location, fetch and every other browser global are undefined; only plain JavaScript (Math, JSON, Array, …) and `mika` are there, and everything mika returns is plain data (always await): mika.snapshot() → {snapshotId, elements:[{ref, role, name, center}]}; mika.read({maxChars, offset}) → page text chunk {text, nextOffset}; mika.queryAll(cssSelector, {fields: ['text','attrs','value','box'], limit, maxChars}) → {items:[{tag, text, attrs, value, box}], total}; mika.query(cssSelector, opts) → first item or null (fields ['count'] → number); mika.text(cssSelector) → visible text (password-like values read as ***); mika.tap(ref); mika.type(ref, text, {enter}); mika.scroll('down'|'up'|'left'|'right', {amount}); mika.navigate(url); mika.wait(ms) or mika.wait({text, timeoutMs}) → true/false; mika.log(...). tap/type use refs from the latest mika.snapshot() in the script. Every action runs through the same execution and recording path as a normal call, including send, post, order, delete and pay. A failed mika call throws an Error whose message starts with the error code. Limits: {{max_actions}} actions, {{max_reads}} reads, {{max_seconds}} s. A navigation that loads a new page ends the script (endedBy=navigation). Returns result (JSON), logs, and actions with each outcome. Call web_observe before acting after it: the page may have changed.

© wangzan101 · Apache-2.0 · wangzan101/Mika

Similar prompts

Prompts catalog →

From the same set132

The whole set →
do_steps The do_steps Claude Code prompt batches known actions on one screen into a single call. It stops when a step fails or the next result needs visual inspection. GP ChatGPT ★ 9,488repo stars notice_triage notice_triage — a prompt for Claude Code and ChatGPT categorizes phone notifications from a single app. It isolates incoming alert text to prevent prompt injection inside assistant workflows. GP ChatGPT ★ 9,488repo stars phone_type_text The phone_type_text Claude Code prompt enters a complete text string into a phone field in one call. It can target a field by label or coordinates. GP ChatGPT ★ 9,488repo stars stop_summary stop_summary — a prompt for Claude Code and ChatGPT that summarizes progress when an assistant is stopped midway. It turns session logs into a concise status report in five lines or fewer. GP ChatGPT ★ 9,488repo stars phone_sms_login phone_sms_login — a prompt for Claude Code and ChatGPT logs into an Android app via SMS on explicit user request. Device credentials stay local and never reach the model. GP ChatGPT ★ 9,488repo stars notices_read notices_read — a Claude Code prompt that reads notifications from apps Mika can access. Ask what came in or get a digest for a day, week, or month. GP ChatGPT ★ 9,488repo stars channels Prompt for Claude Code and ChatGPT manages screen and channel selection between mobile apps and built-in browser. GP ChatGPT ★ 9,488repo stars handover The handover prompt for Claude Code and ChatGPT tells an agent how to complete authorized tasks and hand control back to the user. It covers actions that need a password, one-time code, or CAPTCHA. GP ChatGPT ★ 9,488repo stars

Project sponsors

Companies that keep this analytics open