Skip to content

Improve AGENTS.md files based on recurring PR review feedback#13408

Merged
petebacondarwin merged 1 commit intomainfrom
improve-agents-md-from-pr-reviews
Apr 15, 2026
Merged

Improve AGENTS.md files based on recurring PR review feedback#13408
petebacondarwin merged 1 commit intomainfrom
improve-agents-md-from-pr-reviews

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Apr 10, 2026

Analyzed review comments from the last 100 merged PRs to identify recurring patterns that should be codified in agent guidance.

Changes

Root AGENTS.md

Code Style (3 new rules):

  • Prefer function declarations over const arrow functions for named/exported functions
  • ESLint disable comments must use -- double-dash separator before reason
  • Never modify generated files directly — modify the generator/config instead

Testing Standards (6 new items):

  • Full expect from test context pattern with sub-bullets covering destructured context, ExpectStatic parameter passing, import type usage, node:assert fallback, and the E2E globals: true caveat
  • Snapshot update reminder when changing user-facing strings
  • Test fixture tsconfig.json requirement for vitest-pool-workers-examples/
  • Test fixtures as user-facing recipes (avoid type casting)

Changesets (1 new rule):

  • Focus on user-facing impact; reference the public-facing package, not internal packages

Anti-Patterns (2 new entries):

  • Trivial/obvious code comments (explain "why" not "what")
  • Cross-package type/constant duplication

Subdirectory Knowledge:

  • Keep AGENTS.md files updated when making architectural changes

packages/wrangler/AGENTS.md

  • E2E vitest config globals: true caveat (most common source of ReferenceError bugs)
  • Check ALL call sites when adding expect parameter to helpers

packages/miniflare/AGENTS.md

  • New "Generated Files" section documenting workerd.ts and openapi.local.json as generated

Evidence from PR reviews

The most frequently recurring themes across the last 100 PRs:

Theme PRs where it came up
expect from test context #13255, #13149, #13180, #13164, #13102, #13084
Trivial AI-generated comments #13240
Stale AGENTS.md after arch changes #13243
Prefer function over arrow #13102
Generated files modified directly #13240
Cross-package duplication #13073
Missing fixture tsconfig.json #13079
ESLint disable -- format #13149
Changeset scope/focus #13079, #13087

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: documentation-only changes to AGENTS.md files
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal agent guidance only

Open with Devin

Analyzed review comments from the last 100 merged PRs to identify
patterns that should be codified in agent guidance. The most frequent
issue was expect-from-test-context violations, followed by trivial
AI-generated comments and stale AGENTS.md content.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 10, 2026

⚠️ No Changeset found

Latest commit: c691c62

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Apr 10, 2026
@workers-devprod workers-devprod requested review from a team and ascorbic and removed request for a team April 10, 2026 16:17
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 10, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Apr 10, 2026

Everything checks out. The changes are documentation-only updates to AGENTS.md files, adding codified guidance based on recurring PR review feedback. The referenced files exist, the descriptions are accurate, and the content is well-structured and actionable.

LGTM

github run

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 10, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13408

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13408

miniflare

npm i https://pkg.pr.new/miniflare@13408

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13408

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13408

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13408

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13408

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13408

wrangler

npm i https://pkg.pr.new/wrangler@13408

commit: c691c62

Copy link
Copy Markdown
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Good idea

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 15, 2026
@petebacondarwin petebacondarwin merged commit 2403ea6 into main Apr 15, 2026
59 of 64 checks passed
@petebacondarwin petebacondarwin deleted the improve-agents-md-from-pr-reviews branch April 15, 2026 16:34
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants