xiaohongshu
xiaohongshu
browser-ext-creator
ブラウザ拡張機能の開発を支援するスキル。Chrome (Manifest V3) と Firefox に対応したブラウザ拡張を設計・実装する。以下の状況で使用: (1) ユーザーが「ブラウザ拡張を作って」「Chrome拡張を実装して」「Firefox拡張を開発して」と依頼した時、(2) ユーザーが明示的に「/browser-ext-creator」を実行した時、(3) 特定のウェブサイトの機能拡張や自動化を求められた時、(4) content script、background script、popup UIなどの拡張機能コンポーネントの実装が必要な時
Full skill instructions
ブラウザ拡張機能(Chrome Manifest V3 / Firefox)の設計・実装を支援するスキル。
1. 要件収集 → AskUserQuestion で機能仕様を確認
2. 設計 → プロジェクト構造とファイル構成を決定
3. 実装 → テンプレートをベースにコード生成
4. レビュー → セキュリティ・パフォーマンス観点で自己評価
AskUserQuestion ツールで以下を確認する:
https://www.youtube.com/watch*)chrome.storage.sync / chrome.storage.local の使用extension-name/
├── manifest.json # 拡張機能の設定(Manifest V3)
├── content-script.js # 対象ページに注入されるスクリプト
├── background.js # Service Worker(バックグラウンド処理)
├── popup/
│ ├── popup.html # ポップアップUI
│ ├── popup.css
│ └── popup.js
├── options/
│ ├── options.html # 設定ページUI
│ ├── options.css
│ └── options.js
├── styles/
│ └── content.css # ページ埋め込みスタイル
└── icons/
├── icon16.png
├── icon48.png
└── icon128.png
Firefox はほぼ同じ構造だが、manifest.json に差異あり(browser_specific_settings が必要)。
{
"manifest_version": 3,
"name": "Extension Name",
"version": "1.0.0",
"description": "Extension description",
"permissions": [],
"host_permissions": ["https://example.com/*"],
"action": {
"default_popup": "popup/popup.html",
"default_icon": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
},
"content_scripts": [
{
"matches": ["https://example.com/*"],
"js": ["content-script.js"],
"css": ["styles/content.css"]
}
],
"background": {
"service_worker": "background.js"
},
"options_ui": {
"page": "options/options.html",
"open_in_tab": true
}
}
// content-script.js
(() => {
'use strict';
// Wait for page load
const init = () => {
// Avoid duplicate initialization
if (document.querySelector('#my-extension-container')) return;
// Create UI element
const container = document.createElement('div');
container.id = 'my-extension-container';
container.textContent = 'Extension Loaded';
document.body.appendChild(container);
};
// Handle SPA navigation
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
// Observe URL changes for SPA
let lastUrl = location.href;
new MutationObserver(() => {
if (location.href !== lastUrl) {
lastUrl = location.href;
init();
}
}).observe(document.body, { subtree: true, childList: true });
})();
// background.js
chrome.runtime.onInstalled.addListener(() => {
console.log('Extension installed');
});
// Message handler
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === 'fetchData') {
fetchData(request.url)
.then(data => sendResponse({ success: true, data }))
.catch(error => sendResponse({ success: false, error: error.message }));
return true; // Keep message channel open for async response
}
});
const fetchData = async (url) => {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
};
// Save settings
const saveSettings = async (settings) => {
await chrome.storage.sync.set(settings);
};
// Load settings
const loadSettings = async () => {
return chrome.storage.sync.get({
// Default values
apiKey: '',
enabled: true
});
};
生成したコードを以下の観点で評価:
manifest_version: 3 を使用host_permissions で必要なドメインのみ許可eval, new Function)を使用していないtextContent 使用 or DOMPurify でサニタイズ| 項目 | 規約 |
|---|---|
| ファイル名 | ケバブケース(例: content-script.js) |
| 変数名 | キャメルケース(例: selectedElement) |
| 関数 | アロー関数を優先 |
| エラー処理 | try-catch で適切に例外処理 |
詳細な技術情報:
プロジェクトテンプレート:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience