browser-extension
Browser Extension Creator
Create cross-browser extensions using WXT framework (wxt.dev). Supports Chrome, Firefox, Edge, Safari, and Opera with a single codebase.
When to Use
- Creating a new browser extension from scratch
- Porting an existing extension to WXT
- Adding features to a WXT-based extension (content scripts, popup, background, options)
- Publishing to Chrome Web Store, Firefox AMO, Edge Add-ons, or distributing internally
Workflow
Phase 1: Interview
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", activate the security checklist for all subsequent phases. See references/local-distribution-guide.md security section.
Phase 2: Scaffold
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:
- wxt.config.ts — Browser targets, permissions, manifest overrides
- CLAUDE.md — Project-specific instructions (stack, commands, structure)
- .gitignore — Must include:
*.pem,*.key,.env*,config.local.*,.output/,node_modules/
If internal/work extension:
- Generate
.env.examplewith placeholders (never real values) - Generate
config.tsthat reads fromstorage.local, never hardcoded URLs/tokens
Phase 3: Development
Build 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 —
storage.defineItem()for typed persistent state - Messaging —
defineExtensionMessaging()for popup ↔ background communication - Content Script UI —
createShadowRootUi()orcreateIntegratedUi()for injecting UI
For internal extensions accessing corporate APIs:
- URLs go in
storage.local(configurable from options page), never in code - Auth via
browser.identityor user-provided tokens at runtime host_permissionswith specific domains, never<all_urls>
Phase 4: Testing
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.
Phase 5: Build & Distribute
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
Reference Files
| File | When to consult |
|---|---|
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 |
More from testacode/llm-toolkit
claude-md-writer
Escribe y mejora archivos CLAUDE.md siguiendo best practices de Anthropic. Este skill se activa cuando el usuario dice "crear CLAUDE.md", "mejorar CLAUDE.md", "actualizar CLAUDE.md", "revisar CLAUDE.md", "escribir instrucciones del proyecto", "create CLAUDE.md", "improve CLAUDE.md", "review CLAUDE.md", "write project instructions", "optimize docs for Claude", "auditar CLAUDE.md", "audit CLAUDE.md", "limpiar CLAUDE.md", "dead weight", o configura un nuevo repositorio.
53doc-writer
Este skill se usa para crear documentos tecnicos organizados en /docs (specs, planes de implementacion, ADRs, documentacion de referencia). Se activa cuando el usuario dice "crear documento", "escribir spec", "documentar esto", "creame una spec", "escribime documentacion", "hacer documentacion", "write a spec", "create documentation", "write an ADR", o quiere agregar documentacion tecnica al proyecto.
44llms-txt-generator
This skill generates llms.txt documentation optimized for AI/LLM consumption. It should be used when the user says "crear llms.txt", "generate llms.txt", "documentar para AI", "document for AI", "crear documentacion para LLMs", "generate docs for LLMs", "make repo readable for Claude", or wants to create structured machine-readable documentation following the llms.txt standard.
40doc-organizer
Este skill se usa cuando el usuario pide "organizar docs", "ordenar documentacion", "mover documentos a carpetas", "categorizar archivos md", "reorganizar documentacion", o cuando hay archivos .md sueltos en docs/ que necesitan ser movidos a subcarpetas tematicas. Organiza y categoriza documentos tecnicos en la estructura correcta del proyecto.
28feature-planner
Planifica features con entrevista estructurada y crea tareas. Este skill se activa cuando el usuario dice "quiero agregar", "planificar feature", "nueva funcionalidad", "implementar esto", "crear plan", "planificar antes de codear", "disenar feature", "como deberia implementar esto", "pensar la arquitectura", o quiere alinear antes de escribir codigo.
27nextjs-project-starter
Creates Next.js projects with a configurable stack (Mantine, Supabase, Zustand, Zod). This skill should be used when the user says "create a Next.js project", "new web project", "bootstrap fullstack app", "start new app", "crear proyecto Next.js", "nuevo proyecto web", "empezar app fullstack", or wants to scaffold a new personal project from scratch.
25