From llm-toolkit
This skill should be used when the user wants to create, build, modify, test, or publish a browser extension. Trigger phrases include: "crear extension", "browser extension", "extension Chrome", "extension Firefox", "content script", "popup extension", "addon", "extension de navegador", "chrome extension", "firefox addon", "extension para el browser", "quiero hacer un plugin para Chrome", "modificar headers del navegador", "inyectar script en pagina", "publicar extension", "publish to Chrome Web Store", "publish to Firefox AMO", "automate extension release", "extension sin WXT", "Rspack extension", "Webpack extension", "AMO source package", "test my extension", or any project involving a web extension. Defaults to WXT for new projects; also covers existing non-WXT (Rspack/Webpack/Vite, hand-rolled MV3) extensions and CI store publishing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/llm-toolkit:browser-extensionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create cross-browser extensions using WXT framework (wxt.dev). Supports Chrome, Firefox, Edge, Safari, and Opera with a single codebase.
Create cross-browser extensions using WXT framework (wxt.dev). Supports Chrome, Firefox, Edge, Safari, and Opera with a single codebase.
src/manifest.json)First, branch on the project type. The phases below scaffold a NEW project with
WXT. For an EXISTING extension that does not use WXT (a checked-in src/manifest.json
bundled by Rspack/Webpack/Vite — no wxt.config.ts), the scaffold/dev phases do NOT
apply: do not migrate it to WXT unless explicitly asked. Consult
references/existing-extension-guide.md for that case (project shape, testing the
real code, dependency lockstep, CI). references/store-publishing-guide.md applies
to both — use its standalone path for non-WXT.
Gather requirements before writing any code:
1. Purpose — What does the extension do? (one sentence)
2. Features — What specific capabilities? (content script injection, popup UI, background tasks, options page, etc.)
3. Target browsers — Chrome, Firefox, Edge, Safari, Opera? (default: Chrome + Firefox)
4. UI framework — React, Vue, Svelte, Solid, or Vanilla? (default: Vanilla)
5. Distribution mode — stores, local/internal, or both?
6. Internal use? — Does the extension handle corporate/sensitive data?
If the user says "internal" or "work", read the security section in references/local-distribution-guide.md and apply its checklist in all subsequent phases.
Initialize the project with WXT. Consult references/wxt-reference.md for CLI commands and config.
# Initialize project
npx wxt@latest init <project-name>
cd <project-name>
# Install dependencies
npm install
# Prepare TypeScript types
npm run postinstall
Generate these files:
*.pem, *.key, .env*, config.local.*, .output/, node_modules/If internal/work extension:
.env.example with placeholders (never real values)config.ts that reads from storage.local, never hardcoded URLs/tokensBuild features using WXT entrypoints. Consult references/extension-patterns.md for code patterns and references/manifest-permissions.md for permissions.
Entrypoints (file-based, in entrypoints/ directory):
popup/ — Extension popup UI (index.html + main.ts/tsx)background.ts — Service worker (alarms, events, API calls)content.ts — Scripts injected into web pagesoptions/ — Settings page (index.html + main.ts/tsx)Key APIs (all via wxt/storage and browser namespace):
storage.defineItem() for typed persistent statedefineExtensionMessaging() for popup ↔ background communicationcreateShadowRootUi() or createIntegratedUi() for injecting UIFor internal extensions accessing corporate APIs:
storage.local (configurable from options page), never in codebrowser.identity or user-provided tokens at runtimehost_permissions with specific domains, never <all_urls>Set up Vitest with WXT plugin. Consult references/wxt-reference.md testing section for config and fakeBrowser usage. Write tests beside the files they test.
Distribution bifurcates based on the mode chosen in Phase 1.
Local/Internal distribution — Consult references/local-distribution-guide.md:
wxt build # Chrome output: .output/chrome-mv3/
wxt build -b firefox # Firefox output: .output/firefox-mv2/
Load unpacked in browser for testing, ZIP for sharing internally.
Store publishing — Consult references/store-publishing-guide.md:
wxt zip # Chrome ZIP for CWS
wxt zip -b firefox # Firefox ZIP + sources for AMO
Each store has specific requirements (assets, fees, review times).
Automated publishing (optional):
wxt submit init # Configure store credentials
wxt submit --dry-run \ # Test submission
--chrome-zip .output/*-chrome.zip \
--firefox-zip .output/*-firefox.zip \
--firefox-sources-zip .output/*-sources.zip
| File | When to consult |
|---|---|
references/existing-extension-guide.md | EXISTING non-WXT extensions: bundler-based MV3, testing the real code (not a mock), dependency lockstep, CI |
references/wxt-reference.md | CLI commands, project structure, wxt.config.ts, testing setup |
references/extension-patterns.md | Code patterns: popup, content script, background, storage, messaging |
references/manifest-permissions.md | Choosing permissions, host_permissions, optional_permissions |
references/store-publishing-guide.md | Publishing to Chrome Web Store, Firefox AMO, Edge, Safari |
references/local-distribution-guide.md | Load unpacked, enterprise deployment, internal security |
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub testacode/llm-toolkit --plugin llm-toolkit