
Chrome Extension
Generate or refactor Manifest V3 Chrome extensions using prioritized performance and lifecycle rules instead of ad-hoc MV2 habits.
Overview
Chrome Extensions is an agent skill most often used in Build (also Ship) that applies 40+ Manifest V3 performance rules—especially service worker lifecycle—to guide automated extension codegen and refactors.
Install
npx skills add https://github.com/pproenca/dot-skills --skill chrome-extensionWhat is this skill?
- 40+ performance rules across 8 categories for Manifest V3 extensions
- Service worker lifecycle section marked CRITICAL—keep-alive, storage, top-level listeners
- Incorrect vs correct examples per rule with stated impact metrics (e.g. 50–100MB idle memory)
- Prioritized from critical SW lifecycle through incremental API usage patterns
- Written for AI-assisted maintain, generate, and refactor extension codebases
- 40+ rules across 8 categories
- Manifest V3 (Chrome Extensions guide v0.1.0, Jan 2026)
- Service worker keep-alive anti-pattern cited up to 50–100MB idle memory per extension
Adoption & trust: 591 installs on skills.sh; 157 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your MV3 extension leaks memory, loses state on service worker restarts, or misses events because listeners were not registered the way Chrome expects.
Who is it for?
Indie builders using agents to create, maintain, or speed-audit Chrome extensions where MV3 service workers and content scripts are the riskiest surfaces.
Skip if: Non-extension web apps, Firefox-only add-ons, or teams that only need marketing copy for the Chrome Web Store listing.
When should I use this skill?
Maintaining, generating, or refactoring Chrome Extension (Manifest V3) codebases with an AI agent.
What do I get? / Deliverables
Refactored or generated extension code follows prioritized MV3 lifecycle and content-script rules with measurable performance guardrails before you ship to the store.
- Rule-aligned service worker and content script implementations
- Refactor notes mapped to prioritized MV3 performance categories
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Extension code is authored in build; this skill is shelved under frontend because UI, content scripts, and MV3 surfaces dominate the work. Frontend subphase covers extension pages, content scripts, and client-side patterns the guide optimizes.
Where it fits
Scaffold popup, options page, and content script wiring with top-level SW listeners from day one.
Shape message passing between content scripts and the service worker without brittle global state.
Run the categorized rule list against an existing extension before store submission.
Have the agent compare PR diffs to incorrect-vs-correct examples for SW lifecycle regressions.
How it compares
Opinionated MV3 performance rulebook for agents—not a generic React or Next.js frontend starter.
Common Questions / FAQ
Who is chrome-extension for?
Solo developers and agent workflows building Manifest V3 extensions who want consistent, high-impact performance patterns during codegen and refactors.
When should I use chrome-extension?
In build while implementing service workers and content scripts, and in ship during performance pass or pre-launch extension hardening.
Is chrome-extension safe to install?
Treat it as guidance that may drive file edits via your agent; review the Security Audits panel on this page and inspect generated code before publishing.
SKILL.md
READMESKILL.md - Chrome Extension
# Chrome Extensions **Version 0.1.0** Chrome Developer Relations January 2026 > **Note:** > This document is mainly for agents and LLMs to follow when maintaining, > generating, or refactoring codebases. Humans may also find it useful, > but guidance here is optimized for automation and consistency by AI-assisted workflows. --- ## Abstract Comprehensive performance optimization guide for Chrome Extensions (Manifest V3), designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (service worker lifecycle, content script optimization) to incremental (API usage patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation. --- ## Table of Contents 1. [Service Worker Lifecycle](references/_sections.md#1-service-worker-lifecycle) — **CRITICAL** - 1.1 [Avoid Artificial Service Worker Keep-Alive Patterns](references/sw-avoid-keepalive.md) — CRITICAL (reduces memory usage by 50-100MB per idle extension) - 1.2 [Persist State with chrome.storage Instead of Global Variables](references/sw-persist-state-storage.md) — CRITICAL (prevents complete state loss on SW termination) - 1.3 [Register Event Listeners at Top Level of Service Worker](references/sw-register-listeners-toplevel.md) — CRITICAL (prevents missed events when SW restarts) - 1.4 [Return true from Message Listeners for Async Responses](references/sw-return-true-async.md) — CRITICAL (prevents undefined responses and message channel closure) - 1.5 [Use chrome.alarms Instead of setTimeout/setInterval](references/sw-use-alarms-api.md) — CRITICAL (prevents timer callbacks from being lost on SW termination) - 1.6 [Use Offscreen Documents for DOM APIs](references/sw-use-offscreen-for-dom.md) — CRITICAL (enables DOM manipulation without content script injection) 2. [Content Script Optimization](references/_sections.md#2-content-script-optimization) — **CRITICAL** - 2.1 [Batch DOM Operations to Minimize Reflows](references/content-batch-dom-operations.md) — CRITICAL (reduces layout thrashing by 10-100×) - 2.2 [Minimize Content Script Bundle Size](references/content-minimize-script-size.md) — CRITICAL (reduces page load impact by 100-500ms per page) - 2.3 [Prefer Programmatic Injection Over Manifest Declaration](references/content-programmatic-injection.md) — CRITICAL (loads scripts only when user invokes feature) - 2.4 [Use document_idle for Content Script Injection](references/content-use-document-idle.md) — CRITICAL (eliminates page load blocking, faster initial render) - 2.5 [Use MutationObserver Instead of Polling for DOM Changes](references/content-use-mutation-observer.md) — CRITICAL (eliminates polling overhead, event-driven detection) - 2.6 [Use Specific URL Match Patterns Instead of All URLs](references/content-use-specific-matches.md) — CRITICAL (reduces script injection by 90%+, faster browsing) 3. [Message Passing Efficiency](references/_sections.md#3-message-passing-efficiency) — **HIGH** - 3.1 [Always Check chrome.runtime.lastError in Callbacks](references/msg-check-lasterror.md) — HIGH (prevents silent failures and memory leaks) - 3.2 [Avoid Broadcasting Messages to All Tabs](references/msg-avoid-broadcast-to-all-tabs.md) — HIGH (reduces message overhead from O(n) to O(1)) - 3.3 [Debounce High-Frequency Events Before Messaging](references/msg-debounce-frequent-events.md) — HIGH (reduces message volume by 90%+ for scroll/resize events) - 3.4 [Minimize Message Payload Size](references/msg-minimize-payload-size.md) — HIGH (reduces serialization overhead by 2-10×) - 3.5 [Use Port Connections for Frequent Message Exchange](references/msg-use-ports-for-frequent.md) — HIGH (reduces messaging overhead by 50-80% for repeated messages) 4. [Storage Operations](references/_sections.md#4-storage-operations) — **HIGH** - 4.1 [Avoi