AgentSkillsCN

wxt-browser-extensions

WXT 浏览器扩展性能优化指南。在编写、审查或重构 WXT 浏览器扩展代码时,应使用此技能,以确保实现最优的性能模式。适用于涉及 WXT、浏览器扩展、内容脚本、服务工作者、消息传递,以及扩展 API 的各项任务。

SKILL.md
--- frontmatter
name: wxt-browser-extensions
description: WXT browser extension performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring WXT browser extension code to ensure optimal performance patterns. Triggers on tasks involving WXT, browser extensions, content scripts, service workers, messaging, and extension APIs.

Community WXT Browser Extensions Best Practices

Comprehensive performance optimization guide for WXT browser extension development. Contains 49 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation. Updated for WXT v0.20+.

When to Apply

Reference these guidelines when:

  • Writing new WXT browser extension code
  • Implementing service worker background scripts
  • Injecting content scripts into web pages
  • Setting up messaging between extension contexts
  • Configuring manifest permissions and resources

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Service Worker LifecycleCRITICALsvc-
2Content Script InjectionCRITICALinject-
3Messaging ArchitectureHIGHmsg-
4Storage PatternsHIGHstore-
5Bundle OptimizationMEDIUM-HIGHbundle-
6Manifest ConfigurationMEDIUMmanifest-
7UI PerformanceMEDIUMui-
8TypeScript PatternsLOW-MEDIUMts-

Quick Reference

1. Service Worker Lifecycle (CRITICAL)

2. Content Script Injection (CRITICAL)

3. Messaging Architecture (HIGH)

4. Storage Patterns (HIGH)

5. Bundle Optimization (MEDIUM-HIGH)

6. Manifest Configuration (MEDIUM)

7. UI Performance (MEDIUM)

8. TypeScript Patterns (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information