agentleFS

AGENTS.md examples from real projects

How real projects brief Codex, Cursor and every other agent that reads AGENTS.md.

Worked for most · soon
CloudflareAGENTS.md

workerd / net

cloudflare/workerd/src/tests/node/net/AGENTS.md

An informal specification of how a node:net Socket drives the two web-stream halves of the connect() socket underneath it, derived from and kept in lockstep with the test suite in this directory. The tests are the normative artifact; this document maps behaviors to the tests that assert them. Every test runs against the C++ streams implementation (net-cpp.wd-test) and the TypeScript one (net-ts.wd-test). The general net surface (option validation, DNS, BlockList, SocketAddress, BoundSocket, abort signals, reconnect) is owned by src/workerd/api/node/tests/net-nodejs-test.js; this…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / stream

cloudflare/workerd/src/tests/node/stream/AGENTS.md

An informal specification of the node:stream web-interop surface — Readable.toWeb/fromWeb, Writable.toWeb/fromWeb, Duplex.toWeb/fromWeb, Duplex.from, Readable.from over a web stream, pipeline, compose, finished, addAbortSignal, node:stream/web, node:stream/consumers — derived from and kept in lockstep with the test suite in this directory. The tests are the normative artifact; this document maps behaviors to the tests that assert them. Every test runs against the C++ streams implementation (stream-cpp.wd-test) and the TypeScript one (stream-ts.wd-test); the divergence ledger pins the places where the node layer observes a…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / streams

cloudflare/workerd/src/tests/streams/AGENTS.md

Streams test suite, organized WPT-style: one subdirectory per functional area (identity/, encoding/, compression/, digest/, strategies/, readable/, readable-byte/, writable/, transform/, piping/, inspect/, r2-patterns/, iocontext/, cache/, htmlrewriter/, formdata/, sockets/, scaling/). Every test here runs against both streams implementations — the legacy C++ one (src/workerd/api/streams/) and the TypeScript one (src/per_isolate/webstreams/) — to prove parity. A test that only makes sense for one implementation's internals belongs elsewhere. - One file, one behavior. Decompose aggressively; the filename names the behavior. Shared setup helpers go in…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / cache

cloudflare/workerd/src/tests/streams/cache/AGENTS.md

The Cache API consuming and producing stream bodies under both stream implementations. The tests are the normative artifact. The general Cache API surface (headers, vary, purge, instrumentation) is owned by src/workerd/api/tests/cache-*; this suite owns the STREAMS interaction only. All cells wire cacheApiOutbound to a loopback cache-backend worker (cache-backend.js). A cache.put() arrives there as a PUT whose body is the SERIALIZED HTTP RESPONSE (status line + headers + CRLFCRLF + body); the backend splits at the header boundary, verifies the continuous…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / compression

cloudflare/workerd/src/tests/streams/compression/AGENTS.md

An informal specification of the two Compression Streams classes as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact. Both the C++ implementation (src/workerd/api/streams/compression.{h,c++}, built on internal streams over the shared api/compression.h CodecStage) and the TypeScript implementation (src/per_isolate/webstreams/compression.ts, behind typescript_implemented_streams) are covered. The two wrap the SAME C++ zlib codec (the TS pair drives utils.newCompressionCodec handles), so codec output is parity by construction; divergences live…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / digest

cloudflare/workerd/src/tests/streams/digest/AGENTS.md

An informal specification of the Cloudflare-specific DigestStream (a WritableStream subclass computing a hash digest) as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact. Both the C++ implementation (src/workerd/api/crypto/crypto.{h,c++}) and the TypeScript implementation (src/per_isolate/crypto/digest-stream.ts, behind typescript_implemented_streams) are covered. Both drive the SAME native digest context (utils.createDigestContext → CRC/OpenSSL contexts and the WTF-8/toWellFormed string encoder), so hashing, string encoding, and byte counting are parity by construction;…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / encoding

cloudflare/workerd/src/tests/streams/encoding/AGENTS.md

