Thanks for helping improve the collection! This repo is plain JavaScript —
no build step, no bundler. The *.user.js file you edit is exactly what users
install, so keep scripts readable and self-contained.
-
Copy the template. Duplicate
scripts/example-hello-world/toscripts/<slug>/. The folder name, the slug, and the.user.jsfilename must all match (e.g.scripts/reddit-old-redirect/reddit-old-redirect.user.js). Use a short, lowercase, hyphenated slug. -
Fill in the metadata block. Required keys (CI enforces these via
tools/validate-metadata.mjs):Key Notes @nameHuman-readable title @namespacehttps://github.com/Skriptey/Userscripts@versionSemver-ish, e.g. 1.0.0— bump on every change@descriptionOne sentence @authorSkripteyor your name@licenseGPL-3.0-or-later@matchor@includeThe target site(s) @grantnone, or theGM_*APIs you use@downloadURLhttps://skriptey.github.io/Userscripts/<slug>/<slug>.user.js@updateURLsame as @downloadURLRecommended extras:
@run-at,@icon,@homepageURL(…/tree/main/scripts/<slug>),@supportURL(https://github.com/Skriptey/Userscripts/issues).Also add an SPDX line under the block:
// SPDX-License-Identifier: GPL-3.0-or-later. -
Write the code inside an IIFE with
'use strict';. Prefer no@grant(run in page scope) unless you needGM_*APIs. Don't fetch remote code at runtime; if you must use a library, pin it with@require <versioned-URL>and note it in the script's README. -
Add
scripts/<slug>/README.mddescribing what the script does and an install link. -
Check locally:
npm install # one-time: installs ESLint + Prettier (dev only) npm run check # ESLint + Prettier check + metadata validation npm run format # auto-format your changes npm run build:index # optional: regenerate site/ to preview the index
-
Open a pull request. The PR template checklist must pass; the
Lint & validate,CodeQL, andSecret scanchecks run automatically.
Bump @version (managers only offer updates when the version increases) and
describe the change in the PR. Keep @downloadURL/@updateURL pointing at the
script's slug.
Drop an empty file named .privatescript into a scripts/<slug>/ folder to
keep that script out of the published collection. Such a folder is excluded
from the install index and is not shipped to the public site at all — it
stays only in the development repository. Use this for work-in-progress or
personal scripts you don't want publicly listed or downloadable. (A private
script still needs valid metadata; point its @downloadURL/@updateURL at
wherever you actually distribute it, if anywhere.)
- Plain JavaScript wrapped in an IIFE; no transpilation.
- ESLint + Prettier enforce quality and formatting — run
npm run check, andnpm run formatto auto-fix. Prettier owns formatting; don't hand-fight it. - 2-space indent, semicolons, single quotes (
.editorconfig/.prettierrc.json). - The lint/format tooling is dev-only — the
.user.jsfiles still ship verbatim. - No minification — readability is a feature for a public collection.
- Never commit secrets, tokens, or personal data.
Use the issue templates. For security problems, don't open a public issue — see SECURITY.md.