Agent skill

Electron App Source Extractor

by JimLiu in JimLiu/baoyu-skills

Unpacks an installed Electron app's asar bundle and restores readable source from its JavaScript source maps when one is available.

MITAuto-check passedDevelopment

Install Electron App Source Extractor

skills CLI
$ npx skills add JimLiu/baoyu-skills --skill baoyu-electron-extract -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JimLiu/baoyu-skills baoyu-electron-extract --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JimLiu/baoyu-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/baoyu-electron-extract .claude/skills/baoyu-electron-extract && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
baoyu-electron-extract
GitHub stars
27k
Used in
1 other repo
Token cost
~2.6k tokens
SKILL.md length
914 words
Files
3 (incl. scripts)
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Unpacks an installed Electron app's asar bundle and restores readable source from its JavaScript source maps when one is available.

  • Works in 3 steps: Prefer built-in user-input tools exposed… → Fallback: if no such tool exists, emit a… → Batching: if the tool supports multiple…
  • Inspecting how a desktop Electron app, like a chat client or editor, was built
  • SKILL.md covers User Input Tools, Script Directory, When to use and Workflow, plus 5 more sections
  • Runs TypeScript scripts from its folder; calls npx

What it does

This skill finds and extracts an installed Electron application's app archive, and when a source map file is present, restores the original source files from its embedded content, resolving bundled paths relative to the map file so a nested path comes back readable instead of hashed. When no source map exists, it falls back to formatting the minified code with Prettier instead.

It always skips node_modules during extraction and works on both macOS and Windows. For any prompt it needs to show the user, it prefers a runtime's own input tool such as AskUserQuestion, falling back to a numbered plain-text question when no such tool exists, and combines several questions into one call when the tool supports that.

When your agent uses it

  • Inspecting how a desktop Electron app, like a chat client or editor, was built
  • Recovering readable source from a minified or bundled Electron app
  • Looking inside an installed app's bundled JavaScript for learning or debugging

Example prompts

  • “Extract the source code from this Electron app's asar bundle.”
  • “Restore the original TypeScript source from this app's source maps.”
  • “Show me how this desktop app's main process is structured.”

Requirements

  • bun, or npx as a fallback, to run the extraction script

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or…
  2. 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…
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question…

What it can do on your machine

Read from SKILL.md and the folder at commit 1567581. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Electron App Source Extractor loads about 2.6k tokens when it runs. Until then it costs about 119 tokens; SKILL.md has 914 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~119
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from JimLiu/baoyu-skills at commit 1567581, republished under its MIT licence (© JimLiu). 914 words, ~2,552 tokens.

Download SKILL.mdSave it as .claude/skills/baoyu-electron-extract/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
baoyu-electron-extract
description
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.
version
1.119.0

Electron App Extract

Extracts resources and code from an installed Electron app's app.asar. When a .js.map is present, restores the original source files from the embedded sourcesContent; otherwise formats the minified code with Prettier. Source-map paths are resolved relative to the .js.map file first, so bundled paths like ../../src/main.ts restore to readable paths such as restored/src/main.ts instead of hashed placeholders. Always skips node_modules. Works on macOS and Windows.

User Input Tools

When this skill prompts the user, follow this tool-selection rule (priority order):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. 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.
  3. 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

Scripts in scripts/ subdirectory. {baseDir} = this SKILL.md's directory path. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

ScriptPurpose
scripts/main.tsApp discovery + asar extraction + source-map restoration + Prettier formatting

When to use

Use this skill whenever the user wants to look inside an installed Electron application or inspect its bundled code. Trigger phrases include:

  • "extract Electron app", "decompile this Electron app", "unpack app.asar"
  • "show me the source of <app>", "look inside <app>", "how is <app> built"
  • "get the source code of Codex / Cursor / Discord / Slack / VS Code / Notion / Obsidian / ChatGPT desktop"
  • "提取 Electron 应用", "看 <app> 的源码", "反编译 Electron", "解包 app.asar", "还原 source map"

