01 / Router files
Route by the purpose of a directory
The nested-guide table separates SDK internals from examples, narrative tutorials, user documentation, and design records. The routing carries writing and consistency expectations as well as code conventions.
Source excerpt starting at line 42.42Some directories have their own AGENTS.md with deeper guidance:
02 / Verification by change type
Distinguish runtime tests from browser hook tests
Workers tests run in the Workers pool, while React hooks use a separate Playwright-based command and directory. The guide also points to a coverage matrix that maps features to layers and CI evidence.
Source excerpt starting at line 125.125pnpm run test # agents + ai-chat unit/integration tests126pnpm run test:react # Playwright-based React hook tests (agents package)
03 / Generated file guards
Name the generator for environment types
Environment declaration files must be regenerated inside the relevant package or example. The command and working directory matter because bindings are scoped to that configuration.
Source excerpt starting at line 160.160- `env.d.ts` files are generated by `wrangler types` — regenerate with `pnpm exec wrangler types` inside the relevant example/package, don't hand-edit
04 / Contribution etiquette
Keep published behavior distinct from learning material
Public API and bug-fix changes in packages need changesets. Examples, guides, and sites do not, so the rule follows what is released to package consumers.
Source excerpt starting at line 152.152Examples, guides, and sites don't need changesets.