Token导航 LogoToken导航

Agent Skill · AI 工具

tampermonkey(tampermonkey 命令行)

tampermonkey 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

tampermonkey 是AI 工具类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证为 MIT,第三方扫描有提醒项,按安装量在AI 工具类的 2,536 个 Skill 里排第 760。

总安装 2,160周安装 90GitHub Stars 52下载 720核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tampermonkey(tampermonkey 命令行)
来源仓库:https://github.com/henkisdabro/wookstar-claude-code-plugins
仓库路径:skills/tampermonkey
安装命令:
npx skills add https://github.com/henkisdabro/wookstar-claude-code-plugins --skill tampermonkey
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/henkisdabro/wookstar-claude-code-plugins --skill tampermonkey

这个 Skill 是做什么的

AI 工具类 Skill 用来扩展助手本身的能力,例如接模型、接检索、接外部服务。

tampermonkey 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。通过 npx skills add 命令从指定 GitHub 仓库安装使用。

安装前需确认权限范围、维护状态,以及是否触发联网、命令执行或文件读写。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/tampermonkey

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/henkisdabro/wookstar-claude-code-plugins --ski…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tampermonkey 怎么安装?

在终端执行 npx skills add https://github.com/henkisdabro/wookstar-claude-code-plugins --skill tamperm…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tampermonkey 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tampermonkey 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

tampermonkey 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

tampermonkey 用的人多吗?

公开数据是累计安装 2,160 次,近一周安装 90 次,下载 720 次,GitHub 52 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tampermonkey 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理AI 工具类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

AI 工具类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
executing-plans

执行计划 · Codex、Claude

1,515,336173,110只读MIT通过
verification-before-completion

完成前的验证 · Codex、Claude

1,319,472173,121权限未标注MIT通过
subagent-driven-development

子 Agent 驱动开发 · Codex、Claude

1,312,416173,138只读MIT通过
copy-editing

复制编辑 · Codex、Claude

1,209,57625,632只读MIT通过
paywall-upgrade-cro

付费专区升级 cro · Codex、Claude

1,030,17625,617只读MIT通过
tampermonkey

tampermonkey 命令行 · 本页

2,16052操作浏览器MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Tampermonkey Userscript Development

Expert guidance for writing Tampermonkey userscripts - browser scripts that modify web pages, automate tasks, and enhance browsing experience.

Quick Start Template

**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.


Essential Header Tags

TagRequiredPurposeExample
@nameYesScript name (supports i18n with :locale)@name My Script
@namespaceRecommendedUnique identifier namespace@namespace https://yoursite.com/
@versionYes*Version for updates (*required for auto-update)@version 1.2.3
@descriptionRecommendedWhat the script does@description Enhances page layout
@matchYes**URLs to run on (**or @include)@match https://example.com/*
@grantSituationalAPI permissions (use none for no GM_* APIs)@grant GM_setValue
@run-atOptionalWhen to inject (default: document-idle)@run-at document-start
@run-inOptionalLimit to normal or incognito tabs, or Firefox containers (v5.3+)@run-in normal-tabs

For complete header documentation, see: header-reference.md


URL Matching Quick Reference

// 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


@grant Permissions Quick Reference

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


@run-at Injection Timing

ValueWhen Script RunsUse Case
document-startBefore DOM existsBlock resources, modify globals early
document-bodyWhen body existsEarly DOM manipulation
document-endAt DOMContentLoadedMost scripts - DOM ready
document-idleAfter DOMContentLoaded (default)Safe default
context-menuOn right-click menuUser-triggered actions

Common Patterns

