extension-dev
Original:🇺🇸 English
Translated
Detect Chrome extension framework/stack, find proper docs, implement features, and debug across service worker, content script, and popup contexts.
31installs
Added on
NPX Install
npx skill4agent add quangpl/browser-extension-skills extension-devTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Extension Dev
Detect the stack, find docs, implement the feature, debug. Do NOT just explain — execute the workflow.
Workflow (Execute This)
Step 1: Detect framework and UI stack
Run detection (see ):
references/framework-detection.mdbash
ls wxt.config.ts plasmo.config.ts vite.config.ts manifest.json 2>/dev/null
cat package.json | grep -E '"wxt|plasmo|crxjs|react|vue|svelte"'| File found | Framework |
|---|---|
| WXT |
| Plasmo |
| CRXJS |
| Vanilla |
Step 2: Fetch framework docs and style guides
Use skill or web search to find proper docs for the detected stack.
docs-seekerExtension framework docs:
- WXT: https://wxt.dev/ | Plasmo: https://docs.plasmo.com/ | CRXJS: Vite plugin docs
- Chrome APIs: https://developer.chrome.com/docs/extensions/reference/api
- Permissions: https://developer.chrome.com/docs/extensions/reference/permissions-list
UI framework docs (fetch based on detected framework):
Code style guides (always follow):
- TypeScript: https://google.github.io/styleguide/tsguide.html
- JavaScript: https://google.github.io/styleguide/jsguide.html
Step 3: Implement the feature
Follow framework conventions:
- WXT: add entrypoints in , configure
entrypoints/wxt.config.ts - Plasmo: add pages/tabs/contents, use CSUI for content UI
- CRXJS: standard Vite + manifest-based setup
- Vanilla: edit , add JS files directly
manifest.json
For Chrome API usage, check .
For messaging between contexts, check .
references/chrome-api-quick-reference.mdreferences/message-passing-patterns.mdStep 4: Debug
See for context-specific DevTools access.
references/debugging-guide.mdQuick map:
| Context | How to inspect |
|---|---|
| Service worker | |
| Content script | Page DevTools → Console → select extension context |
| Popup | Right-click popup → Inspect |
| Options / Side panel | Open page → F12 |
Step 5: Hot reload setup
| Framework | Command | Notes |
|---|---|---|
| WXT | | Full HMR, auto-reloads extension |
| Plasmo | | HMR for popup/content |
| CRXJS | | Vite HMR |
| Vanilla | Manual | Reload at |
Chrome API Quick Reference (Top 20)
| API | Purpose | Permission |
|---|---|---|
| Query, create, update tabs | |
| Manage browser windows | |
| Persist data locally | |
| Sync data across devices | |
| Session-only data | |
| Toolbar icon, popup, badge | — |
| Right-click menu items | |
| Side panel UI | |
| Desktop notifications | |
| Inject scripts/CSS into pages | |
| Messaging, lifecycle, manifest | — |
| Intercept/modify network requests | |
| Block/redirect requests declaratively | |
| Track page navigation events | |
| OAuth2, Google Sign-In | |
| Schedule periodic tasks | |
| Keyboard shortcuts | |
| Read/write cookies | |
| Browser history access | |
| Read/write bookmarks | |
Message Passing (Quick Pattern)
One-time (popup → service worker):
ts
// sender
const response = await chrome.runtime.sendMessage({ type: 'GET_DATA' });
// receiver (background)
chrome.runtime.onMessage.addListener((msg, sender, reply) => {
if (msg.type === 'GET_DATA') { reply({ data: '...' }); return true; }
});Content script → service worker: same pattern, for async.
Tab-targeted (background → content):
return truets
chrome.tabs.sendMessage(tabId, { type: 'ACTION' });Full patterns in .
references/message-passing-patterns.mdReferences
- — detect WXT/Plasmo/CRXJS/vanilla, dev commands
references/framework-detection.md - — UI framework docs, style guides, extension framework docs
references/framework-styleguides.md - — 30+ APIs with permissions and doc links
references/chrome-api-quick-reference.md - — all messaging patterns with TypeScript examples
references/message-passing-patterns.md - — DevTools per context, common errors, tips
references/debugging-guide.md
Related Skills
- — scaffold new extension with WXT
extension-create - — generate/validate manifest.json
extension-manifest - — write and run extension tests
extension-test - — analyze existing extension codebase
extension-analyze