Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

pandascript

БесплатноБез исполняемых скриптовНе проверен

Write PandaScript agent scripts (.js) — Lightpanda's replayable browser-automation format, run token-free with `lightpanda run script.js`.

lightpanda-ioот lightpanda-io★ 122 звезды на GitHub

Об этом скилле

Writing Lightpanda agent scripts

Run with:

./lightpanda run script.js

Mental model (get this right first)

The script runs in its own V8 context — neither the page nor Node.js:

  • Page is the only global. new Page() makes a page and await page.goto(url) navigates it; every other primitive is a method on that page: const page = new Page(); await page.goto(url); page.extract({...}); page.click(sel);.
  • No window, document, DOM, localStorage — read pages with page.extract(...), run page-side JS only via page.evaluate("...").
  • No require, process, fs, npm. Standard ECMAScript built-ins only (JSON, Map, template literals, …).
  • page.goto(...) and page.evaluate(...) are async — always await them. The other page methods are synchronous: const data = page.extract({...}), never await page.extract(...). The script body runs as an async function, so top-level await is allowed.
  • Re-navigating reuses the same page: await page.goto(url2) keeps page valid and points it at the new URL, discarding the old page — read it before navigating away. Independent URLs don't share a page: make a new Page() for each and load them in parallel (fan-out, best practice 2).
  • Page evaluate("...") cannot see script variables — interpolate values into the string. Script code cannot see page variables.
  • Variables persist across navigations within one run, so cross-page aggregation is plain JS.
  • return <value> is the script's output, printed automatically (objects/arrays as JSON). End with return page.extract({...}); or return results;. A bare trailing expression is NOT printed; neither is console.log(JSON.stringify(...)).

Primitives

Page is the only global; new Page() makes a page and everything else is a method on it.

Call Notes
new Page() Makes a page object. No navigation yet — call page.goto(url) before any other method. Make several to navigate in parallel (fan-out, best practice 2).
page.close() Marks the page done; later method calls on it error. The page is otherwise reclaimed at script end.
await page.goto(url[, { timeout, waitUntil }]) Async — must be awaited. Navigates the page (re-navigating reuses the same object). Waits for load. Rejects on navigation failure or timeout. Default timeout 10000 ms. waitUntil: one of "load", "domcontentloaded", "networkalmostidle", "networkidle", "settled", "done".
page.screenshot([{ path, selector, fullPage, mode, strip, url, timeout }]) path is required: writes a PNG of the text layout. mode: one of "reader", "layout".
await page.evaluate(script[, { url, timeout, save }]) Async — must be awaited. Page-side JS escape hatch; resolves to text (JSON for objects/arrays). Several under one Promise.all wait on their page-side fetches and timers at the same time.
page.extract(schema) The only primitive returning a real JS value (object/array). The schema is its only argument. See schema below.
page.click(selector)
page.fill(selector, value)
page.scroll([{ selector, x, y }])
page.waitForSelector(selector[, { timeout }]) waitFor* default timeout 5000 ms.
page.waitForScript(script[, { timeout }]) Re-evaluates page JS until truthy.
page.waitForState(state[, { timeout }]) state: one of "load", "domcontentloaded", "networkalmostidle", "networkidle", "settled", "done".
page.hover(selector)
page.press(selector, key) Selector first! page.press("Enter") binds "Enter" to selector and fails — use page.press(null, "Enter") or page.press({ key: "Enter" }).
page.selectOption(selector, value)
page.setChecked(selector[, checked]) checked defaults to true.
page.getCookies([{ url, all }]) Returns an array of cookie objects for the page's host, HttpOnly ones included; [] when none match.
page.download([{ url, path }]) Sends the session's cookies, so authenticated downloads work. Nothing is written unless the status is 200-203, and a failed download leaves path as it was.
page.callPageTool([{ name, arguments }]) Runs a tool the page registered through WebMCP; returns its text result.
page.classify(questions[, { selector, presets }]) Classifies page state or candidate elements via a decision model (Gemini Decisions or TypeSafe Jev): an array of categories, or an object of presets and questions. Replay calls the model live and needs TYPESAFE_API_KEY, or GOOGLE_API_KEY/GEMINI_API_KEY with LIGHTPANDA_DECISION_PROVIDER=gemini.
page.acceptCookies([{ prefer, selectors }]) Clicks the consent control the decision model picks, then re-reads the page to check the banner went. Pass the selectors from an earlier result to click them with no model call; otherwise needs TYPESAFE_API_KEY, or GOOGLE_API_KEY/GEMINI_API_KEY with LIGHTPANDA_DECISION_PROVIDER=gemini.
Полный SKILL.md на GitHub

Установить pandascript в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл pandascript?

Write PandaScript agent scripts (.js) — Lightpanda's replayable browser-automation format, run token-free with `lightpanda run script.js`.

Как установить скилл pandascript?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pandascript запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить pandascript с