Workers SDK

Wrangler and the toolchain for Cloudflare Workers.

States that copied values go stale, and points at the config that defines them instead.

Documents

├── AGENTS.mdeach package's own AGENTS.md
├──  · imports AGENTS.md
├── .changeset
│   └── 
├── .github
│   └── PULL_REQUEST_TEMPLATE.md · unavailable at this commit
└── packages
    ├── auto-triage-bot
    │   └── 
    ├── create-cloudflare
    │   └── 
    ├── miniflare
    │   └── 
    ├── vite-plugin-cloudflare
    │   └── 
    ├── vitest-plugin
    │   └── 
    ├── workers-auth
    │   └── 
    ├── workers-utils
    │   └── 
    └── wrangler
        └── 

The file, explained

What makes it useful

Opens with a rule about its own maintenance, then covers commands, a task-to-location table, cross-tool development, and testing conventions. Subsystem detail is delegated to per-package files.

Techniques in this file

Quoted passages are verbatim. Open one to see it in the source.

01 / Pointing at the source of truth

A stated policy against copying

The second sentence of the file rules out copying details into it, naming versions, rule lists and counts as the things that go stale. Later sections apply it: the root package file is named as authoritative for scripts, and a validation command replaces a duplicated list of enforced lint rules.

Source excerpt starting at line 4.
monorepo. Prefer authoritative configuration and documentation over copyingdetails into this file: copied versions, rule lists, and counts become stale.

02 / From this file

A table indexed by task, not by directory

Fourteen rows map a thing the agent might be asked to do onto the location that handles it, with a note on each. The first column is the task rather than the path, so the table is read by intent.

03 / From this file

A rule about which layer a feature belongs in

Three tools consume the same development platform, so a feature is stated to be incomplete if it only works through one of them. Implementation goes in the shared layer wherever possible, with the integration layers kept thin, and intentional gaps documented in the pull request.

Source excerpt starting at line 61.
Workers development platform. A development feature is not complete merelybecause it works through one of them.

04 / Nested instruction files

Package files kept current in the same change

Packages carry their own instruction files, and the agent is directed to read the closest applicable one before making changes and to update it in the same change when the change makes it inaccurate. The division of content between the root file and package files is stated.

05 / Hard prohibitions

One security rule with its linter

Shell commands may not be built from interpolated or concatenated untrusted input, and the custom lint rule that enforces it is named.

Put it to work

Borrow this for your repo

  1. Put the anti-drift rule in the file itself. Naming versions, rule lists and counts as things not to copy is what keeps it from rotting.
  2. Index your repo map by task rather than by directory. Agents arrive with an intent, not a path.
  3. If several tools consume one platform, state which layer a feature belongs in and that one consumer is not done.
  4. Require the package instruction file to be updated in the same change that makes it wrong.

How the file is organized

  1. 01Start Here
  2. 02Common Commands
  3. 03Repository Map
  4. 04Cross-Tool Development Features
  5. 05Implementation Conventions
  6. 06Dependencies and Security
  7. 07Testing Conventions
  8. 08Changes and Pull Requests
  9. 09Package-Specific Guidance
Read this revision on GitHub ↗

Context your instructions cannot carry

Workers SDK's file tells an agent how the codebase works. It cannot tell it which bug three customers hit this week. Modem keeps that context current and attaches it to the work.

Try Modem