一键导入
chrome-extension-basics
Use when creating Chrome extensions - covers project structure, manifest.json, popup/content scripts, and Catppuccin color scheme
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating Chrome extensions - covers project structure, manifest.json, popup/content scripts, and Catppuccin color scheme
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when implementing CLI commands with Cobra - covers root command setup, subcommand patterns, flags, output lifecycle patterns, and TUI output with bubbletea/lipgloss
Use when writing, refactoring, reviewing, or testing ANY Go code. The canonical reference for Go conventions — project taxonomy (CLI Only / Web Only / CLI + Web / Headless API Service / Library), project layout, modern Go 1.26+ idioms (wg.Go, t.Context(), range-over-int, slices/maps/cmp, errors.AsType, min/max/clear, new(value)), edge-case-driven unit testing (add/write Go tests, table-driven, edge cases), core principles, dependency selection, logging, and the utils package. Load this for any Go work. The `develop` skill is the per-task entry point that selects and applies these conventions.
Use when reviewing existing code against development skill best practices — orchestrates multi-agent domain reviews for thoroughness
Entry point for ANY coding work in a project that has these skills installed — implementing a feature, changing or refactoring code, fixing a bug, writing tests, scaffolding something new, or touching build/CI. Selects and loads the development skills that govern the task up front, holds the work to them while coding, and ends with a quick self-review that the skills were actually followed. Use this whenever you are about to develop anything.
Use when implementing Go backend logic - covers internal package architecture, error handling, HTTP servers, storage patterns, and OAuth authentication for CLI clients (browser/device/manual flows, not server-side web OAuth)
Use when running concurrent work or orchestrating multi-job pipelines in Go - covers goroutine patterns (WaitGroup, errgroup, semaphores, fan-out/fan-in), error handling, cancellation, and the Highway pattern for progress tracking and resume
| name | chrome-extension-basics |
| description | Use when creating Chrome extensions - covers project structure, manifest.json, popup/content scripts, and Catppuccin color scheme |
| user-invocable | false |
Standardized patterns for Chrome extension development.
Use this skill when:
Related skills:
project-readme - README templates (includes extension template with security disclaimer)project-ci-cd - Makefile for building extension zipextension-root/
├── manifest.json # Extension configuration (required)
├── Makefile # Build zip for distribution
├── README.md
├── .github/
│ ├── assets/
│ │ └── logo.png # Project logo (128x128 or larger)
│ └── workflows/
│ └── release.yaml # Automated releases
├── icons/
│ ├── icon16.png # Toolbar icon
│ ├── icon32.png # Windows icon
│ ├── icon48.png # Extensions page
│ └── icon128.png # Chrome Web Store / installation
├── popup/
│ ├── popup.html # Popup UI (when extension clicked)
│ ├── popup.css # Popup styles (Catppuccin)
│ └── popup.js # Popup logic
├── content/
│ └── content.js # Content script (runs in web pages)
├── background/
│ └── service-worker.js # Background service worker (Manifest V3)
└── lib/ # Shared libraries (optional)
└── utils.js
Key rules:
icons/ directory{
"manifest_version": 3,
"name": "[EXTENSION_NAME]",
"version": "1.0.0",
"description": "[Brief description of what the extension does]",
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"action": {
"default_popup": "popup/popup.html",
"default_icon": {
"16": "icons/icon16.png",
"32": "icons/icon32.png"
}
},
"permissions": [
"activeTab",
"storage",
"scripting"
],
"background": {
"service_worker": "background/service-worker.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content/content.js"],
"run_at": "document_idle"
}
]
}
| Permission | Purpose |
|---|---|
activeTab | Access current tab when extension clicked (safest) |
storage | Save settings using chrome.storage |
cookies | Read/write cookies (requires host permissions) |
webRequest | Monitor network requests |
tabs | Access tab URLs and metadata |
scripting | Programmatically inject scripts |
Principle: Request minimum permissions needed. Add host_permissions only for specific domains when possible.
Default new extensions to the Catppuccin Mocha dark theme; match the project's existing palette if one is already established:
:root {
/* Catppuccin Mocha */
--rosewater: #f5e0dc;
--flamingo: #f2cdcd;
--pink: #f5c2e7;
--mauve: #cba6f7;
--red: #f38ba8;
--maroon: #eba0ac;
--peach: #fab387;
--yellow: #f9e2af;
--green: #a6e3a1;
--teal: #94e2d5;
--sky: #89dceb;
--sapphire: #74c7ec;
--blue: #89b4fa;
--lavender: #b4befe;
--text: #cdd6f4;
--subtext1: #bac2de;
--subtext0: #a6adc8;
--overlay2: #9399b2;
--overlay1: #7f849c;
--overlay0: #6c7086;
--surface2: #585b70;
--surface1: #45475a;
--surface0: #313244;
--base: #1e1e2e;
--mantle: #181825;
--crust: #11111b;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background-color: var(--base);
color: var(--text);
min-width: 300px;
padding: 16px;
}
button {
background-color: var(--surface0);
color: var(--text);
border: 1px solid var(--surface1);
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s;
}
button:hover {
background-color: var(--surface1);
}
button.primary {
background-color: var(--blue);
color: var(--crust);
border: none;
}
button.primary:hover {
background-color: var(--sapphire);
}
input, textarea {
background-color: var(--surface0);
color: var(--text);
border: 1px solid var(--surface1);
padding: 8px 12px;
border-radius: 6px;
width: 100%;
}
input:focus, textarea:focus {
outline: none;
border-color: var(--blue);
}
.success { color: var(--green); }
.error { color: var(--red); }
.warning { color: var(--yellow); }
.info { color: var(--blue); }
See ./references/popup-template.md for complete popup HTML/CSS/JS.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[EXTENSION_NAME]</title>
<link rel="stylesheet" href="popup.css">
</head>
<body>
<div class="container">
<h1>[EXTENSION_NAME]</h1>
<p class="description">Brief description here</p>
<div class="actions">
<button id="action-btn" class="primary">Do Something</button>
</div>
<div id="status" class="status"></div>
</div>
<script src="popup.js"></script>
</body>
</html>
document.addEventListener('DOMContentLoaded', () => {
const actionBtn = document.getElementById('action-btn');
const status = document.getElementById('status');
actionBtn.addEventListener('click', async () => {
try {
// Get current tab
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
// Execute script in tab
const results = await chrome.scripting.executeScript({
target: { tabId: tab.id },
func: () => {
// This runs in the page context
return document.title;
}
});
status.textContent = `Page title: ${results[0].result}`;
status.className = 'status success';
} catch (error) {
status.textContent = `Error: ${error.message}`;
status.className = 'status error';
}
});
});
Content scripts run in web page context:
// content/content.js
// Run when script loads
(function() {
console.log('[ExtensionName] Content script loaded');
// Listen for messages from popup or background
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'getData') {
const data = extractData();
sendResponse({ success: true, data });
}
return true; // Keep channel open for async response
});
function extractData() {
// Extract data from page
return {
title: document.title,
url: window.location.href
};
}
})();
For persistent background tasks:
// background/service-worker.js
// Extension installed
chrome.runtime.onInstalled.addListener((details) => {
console.log('[ExtensionName] Installed:', details.reason);
// Initialize storage with defaults
chrome.storage.local.set({
settings: {
enabled: true
}
});
});
// Listen for messages
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'someAction') {
handleAction(message.data)
.then(result => sendResponse({ success: true, result }))
.catch(error => sendResponse({ success: false, error: error.message }));
return true; // Async response
}
});
async function handleAction(data) {
// Perform background task
return { processed: true };
}
// Save to storage
async function saveSettings(settings) {
await chrome.storage.local.set({ settings });
}
// Load from storage
async function loadSettings() {
const result = await chrome.storage.local.get('settings');
return result.settings || { enabled: true }; // Default
}
// Watch for changes
chrome.storage.onChanged.addListener((changes, area) => {
if (area === 'local' && changes.settings) {
console.log('Settings changed:', changes.settings.newValue);
}
});
| Size | Purpose | Notes |
|---|---|---|
| 16x16 | Toolbar | Shown in browser toolbar |
| 32x32 | Windows | Windows taskbar |
| 48x48 | Extensions page | chrome://extensions |
| 128x128 | Installation | Store listing, install dialog |
Style:
mkdir my-extension && cd my-extension
mkdir -p icons popup content background .github/assets .github/workflows
Copy the Manifest V3 template and customize:
Use the popup template with Catppuccin colors. Keep it minimal.
Only add if needed:
Generate icon set in all required sizes. Use consistent design.
Use project-ci-cd skill for Makefile that creates distributable zip.
Use project-readme skill with Chrome Extension template. Add security disclaimer if extension handles sensitive data.
| File | Purpose |
|---|---|
./references/popup-template.md | Complete popup HTML/CSS/JS with Catppuccin theme |
| Skill | Use For |
|---|---|
project-readme | README template with security disclaimer |
project-ci-cd | Makefile for building extension zip |