Run the `bad` CLI (Browser Agent Driver) against the local frontend with a web3 wallet (MetaMask) connected. Use this skill when the user wants to browse, test, or interact with the local UI at localhost:1338 using a connected wallet via `bad`. Triggers on: bad + wallet, bad + web3, bad + MetaMask, browse frontend with wallet, test UI with wallet connected.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Run the `bad` CLI (Browser Agent Driver) against the local frontend with a web3 wallet (MetaMask) connected. Use this skill when the user wants to browse, test, or interact with the local UI at localhost:1338 using a connected wallet via `bad`. Triggers on: bad + wallet, bad + web3, bad + MetaMask, browse frontend with wallet, test UI with wallet connected.
Run bad CLI with a real MetaMask wallet extension against the local frontend.
Provider
Default: --provider claude-code --model sonnet (uses local claude CLI OAuth session, no API key needed).
Only use a different provider if the user explicitly asks. Available alternatives:
Provider
Flags
Auth
claude-code (default)
--provider claude-code --model sonnet
claude login OAuth
codex-cli
--provider codex-cli --model gpt-5
codex login OAuth
anthropic
--provider anthropic --model claude-sonnet-4-6
ANTHROPIC_API_KEY env var
openai
--provider openai --model gpt-5.4
OPENAI_API_KEY env var
Prerequisites (check before running)
Run these checks before executing bad:
Frontend running: curl -s -o /dev/null -w '%{http_code}' http://localhost:1338 — must return 200. If not, tell the user to start it with .
pnpm --dir ui dev
bad CLI available: which bad — must resolve. If not, the user needs to install or build browser-agent-driver.
MetaMask extension: Find the browser-agent-driver project (check ~/development/tangle/browser-agent-driver or resolve from which bad), then check extensions/metamask exists. If missing, run pnpm wallet:setup in that project.
Wallet profile: Check .agent-wallet-profile exists in the browser-agent-driver project. If missing, run pnpm wallet:onboard in that project.
Pre-authenticate Operator API
MetaMask 13.x personal_sign popups are not reliably auto-approved in Playwright. To work around this, pre-generate operator API auth tokens via shell commands and inject them into the bad goal.
Run this before launching bad. Determine the wallet address and private key from the Anvil Accounts table below (default: account #0).
Validate: TOKEN must start with v4.local.. If pre-auth fails (e.g. cast not installed, operator down), skip it and warn the user — the run will proceed without pre-auth but operator-authenticated features (sandbox list, chat, terminal) will not work.
Repeat for INSTANCE_OPERATOR_URL if it exists (store as INSTANCE_TOKEN / INSTANCE_TOKEN_EXPIRES).
Inject tokens into the goal
Prepend a runScript injection step to the user's goal. The sessionStorage key format is tangle.operator_auth.{address_lowercase}::{operator_url}.
Build the injection script string (example for account #0 with both operators):
BEFORE doing anything else, run this script to inject operator auth tokens:
sessionStorage.setItem('tangle.operator_auth.0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266::http://127.0.0.1:9102', JSON.stringify({token:"<SANDBOX_TOKEN>",expiresAt:<SANDBOX_TOKEN_EXPIRES>}));
sessionStorage.setItem('tangle.operator_auth.0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266::http://127.0.0.1:9202', JSON.stringify({token:"<INSTANCE_TOKEN>",expiresAt:<INSTANCE_TOKEN_EXPIRES>}));
location.reload();
Then wait 3 seconds for the page to reload with auth active. After that proceed with the actual goal: <USER_GOAL>
Replace <SANDBOX_TOKEN>, <SANDBOX_TOKEN_EXPIRES>, <INSTANCE_TOKEN>, <INSTANCE_TOKEN_EXPIRES> with the actual values from the pre-auth step. The address must be fully lowercase. Use the actual operator URLs from ui/.env.local.
Command Pattern
Resolve <BAD_PROJECT> to the browser-agent-driver project directory (e.g. from which bad or common locations like ~/development/tangle/browser-agent-driver).
Replace <BAD_PROJECT> and <GOAL_WITH_INJECTION_PREFIX> (the injection prefix + user goal). Only change the provider/model if the user explicitly asks for a different one.
Output Mode
By default, use --no-memory and no --sink (results are discarded). The user may override:
"save to tmp" — add --sink /tmp/bad-web3-results and remove --no-memory
"save to project" / "save results" — add --sink ./agent-results and remove --no-memory
"no memory" (default) — keep --no-memory, no --sink
Anvil Accounts
The default MetaMask profile uses account #0. If the user specifies a different account, mention the address for context. All accounts share the same seed phrase: test test test test test test test test test test test junk
These are well-known test keys. Never use them on a real network.
Notes
Always use --no-headless for wallet mode (MetaMask extension requires a visible browser).
The --wallet-auto-approve flag handles MetaMask popups automatically (wallet connect, chain switch, transactions). However, personal_sign popups may not be reliably auto-approved in MetaMask 13.x — use the pre-authentication flow above to bypass this.
Run the command in the background with a timeout of 300000ms since it takes time for the agent to navigate.
To find the browser-agent-driver project: parse the path from which bad (reads the shell script shebang), or check common locations like ~/development/tangle/browser-agent-driver.
Use printf '%s' (not echo) when piping API responses to jq — zsh's echo interprets escape sequences in JSON, breaking the parser.