extension-lifecycle-decoupling

Inspect MV3 service worker lifecycle events for unintended application side effects.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MajorLift/metamask-extension-skills --skill extension-lifecycle-decoupling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extension-lifecycle-decoupling
Source: https://github.com/MajorLift/metamask-extension-skills/tree/main/domains/platform/skills/extension-lifecycle-decoupling
Command: npx skills add https://github.com/MajorLift/metamask-extension-skills --skill extension-lifecycle-decoupling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Verifies that platform lifecycle events in the extension environment do not inadvertently trigger application-level side effects, reducing flaky behavior during MV3 service worker eviction and related lifecycle transitions.

Core Features & Use Cases

  • Clarifies the distinction between platform lifecycle events and application behavior.
  • Provides a practical checklist for debugging lifecycle-induced issues across eviction, keepalive, and state persistence.
  • Guides safe verification in scenarios involving service workers, storage interfaces, and background scripts.

Quick Start

Run the verification checklist against the extension's MV3 service worker lifecycle to confirm that platform events do not cause unintended app behavior.

Frequently Asked Questions about extension-lifecycle-decoupling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Chrome extension service worker produce unintended side effects after eviction?

Service worker eviction triggers unintended side effects when platform lifecycle events inadvertently execute application-level logic. Verifying state persistence and lifecycle guardrails prevents flaky behavior during MV3 background script transitions.

How do I debug MV3 service worker lifecycle issues and state persistence?

Debug MV3 service worker lifecycle issues by applying a verification checklist across eviction, keepalive, and state persistence scenarios. Inspect explicit handlers and storage backends like chrome.storage.session and IndexedDB to verify reliable extension behavior.

Does chrome.storage.session work for maintaining state during service worker eviction?

chrome.storage.session maintains state during service worker eviction when paired with explicit lifecycle handlers. Verifying persistence strategies across storage backends ensures platform lifecycle events do not cause unintended application-level side effects.

What's the best way to verify lifecycle events before app-side effects in extensions?

The best way to verify lifecycle events before app-side effects is mapping checks to explicit handlers and guardrails for MV3 service worker transitions. Validate persistence behavior across storage interfaces to ensure reliable extension behavior.

Can IndexedDB persistence strategies prevent flaky behavior during page unload scenarios?

IndexedDB persistence strategies prevent flaky behavior during page unload scenarios by ensuring state survives platform lifecycle events. Apply verification checks to confirm storage backends do not trigger unintended application-level side effects.