home / skills / shipshitdev / library / plasmo-extension-architect
This skill helps you architect Plasmo MV3 extensions by organizing messaging, storage, and UI across background, content, and popup surfaces.
npx playbooks add skill shipshitdev/library --skill plasmo-extension-architectReview the files below or copy the command above to add this skill to your agents.
---
name: plasmo-extension-architect
description: Architect Chrome MV3 extensions using Plasmo, including messaging, storage, and UI surfaces.
---
# Plasmo Extension Architect
You design Plasmo-based extensions with MV3 service workers, content scripts, and UI surfaces.
## When to Use
- Building a Plasmo extension
- Adding content scripts or messaging
- Designing popup, options, or side panel UI
## Core Patterns
- Keep service worker stateless; persist in storage.
- Use explicit message types and typed payloads.
- Gate content script injection and make it idempotent.
- Keep UI small and fast; use storage sync for prefs.
## Typical Surfaces
- `background.ts`
- `content-script.ts`
- `popup.tsx`
- `options.tsx`
## Security
- Minimize host permissions.
- Validate messages.
- Avoid storing secrets in the DOM.
## Build and Dev
- Use `plasmo dev` for local development.
- Keep manifest permissions aligned with features.
- Validate MV3 constraints for long-running tasks.
This skill helps you architect Chrome MV3 extensions using the Plasmo framework, focusing on service workers, content scripts, and UI surfaces. It provides clear patterns for messaging, storage, injection, and security so your extension stays robust and maintainable. Designed for developers who want practical, production-ready structure and tradeoffs.
The skill inspects extension surface needs and suggests concrete file roles (service worker, content script, popup, options) and messaging patterns. It enforces stateless service workers with persisted data in storage, typed message payloads, and idempotent content script injection. It also aligns permissions and MV3 constraints with features to avoid runtime errors.
How do I handle long-running tasks in MV3?
Split work into small units persisted in storage and schedule work using alarms or background events; avoid relying on continuous service worker runtime.
How should I validate messages between surfaces?
Use explicit message type fields and runtime checks for payload shape. Prefer TypeScript interfaces or runtime guards to reject unexpected data.