How bensgith/userscripts works
Project type and purpose
• This is a personal “monorepo” of independent browser user-scripts (files ending in .user.js), each enhancing or theming a specific website or editor.
• It includes a GitHub Actions workflow to mirror the repo to GitLab, but contains no server, backend or database components.
File structure
• Top-level directories and files
– .github/workflows/sync-to-gitlab.yml: CI pipeline definition
– Several .user.js scripts in the root (e.g. clean-blog-articles.user.js, the-black-zhihu.user.js)
– A “vscode” folder containing more .user.js scripts targeting VS Code web or editor interfaces
• No “src” vs “dist” split, no package.json or build scripts – these are static files.
• No tests folder, no runtime server configs.
README
• Very high-level description: “Just a collection of user scripts for myself.”
• No further architectural notes or dependencies mentioned.
Main components
a. Repository hosting
– GitHub repo (this codebase, .github workflows)
– Mirror on GitLab (via CI)
b. CI/CD pipeline
– GitHub Actions job “sync-to-gitlab”
c. Artifact consumers
– Browser user script manager (Tampermonkey/Violentmonkey, etc.)
– Direct URL fetcher (users install scripts by browsing raw .user.js links)
d. User script files
– Root-scoped scripts (site-specific enhancements)
– vscode-scoped scripts (editor enhancements)
Relationships and interactions
• Developer pushes commits → triggers GitHub Actions → sync workflow runs → pushes mirror to GitLab
• End user points their user-script manager to the raw URL on GitHub (or GitLab) → downloads and runs the script in the browser/VS Code environment
Architectural patterns and design principles
• Monorepo pattern for grouping independent scripts
• CI as code (GitHub workflow for automatic mirroring)
• Static content distribution (no build step)