baoyu-electron-extract
Fungsinya
Skill ini membongkar berkas di dalam aplikasi Electron agar Anda bisa membaca cara aplikasi itu dibangun. Skill ini untuk developer yang ingin memeriksa aplikasi desktop yang sudah terpasang.
Kapan dipakai
- βSaat Anda ingin melihat kode sumber aplikasi desktop Electron yang terpasang.
- βSaat Anda ingin memahami bagaimana aplikasi desktop dibangun.
- βSaat Anda perlu mengambil sumber daya yang dibundel di dalam paket aplikasi.
Link skill
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-electron-extract/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βEkstrak kode sumber dari aplikasi Electron yang terpasang di komputer saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent Anda menemukan aplikasi, mengekstrak paketnya, memulihkan sumber asli dari source map jika tersedia, dan memformat kode minified jika tidak.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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 |
Pertanyaan umum
Aplikasi apa saja yang bisa dibuka?
Skill bekerja dengan aplikasi Electron yang terpasang, yang bisa Anda sebutkan namanya atau tunjuk melalui jalurnya.
Bagaimana jika kodenya minified?
Jika tidak ada source map, skill memformat kode minified agar lebih mudah dibaca.
Apakah nama berkas asli dipulihkan?
Ya, jika aplikasi menyertakan source map, skill memulihkan sumber asli dari situ.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 27k
- Peringkat
- #9955
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
release-skills
27kMemandu agent Anda melalui rilis untuk proyek apa pun: menaikkan versi, memperbarui changelog, dan mempublikasikan rilis atau tag GitHub.
baoyu-article-illustrator
27kMembantu agent Anda menambahkan ilustrasi ke artikel dengan mencari titik yang membutuhkan visual dan membuat gambar dalam satu gaya yang konsisten.
baoyu-comic
27kMenunjukkan cara membuat komik edukatif dengan panel, gaya seni, dan nada, seperti biografi atau tutorial.
baoyu-compress-image
27kMembantu agent Anda memperkecil ukuran berkas gambar dengan mengubahnya ke WebP atau PNG dan memilih alat secara otomatis, agar lebih cepat dimuat.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.