workers-sdk / miniflare
AGENTS.md4.6k starsChanged 6 months agoApache-2.0View on GitHub
Local dev simulator for Cloudflare Workers, powered by workerd runtime. Main class Miniflare in src/index.ts.
Trending
Quiet since August.about the whole repository
Who's talking about cloudflare/workers-sdk
- cloudflare/workerd“🐛 BUG: The cache field on RequestInitializerDict is not implemented in fetch”GitHub · Apr 7, 2023 · 85 reactions
- sveltejs/kit“feat: Vite environment API”GitHub · Jul 17, 2025 · 31 reactions
- remix-run/remix“Cloudflare support for Vite”GitHub · Jan 16, 2024 · 25 reactions
- cloudflare/workerd“🐛 BUG: Workers TTFB slows down based on unused dynamic imports (additional modules)”GitHub · Mar 27, 2024 · 22 reactions
- withastro/astro“Cloudflare adapter returning [object Object]”GitHub · Oct 10, 2025 · 18 reactions
The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 17
Talked about on GitHub, Bluesky and Hacker News (17 times).
On GitHub · 14
- Apr 7, 2023🐛 BUG: The cache field on RequestInitializerDict is not implemented in fetch — cloudflare/workerd85 reactions · 61 comments
- Jul 17, 2025feat: Vite environment API — sveltejs/kit31 reactions · 16 comments
- Jan 16, 2024Cloudflare support for Vite — remix-run/remix25 reactions · 21 comments
- Mar 27, 2024🐛 BUG: Workers TTFB slows down based on unused dynamic imports (additional modules) — cloudflare/workerd22 reactions · 6 comments
- Oct 10, 2025Cloudflare adapter returning [object Object] — withastro/astro18 reactions · 15 comments
9 more on GitHub
- May 24, 2023Support Node Compat in Cloudflare Adaptor — sveltejs/kit17 reactions · 2 comments
- Oct 17, 2024Support Wrangler, the CLI for Cloudflare Workers — denoland/deno15 reactions · 8 comments
- Aug 10, 2026feat: `@cloudflare/vite-plugin` integration, take 2 — sveltejs/kit11 reactions · 5 comments
- Jul 22, 2023Feature Request — Runtime APIs: Superfluous throws — cloudflare/workerd11 reactions
- Oct 29, 2025Add --target=cloudflare support to bundler — oven-sh/bun8 reactions · 10 comments
- Nov 6, 2025placement just got better (finally) — cloudflare/cloudflare-docs7 reactions · 6 comments
- Oct 28, 2025vitest 4.0 fails with "TypeError: filename.replace is not a function" — withastro/astro7 reactions · 3 comments
- May 23, 2025'scopes' for Secret Store's secrets not retained in local development — cloudflare/developer-platform7 reactions · 7 comments
- Jul 23, 2024bun fetch to wrangler dev server crashes server and fails with "socket connection was closed unexpectedly" — oven-sh/bun7 reactions · 20 comments
On Bluesky · 2
- Oct 20, 2023📦 cloudflare / workers-sdk ⭐ 1,781 (+48) 🗒 TypeScript ⛅️ Home to Wrangler, the CLI for Cloudflare Workers® — @github-trending-js.bsky.social1 likes and repost
- Oct 20, 2023📦 cloudflare / workers-sdk ⭐ 1,734 (+4) 🗒 TypeScript ⛅️ Home to Wrangler, the CLI for Cloudflare Workers® — @github-trending.bsky.social1 likes and repost
On Hacker News · 1
- May 2, 2026Cloudflare Workers let you deploy serverless code instantly across the globe3 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packages/auto-triage-bot/AGENTS.mdAGENTS.md
- packages/create-cloudflare/AGENTS.mdAGENTS.md
- packages/vite-plugin-cloudflare/AGENTS.mdAGENTS.md
- packages/vitest-plugin/AGENTS.mdAGENTS.md
- packages/workers-auth/AGENTS.mdAGENTS.md
- packages/workers-utils/AGENTS.mdAGENTS.md
- packages/wrangler/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- local-explorerSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Does NOT extend shared @cloudflare/workers-tsconfig — has its own full config
- Very specific: line 43
Test files use .spec.ts (NOT .test.ts)
- Very specific: line 45
Does NOT extend vitest.shared.ts — own full vitest config
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Miniflare — Agent Guide
Overview
Local dev simulator for Cloudflare Workers, powered by workerd runtime. Main class Miniflare in src/index.ts.
Structure
src/index.ts— MainMiniflareclass, server setup, plugin orchestration, all exportssrc/workers/— ~30 embedded worker scripts (D1, KV, R2, caches, etc.), built viaworker:virtual import schemesrc/workers/shared/— Shared utilities across embedded workerssrc/workers/core/dev-registry-proxy.worker.ts— Proxy worker for cross-process service bindings via debug port RPCsrc/workers/core/dev-registry-proxy-shared.worker.ts— Shared proxy logic (registry Map, DO proxy class, tail serializers)src/shared/dev-registry.ts— Filesystem-based worker registry (chokidar watch, heartbeat, stale cleanup)src/shared/persist-root-lock.ts— Token-safe startup serialisation for shared persistent storagesrc/shared/DEV_REGISTRY.md— Full architecture doc for the dev registrysrc/runtime/config/generated/workerd.ts— Generated workerd Cap'n Proto config typestest/— Tests (.spec.tsnaming, NOT.test.ts)test/test-shared/— Shared test utilitiesscripts/build.mjs— Custom esbuild build script
Build
- Custom
scripts/build.mjsbundlessrc/index.tsas CJS →dist/src/index.js - Also compiles ~30 embedded worker scripts via
worker:...virtual import scheme — each triggers a nested esbuild sub-build producing standalone ESM worker scripts - Build outputs:
dist/,worker-metafiles/
Lint Status (Transitional)
- Many shared ESLint rules temporarily DISABLED:
no-explicit-any,consistent-type-imports,no-shadow,no-floating-promises, others - Comment in config: "temporarily enabled while we transition Miniflare to use the standard workers-sdk eslint config"
no-console: erroris on, except forsrc/workers/andscripts/
TypeScript
- Does NOT extend shared
@cloudflare/workers-tsconfig— has its own full config - Uses
experimentalDecorators - Path aliases:
miniflare:shared,miniflare:zod declaration: true(emits .d.ts)
Testing
- Test files use
.spec.ts(NOT.test.ts) pool: "forks",maxWorkers: 1(Vitest 4 equivalent of the oldsingleFork: true)- Does NOT extend
vitest.shared.ts— own full vitest config - Timeouts: 30s test, 30s hook
globals: true- Factory pattern:
miniflareTest(opts, handler?)creates instance inbeforeAll, disposes inafterAll useDispose(mf)/disposeWithRetry()— exponential backoff for Windows EPERM file lockinguseServer()— temp HTTP server with auto-cleanupTestLog— captures log entries by level
Generated Files
src/runtime/config/generated/workerd.ts— generated Cap'n Proto types, do not edit directlysrc/workers/local-explorer/openapi.local.json— generated fromscripts/openapi-filter-config.ts, modify the config not the output
Version Pinning
- Miniflare minor version must match workerd minor version
.github/changeset-version.jsenforces this: if changeset bumps miniflare minor beyond workerd's, it converts to patch
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

