agentleFS
mxrsvmxrsv/spacevibe-deck/.claude/skills/test-deck-app/SKILL.md

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

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
  1. Distinctive:

    If the app cannot be launched (no display, build fails, Electron missing), report the blocker and stop.

    line 13
  2. Very specific:

    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: …

    line 46
  3. Very specific:

    setViewportSize pins innerWidth: After any window resize, call it again with BrowserWindow.getAllWindows()[0].getContentSize() and read …

    line 52
  4. Very specific:

    Stop only the processes you started, by PID.

    line 93

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. In the checkout under test: npm run build && npm run electron:build. In a fresh worktree node_modules/electron/dist may be missing after npm install; run node node_modules/electron/install.js once.
  2. Make a scratch directory outside the repo for userData, a CLAUDE_CONFIG_DIR, and stub agents. A plain electron:dev run shares the owner's real workspaces.json and session.json.
  3. 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.cjs sets userData before 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 PATH set in a scratch ZDOTDIR/.zshrc (override path_helper), and never seed lastAgent: "claude": it starts a real, unattended session. Unset the CLAUDECODE variables 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.
  • setViewportSize pins innerWidth. After any window resize, call it again with BrowserWindow.getAllWindows()[0].getContentSize() and read innerWidth before measuring.
  • app.close() hangs. End with app.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.openExternal in app.evaluate before 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), the userData scratch 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: errors asserted 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.