mcpField
W
wxt

wxt

github.com/timeraaDevelopment442 installsUpdated 33w ago
Repository

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

  1. 01Configuration and manifest guidance
  2. 02Entrypoints and content scripts
  3. 03Storage and messaging patterns
  4. 04Testing with WxtVitest and fakeBrowser
  5. 05Modules and multi-browser builds

Use cases

  1. 01Implementing a WXT background script
  2. 02Building extension UI with a frontend framework
  3. 03Testing browser-extension behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/timeraa/skills --skill wxt

After installing, type/wxtin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

GENERATION.md
references/
config.md
content-scripts.md
entrypoints.md
frontend-frameworks.md
messaging.md
modules.md
multi-browser.md
patterns.md
storage.md
testing.md

Details

From the project README

WXT - Browser Extension Framework

When to Use

Apply this skill when:

  • Project has wxt.config.ts in root
  • Code uses defineBackground, defineContentScript, defineUnlistedScript
  • package.json has wxt as a dependency
  • Entrypoints directory contains extension entry files
  • Code imports from #imports or wxt/*

Quick Reference

TopicReference
Configuration, manifest, env vars, TypeScriptreferences/config.md
Entrypoints (background, HTML pages, unlisted)references/entrypoints.md
Content scripts (UI, main world, SPA)references/content-scripts.md
Storage API, defineItem, migrations, watchersreferences/storage.md
Messaging (cross-context communication)references/messaging.md
Testing with WxtVitest and fakeBrowserreferences/testing.md
WXT modules (using and creating)references/modules.md
Multi-browser builds and runtime detectionreferences/multi-browser.md
Vue, React, Svelte, Solid setupreferences/frontend-frameworks.md
Common patterns and anti-patternsreferences/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