develop-userscripts
Installation
Summary
Build, debug, and publish userscripts for Tampermonkey or ScriptCat with proper metadata and runtime selection.
- Covers foreground page scripts, ScriptCat background workers, scheduled cron tasks, and subscription bundles; choose runtime before writing code
- Includes metadata preflight checklist:
@match,@grant,@connect,@run-at, and update URLs to avoid permission and injection timing failures - Provides decision tree for runtime selection and quick reference table mapping intent (DOM access, cross-origin requests, scheduled work, user config) to the right approach
- Highlights common mistakes: missing
@grant/@connect, DOM calls in background scripts, async handling in ScriptCat workers, and config key naming withgroup.keypattern
SKILL.md
Userscript work usually breaks at the runtime and metadata boundary, not in the page logic. Choose the runtime first, declare the minimum permissions up front, then debug in the environment where the script actually runs.
When to Use
Use this skill for:
- writing or fixing a Tampermonkey or ScriptCat userscript
- debugging injection timing, missing permissions, CSP workarounds, update checks, or
GM_*behavior - deciding between a portable foreground script and ScriptCat-only
@backgroundor@crontab - adding config UI with
==UserConfig== - packaging a ScriptCat
==UserSubscribe==bundle or preparing a CloudCat-compatible script
Do not use this skill for full browser extension development or general browser automation outside userscript managers.