baoyu-electron-extract
하는 일
이 스킬은 Electron 앱 안의 파일을 풀어 어떻게 만들어졌는지 읽을 수 있게 합니다. 설치한 데스크톱 앱을 살펴보려는 개발자를 위한 것입니다.
사용하는 경우
- ✓설치된 Electron 데스크톱 앱의 소스 코드를 보고 싶을 때.
- ✓데스크톱 앱이 어떻게 만들어졌는지 이해하고 싶을 때.
- ✓앱 패키지에 들어 있는 리소스를 꺼내야 할 때.
스킬 링크
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-electron-extract/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 컴퓨터에 설치된 Electron 앱에서 소스 코드를 추출해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 앱을 찾고, 패키지를 추출하며, 소스 맵이 있으면 원본 소스를 복원하고, 없으면 압축된 코드를 읽기 쉽게 정리합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Electron App Extract
User Input Tools
When this skill prompts the user, follow this tool-selection rule (priority order):
- Prefer built-in user-input tools exposed by the current agent runtime — e.g.,
AskUserQuestion,request_user_input,clarify,ask_user, or any equivalent. - Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
- Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.
Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
Script Directory
{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: bun if installed; else npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.
| Script | Purpose |
|---|---|
scripts/main.ts |
App discovery + asar extraction + source-map restoration + Prettier formatting |
Workflow
1. Determine the input. Accepts an app name (e.g., Codex) or absolute path (/Applications/Codex.app, a .asar file, or a Windows install dir). Ask for it if not given; ask for a custom output directory if they want one.
2. Run the script.
${BUN_X} {baseDir}/scripts/main.ts "<app>" [--output <dir>] [--asar <path>] [--force]
If unsure discovery will find the right bundle, run with --dry-run first (prints resolved paths, writes nothing).
3. Handle the result.
- Success → report output paths and counts (extracted / restored / formatted).
- Multiple matches → script lists candidates and exits non-zero. Ask the user which one (via
AskUserQuestionor the runtime equivalent), then re-run with the chosen absolute path. - Existing non-empty output dir → script refuses without
--force. Ask whether to overwrite (--force) or pick a new--output. - Unsupported platform / no match → suggest
--asar /full/path/to/app.asarif the user knows where the bundle lives.
4. Point the user at the result (default ~/Downloads/<AppName>-electron-extract/):
restored/exists → original source tree reconstructed from.js.mapfiles; read this first.- Only
extracted/(no maps) → JS/CSS inextracted/was Prettier-formatted in place; read from there.
Usage
${BUN_X} {baseDir}/scripts/main.ts Codex # → ~/Downloads/Codex-electron-extract/
${BUN_X} {baseDir}/scripts/main.ts "/Applications/Visual Studio Code.app" # .app bundle, install dir, or .asar
${BUN_X} {baseDir}/scripts/main.ts "C:\Users\you\AppData\Local\Programs\codex"
${BUN_X} {baseDir}/scripts/main.ts --asar /Applications/Codex.app/Contents/Resources/app.asar Codex
${BUN_X} {baseDir}/scripts/main.ts Codex --output ~/work/codex-source
${BUN_X} {baseDir}/scripts/main.ts Codex --json # one JSON line on stdout
Options
| Option | Short | Description | Default |
|---|---|---|---|
<app> |
App name or absolute path. Required unless --asar is given. |
— | |
--output |
-o |
Output directory | ~/Downloads/<AppName>-electron-extract |
--asar |
Override the resolved .asar path |
auto-discovered | |
--force |
-f |
Allow writing into a non-empty existing output dir | false |
--skip-format |
Skip Prettier formatting | false | |
--skip-restore |
Skip source-map restoration | false | |
--no-unpacked |
Don't copy app.asar.unpacked/ alongside |
false | |
--dry-run |
Print resolved |
자주 묻는 질문
어떤 앱을 열 수 있나요?
설치된 Electron 앱을 이름으로 지정하거나 경로로 가리킬 수 있습니다.
코드가 압축되어 있으면 어떻게 하나요?
소스 맵이 없으면 압축된 코드를 읽기 쉽게 정리한다고 설명합니다.
원래 파일 이름도 복원하나요?
네. 앱에 소스 맵이 있으면 그것으로 원본 소스를 복원합니다.
상세 정보
작성자의 원본 설명
Extracts resources and JavaScript from any installed Electron app (`.asar` bundle), restoring original sources from `.js.map` files when available or formatting minified code with Prettier otherwise. Use when user wants to "extract Electron app", "decompile Electron", "get the source code of <app>", "inspect app.asar", "看 Electron 应用源码", "提取 .asar", or asks how a desktop Electron app is built. Skips `node_modules` and supports both macOS and Windows.
repo: JimLiu/baoyu-skills
인기도
- GitHub 스타
- 27k
- 순위
- #9955
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
release-skills
27k버전 올리기, 변경 로그 업데이트, GitHub 릴리스나 태그 게시까지, 모든 프로젝트의 릴리스 과정을 에이전트가 안내하도록 합니다.
baoyu-article-illustrator
27k독자에게 도움이 되는 위치를 찾아 글에 삽화를 넣고, 같은 스타일로 그림을 만들도록 에이전트를 돕습니다.
baoyu-comic
27k주제를 설명하는 패널, 그림 스타일, 톤을 갖춘 교육용 만화를 만드는 방법을 에이전트에게 보여 줍니다. 전기나 튜토리얼 같은 형식이 가능합니다.
baoyu-compress-image
27k이미지를 WebP나 PNG로 바꿔 파일 크기를 줄이고, 도구를 자동으로 골라 더 빠르게 불러오도록 에이전트를 돕습니다.