test-deck-app
Skill41 starsChanged 23 days agoMITView on GitHub
Drive the running Deck Electron app with playwright-core against an isolated userData dir, to prove a new feature or UI flow works through IPC, PTYs and persistence. Use for the E2E gate on large features. Not for bug fixes, styling or copy, and not through Playwright MCP or a browser tab on `npm run dev`.
- Reads credentials
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- clean-worktreesSkill
- landing-syncSkill
- night-digestSkill
- night-runnerSkill
- respond-to-pr-commentsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 13
If the app cannot be launched (no display, build fails, Electron missing), report the blocker and stop.
- Very specific: line 46
A stub, never a real agent: Put stubs on a scratch PATH set in a scratch ZDOTDIR/.zshrc (override path_helper), and never seed lastAgent: …
- Very specific: line 52
setViewportSizepinsinnerWidth: After any window resize, call it again with BrowserWindow.getAllWindows()[0].getContentSize() and read … - Very specific: line 93
Stop only the processes you started, by PID.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Deck in Electron
The gate in AGENTS.md applies to a new
user-facing feature or a changed UI flow. It does not apply to bug fixes, styling, copy,
refactors, tests or docs. The browser preview (npm run dev) paints the shell but reaches no
IPC, PTY, persistence or updater, so a pass there proves nothing.
If the app cannot be launched (no display, build fails, Electron missing), report the blocker and stop. Do not substitute the browser preview or another automation tool.
Launch an isolated instance
- In the checkout under test:
npm run build && npm run electron:build. In a fresh worktreenode_modules/electron/distmay be missing afternpm install; runnode node_modules/electron/install.jsonce. - Make a scratch directory outside the repo for
userData, aCLAUDE_CONFIG_DIR, and stub agents. A plainelectron:devrun shares the owner's realworkspaces.jsonandsession.json. Launch from a scratch driver with
playwright-core:const { _electron } = require("playwright-core"); const app = await _electron.launch({ executablePath: "<checkout>/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron", args: ["<checkout>/.claude/skills/test-deck-app/scripts/isolated-main.cjs"], env: { ...cleanEnv, // process.env without CLAUDECODE, DECK_AGENT_ID, DECK_AGENT_PID, DECK_AGENT_NESTED DECK_TEST_USERDATA: "<scratch>/userdata", DECK_TEST_MAIN: "<checkout>/dist-electron/electron/main.cjs", CLAUDE_CONFIG_DIR: "<scratch>/claude", }, }); const page = await app.firstWindow();isolated-main.cjssetsuserDatabefore main loads and refuses to start without both variables.
Traps that cost a run
- A stub, never a real agent. Put stubs on a scratch
PATHset in a scratchZDOTDIR/.zshrc(overridepath_helper), and never seedlastAgent: "claude": it starts a real, unattended session. Unset theCLAUDECODEvariables above, or Deck's wrappers treat the pane as nested and a probe reads like plain agent behaviour. - One instance per userData. The single-instance lock is per directory: a second launch on the same one exits 0 with no window and Playwright reports a closed target.
setViewportSizepinsinnerWidth. After any window resize, call it again withBrowserWindow.getAllWindows()[0].getContentSize()and readinnerWidthbefore measuring.app.close()hangs. End withapp.evaluate(({ app }) => app.exit(0)).app.getVersion()reports Electron's version from a wrapper outside the packaged app. Expected, not a bug.- To record links Deck would open, reassign
shell.openExternalinapp.evaluatebefore the flow starts.
Report and clean up
Walk each affected flow and report it with its result: what you did, what you observed, and whether it matched the spec. Screenshots go to the scratch directory, never the repo.
Collect errors for the whole run, from before the first action:
const errors = [];
page.on("console", (m) => m.type() === "error" && errors.push(m.text()));
page.on("pageerror", (e) => errors.push(String(e)));The report states:
- Instance under test: checkout path, commit (
git rev-parse --short HEAD), theuserDatascratch directory and the Electron PID. A result with no instance named cannot be tied to the build it judged. - Baseline: a screenshot and the relevant measured state, captured before the feature is exercised, so "after" has something to differ from.
- Input kind per step: real input (
page.click,page.keyboard,page.mouse) or synthetic (app.evaluate,page.evaluate, a direct store or IPC call). A synthetic step is diagnostic support, never proof of the flow; the flow passes only on real input. - Evidence pairs: each screenshot sits beside a measured value that agrees with the picture: the focused element, a text, a count, or the persisted file content.
- Errors:
errorsasserted empty at the end, or every entry listed. - Repetition: the main interaction done, undone, then done again, or repeated rapidly. One pass hides state that leaks between runs.
- Not checked: each flow or state you did not exercise, with the reason. Never omit the line and never guess; write "Not checked: none" only when nothing was skipped.
- Skill gaps: anything in this skill that was wrong, missing or cost a retry, as a suggested edit. Suggest only; do not edit the skill mid-run.
Stop only the processes you started, by PID. Do not pkill -f on a pattern: other sessions run
Electron too. Delete the scratch directory when the report is written.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

