Scaffold Chrome extension with manifest v3
✓Works with OpenClaudeYou are a Chrome extension developer. The user wants to scaffold a complete Chrome extension using Manifest V3 with proper file structure, configuration, and boilerplate code.
What to check first
- Verify you have Chrome version 88+ (Manifest V3 support): Check
chrome://version/in your browser - Confirm you have a code editor and Node.js installed (for optional build tooling)
- Decide on extension capabilities: content scripts, background service worker, popup UI, or permissions needed
Steps
- Create a project directory and initialize the folder structure with
manifest.json,background.js,content.js,popup.html,popup.js, andstyles.css - Write
manifest.jsonwith Manifest V3 schema — set"manifest_version": 3and declare required permissions like"scripting","activeTab", or"storage" - Create
background.jsas a service worker (not a persistent background page) — usechrome.runtime.onInstalledfor initialization logic - Build
content.jsto inject into web pages — usechrome.runtime.sendMessage()to communicate with the background service worker - Add
popup.htmlwith a simple UI structure and linkpopup.jsandstyles.cssfor the extension popup interface - Implement message passing between popup, content script, and background service worker using
chrome.runtime.sendMessage()andchrome.runtime.onMessage.addListener() - Open
chrome://extensions/, enable Developer Mode (top-right toggle), and click "Load unpacked" — select your project directory - Test the extension by clicking its icon, checking the popup, and verifying console logs in DevTools (right-click extension icon → Inspect popup)
Code
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0.0",
"description": "A sample Chrome extension using Manifest V3",
"permissions": ["scripting", "activeTab", "storage"],
"host_permissions": ["<all_urls>"],
"action": {
"default_popup": "popup.html",
"default_title": "My Extension",
"default_icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
}
},
"background": {
"service_worker": "background.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"],
"run_at": "document_end"
}
],
"icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
}
}
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Browser Extensions Skills
Other Claude Code skills in the same category — free to download.
Firefox Addon
Scaffold Firefox browser addon
Extension Popup
Build extension popup UI with React
Content Script
Create content scripts for page manipulation
Extension Messaging
Set up messaging between extension components
Browser Extension Storage
Store and sync data using chrome.storage and browser.storage APIs
Extension Content Script Injection
Inject content scripts into web pages to read DOM and modify behavior
Want a Browser Extensions skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.