playwright-browser

Instructions for controlling web pages with Playwright inside the Lfcode desktop app. Playwright is a browser-automation tool, and these instructions explain how to target Lfcode's embedded browser panel.

In plain words
What is it for?
Use them when navigating pages, taking snapshots, clicking, typing, or capturing screenshots through Playwright in Lfcode.
Why use it?
They prevent automation from replacing the desktop app shell or opening duplicate browser targets, which can make browser tasks fail.

Skill for Claude CodeCodex

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 skills/lfyxhappy/lfcode/playwright-browser
Any agent
npx skills add lfyxhappy/lfcode --skill playwright-browser
Clone the repo
git clone --depth 1 https://github.com/lfyxhappy/lfcode

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 482 The whole file, excluding the scripts and references it only reads on demand.
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.00042 $0.00482
Opus 5 $0.00021 $0.00241
Sonnet 5 $0.00008 $0.00096
Haiku 4.5 $0.00004 $0.00048

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

Security

Grade A, and why

playwright-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 yesterday.

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.

packages/lfcode/src/skill/lfcode/.bundle/playwright-browser/SKILL.md · 35 lines

How it starts

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

Lfcode Playwright Browser

Use this skill whenever the task involves Playwright MCP browser tools such as browser_navigate, browser_snapshot, browser_click, browser_type, or screenshots in the Lfcode desktop app.

Target

Lfcode desktop has an embedded side browser implemented as an Electron <webview>. It uses the persistent partition persist:lfcode-browser.

Playwright automation must target that embedded side browser. Do not navigate, reload, or otherwise replace the Electron app shell window.

Workflow

  1. Treat the Lfcode main window as the application shell, not the browser target.
  2. Before navigating, look for an existing embedded side browser target first. A collapsed, hidden, inactive, inert, or display:none side browser still counts as open when its browser tab or webview target exists.
  3. Reuse the existing side browser target when it exists. Do not create duplicate browser tabs just because the side panel is hidden.
  4. Create or open a side browser tab only when no embedded browser target exists.
  5. Use Playwright browser tools only for the actual web page inside the side browser.
  6. After navigation or major UI changes, take a fresh snapshot before clicking element references.
  7. If a hidden side browser target is selected but cannot produce a useful snapshot or interaction, bring the side browser panel/tab active, then continue on the same target.
  8. If a Playwright action appears to affect the whole Lfcode window, stop using that tab and reopen or retarget the embedded side browser before continuing.

Guardrails

  • Never call browser_navigate against the Electron main app shell.
  • Never use Playwright to replace the Lfcode UI with an external website.
  • External web pages belong in the side browser panel.
  • If multiple pages or targets are visible, choose the target that corresponds to the embedded browser webview, not the Lfcode application page.
  • Hidden side browser targets are valid targets; closed browser tabs are not.
  • If you are unsure which target is current, list tabs or inspect a snapshot before taking navigation actions.

Read the full file on GitHub · 35 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. yesterday First seen · 35 lines · 42 tokens per session scan A 7cf361f4a839

Subscribe to this mod's changes

playwright-browser is a skill published in the GitHub repository lfyxhappy/lfcode (2 stars, last pushed 1mo ago), licensed MIT. It adds 42 tokens to every session and 482 once invoked, about $0.0002 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-08-31.