clasen/rosterserver/roster-server
Claude Code and agent skill by clasen/rosterserver
- community
Checking that the SKILL.md file is still in the repository.
Integrate and troubleshoot roster-server in applications using domain routing, HTTPS certificates, local HTTP, Express, Socket.IO, external servers, and graceful shutdown. Use when adding, configuring, or debugging RosterServer in a service.
Install
npx vskill@latest install clasen/rosterserver/roster-serverSKILL.md
RosterServer integration
Use this skill to configure a consuming application. Keep its existing configuration source, module format, and process lifecycle. Check the installed package's API when version differences matter; the upstream README may describe changes not yet installed.
Choose the lifecycle owner
- Local development:
new Roster({ local: true, wwwPath: absolutePath }), register sites, thenawait roster.start(). Local mode binds tohostname(default::, IPv4 and IPv6) and assigns ports; read URLs withroster.getUrl(domain)after startup. - Standalone HTTPS: set the real
email, absolutewwwPathandgreenlockStorePath; leavelocalfalse.await roster.start()owns ACME HTTP on port 80 and the configured HTTPS listeners. A different HTTPS port does not eliminate the need for port 80. - External server/worker:
await roster.init(), thenroster.attach(server, { port })or an HTTPS helper. The caller owns listening and closing that server.portonattach()selects the routing table, not the TCP port. - Serving-only worker: use
autoCertificates: falsewithinit()andcreateServingHttpsServer({ servername }). A separate manager must provide certificates first. Callingstart()still enables the standalone ACME lifecycle.
init() invokes site factories and can write certificate configuration/start renewal work; it is not a side-effect-free inspection method. Keep domains and certificate configuration consistent across workers sharing a store. The legacy cluster: true launcher delegates process management to Greenlock; it is separate from using Roster with an external cluster manager.
Sites and routing
Register sites before init()/start(). Export a synchronous factory (virtualServer) => requestHandler; the returned (req, res) handler may be async. An Express app is a valid return value. Never call app.listen() inside the factory.
- Discovery tries
index.js,index.mjs, thenindex.cjs; use the module format appropriate to the application's package. Without an entry script,index.htmlenables static serving. filenamechanges the script basename only.basePathsupplies default directories; it does not rebase explicitly supplied relative paths. Prefer absolute paths.- Discovered sites stay on HTTPS 443, even with another default
port. Discovery replaces a manual registration for the same domain/port; distinct ports coexist. - Manual
register('api.example.com:8443', factory)selects that port. Exact hosts precede wildcard matches;*.example.comdoes not match the apex. - Static serving streams files and supports HEAD and directory indexes, with strict missing-file 404s and no SPA fallback.
- Local ports are hash-based with in-instance collision handling, not OS availability detection. Do not hardcode example port numbers.
- Production
getUrl()uses the instance's default port; it is not a per-registration custom-port lookup. A site registered only on another port can returnnull.
Socket.IO and asynchronous requests
Attach Socket.IO to the supplied virtual server. Return the ordinary HTTP handler and register cleanup in the same factory:
Socket.IO wraps the request listeners and captures the returned handler as its fallback. Do not add a manual endpoint exclusion to that handler; use io.path() when application code needs the path. Do not use io.opts.path.
A virtual request listener owns its request even before it ends the response. Roster does not infer that an asynchronous listener declined the request. Thrown/rejected handler errors produce 500 or destroy an already-started response. Virtual servers are not process boundaries. start() runs each site directory in its own process unless isolation: false is set. Factories passed to register() stay in the main process; register a site directory to isolate one.
Shutdown
- Connect
await roster.close()to the application's existing shutdown flow, or explicitly sethandleSignals: truefor automaticSIGINT/SIGTERMcleanup. It defaults tofalse; listeners are installed duringinit()/start()and removed after closure, including failure. Repeated signals during closure do not repeat hooks. Existing signal listeners are preserved; shutdown errors are logged and setprocess.exitCode = 1. Roster never forces process termination. - Register
virtualServer.onClose(fn)for each site's timers, databases, and other resources. Return/await its cleanup Promise; wrap callback APIs when needed. - Roster signals virtual
closeat shutdown start to release integrations such as long polling, closes routed WebSockets, drains HTTP, then runs cleanup hooks concurrently. Put dependent cleanup steps in one hook. - Hooks run once. Failures are aggregated after other hooks are attempted.
closeTimeoutMsbounds the complete operation; timeout cannot cancel arbitrary user Promises or in-flight ACME work. close()is idempotent and terminal.init()/start()share concurrent calls; startup failures clean up the instance. Create a new instance after closing or failed startup.- For
attach()and both HTTPS helpers, also close the caller-owned server. Roster removes its attached listeners but does not own that server's listener lifecycle. Remove manually wired dispatchers yourself. - Coordinate each process separately; closing an instance does not stop the legacy Greenlock cluster's worker processes.
Certificates and plugins
- Use
staging: truefor ACME test issuance when requested.init()alone does not bind the HTTP challenge listener. - Wildcard certificates require DNS-01. The default CLI wrapper needs manual TXT records unless an API provider is configured;
dnsChallenge: falsedisables that integration, not HTTPS. - Linode mode uses
ROSTER_DNS_PROVIDER=linodeandLINODE_API_KEYfrom the application's secret configuration; a key also selects Linode when no provider is set. With an explicitdnsChallengeobject, includemodule: 'acme-dns-01-cli'to select the wrapper. - For unattended Linode operation that must fail rather than fall back to manual DNS, set
dnsChallenge.dnsApiFallbackToManual: false. Keep other provider choices explicit. combineWildcardCertscombines apex/www/wildcard issuance using DNS-01;disableWildcardignores wildcard sites. Do not enable either as a generic troubleshooting step.ensureCertificate(name)loads existing PEMs or issues missing ones;loadCertificate(name)only reads files. Neither means “force renewal.” File-based SNI caches detect certificate changes on supported runtimes.- In local testing, Bun 1.3.4's
node:httpsserving helper did not invokeSNICallback, including with the previous synchronous resolver. Do not promise SNI certificate reload merely because files changed; Node and Bun require separate runtime verification. - Request plugins registered with
roster.use(fn)are synchronous and run before redirects/dispatch. Returntrueonly after handling the response. Promise returns produce 500. - The optional
createScannerBlockercomes fromroster-server/plugins/scanner-blocker.js. Its ban state is per process and in memory. EnabletrustProxyonly when a trusted proxy overwritesX-Forwarded-For;onBlockdoes not itself provide shared bans.
Use the consuming application's installed README for the complete options and method signatures. The upstream README is the project reference; prefer documentation matching the installed version.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/roster-server/SKILL.md
Popularity
- Repository stars
- 1
- Repository npm downloads, 7 days
- 913
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 23 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/clasen/rosterserver/roster-server)