develop-userscripts
द्वारा xixu-me
जब Tampermonkey या ScriptCat के लिए ब्राउज़र यूज़रस्क्रिप्ट बनाने, डीबग करने, पैकेज करने या प्रकाशित करने में उपयोग करें, जिसमें GM APIs, मेटाडेटा ब्लॉक, अनुमति संबंधी समस्याएं, @match/@grant/@connect सेटअप, ScriptCat बैकग्राउंड या शेड्यूल्ड स्क्रिप्ट, UserConfig ब्लॉक, या सब्सक्रिप्शन वर्कफ़्लो शामिल हों।
npx skills add https://github.com/xixu-me/skills --skill develop-userscriptsUserscript 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.
Runtime Selection
digraph userscript_runtime {
"Need page DOM or page context?" [shape=diamond];
"Need persistent or scheduled work?" [shape=diamond];
"Need to install many scripts as one package?" [shape=diamond];
"Portable foreground script" [shape=box];
"ScriptCat background or crontab script" [shape=box];
"ScriptCat subscription package" [shape=box];
"Need page DOM or page context?" -> "Portable foreground script" [label="yes"];
"Need page DOM or page context?" -> "Need persistent or scheduled work?" [label="no"];
"Need persistent or scheduled work?" -> "ScriptCat background or crontab script" [label="yes"];
"Need persistent or scheduled work?" -> "Need to install many scripts as one package?" [label="no"];
"Need to install many scripts as one package?" -> "ScriptCat subscription package" [label="yes"];
"Need to install many scripts as one package?" -> "Portable foreground script" [label="no"];
}
Preflight
- Confirm the manager and browser. On Manifest V3 browsers, ScriptCat may require
Allow User Scriptsor browser developer mode before scripts run. - Decide page script versus background script before writing code. ScriptCat background scripts cannot touch the DOM.
- Start with metadata, not implementation:
@match,@grant,@connect,@run-at, and any update URLs. - Prefer portable
==UserScript==patterns for ordinary page scripts. Only switch to ScriptCat-only headers when the requested behavior actually needs them.
Workflow
- Choose the runtime and metadata first.
- Declare the smallest permission surface that fits the task.
- Implement against the runtime you chose.
- Debug where the code really runs.
- Foreground scripts: page console plus manager logs.
- ScriptCat background scripts: run log first, then
background.htmlfor real-environment debugging.
- Publish with the right update model.
- Normal scripts: keep
@versionaccurate and add@updateURLor@downloadURLonly when needed. - Subscription bundles: use
==UserSubscribe==, HTTPS URLs, and subscription-level@connect.
- Normal scripts: keep
Quick Reference
| Intent | Default choice | Watch for |
|---|---|---|
| Page UI, DOM scraping, page patching | Portable ==UserScript== | @match, @grant, @run-at, CSP-sensitive injection |
| Cross-origin API access | GM_xmlhttpRequest with explicit @connect | Missing hosts, cookie behavior differences, user authorization |
| Long-running worker | ScriptCat @background | No DOM, must return Promise for async work |
| Scheduled task | ScriptCat @crontab | Only first @crontab counts, prefer 5-field cron, avoid interval overlap |
| User-editable settings | ==UserConfig== plus GM_getValue | Block placement and group.key naming |
| Silent bundle install and updates | ==UserSubscribe== | HTTPS, user.sub.js, subscription connect overrides child scripts |
Common Mistakes
- Missing
@grantfor APIs the script actually uses. - Missing
@connectfor hosts used byGM_xmlhttpRequestorGM_cookie. - Treating
@includeas a better default than@matchfor ordinary host targeting. - Using DOM APIs inside ScriptCat background or cron scripts.
- Returning from a ScriptCat background script before async GM work is truly finished.
- Mixing
==UserScript==and==UserSubscribe==packaging concepts. - Putting
==UserConfig==in the wrong place or reading config keys without thegroup.keyname. - Assuming Tampermonkey and ScriptCat storage, notification, or request behavior is identical.
References
xixu-me की और Skills
github-actions-docs
xixu-me
उपयोग तब करें जब उपयोगकर्ता GitHub Actions वर्कफ़्लो, वर्कफ़्लो सिंटैक्स, ट्रिगर, मैट्रिसेस, रनर, पुन: प्रयोज्य वर्कफ़्लो, आर्टिफैक्ट, कैशिंग, सीक्रेट, OIDC, डिप्लॉयमेंट, कस्टम एक्शन या Actions Runner Controller को लिखने, समझाने, अनुकूलित करने, माइग्रेट करने, सुरक्षित करने या समस्या निवारण करने के बारे में पूछते हैं, विशेष रूप से जब उन्हें आधिकारिक GitHub दस्तावेज़ीकरण, सटीक लिंक या दस्तावे
developmentdevopsdocument
use-my-browser
xixu-me
उपयोग तब करें जब कार्य उपयोगकर्ता के लाइव ब्राउज़र सत्र या दृश्य रेंडर की गई स्थिति पर निर्भर करता है, न कि स्थिर फ़ेच पर, विशेष रूप से ब्राउज़र डिबगिंग संदर्भों या DevTools-चयनित तत्वों या अनुरोधों, लॉग-इन डैशबोर्ड या CMS प्रवाह, localhost ऐप्स, फ़ॉर्म, अपलोड, डाउनलोड, मीडिया निरीक्षण, DOM या iframe निरीक्षण, Shadow DOM, या ब्राउज़र विफलताओं के लिए जो सॉफ्ट 404, प्रमाणीकरण दीवारों
browser-automationweb-scrapingtesting
readme-i18n
xixu-me
उपयोग तब करें जब उपयोगकर्ता किसी रिपॉजिटरी के README का अनुवाद करना चाहता है, रिपॉजिटरी को बहुभाषी बनाना चाहता है, दस्तावेज़ों का स्थानीयकरण करना चाहता है, भाषा स्विचर जोड़ना चाहता है, README को अंतर्राष्ट्रीयकृत करना चाहता है, या GitHub-शैली रिपॉजिटरी में स्थानीयकृत README वेरिएंट को अपडेट करना चाहता है।
documentdevelopmentapi
openclaw-secure-linux-cloud
xixu-me
जब क्लाउड सर्वर पर OpenClaw को स्वयं-होस्ट करना हो, किसी दूरस्थ OpenClaw गेटवे को सुरक्षित करना हो, SSH टनलिंग, Tailscale, या रिवर्स-प्रॉक्सी एक्सपोज़र के बीच चयन करना हो, या सुरक्षित व्यक्तिगत तैनाती के लिए Podman, पेयरिंग, सैंडबॉक्सिंग, टोकन प्रमाणीकरण, और टूल-अनुमति डिफ़ॉल्ट की समीक्षा करनी हो, तब उपयोग करें।
devopssecurity
secure-linux-web-hosting
xixu-me
क्लाउड सर्वर को सेल्फ-होस्टिंग के लिए सेट अप करने, सुरक्षित करने या समीक्षा करने के दौरान उपयोग करें, जिसमें DNS, SSH, फायरवॉल, Nginx, स्टैटिक-साइट होस्टिंग, किसी ऐप का रिवर्स-प्रॉक्सी, Let's Encrypt या ACME क्लाइंट के साथ HTTPS, सुरक्षित HTTP-to-HTTPS रीडायरेक्ट, या वैकल्पिक लॉन्च-पश्चात नेटवर्क ट्यूनिंग जैसे BBR शामिल हैं।
devopssecurityaws
opensource-guide-coach
xixu-me
उपयोग तब करें जब कोई उपयोगकर्ता ओपन सोर्स प्रोजेक्ट शुरू करने, उसमें योगदान देने, उसे बढ़ाने, संचालित करने, वित्तपोषित करने, सुरक्षित करने या बनाए रखने पर मार्गदर्शन चाहता है, या योगदानकर्ता ऑनबोर्डिंग, सामुदायिक स्वास्थ्य, अनुरक्षक थकान, आचार संहिता, मीट्रिक्स, कानूनी मूल बातें, या ओपन सोर्स प्रोजेक्ट अपनाने के बारे में पूछता है।
developmentresearch
running-claude-code-via-litellm-copilot
xixu-me
जब Claude Code को स्थानीय LiteLLM प्रॉक्सी के माध्यम से GitHub Copilot पर रूट करना हो, प्रत्यक्ष Anthropic खर्च कम करना हो, ANTHROPIC_BASE_URL या ANTHROPIC_MODEL ओवरराइड कॉन्फ़िगर करना हो, या Copilot प्रॉक्सी सेटअप विफलताओं जैसे model-not-found, कोई localhost ट्रैफ़िक न होना, या GitHub 401/403 प्रमाणीकरण त्रुटियों का समस्या निवारण करना हो, तब उपयोग करें।
developmentapidevops
skills-cli
xixu-me
Use when users ask to discover, install, list, check, update, remove, back up, restore, sync, or initialize Agent Skills, mention `bunx skills`, `npx skills`, `skills.sh`, or `skills-lock.json`, ask "find a skill for X", or want help extending agent capabilities with installable skills.
developmentapiproductivity