본문으로 건너뛰기
Skillpedia
테스트48k · #6273

electron-drive-skill

하는 일

이 도구는 Electron 애플리케이션을 제어하게 해 줍니다. 앱 안에서 클릭하고, 입력하고, 스크린샷을 찍고, 코드를 실행해 테스트할 수 있습니다.

사용하는 경우

  • ✓화면의 시각적 변경이 제대로 작동하는지 확인할 때.
  • ✓최종 버전 프로그램에서만 나타나는 버그를 재현할 때.
  • ✓사용자가 앱을 처음 열었을 때 보는 초기 화면을 테스트하는 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/electron-drive-skill/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/electron-drive-skill/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“설정 화면의 ‘저장’ 버튼을 테스트해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 앱을 격리된 환경에서 실행합니다. 그다음 ‘여기를 클릭해’ 또는 ‘이것을 입력해’ 같은 명령을 내려 앱과 상호작용하고 모든 것이 기대대로 작동하는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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's build command first. Needed after any source change if the app runs from a build, because the build is otherwise stale; start prints 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="…"] from snapshot output, then text=…, 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 help lists 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 whose package.json main is the built entry point, or the entry file itself.
  • env: added to the app's environment. {profile} becomes the scratch profile directory (in env values only, not in args). This is how data kept outside userData is redirected: APP_DATA_DIR is 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 by logs.

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.

…

자주 묻는 질문

‘스크래치 프로필’이란 무엇인가요?

앱이 실행되는 임시의 격리된 환경입니다. 테스트가 사용자의 실제 데이터나 설정에 영향을 주지 않도록 합니다.

도구는 어디를 클릭하거나 무엇을 입력할지 어떻게 아나요?

버튼이나 입력란처럼 화면의 요소를 설명하는 ‘선택자’를 사용합니다. 브라우저가 웹 페이지의 요소를 찾는 방식과 비슷합니다.

이 도구로 모든 종류의 앱을 테스트할 수 있나요?

아니요, 이 도구는 Electron으로 만든 앱에만 맞습니다. 일반 웹 앱이나 여러 창으로 이루어진 흐름에는 작동하지 않습니다.

상세 정보

작성자의 원본 설명

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.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#6273
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