返回 Skill 列表
extension
分类: 开发与工程无需 API Key

chrome-ext

Chrome扩展程序(Manifest V3)性能优化指南(以前称为chrome-extensions)。在编写、审查或重构Chrome扩展代码以确保最佳性能模式时应使用此技能。触发于涉及服务工作者、内容脚本、消息传递、存储API或扩展开发的任务。

person作者: jakexiaohubgithub

Chrome Developer Relations Chrome Extensions Best Practices

Comprehensive performance optimization guide for Chrome Extensions (Manifest V3), maintained by Chrome Developer Relations. Contains 40+ rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new Chrome extension code
  • Migrating from Manifest V2 to Manifest V3
  • Optimizing service worker lifecycle and state management
  • Implementing content scripts for page interaction
  • Debugging performance issues in extensions

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Service Worker Lifecycle | CRITICAL | sw- | | 2 | Content Script Optimization | CRITICAL | content- | | 3 | Message Passing Efficiency | HIGH | msg- | | 4 | Storage Operations | HIGH | storage- | | 5 | Network & Permissions | MEDIUM-HIGH | net- | | 6 | Memory Management | MEDIUM | mem- | | 7 | UI Performance | MEDIUM | ui- | | 8 | API Usage Patterns | LOW-MEDIUM | api- |

Quick Reference

1. Service Worker Lifecycle (CRITICAL)

2. Content Script Optimization (CRITICAL)

3. Message Passing Efficiency (HIGH)

4. Storage Operations (HIGH)

5. Network & Permissions (MEDIUM-HIGH)

6. Memory Management (MEDIUM)

7. UI Performance (MEDIUM)

8. API Usage Patterns (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For a complete guide with all rules in a single document, see AGENTS.md.

Reference Files

| File | Description | |------|-------------| | AGENTS.md | Complete compiled guide with all rules | | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |