Awesome-omni-skill chrome-extension-init-skill
Initialize a Chrome/Chromium browser extension project from an empty folder by having the user choose a scaffolding toolchain (Plasmo, WXT, or Vite + CRXJS), then running the official interactive CLI (e.g., `npm create plasmo`, `npx wxt@latest init`, `npm create crxjs@latest`) to scaffold the project, and finishing with git init + first commit. Use when a user asks to start or bootstrap a browser extension from scratch.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/tools/chrome-extension-init-skill" ~/.claude/skills/diegosouzapw-awesome-omni-skill-chrome-extension-init-skill && rm -rf "$T"
skills/tools/chrome-extension-init-skill/SKILL.mdChrome Extension Init Skill
Overview
Guide the user to pick a scaffolding toolchain (Plasmo / WXT / Vite + CRXJS), scaffold via the official CLI (not manual setup), then do minimal verification, git init, and the first commit.
Workflow
1) Confirm Preconditions
- Verify the target directory is empty or get permission to scaffold into it.
- Confirm target browsers (default to Chrome/Chromium). If the user needs Firefox, note differences and ask before proceeding.
2) Choose Scaffolding Toolchain (multi-turn)
Ask these in order; use numeric options for each choice. Do not manually scaffold; rely on the selected toolchain CLI.
- Scaffolding toolchain:
-
- Plasmo
-
- WXT
-
- Vite + CRXJS
-
- Target directory (absolute/relative path) and project name.
- Package manager:
-
- pnpm
-
- npm
-
- yarn
-
- Basic extension metadata: name, description, author (or confirm to keep CLI defaults).
Then ask toolchain-specific questions before running any interactive CLI:
-
If Plasmo:
- Starter template:
-
- Default starter (React)
-
- Example template from PlasmoHQ/examples (uses
):--with-<example>
,with-vue
,with-svelte
,with-env
,with-tailwindcsswith-antd
- Example template from PlasmoHQ/examples (uses
-
- Other example (user provides the exact example name, e.g.
)with-ai
- Other example (user provides the exact example name, e.g.
-
- Initial entry files to include (multi-select; maps to
comma list; omit extensions):--entry-
popup
-
options
-
newtab
-
background
-
content
-
contents/inline
-
contents/overlay
-
- If using npm, remind the user that npm requires
before passing plasmo flags (npm does not forward args).--
- Starter template:
-
If WXT:
- Starter template (maps to
):--template-
vanilla
-
vue
-
react
-
svelte
-
solid
-
- Package manager (maps to
):--pm-
pnpm
-
npm
-
yarn
-
- Optional: enable debug mode (maps to
)--debug - Optional: manifest target for future
commands: MV3 (default,wxt
) or MV2 (--mv3
)--mv2
- Starter template (maps to
-
If Vite + CRXJS:
- Framework template (maps to
):--template-
- Vanilla:
(JS) /vanilla
(TS)vanilla-ts
- Vanilla:
-
- React:
(JS) /react
(TS)react-ts
- React:
-
- Vue:
(JS) /vue
(TS)vue-ts
- Vue:
-
- Svelte:
(JS) /svelte
(TS)svelte-ts
- Svelte:
-
- Solid:
(JS) /solid
(TS)solid-ts
- Solid:
-
- Language:
-
- TypeScript (recommended)
-
- JavaScript
-
- Framework template (maps to
-
Confirm whether to proceed with an interactive CLI run now:
-
- Yes, run the CLI and answer prompts
-
- No, ask more questions first
-
Use toast for user-facing prompts and avoid alert when generating UI scaffolding.
3) Scaffold via Official CLI (interactive)
- Treat these CLIs as interactive. Before running them, summarize the expected answers with the user and confirm.
- Run the CLI in a TTY. If an unexpected prompt appears, stop and ask the user before answering.
Toolchain commands (examples):
- Plasmo:
- Default:
pnpm create plasmo "<name>" --entry=options,newtab,contents/inline - Example:
pnpm create plasmo "<name>" --entry=options,newtab,contents/inline --with-vue - NPM (note
):--npm create plasmo "<name>" -- --entry=options,newtab,contents/inline --with-vue
- Default:
- WXT:
npx wxt@latest init "<dir>" --template react --pm pnpm
- Vite + CRXJS:
- Always include
(avoid cached old versions)@latest npm create crxjs@latest "<dir>" -- --template react-ts
- Always include
4) Verify & Minimal Wiring
- Install dependencies with the chosen package manager.
- Run the toolchain's build (and dev if available) to ensure it produces a working extension output.
- Confirm MV3 by default; if the user explicitly requests MV2, ask again and only proceed if the chosen toolchain supports it.
- Keep Chrome content scripts as classic scripts; avoid ES module imports unless the manifest explicitly loads them as modules.
5) Initialize Git and Commit
- Initialize git in the project root if not already initialized by the CLI.
- Ensure
exists and matches the chosen tooling..gitignore - Create
in the project root with the rule:AGENTS.md- Run build after every change. - Commit all files with a clear message like "chore: initialize extension project".
6) Hand-off
- Provide quick start commands (read from the generated
scripts instead of guessing).package.json - Explain where to edit manifest, background/service worker, content scripts, and UI pages as generated by the chosen toolchain.