wxt-browser-extensions by pproenca/dot-skills
npx skills add https://github.com/pproenca/dot-skills --skill wxt-browser-extensionsWXT 浏览器扩展开发的全面性能优化指南。包含 8 个类别共 49 条规则,按影响优先级排序,以指导自动化重构和代码生成。已针对 WXT v0.20+ 更新。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | Service Worker 生命周期 | 关键 | svc- |
| 2 | 内容脚本注入 | 关键 | inject- |
| 3 | 消息架构 | 高 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
msg-| 4 | 存储模式 | 高 | store- |
| 5 | 打包优化 | 中高 | bundle- |
| 6 | 清单配置 | 中 | manifest- |
| 7 | UI 性能 | 中 | ui- |
| 8 | TypeScript 模式 | 低中 | ts- |
svc-register-listeners-synchronously - 同步注册监听器以防止错过事件svc-avoid-global-state - 使用存储而非内存状态svc-keep-alive-patterns - 为长时间操作保持 Service Worker 活动svc-handle-install-update - 处理安装和更新生命周期事件svc-offscreen-documents - 使用离屏文档进行 DOM 操作svc-declarative-net-request - 使用声明式规则进行网络拦截inject-use-main-function - 将运行时代码放在 main() 函数内inject-choose-correct-world - 适当选择 ISOLATED 或 MAIN 世界inject-run-at-timing - 配置适当的 runAt 时机inject-use-ctx-invalidated - 处理更新时的上下文失效inject-dynamic-registration - 使用运行时注册进行条件注入inject-all-frames - 为 iframe 处理配置 allFramesinject-spa-navigation - 使用 wxt:locationchange 处理 SPA 导航msg-type-safe-messaging - 使用 @webext-core/messaging 实现类型安全的协议msg-return-true-for-async - 为异步消息处理程序返回 true(原始 API)msg-use-tabs-sendmessage - 对内容脚本使用 tabs.sendMessagemsg-use-ports-for-streams - 使用端口进行流式通信msg-handle-no-receiver - 处理缺失的消息接收者msg-avoid-circular-messages - 防止循环消息store-use-define-item - 使用 storage.defineItem 进行类型安全的访问store-choose-storage-area - 选择合适的存储区域store-batch-operations - 将相关数据分组到单个 defineItem 中store-watch-for-changes - 使用 watch() 实现响应式更新store-handle-quota-errors - 处理存储配额错误store-versioned-migrations - 使用版本控制进行模式迁移bundle-split-entrypoints - 按入口点拆分代码bundle-analyze-size - 分析和监控打包大小bundle-tree-shake-icons - 对图标库使用直接导入bundle-externalize-wasm - 动态加载 WASMbundle-minify-content-scripts - 最小化内容脚本大小manifest-minimal-permissions - 请求最小权限manifest-use-optional-permissions - 渐进式使用可选权限manifest-web-accessible-resources - 限定可访问的网络资源范围manifest-content-security-policy - 正确配置 CSPmanifest-cross-browser-compatibility - 支持多浏览器ui-use-shadow-dom - 对注入的 UI 使用 Shadow DOMui-defer-rendering - 延迟弹窗渲染直到需要时ui-cleanup-on-unmount - 在卸载时清理 UIui-sidepanel-persistence - 保持侧边栏状态ui-position-fixed-iframe - 对复杂 UI 使用 iframeui-avoid-layout-thrashing - 批量进行 DOM 读取和写入ts-use-imports-module - 使用 #imports 虚拟模块和自动导入ts-use-browser-not-chrome - 使用 browser 命名空间而非 chromets-type-entrypoint-options - 显式地为入口点选项添加类型ts-augment-browser-types - 为缺失的 API 扩展类型ts-strict-null-checks - 启用严格的空值检查ts-import-meta-env - 使用 import.meta 获取构建信息ts-avoid-any - 避免在处理程序中使用 any 类型ts-path-aliases - 对导入使用路径别名阅读各个参考文件以获取详细解释和代码示例:
| 文件 | 描述 |
|---|---|
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装数
254
代码仓库
GitHub 星标数
85
首次出现
2026年1月28日
安全审计
安装于
opencode209
codex209
gemini-cli206
github-copilot196
cursor179
kimi-cli178
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+.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Service Worker Lifecycle | CRITICAL | svc- |
| 2 | Content Script Injection | CRITICAL | inject- |
| 3 | Messaging Architecture | HIGH | msg- |
| 4 | Storage Patterns | HIGH | store- |
| 5 | Bundle Optimization | MEDIUM-HIGH | bundle- |
| 6 | Manifest Configuration | MEDIUM | manifest- |
| 7 | UI Performance | MEDIUM | ui- |
| 8 | TypeScript Patterns | LOW-MEDIUM | ts- |
svc-register-listeners-synchronously - Register listeners synchronously to prevent missed eventssvc-avoid-global-state - Use storage instead of in-memory statesvc-keep-alive-patterns - Keep service worker alive for long operationssvc-handle-install-update - Handle install and update lifecycle eventssvc-offscreen-documents - Use offscreen documents for DOM operationsinject-use-main-function - Place runtime code inside main() functioninject-choose-correct-world - Select ISOLATED or MAIN world appropriatelyinject-run-at-timing - Configure appropriate runAt timinginject-use-ctx-invalidated - Handle context invalidation on updateinject-dynamic-registration - Use runtime registration for conditional injectionmsg-type-safe-messaging - Use @webext-core/messaging for type-safe protocolsmsg-return-true-for-async - Return true for async message handlers (raw API)msg-use-tabs-sendmessage - Use tabs.sendMessage for content scriptsmsg-use-ports-for-streams - Use ports for streaming communicationmsg-handle-no-receiver - Handle missing message receiversstore-use-define-item - Use storage.defineItem for type-safe accessstore-choose-storage-area - Select appropriate storage areastore-batch-operations - Group related data into single defineItemstore-watch-for-changes - Use watch() for reactive updatesstore-handle-quota-errors - Handle storage quota errorsbundle-split-entrypoints - Split code by entrypointbundle-analyze-size - Analyze and monitor bundle sizebundle-tree-shake-icons - Use direct imports for icon librariesbundle-externalize-wasm - Load WASM dynamicallybundle-minify-content-scripts - Minimize content script sizemanifest-minimal-permissions - Request minimal permissionsmanifest-use-optional-permissions - Use optional permissions progressivelymanifest-web-accessible-resources - Scope web accessible resourcesmanifest-content-security-policy - Configure CSP correctlymanifest-cross-browser-compatibility - Support multiple browsersui-use-shadow-dom - Use Shadow DOM for injected UIui-defer-rendering - Defer popup rendering until neededui-cleanup-on-unmount - Clean up UI on unmountui-sidepanel-persistence - Preserve sidepanel stateui-position-fixed-iframe - Use iframe for complex UIts-use-imports-module - Use #imports virtual module and auto-importsts-use-browser-not-chrome - Use browser namespace over chromets-type-entrypoint-options - Type entrypoint options explicitlyts-augment-browser-types - Augment types for missing APIsts-strict-null-checks - Enable strict null checksRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
254
Repository
GitHub Stars
85
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode209
codex209
gemini-cli206
github-copilot196
cursor179
kimi-cli178
Vue.js测试最佳实践:Vue 3组件、组合式函数、Pinia与异步测试完整指南
3,700 周安装
产品头脑风暴工具:从产品经理、设计师、工程师多视角生成创意,筛选最佳方案
249 周安装
JavaScript 事实核查器 - 验证 33 JS 概念准确性,确保代码示例与 MDN 文档正确
249 周安装
阿里云函数计算AgentRun OpenAPI管理指南:运行时、沙箱、模型服务配置
250 周安装
发票模板生成技能 - 使用Python ReportLab快速创建专业PDF发票,支持批量生成与定制
250 周安装
移动优先设计指南:响应式网页开发、性能优化与渐进增强最佳实践
250 周安装
Beads - AI代理持久化任务记忆工具,基于Git的图结构问题跟踪器
250 周安装
svc-declarative-net-requestinject-all-framesinject-spa-navigation - Handle SPA navigation with wxt:locationchangemsg-avoid-circular-messagesstore-versioned-migrationsui-avoid-layout-thrashingts-import-meta-envts-avoid-any - Avoid any type in handlersts-path-aliases - Use path aliases for imports