Skip to content

add AGENTS.md to templates#12286

Merged
MattieTK merged 19 commits intomainfrom
add-agents-md-to-templates
Feb 6, 2026
Merged

add AGENTS.md to templates#12286
MattieTK merged 19 commits intomainfrom
add-agents-md-to-templates

Conversation

@elithrar
Copy link
Copy Markdown
Contributor

@elithrar elithrar commented Jan 29, 2026

Adds an AGENTS.md to non-framework templates (for now) that guides agents to focus on docs search and retrieval due to knowledge cut-offs and potentially stale usage of APIs, best practices, and Node.js compat in Workers.

Open questions:

  1. Should we add a package.json script - e.g. npm run update-agents-md that fetches an updated copy from this repo?
  2. Or (better DX?) some form of wrangler agents or wrangler update that updates wrangler and the AGENTS.md file as well?

Note that the AGENTS.md here is intentionally designed to be long-lived and minimize 'staleness' itself.


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 0a03c9e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 29, 2026

Claude finished @elithrar's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Validate against criteria
  • Provide feedback

All changesets look good

The changeset .changeset/add-agents-md-to-templates.md meets all requirements:

  1. Version Type: minor is correct - this adds a new feature (AGENTS.md file) to Workers templates
  2. Changelog Quality: Clear description with bullet points explaining what's included in the file
  3. Markdown Headers: No h1/h2/h3 headers present
  4. Analytics: No analytics collection changes
  5. Experimental Features: Not applicable - this is a standard feature addition

The changeset follows the recommended format with a clear title and informative body that explains both what the change does and why it's valuable for users.


@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 29, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12286

wrangler

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

commit: 0a03c9e

@elithrar elithrar marked this pull request as ready for review January 30, 2026 19:26
@elithrar elithrar requested a review from a team as a code owner January 30, 2026 19:26
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 potential bugs to report.

View in Devin Review to see 3 additional flags.

Open in Devin Review

Generate the compatibility_date at project creation time rather than
using a hardcoded date, ensuring new projects always have a current
compatibility date in the example.
Copy link
Copy Markdown
Member

@MattieTK MattieTK left a comment

Choose a reason for hiding this comment

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

Have modified the code to use today's date rather than a fixed date or the workerd compatibility date..

Aligning it with wrangler.jsonc would require threading the project path through multiple layers or refactoring the CLI flow, adding complexity for no real benefit at this point.

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jan 30, 2026
@MattieTK MattieTK added the skip-pr-description-validation Skip validation of the required PR description format label Jan 30, 2026
Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

See the inline comments

Comment thread packages/create-cloudflare/src/agents-md.ts Outdated
Comment thread packages/create-cloudflare/src/agents-md.ts Outdated
@github-project-automation github-project-automation Bot moved this from Approved to In Review in workers-sdk Jan 31, 2026
Comment thread packages/create-cloudflare/src/templates.ts
@MattieTK MattieTK requested review from a team as code owners February 3, 2026 22:33
@MattieTK MattieTK force-pushed the add-agents-md-to-templates branch from 71a28d8 to 97de148 Compare February 3, 2026 22:43
@MattieTK
Copy link
Copy Markdown
Member

MattieTK commented Feb 3, 2026

@vicb I've refactored and tested this to work using the latest workerd specified compatibility date

Comment thread packages/create-cloudflare/src/agents-md.ts Outdated
Comment thread packages/create-cloudflare/src/__tests__/templates.test.ts Outdated
Comment thread packages/create-cloudflare/src/__tests__/templates.test.ts Outdated
Comment thread packages/create-cloudflare/src/helpers/args.ts Outdated
Comment thread packages/create-cloudflare/src/agents-md.ts
Comment thread packages/create-cloudflare/src/agents-md.ts
Comment thread packages/create-cloudflare/src/agents-md.ts
Comment thread packages/create-cloudflare/src/cli.ts Outdated
await npmInstall(ctx);
await rectifyPmMismatch(ctx);

// Offer AGENTS.md for Workers templates that don't use a framework CLI
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"that don't use a framework CLI"

Next doesn't use a framework CLI but still is a framework.
So I guess we should update this to say "framework" (no CLI) and make sure the behavior is correct for next

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good point, I'll do and verify that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

frameworkCli: "create-next-app",
platform: "workers",

I think nextjs is included even though we don't run it as the other frameworks. So this is covered.

Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Thanks for the updates
See my inline comments

Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Thanks for the updates.

Also thanks for reminding me about jsonc... atsro repo, I'm coming!

@github-project-automation github-project-automation Bot moved this from In Review to Approved in workers-sdk Feb 6, 2026
@MattieTK MattieTK merged commit 5ddd276 into main Feb 6, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Feb 6, 2026
@MattieTK MattieTK deleted the add-agents-md-to-templates branch February 6, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-description-validation Skip validation of the required PR description format

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants