plugins/tampermonkey/skills/tampermonkey/SKILL.md
Write and debug Tampermonkey userscripts for browser automation, page modification, and web enhancement. Use whenever the user mentions userscripts, Tampermonkey, Greasemonkey, Violentmonkey, or wants to write a script that runs on a website - even if they don't say 'userscript' explicitly. Also trigger for: injecting JavaScript or CSS into web pages, modifying website behaviour, hiding page elements, form auto-fill, scraping page data, intercepting requests, detecting URL changes in SPAs, adding keyboard shortcuts to websites, tab audio control, or TypeScript userscripts. Covers all header tags (@match, @grant, @require, @run-in), GM_* synchronous APIs, GM.* promise-based APIs (recommended for new scripts), batch storage (GM.getValues/setValues v5.3+), binary data support (v5.4+), TypeScript setup via @types/tampermonkey, security sandboxing, and cross-browser compatibility (Chrome, Firefox, Edge). Do NOT use for Selenium/Puppeteer automation, browser extensions (WebExtensions/MV3), or server-side scripts.
npx skillsauth add henkisdabro/wookstar-claude-plugins tampermonkeyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert guidance for writing Tampermonkey userscripts - browser scripts that modify web pages, automate tasks, and enhance browsing experience.
JavaScript (simple scripts with no GM. APIs)*
// ==UserScript==
// @name My Script Name // <- CUSTOMISE: Unique script name
// @namespace https://example.com/scripts/ // <- CUSTOMISE: Your unique namespace
// @version 1.0.0 // <- INCREMENT on updates
// @description Brief description of the script // <- CUSTOMISE: What it does
// @author Your Name // <- CUSTOMISE: Your name
// @match https://example.com/* // <- CUSTOMISE: Target URL pattern
// @grant none // <- ADD permissions as needed
// @run-at document-idle // <- ADJUST timing if needed
// ==/UserScript==
(function() {
'use strict';
// Your code here
})();
Modern (async/await - recommended when using GM. APIs)*
// ==UserScript==
// @name My Script Name
// @namespace https://example.com/scripts/
// @version 1.0.0
// @description Brief description of the script
// @author Your Name
// @match https://example.com/*
// @grant GM.getValue
// @grant GM.setValue
// @run-at document-idle
// ==/UserScript==
(async () => {
'use strict';
// Async entry point — use await with GM.* APIs
const setting = await GM.getValue('myKey', 'default');
console.log('Script loaded, setting:', setting);
})();
TypeScript: Add @types/tampermonkey for full type safety. See typescript.md.
| Tag | Required | Purpose | Example |
|-----|----------|---------|---------|
| @name | Yes | Script name (supports i18n with :locale) | @name My Script |
| @namespace | Recommended | Unique identifier namespace | @namespace https://yoursite.com/ |
| @version | Yes* | Version for updates (required for auto-update) | @version 1.2.3 |
| @description | Recommended | What the script does | @description Enhances page layout |
| @match | Yes* | URLs to run on (*or @include) | @match https://example.com/* |
| @grant | Situational | API permissions (use none for no GM_ APIs) | @grant GM_setValue |
| @run-at | Optional | When to inject (default: document-idle) | @run-at document-start |
| @run-in | Optional | Limit to normal or incognito tabs, or Firefox containers (v5.3+) | @run-in normal-tabs |
For complete header documentation, see: header-reference.md
// Exact domain // @match https://example.com/*
// All subdomains // @match https://*.example.com/*
// HTTP and HTTPS // @match *://example.com/*
// Exclude paths (with @match) // @exclude https://example.com/admin/*
For advanced patterns (regex, @include, specific paths), see: url-matching.md
| You Need To... | Grant This |
|----------------|------------|
| Store persistent data | @grant GM_setValue + @grant GM_getValue |
| Make cross-origin requests | @grant GM_xmlhttpRequest + @connect domain |
| Add custom CSS | @grant GM_addStyle |
| Access page's window | @grant unsafeWindow |
| Show notifications | @grant GM_notification |
| Add menu commands | @grant GM_registerMenuCommand |
| Detect URL changes (SPA) | @grant window.onurlchange |
| Batch read/write settings (v5.3+) | @grant GM.getValues + @grant GM.setValues |
| Mute/unmute tab audio | @grant GM_audio |
// Disable sandbox (no GM_* except GM_info)
// @grant none
// Cross-origin requests require @connect
// @grant GM_xmlhttpRequest
// @connect api.example.com
// @connect *.googleapis.com
For complete permissions guide, see: header-reference.md
| Value | When Script Runs | Use Case |
|-------|------------------|----------|
| document-start | Before DOM exists | Block resources, modify globals early |
| document-body | When body exists | Early DOM manipulation |
| document-end | At DOMContentLoaded | Most scripts - DOM ready |
| document-idle | After DOMContentLoaded (default) | Safe default |
| context-menu | On right-click menu | User-triggered actions |
These patterns are used frequently. Brief summaries are below - load patterns.md for full implementations with code examples.
window.onurlchange grant or History API interceptionGM_xmlhttpRequest with @connect domain whitelisting. See also http-requests.mdGM_addStyle to restyle pages or hide elements. See also api-dom-ui.mdGM_setValue/GM_getValue and expose toggle via GM_registerMenuCommand. See also api-storage.md@types/tampermonkey. See typescript.md// @require - Load external scripts
// @require https://code.jquery.com/jquery-3.6.0.min.js#sha256-/xUj+3OJU...
// @require tampermonkey://vendor/jquery.js // Built-in library
// @resource - Preload and inject external CSS
// @resource myCSS https://example.com/style.css // Then: GM_addStyle(GM_getResourceText('myCSS'))
// @grant GM_getResourceText
// @grant GM_addStyle
Install the type definitions for full IDE autocompletion and type safety:
npm install --save-dev @types/tampermonkey
// ==UserScript==
// @name My TypeScript Script
// @match https://example.com/*
// @grant GM.getValue
// @grant GM.xmlHttpRequest
// @connect api.example.com
// ==/UserScript==
(async () => {
'use strict';
const value = await GM.getValue<string>('key', 'default');
const info: Tampermonkey.ScriptInfo = GM_info;
console.log(info.script.name, value);
})();
Build with a bundler (esbuild, Vite, webpack) to a single .user.js output file. For full project setup including tsconfig and bundler config, see typescript.md.
Userscripts have limitations:
Most limitations have workarounds - see common-pitfalls.md.
Always include in your response:
Before returning a userscript, verify:
*://*/*)For complete security checklist, see: security-checklist.md
Load these on-demand based on user needs:
| File | When to Load | |------|--------------| | Core | | | header-reference.md | Header syntax - all @tags with examples | | url-matching.md | @match, @include, @exclude patterns | | patterns.md | Common implementation patterns with code | | sandbox-modes.md | Security/isolation execution contexts | | API | | | api-sync.md | GM_* synchronous function reference (callback-based) | | api-async.md | GM.* promise-based API reference - prefer these for new scripts | | api-storage.md | GM_setValue, GM_getValue, listeners | | http-requests.md | GM_xmlhttpRequest cross-origin | | web-requests.md | GM_webRequest interception (Firefox) | | api-cookies.md | GM_cookie manipulation | | api-dom-ui.md | addElement, addStyle, unsafeWindow | | api-tabs.md | getTab, saveTab, openInTab | | api-audio.md | Mute/unmute tabs | | Quality | | | common-pitfalls.md | What breaks scripts and workarounds | | debugging.md | How to debug userscripts | | browser-compatibility.md | Chrome vs Firefox differences | | security-checklist.md | Pre-delivery security validation | | version-numbering.md | Version string comparison rules | | typescript.md | TypeScript project setup with @types/tampermonkey, bundler config |
testing
Identifies and removes AI writing patterns to make text sound natural and human-written. Use when user says "humanise this", "make this sound less AI", "this reads like a robot wrote it", "de-AI this text", "remove AI patterns", "make this more natural", "clean up this AI-generated text". Detects and fixes 29 patterns based on Wikipedia's "Signs of AI writing" guide - inflated language, promotional tone, AI vocabulary, em dash overuse, filler phrases, sycophantic tone, placeholder text, formulaic structure, thematic breaks. Do NOT use for grammar-only proofreading, spell checking, or rewriting text that is already clearly human-written.
tools
Fast, zero-AI text extraction from PDFs that have a text layer (digitally created PDFs from Word, Typst, WeasyPrint, wkhtmltopdf, LaTeX, etc). Uses pymupdf (fitz) - instant and deterministic. Use when you need to quickly pull raw text from a known text-layer PDF, e.g. "extract text from this PDF", "read this PDF", "get the content of", "what does this PDF say", "quickly read this PDF". Do NOT use for scanned/image PDFs or when you need structured output (tables, headings, OCR, AI analysis) - use the pdf-processing-pro skill in this plugin for those cases.
tools
Get current time in any timezone and convert times between timezones. Use when working with time, dates, timezones, scheduling across regions, "what time is it in X", "convert 3pm Sydney to London", DST checks, or when the user mentions specific cities/regions for time queries. Supports IANA timezone names. Do NOT use for date arithmetic (adding days/months), recurring event scheduling, business-day calculations, or full calendar/booking logic - those need a dedicated date library or scheduling tool.
tools
Complete Shopify development reference for Liquid templating, theme development (OS 2.0), GraphQL Admin API, Storefront API, custom app development, Shopify Functions, Hydrogen, performance optimisation, and debugging. Use when working with .liquid files, creating theme sections and blocks, writing GraphQL queries or mutations for Shopify, building Shopify apps with CLI and Polaris, implementing cart operations via Ajax API, optimising Core Web Vitals for Shopify stores, debugging Liquid or API errors, configuring settings_schema.json, accessing Shopify objects (product, collection, cart, customer), using Liquid filters, creating app extensions, working with webhooks, migrating from Scripts to Functions, or building headless storefronts with Hydrogen and React Router 7. Covers API version 2026-01. Do NOT use for WooCommerce, Magento, BigCommerce, or other non-Shopify e-commerce platforms.