agentleFS
FirzusFirzus/agent-skills/skills/web/web-extension/SKILL.md

web-extension

Skill4 starsChanged 21 days agoMITView on GitHub

Design, build, port, debug, test, or prepare browser extensions for Chromium, Firefox, and Safari using the WebExtensions model. Use when work involves manifest.json, Manifest V3, extension service workers or background scripts, content scripts, extension messaging, browser permissions, toolbar actions, options pages, sidebars, cross-browser extension compatibility, store-ready packages, Chrome Web Store, Firefox Add-ons, or Safari Web Extensions. Also use when migrating an existing extension between browsers.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 16 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use discovery and compatibility.

    line 28
  2. Distinctive:

    Create a compatibility matrix.

    line 29
  3. Distinctive:

    Prefer narrow, optional, and user-initiated access.

    line 37
  4. Distinctive:

    Test source behavior and the packaged artifact in every declared browser.

    line 45
  5. Distinctive:

    Run a separate release gate for each target store.

    line 48
  6. Distinctive:

    Existing project: follow its namespace, manifest-generation, bundling, and test conventions unless they conflict with a target-browser …

    line 54
  7. Distinctive:

    New multi-browser extension: use one shared core plus explicit adapters and target manifests.

    line 58
  8. Distinctive:

    Chromium: use the target's documented Manifest V3 service-worker syntax and lifecycle.

    line 60
  9. Distinctive:

    Firefox: verify each API and manifest key.

    line 62
  10. Distinctive:

    If neither preserves the requested behavior, report the limitation instead of silently widening permissions or weakening security.

    line 67
  11. Very specific:

    Do not solve injection failures by defaulting to <all_urls>.

    line 72
  12. Distinctive:

    Do not download executable code at runtime, use dynamic evaluation, or weaken the extension Content Security Policy as a default fix.

    line 73
  13. Distinctive:

    Do not assume a popup can access the current page DOM.

    line 75
  14. Distinctive:

    Do not treat a namespace polyfill as proof that an API exists on every target.

    line 76
  15. Distinctive:

    Do not encode volatile store fees, review times, asset dimensions, or compatibility tables.

    line 77
  16. Distinctive:

    Do not impose a framework.

    line 79
  17. Distinctive:

    Every permission and data flow has a necessary, user-visible purpose.

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Extension

Build extension behavior around explicit browser targets, execution contexts, permissions, and lifecycle constraints. Treat WebExtensions as a shared model with vendor-specific seams, not as one perfectly uniform platform.

This skill covers WebExtensions and migrations to that model. Ordinary websites, browser automation, userscripts, bookmarklets, legacy Chrome Apps, and legacy Safari App Extensions remain outside its scope.

Workflow

  1. Discover the target before choosing architecture or syntax. Inspect the repo, then establish browsers and minimum versions, features, UI surfaces, host/data access, distribution channels, native companion needs, and existing tooling. Use discovery and compatibility.
  2. Create a compatibility matrix. For every required capability, classify it as common, syntax-different, API-different, or unavailable. Verify uncertain or version-sensitive support in current vendor documentation before coding.
  3. Map execution contexts and message boundaries before implementation. Assign work to content scripts, background/event code, extension pages, page code, or a native companion. Define small validated request/response messages. Use architecture and implementation.
  4. Map every permission, host pattern, and data flow to a user-visible purpose. Prefer narrow, optional, and user-initiated access. Use permissions, privacy, and security.
  5. Implement shared domain logic behind narrow browser adapters. Preserve the existing stack. Keep browser namespace, manifests, background declarations, and browser-only UI out of shared feature logic.
  6. Make background work restart-safe: register listeners at startup, persist durable state, make event handlers idempotent, and never depend on globals surviving suspension.
  7. Test source behavior and the packaged artifact in every declared browser. Include denial, revocation, restart, upgrade, restricted-page, and failure paths. Use testing and debugging.
  8. Run a separate release gate for each target store. Re-open the current official policy and submission checklist before packaging, signing, or publishing. Use packaging and release.

Explicit branches

  • Existing project: follow its namespace, manifest-generation, bundling, and test conventions unless they conflict with a target-browser requirement.
  • New single-browser extension: optimize for that browser, but isolate platform calls where doing so costs little. Do not claim cross-browser support.
  • New multi-browser extension: use one shared core plus explicit adapters and target manifests. Do not scatter browser checks through feature logic.
  • Chromium: use the target's documented Manifest V3 service-worker syntax and lifecycle. Test forced worker termination.
  • Firefox: verify each API and manifest key; choose the documented background declaration and account for Mozilla signing.
  • Safari: plan the containing Apple-platform app, Xcode workflow, website-access states, platform testing, signing, and distribution from the start.
  • Unsupported capability: feature-detect or provide a target-specific fallback. If neither preserves the requested behavior, report the limitation instead of silently widening permissions or weakening security.

Guardrails

  • Do not solve injection failures by defaulting to <all_urls>.
  • Do not download executable code at runtime, use dynamic evaluation, or weaken the extension Content Security Policy as a default fix.
  • Do not assume a popup can access the current page DOM; cross contexts explicitly.
  • Do not treat a namespace polyfill as proof that an API exists on every target.
  • Do not encode volatile store fees, review times, asset dimensions, or compatibility tables. Consult current official documentation when those facts affect the task.
  • Do not impose a framework. If recommending one, research its current primary documentation and explain why it fits the discovered constraints.

Done when

  • The requested feature works in every declared browser and minimum version.
  • Each capability has an explicit compatibility outcome and vendor seam.
  • Context ownership and all cross-context messages are documented and validated.
  • Every permission and data flow has a necessary, user-visible purpose; denial and revocation behave safely.
  • Background behavior survives suspension, restart, duplication, and partial work.
  • Automated checks pass where present, and the manual matrix covers install, upgrade, primary workflows, failures, and every extension UI surface.
  • The exact release artifact loads and passes smoke tests on every target.
  • Per-store permissions, privacy disclosures, package contents, signing, and current submission requirements have been checked before release.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.