Both app name (e.g., Codex) and absolute path (e.g., /Applications/Codex.app, a .asar file, or a Windows install dir) are accepted. The script handles discovery for both platforms.

Workflow

1. Determine the input. Ask the user for the app name or path if they haven't given one. If they want a custom output directory, ask for that too.

2. Run the script.

bash
${BUN_X} {baseDir}/scripts/main.ts "<app>" [--output <dir>] [--asar <path>] [--force]

Start with --dry-run first if you're unsure whether discovery will find the right bundle — it prints the resolved paths and exits without touching the filesystem.

3. Handle the result.

  • Success → report the output paths and the counts (extracted / restored / formatted).
  • Multiple matches → the script lists candidates and exits non-zero. Show the user the candidates, ask which one to use (via AskUserQuestion or the runtime equivalent), then re-run with the chosen absolute path.
  • Existing non-empty output dir → the script refuses without --force. Ask the user whether to overwrite (--force) or pick a new --output path.
  • Unsupported platform / no match → suggest passing --asar /full/path/to/app.asar if the user knows where the bundle lives.

4. Point the user at the result. The default output dir is ~/Downloads/<AppName>-electron-extract/. The most interesting subdirectory depends on what was found:

  • restored/ exists → the original source tree was reconstructed from .js.map files; this is what to read first.
  • Only extracted/ exists (no maps) → the JS/CSS in extracted/ was Prettier-formatted in place; read from there.
Show full SKILL.md (397 more words)Show less

Source-map path restoration

