К основному содержанию
скилл CX Codex

chrome-extension-development — скилл для Claude Code: разработка

Ведёт агента по сборке расширений Chrome на Manifest V3: манифест, service worker, content scripts, попап, публикация в Chrome Web Store.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Mindrally/skills --skill chrome-extension-development -a claude-code
Открыть на GitHub

Что делает chrome-extension-development

Скилл задаёт порядок работы над расширением Chrome. Сначала структура проекта с manifest.json, фоновым service worker, content scripts и попапом. Дальше настройка манифеста в формате Manifest V3: разрешения, matches для content scripts, регистрация service worker, параметры action.

Внутри есть готовые примеры кода. Минимальный манифест с permissions, action, background и content_scripts. Service worker на TypeScript с обработкой chrome.runtime.onInstalled, обменом сообщениями через chrome.runtime.onMessage и периодическими задачами на chrome.alarms. Отдельные разделы про chrome.storage.local и chrome.storage.sync, chrome.i18n, ARIA-метки и адаптацию попапа под клавиатуру.

Скилл требует строго следовать Manifest V3, поэтому старый код на Manifest V2 агент переписывать не станет — это повод проверить, что у вас уже не осталось фоновых страниц вместо service worker. Разрешения советует выдавать по принципу наименьших привилегий. Для отладки расширение грузится распакованным через chrome://extensions, а service worker и content scripts смотрят в Chrome DevTools.

Какие задачи решает

  • собрать структуру расширения с нуля под Manifest V3
  • настроить обмен сообщениями между service worker и content script
  • сохранить настройки пользователя в chrome.storage
  • запланировать периодическую задачу через chrome.alarms
  • подготовить иконки, скриншоты и политику конфиденциальности для Chrome Web Store

Примеры запросов агенту

  • Создай расширение Chrome на Manifest V3: попап, content script и service worker с обменом сообщениями
  • Проверь мой manifest.json — не запрошены ли лишние разрешения?
  • Добавь в service worker периодическую синхронизацию через chrome.alarms

Как установить chrome-extension-development

1Через Skills CLI (Vercel)

npx skills add Mindrally/skills --skill chrome-extension-development -a claude-code

2Вручную: положить файлы

~/.claude/skills/chrome-extension-development/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/chrome-extension-development/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о chrome-extension-development

Как установить chrome-extension-development в Claude?

Выполните npx skills add Mindrally/skills --skill chrome-extension-development -a claude-code. После этого файл скилла лежит в ~/.claude/skills/chrome-extension-development/SKILL.md.

Что делает chrome-extension-development?

Даёт агенту инструкции по разработке расширений Chrome: структура проекта, манифест Manifest V3, service worker, content scripts, попап, хранилище, тестирование и публикация.

С какими версиями манифеста работает скилл?

Только Manifest V3. Фоновые скрипты оформляются как service worker, а разрешения предлагается выдавать по принципу наименьших привилегий.

Исходный текст

SKILL.md · Apache-2.0
---
name: chrome-extension-development
description: "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."
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Chrome Extension Development

This skill provides expert-level guidance for Chrome extension development, covering JavaScript/TypeScript, browser extension APIs, and modern web development practices.

## Workflow: Building a Chrome Extension from Scratch

1. **Initialize the project** — Create the directory structure with `manifest.json`, background service worker, content scripts, and popup files.
2. **Configure the manifest** — Define permissions, content script matches, service worker registration, and action settings in Manifest V3 format.
3. **Implement the background service worker** — Set up event listeners for extension lifecycle, messaging, and alarms using the `chrome.*` API.
4. **Build content scripts** — Write scripts that interact with web page DOM, communicate with the background worker via `chrome.runtime.sendMessage`, and respect CSP.
5. **Create the popup UI** — Design the popup HTML/CSS and wire up interactivity with the background and content scripts.
6. **Add storage and state management** — Use `chrome.storage.local` or `chrome.storage.sync` to persist user settings and extension state.
7. **Test and debug** — Load the extension unpacked via `chrome://extensions`, use Chrome DevTools to inspect the service worker and content scripts, and run unit tests.
8. **Package and publish** — Prepare store assets (icons, screenshots, description), create a privacy policy, and submit to the Chrome Web Store.

## Example: Minimal Manifest V3 Configuration

```json
{
  "manifest_version": 3,
  "name": "My Extension",
  "version": "1.0.0",
  "description": "A sample Chrome extension using Manifest V3",
  "permissions": ["storage", "activeTab"],
  "action": {
    "default_popup": "popup/popup.html",
    "default_icon": {
      "16": "icons/icon16.png",
      "48": "icons/icon48.png",
      "128": "icons/icon128.png"
    }
  },
  "background": {
    "service_worker": "background/service-worker.js",
    "type": "module"
  },
  "content_scripts": [
    {
      "matches": ["https://*.example.com/*"],
      "js": ["content/content-script.js"],
      "css": ["content/styles.css"]
    }
  ]
}
```

## Example: Background Service Worker with Messaging

```typescript
// 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');
  }
});
```

## Code Style and Structure

- Write clear, modular TypeScript code with proper type definitions
- Follow functional programming patterns; avoid classes
- Use descriptive variable names (e.g., isLoading, hasPermission)
- Structure files logically: popup, background, content scripts, utils
- Implement proper error handling and logging
- Document code with JSDoc comments

