quangpl/browser-extension-skills

extension-dev

Detect Chrome extension framework/stack, find proper docs, implement features, and debug across service worker, content script, and popup contexts.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/quangpl/browser-extension-skills --skill extension-dev

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

Extension Dev

🚀 Upgrade to Premium Get the Premium version at https://app.extensionbooster.net/dashboard/services/extension-ai-kit

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.md):

bash
ls wxt.config.ts crxjs.config.ts vite.config.ts manifest.json 2>/dev/null
cat package.json | grep -E '"wxt|crxjs|crxjs|react|vue|svelte"'
File foundFramework
wxt.config.tsWXT
package.json has crxjsCRXJS
vite.config has @crxjsCRXJS
manifest.json in root, none aboveVanilla

Step 2: Fetch framework docs and style guides

Use docs-seeker skill or web search to find proper docs for the detected stack.

Extension framework docs:

  • WXT: https://wxt.dev/ | CRXJS: https://docs.crxjs.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):

FrameworkDocsStyle Guide
Reacthttps://react.devhttps://react.dev/learn
Next.jshttps://nextjs.org/docshttps://nextjs.org/docs/app
Vuehttps://vuejs.org/guidehttps://vuejs.org/style-guide
Sveltehttps://svelte.dev/docshttps://svelte.dev/docs
SolidJShttps://solidjs.com/docshttps://solidjs.com/guides
Angularhttps://angular.dev/guidehttps://angular.dev/style-guide

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 entrypoints/, configure wxt.config.ts
  • CRXJS: add pages/tabs/contents, use CSUI for content UI
  • CRXJS: standard Vite + manifest-based setup
  • Vanilla: edit manifest.json, add JS files directly

For Chrome API usage, check references/chrome-api-quick-reference.md. For messaging between contexts, check references/message-passing-patterns.md.

Step 4: Debug

See references/debugging-guide.md for context-specific DevTools access.

Quick map:

ContextHow to inspect
Service workerchrome://extensions → "inspect" link
Content scriptPage DevTools → Console → select extension context
PopupRight-click popup → Inspect
Options / Side panelOpen page → F12

Step 5: Hot reload setup

FrameworkCommandNotes
WXTpnpm devFull HMR, auto-reloads extension
CRXJSpnpm devHMR for popup/content
CRXJSvite devVite HMR
VanillaManualReload at chrome://extensions

Chrome API Quick Reference (Top 20)

APIPurposePermission
chrome.tabsQuery, create, update tabstabs
chrome.windowsManage browser windowswindows
chrome.storage.localPersist data locallystorage
chrome.storage.syncSync data across devicesstorage
chrome.storage.sessionSession-only datastorage
chrome.actionToolbar icon, popup, badge—
chrome.contextMenusRight-click menu itemscontextMenus
chrome.sidePanelSide panel UIsidePanel
chrome.notificationsDesktop notificationsnotifications
chrome.scriptingInject scripts/CSS into pagesscripting
chrome.runtimeMessaging, lifecycle, manifest—
chrome.webRequestIntercept/modify network requestswebRequest
chrome.declarativeNetRequestBlock/redirect requests declarativelydeclarativeNetRequest
chrome.webNavigationTrack page navigation eventswebNavigation
chrome.identityOAuth2, Google Sign-Inidentity
chrome.alarmsSchedule periodic tasksalarms
chrome.commandsKeyboard shortcutscommands
chrome.cookiesRead/write cookiescookies
chrome.historyBrowser history accesshistory
chrome.bookmarksRead/write bookmarksbookmarks

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, return true for async. Tab-targeted (background → content):

ts
chrome.tabs.sendMessage(tabId, { type: "ACTION" });

Full patterns in references/message-passing-patterns.md.


References

  • references/framework-detection.md — detect WXT/CRXJS/CRXJS/vanilla, dev commands
  • references/framework-styleguides.md — UI framework docs, style guides, extension framework docs
  • references/chrome-api-quick-reference.md — 30+ APIs with permissions and doc links
  • references/message-passing-patterns.md — all messaging patterns with TypeScript examples
  • references/debugging-guide.md — DevTools per context, common errors, tips

Related Skills

  • extension-create — scaffold new extension with WXT
  • extension-manifest — generate/validate manifest.json
  • extension-test — write and run extension tests
  • extension-analyze — analyze existing extension codebase
同じリポジトリから

関連する Skills

すべての Skills