baoyu-electron-extract

Extracts resources and JavaScript from installed Electron apps, restoring sources from source maps.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill baoyu-electron-extract-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-electron-extract
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/assignment-generator/antigravity-skills-main/antigravity-skills-main/skills/baoyu-electron-extract
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill baoyu-electron-extract-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @electron/asar, prettier, and includes scripts (resource) components.

What problem does it solve? Installed Electron applications ship their code inside packed app.asar archives, often minified, making it hard to inspect how a desktop app is built or audit its behavior. This Skill unpacks the archive, restores original source files from embedded .js.map source maps when available, and formats minified JavaScript and CSS with Prettier otherwise. ## Core Features & Use Cases - Asar Extraction: Unpacks app.asar bundles from macOS .app packages or Windows install directories, with automatic app discovery by name or absolute path. - Source-Map Restoration: Rebuilds the original source tree from sourcesContent embedded in .js.map files, resolving bundler-relative paths like ../../src/main.ts into readable paths such as restored/src/main.ts. - Prettier Formatting: Formats minified JS and CSS in place when no usable source map exists, while always skipping node_modules. - Use Case: A developer wants to understand how the Codex desktop app implements its IPC layer. They run the extractor by app name, and the script produces restored/src/main/ with the original TypeScript sources plus an extract-report.json summary. ## Quick Start Ask the assistant to extract the source code of an installed Electron app such as Codex or VS Code, optionally specifying an output directory or a direct path to the app.asar file.

Frequently Asked Questions about baoyu-electron-extract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract the source code from an Electron app?

Run the extraction script with the app name or an absolute path to the .app bundle, install directory, or app.asar file. The script unpacks the asar archive, restores original sources from .js.map files when available, and formats remaining minified JavaScript with Prettier.

How to unpack an app.asar file?

Pass the .asar path directly with the --asar flag, for example --asar /Applications/Codex.app/Contents/Resources/app.asar. The script uses @electron/asar via npx to extract the archive into an output directory under ~/Downloads by default.

Does Electron extraction work on Windows and macOS?

Yes, app discovery searches /Applications and ~/Applications on macOS, and %LOCALAPPDATA%\Programs, %PROGRAMFILES%, and %APPDATA% on Windows. On Linux or other platforms, pass the --asar flag with an explicit path instead.

Why are some sources not restored from source maps?

Restoration only works when the .js.map embeds sourcesContent, which is common for webpack, esbuild, Vite, and rollup builds. Maps referencing external files without embedded content are skipped, listed as warnings in extract-report.json, and the corresponding JS is Prettier-formatted instead.

What are the limitations of Electron app extraction?

The script always skips node_modules and webpack runtime entries, and it cannot recover original sources when no source maps ship with the app. It also refuses to write into unsafe locations like the filesystem root, home directory, or a non-empty output directory without --force.