## Architecture and Best Practices

- Strictly follow Manifest V3 specifications
- Divide responsibilities between background, content scripts and popup
- Configure permissions following the principle of least privilege
- Use modern build tools (webpack/vite) for development
- Implement proper version control and change management

## Chrome API Usage

- Use chrome.* APIs correctly (storage, tabs, runtime, etc.)
- Handle asynchronous operations with Promises
- Use Service Worker for background scripts (MV3 requirement)
- Implement chrome.alarms for scheduled tasks
- Use chrome.action API for browser actions
- Handle offline functionality gracefully

## Security and Privacy

- Implement Content Security Policy (CSP)
- Handle user data securely
- Prevent XSS and injection attacks
- Use secure messaging between components
- Handle cross-origin requests safely
- Implement secure data encryption
- Follow web_accessible_resources best practices

## Performance and Optimization

- Minimize resource usage and avoid memory leaks
- Optimize background script performance
- Implement proper caching mechanisms
- Handle asynchronous operations efficiently
- Monitor and optimize CPU/memory usage

## UI and User Experience

- Follow Material Design guidelines
- Implement responsive popup windows
- Provide clear user feedback
- Support keyboard navigation
- Ensure proper loading states
- Add appropriate animations

## Internationalization

- Use chrome.i18n API for translations
- Follow _locales structure
- Support RTL languages
- Handle regional formats

## Accessibility

- Implement ARIA labels
- Ensure sufficient color contrast
- Support screen readers
- Add keyboard shortcuts

## Testing and Debugging

- Use Chrome DevTools effectively
- Write unit and integration tests
- Test cross-browser compatibility
- Monitor performance metrics
- Handle error scenarios

## Publishing and Maintenance

- Prepare store listings and screenshots
- Write clear privacy policies
- Implement update mechanisms
- Handle user feedback
- Maintain documentation

## Follow Official Documentation

- Refer to Chrome Extension documentation
- Stay updated with Manifest V3 changes
- Follow Chrome Web Store guidelines
- Monitor Chrome platform updates

## Output Expectations

- Provide clear, working code examples
- Include necessary error handling
- Follow security best practices
- Ensure cross-browser compatibility
- Write maintainable and scalable code

© Mindrally · Apache-2.0 · Mindrally/skills

Похожие скиллы

Все скиллы по теме «Браузер и парсинг» →
chrome-extension pproenca Скилл с 67 правилами по Chrome Extensions на Manifest V3. Пригодится, когда пишете service worker, content script или мигрируете с MV2. CX Codex +1 717установок chrome-extension-dev-js-typescript-cursorrules-pro PatrickJS Правило для Cursor, которое настраивает агента писать код расширений Chrome на JavaScript и TypeScript по единому своду соглашений. ★ 41 011звёзд репо chrome-extension-ui pproenca Набор правил по интерфейсу расширений Chrome: где ставить popup, где side panel, как сделать доступную навигацию и понятные состояния загрузки. CX Codex +1 719установок chrome-extensions GoogleChrome Помогает создавать и публиковать расширения для Chrome по стандартам Manifest V3. Задаёт правила для фоновых скриптов, боковых панелей и разрешений. CX Codex +1 10 900установок browser-extension-builder sickn33 Скилл помогает проектировать браузерные расширения на Manifest V3 для Chrome и Firefox. Пригодится при настройке архитектуры скриптов, фоновых воркеров и обмена сообщениями. CX Codex +1 2 000установок clerk-chrome-extension-patterns clerk Набор инструкций по интеграции @clerk/chrome-extension в браузерные расширения. Помогает настроить вход в popup, сессии в service worker и делегирование OAuth через веб-приложение. CX Codex +1 14 400установок

Из того же набора168

fastapi-python Задаёт агенту стиль разработки на FastAPI: async, Pydantic v2, обработка ошибок и структура роутеров. Пригодится, когда пишете API на Python. CX Codex +1 13 900установок web-scraping Скилл задаёт агенту правила парсинга: какие библиотеки брать для статики, динамики и больших обходов, как обходить блокировки и ошибки. CX Codex +1 4 500установок computer-vision-opencv Скилл задаёт агенту рамки работы с изображениями и видео: OpenCV, PyTorch, аугментации, трекинг. Пригодится, когда в проекте есть пайплайны обработки кадров. CX Codex +1 3 800установок framer-motion Задаёт агенту правила анимаций на Motion: что анимировать, а что ломает раскладку. Пригодится, когда в проекте уже есть React и TypeScript. CX Codex +1 3 000установок mysql-best-practices Скилл задаёт агенту правила проектирования схем MySQL, индексов и оптимизации запросов. Пригодится, когда агент пишет миграции или разбирает медленный запрос. CX Codex +1 2 700установок odoo-development Скилл для ИИ-агента, который подсказывает, как писать модули Odoo: модели на Python ORM, XML-представления, права доступа. CX Codex +1 2 300установок expo-react-native-typescript Скилл задаёт агенту правила разработки мобильных приложений на Expo, React Native и TypeScript: структура файлов, навигация, состояние, тесты. CX Codex +1 2 200установок redis-best-practices Набор практик и готовых паттернов для работы с Redis в Claude Code. Помогает настроить структуры данных, инвалидацию кэша и блокировки без ошибок. CX Codex +1 2 200установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой