workers-sdk / workers-utils
AGENTS.md4.6k starsChanged 6 months agoApache-2.0View on GitHub
Shared utility package used across wrangler, miniflare, and others. Two main areas: config validation and test helpers.
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/miniflare/AGENTS.mdAGENTS.md
- packages/vite-plugin-cloudflare/AGENTS.mdAGENTS.md
- packages/vitest-plugin/AGENTS.mdAGENTS.md
- packages/workers-auth/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
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Test helpers imported as @cloudflare/workers-utils/test-helpers across packages
≈ “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
AGENTS.md — workers-utils
OVERVIEW
Shared utility package used across wrangler, miniflare, and others. Two main areas: config validation and test helpers.
STRUCTURE
src/config/— Configuration types, validation, normalizationvalidation.ts— The config normalizer (large file). Central to all wrangler config processing.environment.ts— Environment/config field definitions (many deprecated fields)config.ts— Config types
src/test-helpers/— Shared test utilities used across packagessrc/types.ts— Shared type definitions
KEY EXPORTS
Config
- Validation pipeline normalizes wrangler.json/toml into typed config objects
- Used by wrangler for all config loading
D1 migrations
getD1MigrationFiles({ projectPath, migrationsDir, migrationsPattern })— shared glob-based discovery used by Wrangler and the Vitest plugin. Honourmigrations_patternrather than recursively collecting every.sqlfile.
Shared runtime utilities
createConfigCache(logger)— file-backed JSON config cache (node_modules/.cache or.wrangler/cache). Generic mechanism; the consumer passes its logger (this package has no logger singleton). Bothwrangler(src/config-cache.ts) and@cloudflare/workers-authbuild their own instances.openInBrowser(url, logger)— opens theopenpackage with a graceful copy-paste fallback when no browser opener is available. Logger is a parameter, not imported.isInteractive()/isNonInteractiveOrCI()/isCI()— TTY / CI detection (the TTY check is inlined here to avoid a cycle back through@cloudflare/cli-shared-helpers).isCI()keys off CI specifically (ignoring TTY), for behaviour like redacting account names in public CI logs. These readci-info, which is bundled into consumers' distributables. Because a bundledci-infois an unmockable separate instance (and reads the real environment), consumers that need to fake CI in their tests mock this package's exports rather thanci-info— e.g. wrangler'svitest.setup.tsmocks@cloudflare/workers-utilssoisInteractive/isNonInteractiveOrCI/isCIdelegate to the mockableci-info, which reaches both wrangler-source and bundled@cloudflare/workers-authconsumers (since@cloudflare/*is external in workers-auth's bundle).
Test Helpers
runInTempDir()— Creates temp dir, chdir's into it, stubs HOME/XDG_CONFIG_HOME, cleans upseed(files)— WritesRecord<string, string>of path->content into temp dirwriteWranglerConfig()/readWranglerConfig()— Mock wrangler config files (TOML, JSON, JSONC)mockConsoleMethods()— Spies on console, returns normalized output with.debug,.out,.info,.err,.warnnormalizeString()— Multi-stage pipeline: strips timings, thin spaces, temp dirs, normalizes slashes/cwd/dates/tables/error markers/byte values, and scrubs the OAuth authorize URL's randomstate/code_challengequery params to<OAUTH_STATE>/<OAUTH_CODE_CHALLENGE>(so login-URL snapshots stay deterministic without mocking the URL builder)
NOTES
validation.tsis the largest single file in the monorepo after generated code — changes here affect all config processing- Many deprecated fields in
environment.ts— check@deprecatedannotations before modifying - Test helpers imported as
@cloudflare/workers-utils/test-helpersacross packages
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.