These patterns are used frequently. Brief summaries are below - load patterns.md for full implementations with code examples.

  • Wait for Element - Promise-based MutationObserver that resolves when a CSS selector appears in the DOM, with configurable timeout
  • SPA URL Change Detection - Detect navigation in single-page apps using window.onurlchange grant or History API interception
  • Cross-Origin Request - Fetch data from external APIs using GM_xmlhttpRequest with @connect domain whitelisting. See also http-requests.md
  • Add Custom Styles - Inject CSS with GM_addStyle to restyle pages or hide elements. See also api-dom-ui.md
  • Persistent Settings - Store user preferences with GM_setValue/GM_getValue and expose toggle via GM_registerMenuCommand. See also api-storage.md
  • DOM Mutation Observation - Watch for dynamically added content with MutationObserver (debounced variant included)
  • Element Manipulation - Inject HTML, remove/hide elements, replace text across the page
  • Keyboard Shortcuts - Simple handlers and a shortcut manager with modifier key support
  • Data Extraction - Extract table data to arrays/objects, collect and filter page links
  • Error Handling - Safe wrapper for try/catch and async retry with exponential backoff
  • TypeScript Userscripts - Type-safe scripts with @types/tampermonkey. See typescript.md

External Resources

// @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

TypeScript Support

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.


What Tampermonkey Cannot Do

Userscripts have limitations:

  • Access local files - Cannot read/write files on your computer
  • Run before page scripts - In isolated sandbox mode, page scripts run first
  • Access cross-origin iframes - Browser security prevents this
  • Persist across machines - GM storage is local to each browser
  • Bypass all CSP - Some very strict CSP cannot be bypassed
  • Inject without permission - Tampermonkey v5.4.1+ requires users to grant injection permission per-site or globally; scripts cannot bypass this requirement

Most limitations have workarounds - see common-pitfalls.md.


When Generating Userscripts

Always include in your response:

  1. Explanation - What the script does (1-2 sentences)
  2. Complete userscript - Full code with all headers in a code block
  3. Installation - "Copy/paste into Tampermonkey dashboard" or "Save as.user.js"
  4. Customisation points - What the user can safely modify (selectors, timeouts, etc.)
  5. Permissions used - Which @grants and why they're needed
  6. Browser support - If Chrome-only, Firefox-only, or universal

Pre-Delivery Checklist

Before returning a userscript, verify:

Critical (Must Pass)

  • No hardcoded API keys, tokens, or passwords
  • @match is specific (not *://*/*)
  • All external URLs use HTTPS
  • User input sanitised before DOM insertion

Important (Should Pass)

  • Wrapped in IIFE with 'use strict'
  • All @grant statements are necessary
  • @connect includes all external domains
  • Error handling for async operations
  • Null checks before DOM manipulation

Recommended

  • @version follows semantic versioning (X.Y.Z)
  • Works in both Chrome and Firefox
  • Comments explain non-obvious code

For complete security checklist, see: security-checklist.md


Reference Files Guide

Load these on-demand based on user needs:

FileWhen to Load
Core
header-reference.mdHeader syntax - all @tags with examples
url-matching.md@match, @include, @exclude patterns
patterns.mdCommon implementation patterns with code
sandbox-modes.mdSecurity/isolation execution contexts
API
api-sync.mdGM_* synchronous function reference (callback-based)
api-async.mdGM.* promise-based API reference - prefer these for new scripts
api-storage.mdGM_setValue, GM_getValue, listeners
http-requests.mdGM_xmlhttpRequest cross-origin
web-requests.mdGM_webRequest interception (Firefox)
api-cookies.mdGM_cookie manipulation
api-dom-ui.mdaddElement, addStyle, unsafeWindow
api-tabs.mdgetTab, saveTab, openInTab
api-audio.mdMute/unmute tabs
Quality
common-pitfalls.mdWhat breaks scripts and workarounds
debugging.mdHow to debug userscripts
browser-compatibility.mdChrome vs Firefox differences
security-checklist.mdPre-delivery security validation
version-numbering.mdVersion string comparison rules
typescript.mdTypeScript project setup with @types/tampermonkey, bundler config

平台分布

Claude Code

30.92%
按下载量换算223

OpenCode

25.18%
按下载量换算181

Cursor

17.21%
按下载量换算124

openclaw

12.69%
按下载量换算91

Gemini CLI

7.52%
按下载量换算54

Antigravity

3.35%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills