baoyu-electron-extract
What it does
This skill unpacks the files inside an Electron app so you can read how it was built. It is for developers who want to inspect a desktop app they have installed.
When to use it
- โWhen you want to see the source code of an installed Electron desktop app.
- โWhen you want to understand how a desktop app is built.
- โWhen you need to pull out the resources bundled inside an app package.
Skill link
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-electron-extract/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentโs skills folder.
Example of what to ask your AI
โExtract the source code from the Electron app installed on my computer.โ
5 new skills a week. 1 minute to read.
How it works
Your agent finds the app, extracts its package, restores original source from source maps when available and formats minified code otherwise.
Technical content (original SKILL.md)
Original text by the author, straight from 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 |
FAQ
Which apps can it open?
It works with installed Electron apps, which you can name or point to by path.
What if the code is minified?
When no source map is available, the skill formats the minified code so it is easier to read.
Does it restore original file names?
Yes, when the app includes source maps, the skill restores the original sources from them.
Details
Original description by the author
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
Popularity
- GitHub stars
- 27k
- Ranking position
- #9955
- License
- MIT
- Updated
- 11/2/2026
Comments
- โฆ
More skills from this repository
release-skills
27kGuides your agent through a release for any project: bumping the version, updating changelogs and publishing a GitHub release or tag.
baoyu-article-illustrator
27kHelps your agent add illustrations to an article by finding the spots that need visuals and creating images in one consistent style.
baoyu-comic
27kShows your agent how to create an educational comic with panels, art styles and tones, such as a biography or a tutorial.
baoyu-compress-image
27kLets your agent shrink image files by converting them to WebP or PNG with automatic tool selection, so they load faster.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.