Перейти к содержанию
Skillpedia
Код в целом27k · #9955

baoyu-electron-extract

Что он делает

Этот скилл распаковывает файлы внутри приложения Electron, чтобы вы могли понять, как оно устроено. Он нужен разработчикам, которые хотят изучить установленное настольное приложение.

Когда использовать

  • ✓Когда вы хотите увидеть исходный код установленного настольного приложения на Electron.
  • ✓Когда вы хотите понять, как устроено настольное приложение.
  • ✓Когда нужно извлечь ресурсы, упакованные внутри пакета приложения.

Ссылка на скилл

https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-electron-extract/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-electron-extract/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Извлеки исходный код из приложения 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):

  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

{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 AskUserQuestion or 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.asar if 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.map files; read this first.
  • Only extracted/ (no maps) → JS/CSS in extracted/ 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
Обновлён
02.11.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы