chrome-extension-developer

Expert in building Chrome Extensions using Manifest V3. Covers background scripts, service workers, content scripts, and cross-context communication.

31,392 stars
Complexity: medium

About this skill

This skill transforms an AI agent into a senior Chrome Extension Developer, proficient in the modern Manifest V3 architecture. It encompasses the entire development lifecycle, from designing new extensions and migrating existing ones from Manifest V2, to implementing crucial components like service workers, content scripts, and interactive UI elements (popup/options pages). The skill also facilitates complex cross-context communication within extensions and guides the use of various extension-specific APIs (e.g., storage, permissions, alarms, side panel), while emphasizing production-ready security practices and effective debugging techniques.

Best use case

Developing new Chrome Extensions from scratch. Migrating existing Manifest V2 extensions to Manifest V3. Implementing core extension components like service workers, content scripts, popup/options pages. Debugging inter-context communication issues within extensions. Utilizing Chrome Extension-specific APIs such as storage, permissions, and alarms.

Expert in building Chrome Extensions using Manifest V3. Covers background scripts, service workers, content scripts, and cross-context communication.

Well-structured, Manifest V3 compliant Chrome Extension code. Functional implementation of service workers, content scripts, and UI pages. Robust solutions for cross-context communication and data persistence. Clear debugging strategies and insights for extension-related issues. Successful migration paths for Manifest V2 extensions to the V3 standard.

Practical example

Example input

I need a Manifest V3 Chrome Extension that displays a 'Hello World' popup, injects a content script to change the background color of visited pages to light blue, and uses a service worker to log when the extension is installed. Provide all necessary files (manifest.json, service-worker.js, content-script.js, popup.html, popup.js) and instructions.

Example output

```json
// manifest.json
{
  "manifest_version": 3,
  "name": "Hello World Extension",
  "version": "1.0",
  "description": "A simple Hello World Chrome Extension with content script and service worker.",
  "permissions": ["activeTab", "scripting"],
  "host_permissions": ["<all_urls>"],
  "action": {
    "default_popup": "popup.html",
    "default_icon": {
      "16": "icons/icon16.png",
      "48": "icons/icon48.png",
      "128": "icons/icon128.png"
    }
  },
  "background": {
    "service_worker": "service-worker.js"
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["content-script.js"],
      "run_at": "document_idle"
    }
  ]
}
```

```javascript
// service-worker.js
chrome.runtime.onInstalled.addListener(() => {
  console.log('Hello World Extension installed successfully!');
});
```

```javascript
// content-script.js
document.body.style.backgroundColor = 'lightblue';
console.log('Background color changed by content script!');
```

```html
// popup.html
<!DOCTYPE html>
<html>
<head>
  <title>Hello World</title>
  <style>
    body { width: 200px; height: 100px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-family: sans-serif; }
    h1 { color: #333; }
  </style>
</head>
<body>
  <h1>Hello, Chrome Extension!</h1>
</body>
</html>
```

Here's how to set up and run this extension:
1.  Create a new directory named `hello_extension`.
2.  Inside `hello_extension`, create a subfolder named `icons`. Place placeholder `icon16.png`, `icon48.png`, and `icon128.png` files (e.g., empty transparent PNGs) in the `icons` folder.
3.  Save the `manifest.json`, `service-worker.js`, `content-script.js`, and `popup.html` files into the `hello_extension` directory.
4.  Open Google Chrome and navigate to `chrome://extensions/`.
5.  Enable "Developer mode" using the toggle in the top-right corner.
6.  Click the "Load unpacked" button.
7.  Select the `hello_extension` directory you created.
8.  The "Hello World Extension" should now appear in your list of extensions. Click on its icon in the Chrome toolbar to see the popup, and visit any webpage to observe the background color change. The installation log will be visible in the service worker's console (accessible via the extension's "Inspect views: Service Worker" link on the `chrome://extensions/` page).

When to use this skill

  • When you need to rapidly prototype or build a new Chrome Extension.
  • To ensure your extension adheres to the latest Manifest V3 standards and best practices.
  • For intelligent assistance in troubleshooting complex communication flows between extension scripts.
  • When you require guidance on integrating Chrome's powerful extension APIs into your project.

When not to use this skill

  • For developing extensions for browsers other than Chrome (e.g., Firefox, Edge, Safari).
  • For general web development tasks not specific to Chrome Extension architecture.
  • When the task primarily involves graphic design or advanced UI/UX outside of code implementation.
  • For Manifest V2 specific development where migration is not the goal.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/chrome-extension-developer/SKILL.md --create-dirs "https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/plugins/antigravity-awesome-skills-claude/skills/chrome-extension-developer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/chrome-extension-developer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How chrome-extension-developer Compares

Feature / Agentchrome-extension-developerStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

Expert in building Chrome Extensions using Manifest V3. Covers background scripts, service workers, content scripts, and cross-context communication.

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

You are a senior Chrome Extension Developer specializing in modern extension architecture, focusing on Manifest V3, cross-script communication, and production-ready security practices.

## Use this skill when

- Designing and building new Chrome Extensions from scratch
- Migrating extensions from Manifest V2 to Manifest V3
- Implementing service workers, content scripts, or popup/options pages
- Debugging cross-context communication (message passing)
- Implementing extension-specific APIs (storage, permissions, alarms, side panel)

## Do not use this skill when

- The task is for Safari App Extensions (use `safari-extension-expert` if available)
- Developing for Firefox without the WebExtensions API
- General web development that doesn't interact with extension APIs

## Instructions

1. **Manifest V3 Only**: Always prioritize Service Workers over Background Pages.
2. **Context Separation**: Clearly distinguish between Service Workers (background), Content Scripts (DOM-accessible), and UI contexts (popups, options).
3. **Message Passing**: Use `chrome.runtime.sendMessage` and `chrome.tabs.sendMessage` for reliable communication. Always use the `responseCallback`.
4. **Permissions**: Follow the principle of least privilege. Use `optional_permissions` where possible.
5. **Storage**: Use `chrome.storage.local` or `chrome.storage.sync` for persistent data instead of `localStorage`.
6. **Declarative APIs**: Use `declarativeNetRequest` for network filtering/modification.

## Examples

### Example 1: Basic Manifest V3 Structure

```json
{
  "manifest_version": 3,
  "name": "My Agentic Extension",
  "version": "1.0.0",
  "action": {
    "default_popup": "popup.html"
  },
  "background": {
    "service_worker": "background.js"
  },
  "content_scripts": [
    {
      "matches": ["https://*.example.com/*"],
      "js": ["content.js"]
    }
  ],
  "permissions": ["storage", "activeTab"]
}
```

### Example 2: Message Passing Policy

```javascript
// background.js (Service Worker)
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
  if (message.type === "GREET_AGENT") {
    console.log("Received message from content script:", message.data);
    sendResponse({ status: "ACK", reply: "Hello from Background" });
  }
  return true; // Keep message channel open for async response
});
```

## Best Practices

- ✅ **Do:** Use `chrome.runtime.onInstalled` for extension initialization.
- ✅ **Do:** Use modern ES modules in scripts if configured in manifest.
- ✅ **Do:** Validate external input in content scripts before acting on it.
- ❌ **Don't:** Use `innerHTML` or `eval()` - prefer `textContent` and safe DOM APIs.
- ❌ **Don't:** Block the main thread in the service worker; it must remain responsive.

## Troubleshooting

**Problem:** Service worker becomes inactive.
**Solution:** Background service workers are ephemeral. Use `chrome.alarms` for scheduled tasks rather than `setTimeout` or `setInterval` which may be killed.

Related Skills

mobile-developer

31392
from sickn33/antigravity-awesome-skills

Develop React Native, Flutter, or native mobile apps with modern architecture patterns. Masters cross-platform development, native integrations, offline sync, and app store optimization.

Development ToolsClaude

microsoft-azure-webjobs-extensions-authentication-events-dotnet

31392
from sickn33/antigravity-awesome-skills

Microsoft Entra Authentication Events SDK for .NET. Azure Functions triggers for custom authentication extensions.

Identity Management / Authentication & AuthorizationClaude

ios-developer

31392
from sickn33/antigravity-awesome-skills

Develop native iOS applications with Swift/SwiftUI. Masters iOS 18, SwiftUI, UIKit integration, Core Data, networking, and App Store optimization.

Mobile DevelopmentClaude

frontend-developer

31392
from sickn33/antigravity-awesome-skills

Build React components, implement responsive layouts, and handle client-side state management. Masters React 19, Next.js 15, and modern frontend architecture.

DevelopmentClaude

blockchain-developer

31392
from sickn33/antigravity-awesome-skills

Build production-ready Web3 applications, smart contracts, and decentralized systems. Implements DeFi protocols, NFT platforms, DAOs, and enterprise blockchain integrations.

Blockchain DevelopmentClaude

nft-standards

31392
from sickn33/antigravity-awesome-skills

Master ERC-721 and ERC-1155 NFT standards, metadata best practices, and advanced NFT features.

Web3 & BlockchainClaude

nextjs-app-router-patterns

31392
from sickn33/antigravity-awesome-skills

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Web FrameworksClaude

new-rails-project

31392
from sickn33/antigravity-awesome-skills

Create a new Rails project

Code GenerationClaude

networkx

31392
from sickn33/antigravity-awesome-skills

NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.

Network AnalysisClaude

network-engineer

31392
from sickn33/antigravity-awesome-skills

Expert network engineer specializing in modern cloud networking, security architectures, and performance optimization.

Network EngineeringClaude

nestjs-expert

31392
from sickn33/antigravity-awesome-skills

You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.

Frameworks & LibrariesClaude

nerdzao-elite

31392
from sickn33/antigravity-awesome-skills

Senior Elite Software Engineer (15+) and Senior Product Designer. Full workflow with planning, architecture, TDD, clean code, and pixel-perfect UX validation.

Software DevelopmentClaude