The script should preserve original source names and directory structure as much as the source map allows:

  • Resolve each sources[] entry with sourceRoot when present, then relative to the .js.map file's directory inside extracted/.
  • Collapse normal bundler-relative paths into the restored project tree. For example, .vite/main/index.js.map + ../../src/main.ts becomes restored/src/main.ts.
  • If a source path climbs above extracted/, keep the readable remaining path under restored/ instead of hashing it. For example, .vite/main/index.js.map + ../../../shared/src/lib/foo.ts becomes restored/shared/src/lib/foo.ts.
  • Strip URL/query decorations from source names, including common webpack://, file://, and ?loader suffixes.
  • Use restored/__unknown/<hash>.<ext> only when the source name is empty or cannot be reduced to a safe file path.
  • Continue skipping node_modules and webpack/runtime/* entries; these are bundler/runtime noise, not app sources.

Usage

bash
# Extract by app name (default output: ~/Downloads/Codex-electron-extract/)
${BUN_X} {baseDir}/scripts/main.ts Codex

# Extract by absolute path (works for .app bundles, install dirs, or .asar files)
${BUN_X} {baseDir}/scripts/main.ts "/Applications/Visual Studio Code.app"
${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

# Custom output
${BUN_X} {baseDir}/scripts/main.ts Codex --output ~/work/codex-source

# Preview discovery without writing anything
${BUN_X} {baseDir}/scripts/main.ts Codex --dry-run

# Overwrite an existing output dir
${BUN_X} {baseDir}/scripts/main.ts Codex --force

# Machine-readable result (one JSON line on stdout)
${BUN_X} {baseDir}/scripts/main.ts Codex --json

Options

OptionShortDescriptionDefault
<app>App name or absolute path. Required unless --asar is given.—
--output-oOutput directory~/Downloads/<AppName>-electron-extract
--asarOverride the resolved .asar pathauto-discovered
--force-fAllow writing into a non-empty existing output dirfalse
--skip-formatSkip Prettier formattingfalse
--skip-restoreSkip source-map restorationfalse
--no-unpackedDon't copy app.asar.unpacked/ alongsidefalse
--dry-runPrint resolved paths and exit without writingfalse
--jsonEmit one JSON-line summary on stdout (suppresses normal output)false

Output layout

~/Downloads/<AppName>-electron-extract/
├── extract-report.json          # JSON summary: counts, warnings, resolved paths
├── extracted/                   # raw asar contents (JS/CSS Prettier-formatted when no map)
│   └── ...                      # node_modules left untouched (skipped from format)
├── extracted.unpacked/          # copied from <asar>.unpacked/ if present
│   └── ...                      # native modules (.node), large assets
└── restored/                    # only present if at least one .js.map was usable
    └── <original/source/tree>   # rebuilt from sourcesContent in each .js.map

Notes

  • node_modules is always skipped — both for source-map restoration and Prettier formatting — because vendored dependencies are noise when inspecting an app.
  • Source-map restoration only works when the .js.map embeds sourcesContent. This is the common case for modern bundlers (webpack, esbuild, Vite, rollup). If a map references external .ts/.js files without embedding them, that map is skipped and the corresponding .js is Prettier-formatted instead. Skipped maps are listed in extract-report.json under warnings.
  • Readable paths over hashes — don't treat ../ segments in source-map paths as automatically unsafe. First resolve them from the map location and then sanitize the final output path so it still stays under restored/. Hash fallback is only for unusable source names.
  • App discovery searches /Applications + ~/Applications on macOS, and %LOCALAPPDATA%\Programs, %PROGRAMFILES%, %PROGRAMFILES(X86)%, %APPDATA% on Windows. If discovery finds multiple matches, the script exits and lists them — re-run with an absolute path. On Linux or other platforms, pass --asar /path/to/app.asar explicitly.
  • Safety — the script refuses to write to /, the user home directly, or the current working directory, and refuses to populate an existing non-empty output dir without --force.
  • No global installs — @electron/asar and prettier are resolved on-the-fly via npx -y. First run will be slower while npx caches them.

© JimLiu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in skills/baoyu-electron-extract of JimLiu/baoyu-skills.

  • SKILL.md
  • scripts/main.test.ts
  • scripts/main.ts

Open the folder on GitHubat commit 1567581

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in JimLiu/baoyu-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Electron App Source Extractor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Electron App Source Extractor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Electron App Source Extractor this skillJimLiu/baoyu-skills27k1 repos~2.6kAutomated safety check: PassMIT
Setup Pre Commitfossasia/eventyay-interpretation1.6k12 repos~565Automated safety check: PassApache-2.0
Formatter Developmentbiomejs/biome26k—~2.1kAutomated safety check: PassApache-2.0
Code Qualityredis/RedisInsight8.9k—~1.2kAutomated safety check: PassCustom licence
Code Change Verificationopenai/openai-agents-python30k—~1.4kAutomated safety check: PassMIT
Flowmark Markdown Formatterjlevy/repren374—~631Automated safety check: PassMIT

Similar skills

  • Setup Pre Commit

    fossasia/eventyay-interpretation

    Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.

    1.6k GitHub starsUsed in 12 repos~565 tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses whenever implementing or debugging Biome formatter behavior, IR composition, node rules, layout selection, source-comment handling, verbatim formatting, idempotency, internal…

    26k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Quality

    redis/RedisInsight

    Official

    Code-quality standards for RedisInsight: TypeScript strictness, naming conventions (camelCase, PascalCase, UPPERSNAKECASE), linting rules, no any without reason, no !important in styles, and…

    8.9k GitHub stars~1.2k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Code Change Verification

    openai/openai-agents-python

    Official

    Run the required final formatting, lint, type, and test checks after eligible SDK changes pass review.

    30k GitHub stars~1.4k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Formats Markdown with the Flowmark auto-formatter for typographic cleanup and semantic line breaks, and helps adopt it across a repository.

    374 GitHub stars~631 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Codex App Ref Refresh

    JimLiu/decode-codex

    Refresh the local ChatGPT app reference source from the installed macOS ChatGPT.app asar.

    133 GitHub stars~875 tokensUpdated 3 days ago
    DevelopmentAuto-check passed

More from JimLiu/baoyu-skills

All 22 skills in this repo
  • Markdown Article Formatter

    JimLiu/baoyu-skills

    Reformats plain text or Markdown articles with frontmatter, a title, a summary, headings, bold, lists and code blocks, and saves a separate formatted copy.

    27k GitHub starsUsed in 6 repos~3.5k tokens
    Auto-check passed
  • X to Markdown Converter

    JimLiu/baoyu-skills

    Saves tweets, threads and X Articles as Markdown files with YAML front matter, using an unofficial API that asks for your consent first.

    27k GitHub starsUsed in 4 repos~1.8k tokens
    Auto-check: warnings
  • SVG Diagram Generator

    JimLiu/baoyu-skills

    Creates standalone dark-themed SVG diagrams, including architecture, flowchart, sequence, structural, mind map, timeline and state machine types.

    27k GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed
  • Publishes articles and image-text posts to a WeChat Official Account through the API or Chrome CDP, converting markdown to WeChat-ready HTML with link citations.

    27k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check: warnings
  • Image Compressor

    JimLiu/baoyu-skills

    Compresses images to WebP by default, or to PNG or JPEG, picking the best available tool on the machine and optionally processing whole folders.

    27k GitHub starsUsed in 5 repos~598 tokens
    Auto-check passed
  • Generates text and images through an unofficial, reverse-engineered Gemini Web API, supporting reference images and multi-turn conversations.

    27k GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check passed

Categories

Questions about Electron App Source Extractor

What does Electron App Source Extractor do?

Unpacks an installed Electron app's asar bundle and restores readable source from its JavaScript source maps when one is available. This skill finds and extracts an installed Electron application's app archive, and when a source map file is present, restores the original source files from its embedded content, resolving bundled paths relative to the map file so a nested path comes back readable instead of hashed. When no source map exists, it falls back to formatting the minified code with Prettier instead.

When should I use Electron App Source Extractor?

Electron App Source Extractor fits situations like: inspecting how a desktop Electron app, like a chat client or editor, was built; recovering readable source from a minified or bundled Electron app; looking inside an installed app's bundled JavaScript for learning or debugging.

How do I install Electron App Source Extractor in Claude Code?

Run `npx skills add JimLiu/baoyu-skills --skill baoyu-electron-extract -a claude-code`. Or copy the skill folder (skills/baoyu-electron-extract in JimLiu/baoyu-skills) into .claude/skills/baoyu-electron-extract in your project. Claude Code loads it when a task matches its description.

How do I install Electron App Source Extractor in Codex?

Run `npx skills add JimLiu/baoyu-skills --skill baoyu-electron-extract -a codex`. Or copy the skill folder (skills/baoyu-electron-extract in JimLiu/baoyu-skills) into .agents/skills/baoyu-electron-extract in your project. Codex loads it when a task matches its description.

Can I use Electron App Source Extractor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JimLiu/baoyu-skills --skill baoyu-electron-extract -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/baoyu-electron-extract, .gemini/skills/baoyu-electron-extract, .github/skills/baoyu-electron-extract and .opencode/skills/baoyu-electron-extract in your project.

What does Electron App Source Extractor need to run?

Going by SKILL.md and its folder, Electron App Source Extractor needs TypeScript for the scripts in its folder and the command-line tools its instructions call (npx). Our summary lists: bun, or npx as a fallback, to run the extraction script.

Does Electron App Source Extractor access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Electron App Source Extractor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Electron App Source Extractor use?

Electron App Source Extractor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Electron App Source Extractor use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Electron App Source Extractor?

Skills that share tags, products or a category with Electron App Source Extractor: Setup Pre Commit (fossasia/eventyay-interpretation, 1.6k stars), Formatter Development (biomejs/biome, 26k stars), Code Quality (redis/RedisInsight, 8.9k stars) and Code Change Verification (openai/openai-agents-python, 30k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Electron App Source Extractor?

JimLiu (a GitHub user) maintains it in JimLiu/baoyu-skills, which has 26,507 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on September 10, 2026.

Source: JimLiu/baoyu-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.