Compare commits

...

2 Commits

Author SHA1 Message Date
5c7b5c8e9d opencode: fix playwright skill: 2 2026-02-11 19:22:46 -05:00
d8b380a9c0 opencode: fix playwright skill 2026-02-10 18:11:28 -05:00

View File

@@ -53,10 +53,46 @@ in
{ {
home.packages = [ home.packages = [
inputs.oh-my-opencode.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode inputs.oh-my-opencode.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode
pkgs.playwright-driver.browsers
]; ];
home.sessionVariables = {
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
};
xdg.configFile."opencode/oh-my-opencode.json".text = builtins.toJSON ohMyOpencodeConfig; xdg.configFile."opencode/oh-my-opencode.json".text = builtins.toJSON ohMyOpencodeConfig;
xdg.configFile."opencode/skills/playwright.md".text =
let
browsers = pkgs.playwright-driver.browsers;
chromiumDir = builtins.head (
builtins.filter (n: builtins.match "chromium-[0-9]+" n != null) (
builtins.attrNames browsers.passthru.entries
)
);
chromiumPath = "${browsers}/${chromiumDir}/chrome-linux64/chrome";
in
''
---
name: playwright
description: "MUST USE for any browser-related tasks. Browser automation via Playwright MCP - verification, browsing, information gathering, web scraping, testing, screenshots, and all browser interactions."
mcp:
playwright:
command: npx
args:
- "@playwright/mcp@latest"
- "--executable-path"
- "${chromiumPath}"
- "--user-data-dir"
- "${config.home.homeDirectory}/.cache/playwright-mcp"
---
# Playwright Browser Automation
This skill provides browser automation capabilities via the Playwright MCP server.
'';
programs.opencode = { programs.opencode = {
package = inputs.llm-agents.packages.${pkgs.stdenv.targetPlatform.system}.opencode; package = inputs.llm-agents.packages.${pkgs.stdenv.targetPlatform.system}.opencode;
enable = true; enable = true;
@@ -71,7 +107,7 @@ in
## Misc ## Misc
For long-running commands, make sure you set the timeout of the Bash tool provided to a larger value. For long-running commands, make sure you set the timeout of the Bash tool provided to a larger value.
Do NOT read secret files. Do not directly read files that are api keys or are contextually sensitive. Do NOT read secret files. Do not directly read files that are api keys or are contextually sensitive.
Do NOT run `skill_mcp [mcp_name=playwright, tool_name=browser_install]` as it requires root and will not work. Do NOT run `skill_mcp [mcp_name=playwright, tool_name=browser_install]` as browsers are provided by NixOS via PLAYWRIGHT_BROWSERS_PATH.
## Behavior ## Behavior
Do not be sycophantic in your responses. Do not be sycophantic in your responses.