OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add mindrally/skills --skill chrome-extension-development
Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices. Use when building browser extensions, creating popup UIs, implementing content scripts, working with Chrome APIs, managing extension permissions, or publishing to Chrome Web Store.
npx skills add mindrally/skills --skill chrome-extension-development
This skill provides expert-level guidance for Chrome extension development, covering JavaScript/TypeScript, browser extension APIs, and modern web development practices.
manifest.json, background service worker, content scripts, and popup files.chrome.* API.chrome.runtime.sendMessage, and respect CSP.chrome.storage.local or chrome.storage.sync to persist user settings and extension state.chrome://extensions, use Chrome DevTools to inspect the service worker and content scripts, and run unit tests.// background/service-worker.ts
// Listen for extension install or update
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason === 'install') {
chrome.storage.local.set({ initialized: true, count: 0 });
console.log('Extension installed');
}
});
// Handle messages from content scripts or popup
chrome.runtime.onMessage.addListener(
(message: { type: string; payload?: unknown }, sender, sendResponse) => {
if (message.type === 'GET_COUNT') {
chrome.storage.local.get('count', (result) => {
sendResponse({ count: result.count ?? 0 });
});
return true; // keep message channel open for async response
}
if (message.type === 'INCREMENT') {
chrome.storage.local.get('count', (result) => {
const newCount = (result.count ?? 0) + 1;
chrome.storage.local.set({ count: newCount }, () => {
sendResponse({ count: newCount });
});
});
return true;
}
}
);
// Schedule periodic tasks with chrome.alarms
chrome.alarms.create('sync-data', { periodInMinutes: 30 });
chrome.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === 'sync-data') {
console.log('Running scheduled sync');
}
});