chrome-extension-dev
Skill2 starsChanged 50 days agoMITView on GitHub
Use to build, scaffold, or debug a Chrome/Edge/Brave extension — Manifest V3, a WXT project, a content script, a background service worker, popup/options UI, chrome.storage, message passing, or in-page floating UI. Trigger phrases: "build a chrome extension", "manifest v3", "content script", "WXT", "background service worker", "chrome.storage", "extension popup", "inject UI into a page". Covers project setup (WXT + React + TS, or plain Vite/CRXJS), MV3 entrypoints, typed messages with sender validation, storage.local vs sync with quotas, alarms, a stable dev extension ID via manifest key, closed-Shadow-DOM UI with viewport-aware positioning, safe text insertion into textarea/contenteditable/rich editors, optional-permission gating, Vitest + Playwright e2e, build/zip packaging. Distilled from a shipped extension. Does NOT cover OAuth/auth, payments/billing, store listing copy, or CI/CD deploy — see chrome-extension-auth, chrome-extension-payments, chrome-web-store-listing, chrome-extension-deploy.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- aktsmm/Agent-Skillstheir own version, first seen Nov 8, 2026
- Aias00/agent-skillstheir own version, first seen Mar 24, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- aktsmm/Agent-Skills★ 26same name
- Aias00/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 20
If the task touches those, do the extension-engineering part here and hand off the rest.
- Very specific: line 24
Pick the stack: Default to WXT + TypeScript unless the decision table in references/project-setup.md says otherwise.
- Distinctive: line 38
Build content-script UI in a closed Shadow DOM: Never inject into the page's own DOM tree.
- Very specific: line 39
Follow references/content-script-ui.md for host creation, positioning (flip/clamp to viewport), isTrusted guards, sensitive-field …
- Very specific: line 98
Never commit .env files, OAuth client secrets, API keys, or the dev signing key pair to a public repo.
- Distinctive: line 100
Never log tokens, session cookies, or full API responses containing user data from the background script or content script — both can end …
- Very specific: line 105
Treat all content-script DOM events as page-controlled unless event.isTrusted === true.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chrome Extension Dev (Manifest V3)
Scope
This skill handles the extension engineering problem: MV3 project setup, entrypoints, message passing, storage, content-script UI, permissions, testing, and packaging.
It does not handle:
- OAuth / sign-in flows, session tokens →
chrome-extension-auth - Payments, billing, entitlements →
chrome-extension-payments - Store listing copy, screenshots, privacy policy →
chrome-web-store-listing - CI/CD, release automation, store upload →
chrome-extension-deploy
If the task touches those, do the extension-engineering part here and hand off the rest.
Workflow
- Pick the stack. Default to WXT + TypeScript unless the decision table in
references/project-setup.mdsays otherwise. Scaffold with the layout andwxt.config.tspattern in that file, including the devkeyfor a stable extension ID (assets/wxt.config.template.ts). - Design entrypoints before writing code. Decide what runs in the background service worker
vs content script vs popup/options vs offscreen document. Read
references/mv3-architecture.mdfor the responsibility split and service-worker lifetime rules. - Define the message contract first. One discriminated union per direction, validated at the
runtime.onMessageboundary. Readreferences/messaging-and-storage.mdbefore writing a singlesendMessagecall. - Choose storage areas deliberately.
localis the source of truth;syncis opt-in, quota-limited, and needs conflict resolution. Same reference file covers quotas and the dirty-queue + alarm pattern. - Build content-script UI in a closed Shadow DOM. Never inject into the page's own DOM tree.
Follow
references/content-script-ui.mdfor host creation, positioning (flip/clamp to viewport),isTrustedguards, sensitive-field exclusion, and the "insert exactly once, verify, fall back to clipboard" pattern for textarea/contenteditable/ProseMirror-like editors. - Minimize permissions. Request the smallest permission set in the base manifest; gate
anything sensitive (e.g.
clipboardRead) behindoptional_permissionsand a user gesture from an extension page. See the table below andreferences/mv3-architecture.md. - Wire env/config at build time.
VITE_*variables with safe local defaults; never let a production build silently point at localhost. Seereferences/project-setup.md. - Write tests as you go. Vitest for pure logic (trigger matching, guards, storage merge
logic) with
happy-dom; Playwright for the real unpacked extension (persistent context, service worker, fixture pages). Readreferences/testing.mdbefore wiring either. - Build and package deliberately.
wxt buildfor unpacked/dev,wxt zip --mode storefor the Chrome Web Store upload (this must not carry the devkey). Naming and versioning inreferences/project-setup.md. - Before calling it done, check
references/pitfalls.md— real bugs from a shipped extension (broken OAuth from a random store ID, a menu invisible at the bottom of the screen, keyup resetting a keyboard highlight, a zip build overwriting the dev build, e2e unable to query tabs). Each entry names the symptom, the cause, and the fix.
Decision tables
Stack
| Situation | Choose |
| New MV3 extension, needs a UI framework, wants a fast dev loop with HMR | WXT + React + TypeScript (this skill's default) |
| Team already has a Vite setup they want to keep, or needs a browser API WXT doesn't wrap yet | Plain Vite + @crxjs/vite-plugin |
| Extension is a single content script with no UI and no build step justified | Hand-written manifest.json + esbuild/tsc, no framework |
| Needs Manifest V2 | Out of scope — MV2 is being phased out; do not build new MV2 extensions |
Storage area
| Need | Use |
| Source of truth, large data, no cross-device sync required | chrome.storage.local (request unlimitedStorage if it can grow) |
| Small, cross-device data (settings, small records) | chrome.storage.sync, mirrored from local, quota-checked before every write |
| One-shot handoff between background and a not-yet-open popup | chrome.storage.session |
| Anything bigger than the sync per-item quota | Keep it local-only; do not force it into sync |
Permission
| Need | Use |
| Needed for the extension to function at all, on install | Base permissions |
| Sensitive, or only needed for a paid tier / opt-in feature | optional_permissions, requested via chrome.permissions.request from an extension page on a user gesture (never from a content script) |
| Only need the current tab when the user invokes the extension | activeTab, not a broad host permission |
| Need to enumerate/query tabs by URL | Add the tabs permission explicitly — activeTab alone will not expose tab URLs to tabs.query |
Reference files
references/project-setup.md— monorepo layout,wxt.config.ts, dev key, env vars, build/zip/versioningreferences/mv3-architecture.md— entrypoints, service worker lifetime, alarms, offscreen documents, permissionsreferences/content-script-ui.md— closed Shadow DOM, positioning, guards, text insertion strategiesreferences/messaging-and-storage.md— typed messages, sender validation, storage quotas and sync mergereferences/testing.md— Vitest unit tests, Playwright e2e against an unpacked buildreferences/pitfalls.md— real bugs and fixes, checked before shipping
Security
- Never commit
.envfiles, OAuth client secrets, API keys, or the dev signingkeypair to a public repo; keep the dev key file gitignored and documented as regenerable. - Never log tokens, session cookies, or full API responses containing user data from the background script or content script — both can end up in bug reports.
- Validate every
runtime.onMessagesender before acting on privileged messages (seereferences/messaging-and-storage.md); a content script runs in the page's renderer and must be treated as less trusted than the extension's own pages. - Treat all content-script DOM events as page-controlled unless
event.isTrusted === true.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

