baoyu-electron-extract
できること
このスキルは、Electronアプリの中のファイルを展開し、どのように作られているかを読めるようにします。インストール済みのデスクトップアプリの仕組みを調べたい開発者向けです。
使う場面
- ✓インストール済みのElectronデスクトップアプリのソースコードを見たいとき。
- ✓デスクトップアプリがどのように作られているかを理解したいとき。
- ✓アプリのパッケージに含まれるリソースを取り出す必要があるとき。
スキルのリンク
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-electron-extract/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“パソコンにインストールされた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):
- 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 |
よくある質問
どのアプリを開けますか?
インストール済みの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
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
release-skills
27kエージェントが、バージョンの更新、変更履歴の更新、GitHubのリリースやタグの公開まで、どのプロジェクトでもリリース作業を案内します。
baoyu-article-illustrator
27kエージェントが、記事の中で図版が役立つ箇所を見つけ、同じスタイルで画像を作って、記事にイラストを追加できるよう支援します。
baoyu-comic
27kエージェントが、パネル、画風、トーンを使って、伝記やチュートリアルなどの教育的なコミックを作れるよう支援します。
baoyu-compress-image
27kエージェントが、画像をWebPまたはPNGに変換して、自動的に選ばれたツールでファイルサイズを縮め、読み込みを速くできるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。