Best for
- "extract Electron app", "decompile this Electron app", "unpack app.asar"
- "show me the source of ", "look inside ", "how is built"
- "get the source code of Codex / Cursor / Discord / Slack / VS Code / Notion / Obsidian / ChatGPT desktop"
JimLiu/baoyu-skills/skills/baoyu-electron-extract/SKILL.md
Use it for engineering and operations tasks; the detail page covers purpose, installation, and practical steps.
Decision brief
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 fi…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/JimLiu/baoyu-skills --skill "skills/baoyu-electron-extract"Inspect the Agent Skill "baoyu-electron-extract" from https://github.com/JimLiu/baoyu-skills/blob/6b7a2e417500561a5ecdd0b168332f4142584617/skills/baoyu-electron-extract/SKILL.md at commit 6b7a2e417500561a5ecdd0b168332f4142584617. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
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.
Review the “Usage” section in the pinned source before continuing.
When this skill prompts the user, follow this tool-selection rule (priority order):
Scripts in scripts/ subdirectory. {baseDir} = this SKILL.md's directory path. Resolve ${BUNX} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUNX} with actual values.
Use this skill whenever the user wants to look inside an installed Electron application or inspect its bundled code. Trigger phrases include:
Permission review
The documentation asks the agent to run terminal commands or scripts.
*2. Run the script.**Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 89/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 24,555 | Source | Repository attention, not individual Skill quality |
| Compatibility | 1 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
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.
When this skill prompts the user, follow this tool-selection rule (priority order):
AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
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.
| Script | Purpose |
|---|---|
scripts/main.ts | App discovery + asar extraction + source-map restoration + Prettier formatting |
Use this skill whenever the user wants to look inside an installed Electron application or inspect its bundled code. Trigger phrases include:
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.
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.
${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.
AskUserQuestion or the runtime equivalent), then re-run with the chosen absolute path.--force. Ask the user whether to overwrite (--force) or pick a new --output path.--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.extracted/ exists (no maps) → the JS/CSS in extracted/ was Prettier-formatted in place; read from there.The script should preserve original source names and directory structure as much as the source map allows:
sources[] entry with sourceRoot when present, then relative to the .js.map file's directory inside extracted/..vite/main/index.js.map + ../../src/main.ts becomes restored/src/main.ts.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.webpack://, file://, and ?loader suffixes.restored/__unknown/<hash>.<ext> only when the source name is empty or cannot be reduced to a safe file path.node_modules and webpack/runtime/* entries; these are bundler/runtime noise, not app sources.# 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
| 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 paths and exit without writing | false | |
--json | Emit one JSON-line summary on stdout (suppresses normal output) | false |
~/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
.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.../ 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./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./, the user home directly, or the current working directory, and refuses to populate an existing non-empty output dir without --force.@electron/asar and prettier are resolved on-the-fly via npx -y. First run will be slower while npx caches them.Alternatives
PramodDutta/qaskills
Gate RAG pipelines in CI with versioned golden eval sets, per-metric thresholds, baseline drift detection, and a build that fails when retrieval or answer quality regresses.
PramodDutta/qaskills
Generate comprehensive test cases from state machine models covering all states, transitions, guard conditions, and invalid transition attempts for workflow-heavy features
wanshuiyin/Auto-claude-code-research-in-sleep
Workflow 4: Submission rebuttal pipeline. Parses external reviews, enforces coverage and grounding, drafts a safe text-only rebuttal under venue limits, and manages follow-up rounds. Use when user says "rebuttal", "reply to reviewers", "ICML rebuttal", "OpenReview response", or wants to answer external reviews safely.
PramodDutta/qaskills
Automatically generate comprehensive API test suites from OpenAPI specifications covering CRUD operations, error handling, authentication, pagination, and edge cases