agentleFS
CloudflareKnown publishercloudflare/workerd/src/tests/url/AGENTS.md

workerd / url

AGENTS.md9.2k starsChanged 8 months agoApache-2.0View on GitHub

An informal specification of URL and URLSearchParams as implemented in workerd, kept in lockstep with the test suite in this directory. The tests are the normative artifact. The cells run the same modules (url-modules.capnp) against the C++ implementations and the TypeScript one: which-impl.js reads the flags; a cell's USING_TS_IMPL binding says which implementation it means to run. enable_fast_jsg_struct is not pinned: the @ and @all-compat-flags variants run each cell with it off and on. The TypeScript implementation honors the dated…

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 3 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 3 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 4 mentionsSep 2026: 4 mentionsOct 2026: 4 mentionsNov 2026: 3 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the cloudflare/workerd repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about cloudflare/workerd

The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 39

Talked about on GitHub, Bluesky, Hacker News and Stack Overflow (39 times).

On GitHub · 32

27 more on GitHub

On Hacker News · 2

On Stack Overflow · 1

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 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.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Setters: only href throws (Failed to set the 'href' property on 'URL': ...).

    line 36
  2. Very specific:

    Serialization: every URL, URLSearchParams and iterator throws DataCloneError: Could not serialize object of type "<constructor>".

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 41,581 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

URL and URLSearchParams

An informal specification of URL and URLSearchParams as implemented in workerd, kept in lockstep with the test suite in this directory. The tests are the normative artifact. The cells run the same modules (url-modules.capnp) against the C++ implementations and the TypeScript one:

CellImplementationFlags the suite branches on
url-standard-cppapi/url-standard.{h,c++} (ada)url_standard, urlsearchparams_delete_has_value_arg, set_tostring_tag
url-standard-legacy-flags-cppthe sameurl_standard, no_urlsearchparams_delete_has_value_arg, do_not_set_tostring_tag
url-legacy-cppapi/url.{h,c++} (kj::Url)url_original, workers_api_getters_setters_on_prototype, set_tostring_tag, urlsearchparams_delete_has_value_arg
url-legacy-instance-cppthe same, attributes on each instanceurl_original, workers_api_getters_setters_on_instance, do_not_set_tostring_tag, no_urlsearchparams_delete_has_value_arg
url-opt-in-cppstandard, with the dateless WebIDL opt-insstandard + spec_compliant_property_attributes, immutable_api_prototypes (--experimental)
url-standard-ts, url-standard-legacy-flags-ts, url-legacy-ts, url-legacy-instance-tssrc/per_isolate/url/, under the TS_URL autogateas the C++ cell of the same name

which-impl.js reads the flags; a cell's USING_TS_IMPL binding says which implementation it means to run. enable_fast_jsg_struct is not pinned: the @ and @all-compat-flags variants run each cell with it off and on.

The TypeScript implementation honors the dated flags above and is otherwise WebIDL-conformant, so it differs from the C++ only toward the spec, in the rows of the ledger below. Each row is pinned on both sides with a usingTsImpl branch. The C++ cells disable the @all-autogates variant, which would run the TypeScript implementation under them.

Core semantics

  • Parsing: the standard backend is ada; the legacy backend is kj::Url, whose results, quirks included, are pinned as they are (setters.js, construction.js, and the URL test data kj::Url passes in legacy-conformance.js). Legacy constructor errors distinguish Invalid base URL string.; the standard one says Invalid URL string. for everything.
  • Setters: only href throws (Failed to set the 'href' property on 'URL': ...); the others leave the URL unchanged on a value they reject. The legacy host, hostname and port setters do not validate. A host kj::Url cannot stringify, or a path whose %2E it decoded, makes href, toString(), toJSON() and the protocol, username and password setters throw Invalid hostname when stringifying URL. or Invalid pathname when stringifying URL.
  • searchParams is the same object for the URL's lifetime. The href and search setters reach it, and every mutator, even one that changes nothing, reserializes the URL's query (?a=b%20c becomes ?a=b+c).
  • Arguments: a missing required argument is a TypeError; an explicit undefined converts to "undefined", null to "null". The standard path converts to USVStrings (a lone surrogate becomes U+FFFD); the legacy one keeps the WTF-8 bytes.
  • Iteration is live by index: deleting the current entry skips the next, appended entries are visited, and done is not sticky.
  • Serialization: every URL, URLSearchParams and iterator throws DataCloneError: Could not serialize object of type "<constructor>".

Ledger

#AreaC++TypeScriptTest
1Legacy instance layout12 own native data properties, reverse WebIDL orderown accessors, same orderapi-surface.js
2Constructors' prototypewritable unless immutable_api_prototypesnon-writableapi-surface.js
3Calling without newJSG's TypeError messagethe language'sconstruction.js
4Serialization messagenames the constructorthe sameserialization.js
4aIterator serialization messageEntryIterator, ...follows #6serialization.js
5Member orderstandard: origin first, searchParams after hash; legacy: WebIDL attributes, toString before toJSONWebIDLapi-surface.js, inspect.js
6Iteratorsthree prototypes and tags (EntryIterator, ...), @@iterator !== entriesone URLSearchParams Iterator prototype, @@iterator === entriesiteration.js, api-surface.js, illegal-invocation.js
9Iterator results and Object.prototype setterswithout enable_fast_jsg_struct, made by assignment: done/value setters runobject literalspollution.js
13Function lengths, accessor names0 and anonymous, unless spec_compliant_property_attributesWebIDLapi-surface.js
14Globalson the global's prototype; also own under spec_compliant_property_attributesown onlyapi-surface.js
15Legacy staticsnonecanParse, parse, createObjectURL, revokeObjectURLapi-surface.js, construction.js
16Legacy initializerarrays and dicts: a Map or other iterable is a dict of its own propertiesWebIDL unionsearch-params.js
17Legacy lone surrogatesWTF-8U+FFFDconversions.js
18forEach(cb, null) receiverundefinednulliteration.js
20Symbol.toStringTagwritablenon-writableapi-surface.js
21Initializer with a non-callable @@iteratora recordTypeErrorsearch-params.js
22Legacy-instance URL.prototypetoString, toJSON onlythe accessors tooapi-surface.js
23Legacy delete/has value under urlsearchparams_delete_has_value_argignoredhonoredsearch-params.js
24Iterator result shape{ done, value }; without enable_fast_jsg_struct the last lacks value{ value, done }iteration.js
25Record initializer read orderevery key's descriptor, then every valueeach key's descriptor, then its valuesearch-params.js
26Record initializer with an enumerable Symbol keyskippedTypeError, as WPT's headers-record.any.js requires of recordssearch-params.js
27Standard sequence initializer's final iterator resultits value is appended, a generator's return value includedignoredsearch-params.js

Rows the plan keeps but no test here covers: #7 and #11 (now matches), #8 and #19 (WPT), #10 (RPC; with the TS cells) and #12 (heap snapshots).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.