electron-drive-skill
Lets your agent interact with an application. It can click, type, and check if everything works as expected in the interface.
What it does
This tool lets you control an Electron application. You can click, type, take screenshots, and run code inside the app to test it.
When to use it
- ✓Verify if a visual change in the app worked correctly.
- ✓Reproduce a bug that only occurs in the final version of the program.
- ✓Test the initial screens the user sees when opening the app for the first time.
Example of what to ask your AI
“Test the 'Save' button on the settings screen.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool starts the application in an isolated environment. Then, you can issue commands like 'click here' or 'type this' to interact with the app and see if everything works as expected.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill electron-drive-skillOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/skills/electron-drive-skill/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Driving the Electron app
Overview
scripts/drive.mjs launches the project's Electron app under Playwright in a
background daemon and keeps it running between commands, so each action
(click, type, snapshot, screenshot, eval) is one fast shell call. Every launch
uses a scratch profile, so the agent can check a UI change or reproduce a bug
in the real app, not only in unit tests, without touching the user's data.
When to Use This Skill
- Use when you need to verify a UI change in the running Electron app.
- Use when reproducing a renderer or startup bug, or a failure that only shows up in the production build (for example a stricter CSP).
- Use when checking first-run, onboarding or settings screens.
- Use when exercising a feature end to end, including IPC through the preload bridge or code in the main process.
- Do not use it for web apps without Electron, or for multi-window flows (see Limitations).
How It Works
Step 1: Check prerequisites
scripts/drive.mjs, in this skill's directory, finds the project by the
nearest package.json, so run it from anywhere inside the project. Set DR
to its absolute path.
It needs electron and playwright-core (1.49 or later) installed in the
project. If start says either is missing, tell the user rather than
installing it yourself. Launch settings come from drive.config.json at the
project root (see Step 4); with no file, it runs electron ..
Step 2: Start, look, act, stop
DR=<this skill's directory>/scripts/drive.mjs
$DR start # last build, profile 'default'; prints status
$DR snapshot # accessibility tree: find what to click, by role and name
$DR click 'role=button[name="Get started"]'
$DR fill 'role=textbox[name="Email"]' 'test@example.com'
$DR wait 'text=Welcome'
$DR screenshot # prints a PNG path; Read it to see the window
$DR logs --lines 80 # main and renderer console, plus the config's logFile
$DR stop # ALWAYS, before finishing
- Start options:
--build: run the config'sbuildcommand first. Needed after any source change if the app runs from a build, because the build is otherwise stale;startprints its age.--fresh: wipe the scratch profile, which gives you the app's first-run state.--profile <name>: a separate scratch profile.--dev: see Step 5.
- Targets are Playwright selectors. Prefer
role=button[name="…"]fromsnapshotoutput, thentext=…, then CSS. --ends the flags. Put it before text that starts with dashes:$DR fill 'role=textbox[name="Args"]' -- --verbose.- Other commands:
select <target> <value|label>,press <key>,status,screenshot --selector <css>.$DR helplists everything.
Step 3: Run code in the app
eval <js> runs in the renderer, main <js> in the main process
(electron and process are in scope, require is not). Use a bare
expression, or a body with return. - reads the code from stdin, which
avoids quoting entirely. The result comes back as JSON, so return plain data:
a DOM node or a function comes back as undefined or {}.
To exercise IPC, call whatever the app's preload exposes through eval. That
goes through the real preload bridge, as the app's own renderer code does.
Step 4: Configure the launch (optional)
drive.config.json at the project root; every field is optional:
{
"build": "npm run build",
"args": ["."],
"env": { "APP_DATA_DIR": "{profile}/data" },
"logFile": "logs/main.log",
"dev": {
"args": ["."],
"env": { "ELECTRON_RENDERER_URL": "http://localhost:5173" },
"url": "http://localhost:5173"
}
}
args: what Electron is launched with: an app directory whosepackage.jsonmainis the built entry point, or the entry file itself.env: added to the app's environment.{profile}becomes the scratch profile directory (inenvvalues only, not inargs). This is how data kept outsideuserDatais redirected:APP_DATA_DIRis only an example name, and it has an effect only if the app reads it. Check the app's source for the variable it actually uses.logFile: a log file relative to the profile directory, shown bylogs.
If a project has no config and start fails or launches the wrong thing,
work out these values from the project's package.json and build setup,
then suggest a drive.config.json to the user.
…
FAQ
What is a 'scratch profile'?
It's a temporary, isolated environment where the application runs. This ensures that tests do not affect your normal data or settings.
How does the tool know where to click or what to type?
It uses 'selectors' that describe elements on the screen, like buttons or text fields, similar to how a browser finds elements on a web page.
Can I test any type of application with this?
No, this tool is specific to applications built with Electron. It does not work for regular web apps or multi-window flows.
Details
Original description by the author
Launch the project's Electron app on a scratch profile and drive it: click, type, screenshot, run renderer or main-process code, read logs. Use to verify UI changes end to end.
Popularity
- GitHub stars
- 48k
- Ranking position
- #4659
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC