Agent skill

Chrome Extension

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when building or shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state, permission warnings, a Chrome Web Store rejection…

MITAuto-check passedDevelopment

Install Chrome Extension

skills CLI
$ npx skills add ericrisco/rsc-harness --skill chrome-extension -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness chrome-extension --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/chrome-extension .claude/skills/chrome-extension && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
chrome-extension
GitHub stars
167
Token cost
~2.7k tokens
SKILL.md length
1,157 words
Files
5 (incl. scripts, references)
Skills in repo
227
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building or shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state, permission warnings, a Chrome Web Store rejection…

  • Works in 3 steps: Service worker… → Content scripts — run inside a web page,… → UI surfaces — popup…
  • Shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state
  • SKILL.md covers Pick a skeleton, manifest.json — minimum viable…, The three contexts and how… and Permissions — least privilege…, plus 4 more sections
  • Runs Shell scripts from its folder

What it does

Chrome Extension is an agent skill from ericrisco/rsc-harness. Use when building or shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state, permission warnings, a Chrome Web Store rejection, content-script/worker/popup messaging, or an MV2-to-V3 migration. NOT a generic web app (that is nextjs), NOT a desktop shell (that is electron).

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/store-and-migration.md`).

It sits in Development, covering Browser extensions. It works with Chrome Extensions, Next.js and Vite. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state
  • Permission warnings
  • A Chrome Web Store rejection
  • Content-script/worker/popup messaging

Example prompts

  • “/chrome-extension”

Requirements

  • A Bash shell

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Service worker (background.service_worker) — the logic and lifecycle brain. Ephemeral: Chrome kills it when idle and restarts it on the…
  2. Content scripts — run inside a web page, can read/write that page's DOM, live in an isolated JS world by default. No access to most…
  3. UI surfaces — popup (action.default_popup), options page, side panel. Normal web pages that load and unload as the user opens/closes them.

What it can do on your machine

Read from SKILL.md and the folder at commit e3d5b33. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Chrome Extension loads about 2.7k tokens when it runs, and up to ~4k if it reads all its reference files. Until then it costs about 86 tokens; SKILL.md has 1,157 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit e3d5b33, republished under its MIT licence (© ericrisco). 1,157 words, ~2,747 tokens.

Download SKILL.mdSave it as .claude/skills/chrome-extension/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
chrome-extension
description
Use when building or shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state, permission warnings, a Chrome Web Store rejection, content-script/worker/popup messaging, or an MV2-to-V3 migration. NOT a generic web app (that is `nextjs`), NOT a desktop shell (that is `electron`).
tags
chrome-extension, manifest-v3, browser-extension, service-worker, chrome-web-store
recommends
nextjs, react, gdpr-privacy, secure-coding, vercel
origin
risco

Chrome extension (Manifest V3)

An MV3 extension is three isolated JavaScript contexts that never share memory and only talk via messages:

  1. Service worker (background.service_worker) — the logic and lifecycle brain. Ephemeral: Chrome kills it when idle and restarts it on the next event. It has no DOM and no window.
  2. Content scripts — run inside a web page, can read/write that page's DOM, live in an isolated JS world by default. No access to most chrome.* APIs except messaging and storage.
  3. UI surfaces — popup (action.default_popup), options page, side panel. Normal web pages that load and unload as the user opens/closes them.

Internalize that picture first. Most extension bugs are someone treating one of these as if it shared state with another. They do not. The wire between them is chrome.runtime messaging and chrome.storage.

Manifest V3 is the only version the Chrome Web Store accepts; MV2 phase-out began June 2024 and is still rolling out. Build MV3 from the start.

Pick a skeleton

SetupPick whenCost
Vanilla (raw files, load unpacked)tiny extension, no npm imports, you want the fastest possible reload loopno TS, no HMR, manual reloads
Vite + CRXJS (@crxjs/vite-plugin)TS, npm imports, React/Vue popup, you want HMRa build step; you ship dist/, not the repo

Default to Vite + CRXJS the moment you want TypeScript or a framework popup — it does the manifest wiring and HMR for you. Reach for vanilla only for a one-file experiment.

Minimal tree (Vite + CRXJS):

text
my-ext/
  manifest.json        # source of truth; CRXJS reads it
  src/
    background.ts       # service worker
    content.ts          # content script
    popup/
      index.html
      popup.tsx
  public/icons/         # 16, 48, 128 px PNGs
  vite.config.ts
  # build output -> dist/  (this is what you zip)

manifest.json — minimum viable shape

json
{
  "manifest_version": 3,
  "name": "Highlighter",
  "version": "1.0.0",
  "description": "Highlights selected text on the current page.",
  "icons": { "16": "icons/16.png", "48": "icons/48.png", "128": "icons/128.png" },
  "action": { "default_popup": "popup/index.html" },
  "background": { "service_worker": "background.js", "type": "module" },
  "permissions": ["activeTab", "storage", "scripting"],
  "host_permissions": [],
  "minimum_chrome_version": "120"
}

Rules that fail review or break the worker if you get them wrong:

  • manifest_version must be 3. There is no 2 path forward.
  • background.service_worker is a string, not an array. There is no background.scripts and no background.page in MV3. The persistent key does not exist — delete it. (Source: developer.chrome.com "Migrate to a service worker", accessed 2026-06-02.)
  • "type": "module" lets the worker use import. Use it if you bundle.
  • Keep host_permissions empty until you can name exactly which sites and why (see permission table).

The three contexts and how they talk

The service worker is ephemeral. It terminates when idle and wakes on an event. Two consequences govern almost all your code:

  • Register every listener synchronously at the top level. If you call chrome.runtime.onMessage.addListener inside an async callback or after an await, Chrome may not have registered it when it wakes the worker, and your event is lost. (Source: developer.chrome.com "Migrate to a service worker", accessed 2026-06-02.)
  • Never keep state in a global variable. The worker dies and your variable resets to its initial value. Persist to chrome.storage.
js
// Bad — global resets to 0 every time the worker is killed and restarts
let clickCount = 0;
chrome.action.onClicked.addListener(() => {
  clickCount++;                          // silently back to 1 after idle
});

// Good — durable across worker restarts, listener registered at top level
chrome.action.onClicked.addListener(async () => {
  const { clickCount = 0 } = await chrome.storage.local.get("clickCount");
  await chrome.storage.local.set({ clickCount: clickCount + 1 });
});

Messaging choices:

  • One-shot request/response: chrome.runtime.sendMessage(msg) / chrome.tabs.sendMessage(tabId, msg) paired with chrome.runtime.onMessage. Return true from the listener to keep the channel open for an async sendResponse.
  • Long-lived stream (e.g. a content script feeding the popup continuously): chrome.runtime.connect() → Port, with port.onMessage / port.postMessage.

Content script → service worker → popup: there is no direct content-script-to-popup channel when the popup is closed. Route through the worker or through chrome.storage and let the popup read on open.

Permissions — least privilege or you get rejected

Reviewers reject broad permissions with no justification, and broad host_permissions trigger a scary install-time warning that tanks conversion. Declare the narrowest thing that works.

PermissionGrantsWarning?Use when
activeTabtemporary access to the current tab, only after a user gesture (toolbar click)nonethe user clicks your icon and you act on that one page
scriptingchrome.scripting.executeScript to inject programmaticallynone alone (needs a host or activeTab to target)inject on demand instead of on every page
host_permissions: ["https://example.com/*"]persistent access to those originsyes, lists the sitesyou must run in the background on specific sites
host_permissions: ["<all_urls>"]every siteloud, broad warningalmost never — avoid; prefer activeTab
optional_permissions + chrome.permissions.request()runtime opt-in inside a user gestureshown only when requesteda feature only some users need; ask when they enable it
declarativeNetRequeststatic/dynamic rules block or modify requests, no request bodies seeninstall-time warningad/tracker blocking — replaces blocking webRequest
declarativeNetRequestWithHostAccesssame, but access granted per host instead of install-timeper-hostDNR scoped to granted hosts only

Rule: write a one-sentence justification for every permission before you add it. If you cannot, drop it. activeTab covers more cases than people expect — try it first. (Source: developer.chrome.com "Declare permissions" + "declarativeNetRequest", accessed 2026-06-02.)

Show full SKILL.md (454 more words)Show less

Content scripts: declarative vs programmatic

json
// Declarative — in manifest. Runs automatically on matching pages.
"content_scripts": [{
  "matches": ["https://example.com/*"],
  "js": ["content.js"],
  "run_at": "document_idle"
}]
js
// Programmatic — inject on a gesture. Needs "scripting" + activeTab or a host match.
chrome.action.onClicked.addListener(async (tab) => {
  await chrome.scripting.executeScript({
    target: { tabId: tab.id },
    files: ["content.js"],
  });
});
  • run_at: document_start (before DOM), document_end, or document_idle (default, after load). Pick document_start only if you must beat the page's own scripts.
  • Isolated world (default): your content script's JS is sandboxed from the page's JS — they share the DOM but not variables. Use MAIN world ("world": "MAIN") only when you must touch the page's own JS objects, and know it loses the isolation guarantee.
  • For dynamic, user-supplied injection, chrome.userScripts.execute() exists (Chrome 135, Mar 2025) — see references/store-and-migration.md.

Storage, alarms, no remote code

  • chrome.storage.local (~10 MB, larger with unlimitedStorage) for most data; chrome.storage.sync (~100 KB, ~8 KB/item) only for small settings you want to follow the user across devices.
  • setTimeout/setInterval are unreliable in the worker — it may be asleep when they fire. Use chrome.alarms for anything beyond a few seconds. (Source: developer.chrome.com "Migrate to a service worker", accessed 2026-06-02.)
  • Remotely hosted code is banned. No <script src="https://cdn...">, no eval-of-fetched-string. All executable JS must ship inside the package — bundle every dependency. This is enforced by MV3's CSP and by review. (Source: developer.chrome.com "What is Manifest V3", accessed 2026-06-02.)

Shipping to the Chrome Web Store

  1. Build, then zip the dist/ output — never the repo. No node_modules, no .git, no source maps you do not want public.
  2. Pay the one-time $5 USD developer registration (covers up to 20 extensions on the account).
  3. Upload the zip in the Developer Dashboard.
  4. Listing assets: a 128×128 PNG icon, at least one screenshot (1280×800 or 640×400), a clear description, a category, and a privacy-policy URL if you collect any data.
  5. Review is typically 1–3 business days (simple extensions often under 24h).

(Source: developer.chrome.com "Register your developer account" + fee guide, accessed 2026-06-02.) For the full dashboard walkthrough, data-disclosure form, staged rollout, appeals, and the MV2→MV3 migration map, see references/store-and-migration.md.

Anti-patterns

Anti-patternWhy it breaksDo instead
background.scripts / persistent: trueMV2 shape; rejected, worker never registersbackground.service_worker: "bg.js" (string)
Listener added after an awaitChrome wakes the worker without your listener; event lostregister all listeners synchronously at top level
State in a global varworker dies, var resets silentlypersist to chrome.storage
<all_urls> when a click sufficesscary install warning, review pushbackactiveTab triggered by the toolbar click
<script src="https://cdn…">remote code is banned in MV3bundle the dependency into the package
setInterval for periodic workfires only while worker is alivechrome.alarms
Zipping the repo / node_modulesbloated, leaks source, may fail reviewzip only the built dist/
Auth token in a global / synclost on restart, or synced off-devicechrome.storage.local (or session for in-memory)
MAIN world by defaultloses isolation, page can tamperisolated world unless you must reach page JS

Run scripts/verify.sh <dir> to lint a produced manifest.json against the MV3 invariants above.

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in skills/chrome-extension of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/store-and-migration.md
  • scripts/verify.sh

Open the folder on GitHubat commit e3d5b33

Compare with similar skills

Chrome Extension next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Chrome Extension compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Chrome Extension this skillericrisco/rsc-harness167—~2.7kAutomated safety check: PassMIT
Wxtmengxi-ream/read-frog10k—~500Automated safety check: PassGPL-3.0
Crxjssamber/cc-skills228—~2.6kAutomated safety check: PassMIT
Browser Extension Devmobazha/mobazha-unified165—~2kAutomated safety check: PassMPL-2.0
Project Scaffoldingaiskillstore/marketplace430—~2kAutomated safety check: PassNone
Wxt Browser Extensionsvantezzen/skip-silence4682 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Wxt

    mengxi-ream/read-frog

    Build browser extensions with WXT - a next-gen framework with file-based entrypoints, Vite builds, auto-imports, typed storage with migrations, content script UIs, and multi-browser MV2/MV3 support.

    10k GitHub stars~500 tokensUpdated today
    DevelopmentAuto-check passed
  • Crxjs

    samber/cc-skills

    CRXJS Chrome extension development — true HMR for popup, options, content scripts, side panels, manifest-driven builds, dynamic content script imports (?script, ?script&module), and defineManifest…

    228 GitHub stars~2.6k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Browser Extension Dev

    mobazha/mobazha-unified

    Chrome/Brave 浏览器扩展开发执行器。覆盖 Ext-0 原型验证到 Ext-4 生态增强的全生命周期. An agent skill from mobazha/mobazha-unified.

    165 GitHub stars~2k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Project Scaffolding

    aiskillstore/marketplace

    IDE-grade project scaffolding wizard for creating new projects with comprehensive configuration.

    430 GitHub stars~2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Wxt Browser Extensions

    vantezzen/skip-silence

    WXT browser extension performance optimization guidelines. An agent skill from vantezzen/skip-silence.

    468 GitHub starsUsed in 2 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Kimi Webbridge

    MoonshotAI/kimi-code

    Kimi Browser Extension(Kimi 浏览器扩展,原 Kimi WebBridge)lets AI control the user's real browser — navigate, click, type, read, screenshot, and interact with any website using the user's actual login…

    7.8k GitHub stars~3.6k tokensUpdated today
    DevelopmentAuto-check passed

More from ericrisco/rsc-harness

All 227 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    167 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    167 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    167 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    167 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    167 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    167 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Categories

Questions about Chrome Extension

What does Chrome Extension do?

A skill your agent uses when building or shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state, permission warnings, a Chrome Web Store rejection…. Chrome Extension is an agent skill from ericrisco/rsc-harness. Use when building or shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state, permission warnings, a Chrome Web Store rejection, content-script/worker/popup messaging, or an MV2-to-V3 migration.

When should I use Chrome Extension?

Chrome Extension fits situations like: shipping a Manifest V3 browser extension and hitting its quirks — service worker dying and losing state; permission warnings; A Chrome Web Store rejection; content-script/worker/popup messaging.

How do I install Chrome Extension in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill chrome-extension -a claude-code`. Or copy the skill folder (skills/chrome-extension in ericrisco/rsc-harness) into .claude/skills/chrome-extension in your project. Claude Code loads it when a task matches its description.

How do I install Chrome Extension in Codex?

Run `npx skills add ericrisco/rsc-harness --skill chrome-extension -a codex`. Or copy the skill folder (skills/chrome-extension in ericrisco/rsc-harness) into .agents/skills/chrome-extension in your project. Codex loads it when a task matches its description.

Can I use Chrome Extension in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill chrome-extension -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/chrome-extension, .gemini/skills/chrome-extension, .github/skills/chrome-extension and .opencode/skills/chrome-extension in your project.

What does Chrome Extension need to run?

Going by SKILL.md and its folder, Chrome Extension needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Chrome Extension access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Chrome Extension safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Chrome Extension use?

Chrome Extension is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Chrome Extension use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Chrome Extension?

Skills that share tags, products or a category with Chrome Extension: Wxt (mengxi-ream/read-frog, 10k stars), Crxjs (samber/cc-skills, 228 stars), Browser Extension Dev (mobazha/mobazha-unified, 165 stars) and Project Scaffolding (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Chrome Extension?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 167 GitHub stars. The repository holds 227 skills in this directory. The repository was last updated on October 7, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.