About wxt
A reference skill for WXT browser-extension projects. It guides developers through common framework patterns and pitfalls, from configuration and entrypoints to testing and browser builds.
Key features
- 01Configuration and manifest guidance
- 02Entrypoints and content scripts
- 03Storage and messaging patterns
- 04Testing with WxtVitest and fakeBrowser
- 05Modules and multi-browser builds
Use cases
- 01Implementing a WXT background script
- 02Building extension UI with a frontend framework
- 03Testing browser-extension behavior
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ timeraa/ skills --skill wxtAfter installing, type/wxtin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
GENERATION.mdreferences/config.mdcontent-scripts.mdentrypoints.mdfrontend-frameworks.mdmessaging.mdmodules.mdmulti-browser.mdpatterns.mdstorage.mdtesting.mdDetails
From the project READMEWXT - Browser Extension Framework
When to Use
Apply this skill when:
- Project has
wxt.config.tsin root - Code uses
defineBackground,defineContentScript,defineUnlistedScript package.jsonhaswxtas a dependency- Entrypoints directory contains extension entry files
- Code imports from
#importsorwxt/*
Quick Reference
| Topic | Reference |
|---|---|
| Configuration, manifest, env vars, TypeScript | references/config.md |
| Entrypoints (background, HTML pages, unlisted) | references/entrypoints.md |
| Content scripts (UI, main world, SPA) | references/content-scripts.md |
| Storage API, defineItem, migrations, watchers | references/storage.md |
| Messaging (cross-context communication) | references/messaging.md |
| Testing with WxtVitest and fakeBrowser | references/testing.md |
| WXT modules (using and creating) | references/modules.md |
| Multi-browser builds and runtime detection | references/multi-browser.md |
| Vue, React, Svelte, Solid setup | references/frontend-frameworks.md |
| Common patterns and anti-patterns | references/patterns.md |
Most Common Pattern
// entrypoints/background.ts
export default defineBackground({
main() {
// ALL runtime code must be inside main() - cannot be async
browser.runtime.onInstalled.addListener(() => {
console.log('Extension installed');
});
},
});
Critical: main() cannot be async. Code outside main() runs at build time in Node.js.
Comments
Markdown supported