An informal specification of the two WHATWG Encoding stream classes as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact; this document indexes every specified behavior to the test that asserts it. Both the C++ implementation (src/workerd/api/streams/encoding.{h,c++}) and the TypeScript implementation (src/per_isolate/webstreams/encoding.ts, behind typescript_implemented_streams) are covered. The WPT encoding/streams/* tests already run against both implementations (//src/wpt:encoding and //src/wpt:encoding-ts), so this suite complements WPT rather than…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / formdata

cloudflare/workerd/src/tests/streams/formdata/AGENTS.md

Multipart parsing FROM streamed bodies and FormData serialized INTO a stream body — under both stream implementations. The tests are the normative artifact. The general FormData surface (W3C API matrix, urlencoded, entry semantics) is owned by src/workerd/api/tests/ form-data-test.js; this suite owns the STREAMS interaction only. Both cells set formdata_parser_supports_files so multipart file entries parse as File objects.

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / htmlrewriter

cloudflare/workerd/src/tests/streams/htmlrewriter/AGENTS.md

HTMLRewriter consuming stream bodies, producing a stream body, and reading streamed replacement content — under both stream implementations. The tests are the normative artifact. The general rewriter surface (selectors, handler types, comments/doctype/text tokens, async handlers) is owned by src/workerd/api/tests/ htmlrewriter-test.js; this suite owns the STREAMS interaction only. Unlike the api/tests rewriter files (which pin the pre-fixup behavior via original-transform-stream-backpressure), the cpp cell here runs under the MODERN fixup-transform-stream-backpressure. After the next source chunk wakes a canceled rewriter pump, C++ makes…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / identity

cloudflare/workerd/src/tests/streams/identity/AGENTS.md

An informal specification of the two workerd-specific identity stream surfaces, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact; this document is the index that maps every specified behavior to the test that asserts it. Both the legacy C++ implementation (src/workerd/api/streams/) and the TypeScript implementation (src/per_isolate/webstreams/identity.ts, behind typescript_implemented_streams) are covered; where they deliberately diverge, both sides are specified and pinned. Unless marked otherwise, behaviors below describe the current…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / inspect

cloudflare/workerd/src/tests/streams/inspect/AGENTS.md

Informal specification of node:util inspect output for every stream surface, derived from — and kept in lockstep with — this suite. The tests are the normative artifact. The C++ implementation installs a custom inspect exposing lock/state internals; the TypeScript implementation has none — every stream inspects as a bare ClassName {} regardless of state, so introspection consumers lose [state], [supportsBYOB], [length], and [expectsBytes] under TS. Both sides are pinned verbatim at every lifecycle transition. The C++ cell pins, beyond the…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / iocontext

cloudflare/workerd/src/tests/streams/iocontext/AGENTS.md

Module evaluation runs OUTSIDE any IoContext, and streams constructed there must work — including when later used inside requests. Migrated wholesale from streams-iocontext-test.js (itself ported from the edgeworker streams-iocontext.ew-test), plus the module-scope WritableStream pin from streams-test.js and new byte-stream and TransformStream coverage. The tests are the normative artifact. Structure note: the module-scope streams live in global-scope-streams.js together with the routing fetch handler; main.js re-exports both. Moving the constructions would change which module's evaluation performs them. Cross-request state (tests 6-8) uses…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / piping

cloudflare/workerd/src/tests/streams/piping/AGENTS.md

Informal specification of stream piping as implemented in workerd, derived from — and kept in lockstep with — this suite. The tests are the normative artifact. Endpoint behaviors belong to the sibling suites (writable/, transform/, readable/, readable-byte/); identity↔ identity piping — including the circular pipeThrough pin — lives in the identity suite's pipe-integration.js. The suite COMPLEMENTS WPT (//src/wpt:streams). The C++ seeds in piping/error-propagation-forward largely root-cause to harness shapes plus ledger #5/#6 below. piping/close-propagation-backward and error-propagation-backward pass with pipe_to_backward_propagation, which the…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / r2-patterns

cloudflare/workerd/src/tests/streams/r2-patterns/AGENTS.md

R2's SDK consumes workerd streams through readAtLeast-driven BYOB loops, tees, Request clones, and TextDecoderStream. This suite pins those real-world shapes against both implementations, migrated wholesale from streams-r2-patterns-test.js. The tests are the normative artifact. The readAtLeast tail rows all follow the C++ tail contract: a close below the minimum folds the available bytes into a done=false result and a follow-up read resolves done. The remaining divergences are the tee byobRequest model (row 2, accepted) and how much an identity-stream readAtLeast takes…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / readable

cloudflare/workerd/src/tests/streams/readable/AGENTS.md

Informal specification of the value-oriented ReadableStream as implemented in workerd, derived from — and kept in lockstep with — this suite. The tests are the normative artifact. Byte streams (type:'bytes', BYOB) belong to the readable-byte suite; the pipeTo/ pipeThrough matrix belongs to piping/. The suite COMPLEMENTS WPT (//src/wpt:streams). Probing the C++ expectedFailures showed many root-cause to a handful of construction divergences (hwm Infinity rejection, validation order) rather than behavioral gaps; the reentrancy family is mostly parity at finite hwm.

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / readable-byte

cloudflare/workerd/src/tests/streams/readable-byte/AGENTS.md

Informal specification of byte-oriented ReadableStreams as implemented in workerd, derived from — and kept in lockstep with — this suite. The tests are the normative artifact. Value streams live in readable/; the pipeTo/pipeThrough matrix belongs to piping/. The suite COMPLEMENTS WPT (//src/wpt:streams). Probing showed the C++ failures in readable-byte-streams/* root-cause to a few construction and pump divergences plus the close-with-partial and read-min shapes below; the releaseLock→second-reader cluster and the buffer-hazard families are behavior-parity (messages aside).

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / scaling

cloudflare/workerd/src/tests/streams/scaling/AGENTS.md

Dequeue cost stays linear in every internal queue of both streams implementations: buffered chunks, pending reads, pending pull-intos, write requests, the writable controller's chunk queue, and the identity stream's write snapshots. Each test drives one queue to 80k-160k entries (identity: 80k, over a 16x range) and asserts, through helpers.js, that the time grows by at most 4x the linear multiple of a run at 1/8 (identity: 1/16) the size. The ratio is machine-independent; the sizes sit well past the ~20k…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / sockets

cloudflare/workerd/src/tests/streams/sockets/AGENTS.md

The readable/writable stream halves of connect() TCP sockets under both stream implementations. The tests are the normative artifact. The general Socket surface (startTls, secureTransport, DNS overrides, the connect-handler protocol, HTTP-over-socket) is owned by src/workerd/api/tests/ (http-socket-test, connect-handler-test, starttls-*); this suite owns the STREAMS interaction only. A node sidecar (echo-server.js) runs three TCP servers, their ports delivered through fromEnvironment bindings (STREAMS_ECHO_PORT, STREAMS_GREET_PORT, STREAMS_STALL_PORT, plus SIDECAR_HOSTNAME): - echo: echoes every byte; on client half-close, flushes and ends (the client's readable reaches EOF after…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / strategies

cloudflare/workerd/src/tests/streams/strategies/AGENTS.md

An informal specification of the two WHATWG queuing strategy classes as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact. Both the C++ implementation (src/workerd/api/streams/readable.h) and the TypeScript implementation (src/per_isolate/webstreams/strategies.ts, behind typescript_implemented_streams) are covered. The WPT streams/queuing-strategies.any.js runs against both implementations; its 12 C++ expectedFailures in src/wpt/streams-test.ts correspond exactly to ledger entries #1–#6 below — the suite pins what the C++ side actually does where…

9.1k8mo agoReviewMountCreate a free account to mount
CloudflareAGENTS.md

workerd / transform

cloudflare/workerd/src/tests/streams/transform/AGENTS.md

An informal specification of the JS-backed TransformStream as implemented in workerd, derived from — and kept in lockstep with — the test suite in this directory. The tests are the normative artifact. Both the C++ implementation (src/workerd/api/streams/transform.c++ over standard.c++'s TransformStreamDefaultController) and the TypeScript implementation (behind typescript_implemented_streams) are covered. The suite COMPLEMENTS WPT (//src/wpt:streams runs transform-streams/ against both implementations). Probing the 30+ C++ expectedFailures showed most narrow to a handful of root causes (below); several WPT "failures" (properties.any's arg counts/prototype-chain, the…

9.1k8mo agoReviewMountCreate a free account to mount
CLAUDE.md vs AGENTS.md

About AGENTS.md

What is AGENTS.md?

An open format for instructions to coding agents, read by Codex, Cursor and others. Think of it as a README written for agents.

Where does it go?

At the repository root, with more specific files in subdirectories. Agents read the one closest to the file they're editing.

What should it contain?

Setup and test commands, code style, and the rules a new contributor would need to know.

Does Claude Code read it?

Claude Code reads CLAUDE.md. A one-line CLAUDE.md that points at AGENTS.md covers both.