How Edaskills Runs on Cloudflare Workers
One Worker serves the library, streams package downloads from R2, and keeps the leaderboards fresh.
Edaskills ships as a single Cloudflare Worker: server-rendered pages, JSON APIs, the MCP endpoint and package downloads all run in the same place. This post walks through the pieces that make a skill library work on that runtime.
One Worker, the whole platform
The app is TanStack Start + React 19. Requests hit the Worker, server functions do the database and storage work, and the response ships fully rendered HTML plus hydration state. Three bindings carry the state: D1 (SQLite) for skills, versions, accounts, installs and ratings; R2 for package ZIPs, demo-run artifacts and previews; KV for cached leaderboard JSON.
Downloads stream through the Worker
The R2 bucket stays private. A download request is authenticated, checked against the published version, and streamed back from R2 in the same request that records the install — one transaction, deduplicated per user and version. The response carries Content-Disposition and an X-Checksum-Sha256 header so the CLI and browser can verify the package before unpacking. No presigned URLs, no public bucket prefixes.
The publish pipeline keeps one source of truth
Admins upload a ZIP; the pipeline validates entry paths, links, sizes and the demo-run report contract, then extracts SKILL.md and references/ into read-only derived fields. The detail page and the public skill.md endpoint render exactly what is inside the package. Editing content means uploading a new version — the database never drifts from the ZIP.
Boards stay fresh without counters in KV
Trending scores (deduplicated installing users over a rolling 7-day window) and rating aggregates are recomputed by scheduled triggers and written to D1; KV only caches the resulting board JSON with a short TTL. KV is eventually consistent and has no atomic increment, so counting lives in D1 transactions.
Why Workers fits a library like this
There is no server to operate, R2 egress is free so streaming downloads costs nothing per byte, and the same runtime hosts the MCP endpoint next to the web app. The constraint is discipline: no Node-only APIs, short CPU budgets per request, and cache misses that fall back to D1 instead of failing.