develop-userscripts

Build, debug, package, and publish browser userscripts for Tampermonkey or ScriptCat.

71|7|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/xixu-me/skills --skill develop-userscripts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: develop-userscripts
Source: https://github.com/xixu-me/skills/tree/main/skills/develop-userscripts
Command: npx skills add https://github.com/xixu-me/skills --skill develop-userscripts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers often struggle with userscript issues that arise at the boundary between runtime environments and metadata configuration, leading to broken scripts, permission errors, and deployment headaches.

Core Features & Use Cases

  • Runtime Selection Guide: Decision graph to choose between portable foreground scripts, ScriptCat background or cron scripts, and subscription packages.
  • Permission Preflight Checklist: Ensures correct @grant, @connect, and manager settings before coding.
  • Step‑by‑step Workflow: From metadata drafting to debugging in the actual execution context and publishing with appropriate update models.
  • Quick Reference Table: Maps common intents to default choices and warns about pitfalls.
  • Common Mistake Alerts: Highlights typical errors such as missing grants, incorrect script type usage, and mis‑placed configuration blocks.
  • Use Case Example: Creating a Tampermonkey script that extracts article titles on page load while handling cross‑origin API calls via GM_xmlhttpRequest.

Quick Start

Use the develop-userscripts skill to help me create a Tampermonkey userscript that extracts article titles from news sites and runs on page load.

Frequently Asked Questions about develop-userscripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Tampermonkey metadata blocks for a new userscript?

Configure Tampermonkey metadata blocks by defining directives like @grant and @connect within a designated comment block to manage permissions and specify execution contexts before writing your core script logic. This preflight setup prevents broken scripts and permission errors.

What is the difference between Tampermonkey and ScriptCat background scripts?

ScriptCat background scripts differ by supporting extended metadata like @background and @crontab, enabling scheduled tasks and background execution without a browser window, whereas standard Tampermonkey scripts typically run in the foreground page context.

Why does my userscript fail with cross-origin API calls?

Your userscript fails with cross-origin API calls likely due to missing @grant and @connect metadata declarations. You must explicitly grant GM_xmlhttpRequest permissions and declare target domains in your metadata block to bypass browser CORS restrictions safely.

How do I create a ScriptCat subscription bundle for userscripts?

Create a ScriptCat subscription bundle by packaging multiple userscripts into a UserSubscribe configuration, allowing users to automatically install and receive updates for a collection of scripts through a single subscription URL.

Can I use GM_xmlhttpRequest without configuring @connect metadata?

Using GM_xmlhttpRequest requires explicit @connect metadata declarations for cross-origin domains. Without configuring @connect in your metadata block, the userscript manager will block outbound requests to external APIs, resulting in network permission errors.

How do I debug a userscript in its actual execution context?

Debug a userscript in its actual execution context by using the browser's developer tools within the target page environment, ensuring you test GM APIs and ScriptCat extensions like @crontab after completing the metadata configuration workflow.