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

workerd / urlpattern

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

An informal specification of URLPattern 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 (urlpattern-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 flags above…

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

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
  1. Very specific:

    Errors: every standard failure is TypeError: Failed to construct URLPattern (or Failed to exec URLPattern / Failed to test URLPattern).

    line 35

≈ “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

URLPattern

An informal specification of URLPattern 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 (urlpattern-modules.capnp) against the C++ implementations and the TypeScript one:

CellImplementationFlags the suite branches on
urlpattern-standard-cppapi/urlpattern-standard.{h,c++} (ada)urlpattern_standard, set_tostring_tag
urlpattern-legacy-cppapi/urlpattern.{h,c++} (jsg::UrlPattern)urlpattern_original, do_not_set_tostring_tag
urlpattern-opt-in-cppstandard, with the dateless WebIDL opt-insstandard + spec_compliant_property_attributes, immutable_api_prototypes (--experimental)
urlpattern-standard-ts, urlpattern-legacy-tssrc/per_isolate/urlpattern/, under the TS_URL_PATTERN 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 parser is ada, the legacy one jsg::UrlPattern; their patterns, quirks included, are pinned as they are (construction.js). In a pattern string : starts a named group and ? makes the part before it optional. The standard parser leaves the components after the last one a string names as *, and against a baseURL the credentials too; the legacy one makes them '', and takes a baseURL's search and hash as well.
  • Errors: every standard failure is TypeError: Failed to construct URLPattern (or Failed to exec URLPattern / Failed to test URLPattern); the legacy parser's messages say what failed.
  • RegExp flags: v (standard) and u (legacy), plus i under ignoreCase.
  • Construction and RegExp.prototype.exec: the standard parser asks a protocol pattern that compiles to a RegExp (not * or an exact protocol) whether it matches each special scheme, through the current RegExp.prototype.exec, in both implementations. What a patched exec returns decides whether the pathname compiles as an opaque path's, and what it throws escapes the constructor (pollution.js). The legacy parser calls nothing while it compiles.
  • Inputs: an object, null or undefined is a URLPatternInit (a URL included, read through its getters); anything else a string. A string input is parsed as a URL; one that does not parse, or a baseURL that does not, does not match. An init input is processed as URL components; when that fails the standard parser does not match and the legacy one throws its message. An init with a baseURL throws.
  • Results: inputs holds the string input and baseURL, or a copy of the init. Groups are named by the pattern's names, wildcards and regexp groups numbered; an unmatched optional group is undefined (standard) or '' (legacy).
  • Constructor overloads: with two arguments, a second that is an object, null or undefined is the options, anything else the baseURL.
  • Serialization: a URLPattern throws DataCloneError: Could not serialize object of type "<constructor>".; results are plain objects.

Ledger

#AreaC++TypeScriptTest
1Standard string input that does not parse, no baseURLada resolves it against an empty URL: test('nope') is trueno matchmatching.js
2Standard group orderada's std::unordered_map orderthe pattern'sresults.js
3URLPatternInit read orderdeclared (protocol … hash, baseURL)lexicographicconversions.js
4Result and inputs copy member orderdeclared (inputs, protocol …; input, groups)lexicographicresults.js
5Patched RegExp.prototype.exec while matchingcalled for each component ada's fast paths do not cover; legacy all eightnot calledpollution.js
6Legacy lone surrogatesWTF-8U+FFFDconversions.js
7Three argumentsan object or undefined second argument is the options (undefined: no baseURL); the third is read and ignoredthe second is the baseURL (ToUSVString)construction.js, conversions.js
8Accessor names, constructor prototype, Symbol.toStringTag, globalJSG: anonymous, writable, writable, on the global's prototype (WebIDL under the opt-ins but the tag)WebIDLapi-surface.js
9Calling without newJSG's TypeError messagethe language'sconstruction.js
10Object.prototype settersgroups always set, so a setter takes them; without enable_fast_jsg_struct results assigned toodata propertiespollution.js
11inputs copy of an init under enable_fast_jsg_structevery member, those absent undefinedthe members presentresults.js

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.