Problem
OpenCode must never use Playwright in any form. This includes direct CLI usage, package-runner downloads, Node imports, Playwright MCP, generated Playwright tests/configuration, or indirect fallback from another browser workflow.
The only approved browser automation tool should be:
~/.agents/skills/agent-browser
A shell alias alone is insufficient because agents may use non-interactive shells, npx, bunx, package scripts, MCP tools, or direct imports.
Required changes
1. Remove Playwright integrations
- Remove Playwright MCP from the OpenCode configuration.
- Remove any Playwright-specific tool/skill configuration.
- Remove installed Playwright dependencies where present:
playwright
playwright-core
@playwright/test
- Remove obsolete Playwright configuration, scripts, and browser caches where appropriate.
2. Add an explicit agent policy
Add a global OpenCode instruction stating:
## Browser Automation Policy
Playwright is prohibited.
Never:
- install or import `playwright`, `playwright-core`, or `@playwright/test`
- use Playwright MCP
- run `playwright`, `npx playwright`, `bunx playwright`, or `pnpm dlx playwright`
- generate Playwright tests or configuration
- use Playwright indirectly through another tool
For all browser interaction, use:
`~/.agents/skills/agent-browser`
If agent-browser cannot complete the task, report the limitation. Do not fall back to Playwright.
Place this in the strongest global instruction file loaded by OpenCode, not only in documentation.
3. Add a blocking playwright executable
Create a PATH-prioritized shim named playwright that exits non-zero and prints:
Playwright is disabled in this environment.
Use agent-browser instead: ~/.agents/skills/agent-browser
The shim must work in non-interactive shells and return exit code 126 or another clearly intentional failure code.
4. Block package-runner bypasses
Prevent OpenCode from downloading or invoking Playwright through at least:
npx playwright
npx playwright@...
bunx playwright
bunx playwright@...
pnpm dlx playwright
@playwright/test
Prefer PATH-prioritized guarded wrappers used specifically in the OpenCode environment. All unrelated package-runner commands must continue to work normally.
5. Add a repository tripwire
Add a script that fails when prohibited Playwright dependencies, MCP configuration, commands, or imports are introduced into active configuration.
Avoid false positives from:
- documentation explaining the prohibition
- the guard script itself
- archived/legacy files, where explicitly excluded
node_modules and .git
Wire the check into the most appropriate existing validation/setup workflow.
6. Update documentation
Document that:
agent-browser is the single supported browser automation path
- Playwright is intentionally unavailable
- failure of agent-browser must be surfaced rather than triggering a fallback
- aliases are not considered enforcement
Acceptance criteria
Verification
Run and record the output of:
command -v playwright
playwright --version
npx playwright --version
bunx playwright --version
pnpm dlx playwright --version
The Playwright commands must fail with intentional guidance, while a harmless unrelated package-runner command should still succeed.
Problem
OpenCode must never use Playwright in any form. This includes direct CLI usage, package-runner downloads, Node imports, Playwright MCP, generated Playwright tests/configuration, or indirect fallback from another browser workflow.
The only approved browser automation tool should be:
A shell alias alone is insufficient because agents may use non-interactive shells,
npx,bunx, package scripts, MCP tools, or direct imports.Required changes
1. Remove Playwright integrations
playwrightplaywright-core@playwright/test2. Add an explicit agent policy
Add a global OpenCode instruction stating:
Place this in the strongest global instruction file loaded by OpenCode, not only in documentation.
3. Add a blocking
playwrightexecutableCreate a PATH-prioritized shim named
playwrightthat exits non-zero and prints:The shim must work in non-interactive shells and return exit code
126or another clearly intentional failure code.4. Block package-runner bypasses
Prevent OpenCode from downloading or invoking Playwright through at least:
npx playwrightnpx playwright@...bunx playwrightbunx playwright@...pnpm dlx playwright@playwright/testPrefer PATH-prioritized guarded wrappers used specifically in the OpenCode environment. All unrelated package-runner commands must continue to work normally.
5. Add a repository tripwire
Add a script that fails when prohibited Playwright dependencies, MCP configuration, commands, or imports are introduced into active configuration.
Avoid false positives from:
node_modulesand.gitWire the check into the most appropriate existing validation/setup workflow.
6. Update documentation
Document that:
agent-browseris the single supported browser automation pathAcceptance criteria
playwrightfails with the custom guidance message.npx playwright,bunx playwright, andpnpm dlx playwrightare blocked.npx,bunx, andpnpm dlxcommands still work for unrelated packages.~/.agents/skills/agent-browser.Verification
Run and record the output of:
command -v playwright playwright --version npx playwright --version bunx playwright --version pnpm dlx playwright --versionThe Playwright commands must fail with intentional guidance, while a harmless unrelated package-runner command should still succeed.