Skip to content

Simplify generated AGENTS.md to use live docs - #15384

Open
acoyfellow wants to merge 2 commits into
cloudflare:mainfrom
acoyfellow:jordan/devx-2642-minimal-agents-shim
Open

acoyfellow wants to merge 2 commits into
cloudflare:mainfrom
acoyfellow:jordan/devx-2642-minimal-agents-shim

Conversation

@acoyfellow

@acoyfellow acoyfellow commented Aug 27, 2026 •

Copy link
Copy Markdown

Tracks DEVX-2642 internally.

Summary

Create Cloudflare currently generates an AGENTS.md with a fixed list of commands, products, limits, error guidance, and best-practice links. That content can become stale as Cloudflare products and documentation change.

This change replaces the fixed inventory with a small retrieval instruction:

# Cloudflare Workers

Always retrieve current Cloudflare documentation before writing or changing Cloudflare code. Do not rely on training data for APIs, configuration, limits, or best practices.

Start at https://developers.cloudflare.com/llms.txt. Choose the relevant product's `llms.txt`, then retrieve only the specific Markdown pages needed for the task.

The root documentation index remains stable while product-specific guidance can change in the documentation without requiring a Create Cloudflare release. Asking agents to retrieve only the pages needed for the task also keeps generated context small.

This deliberately differs from #14775, which expands the generated file with Local Explorer endpoints. The intent here is to keep product instructions in the live documentation and keep the generated file as the durable entry point to that documentation.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this changes generated agent guidance and does not change user-facing product behavior

Validation:

  • pnpm run test:ci in packages/create-cloudflare: 261 tests passed
  • pnpm run check:type in packages/create-cloudflare
  • pnpm run build in packages/create-cloudflare
  • oxlint --deny-warnings --type-aware for the changed TypeScript files
  • oxfmt --check for the changed files

Devin Review

@changeset-bot

changeset-bot Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9bc665d

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

This PR includes changesets to release 1 package
Name Type
create-cloudflare Patch

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 27, 2026
@workers-devprod
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team August 27, 2026 10:42
@workers-devprod

workers-devprod commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment •

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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

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

Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15384

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15384

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15384

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15384

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@15384

create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15384

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15384

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@15384

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15384

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15384

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 958b2ed

@dario-piotrowicz dario-piotrowicz left a comment

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.

Approved with one small suggestion 🙂

@workers-devprod workers-devprod left a comment

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.

Codeowners reviews satisfied

@NuroDev

NuroDev commented Nov 18, 2026

Copy link
Copy Markdown
Member

@acoyfellow can we fix the conflicts here so we can get this merged 🙏

@petebacondarwin
petebacondarwin force-pushed the jordan/devx-2642-minimal-agents-shim branch from 9e36881 to 9bc665d Compare November 23, 2026 18:49
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@petebacondarwin
petebacondarwin force-pushed the jordan/devx-2642-minimal-agents-shim branch from 9bc665d to 958b2ed Compare November 23, 2026 18:49
@clanky-the-clanker

Copy link
Copy Markdown
Contributor

This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting clanky review (or clanker review or @clanky-the-clanker review), optionally followed by instructions (e.g. clanky review focus on the retry logic).

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

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.

Devin Review found 2 new potential issues.

Devin Review

Comment on lines 4 to +14
* This file is injected into new Workers projects created via create-cloudflare
* to provide AI coding agents with retrieval-led guidance for Cloudflare APIs.
*
* Keep the Local Explorer endpoint list in sync with:
* - packages/wrangler/src/dev/start-dev.ts (printLocalExplorerAgentHint)
* - packages/vite-plugin-cloudflare/src/plugins/agent-hint.ts (printLocalExplorerAgentHint)
*
* @returns The AGENTS.md content as a string
*/
export const getAgentsMd = (): string => `# Cloudflare Workers

STOP. Your knowledge of Cloudflare Workers APIs and limits may be outdated. Always retrieve current documentation before any Workers, KV, R2, D1, Durable Objects, Queues, Vectorize, AI, or Agents SDK task.

## Docs

- https://developers.cloudflare.com/workers/
- MCP: \`https://docs.mcp.cloudflare.com/mcp\`

For all limits and quotas, retrieve from the product's \`/platform/limits/\` page. eg. \`/workers/platform/limits\`

## Commands

| Command | Purpose |
|---------|---------|
| \`npx wrangler dev\` | Local development |
| \`npx wrangler deploy\` | Deploy to Cloudflare |
| \`npx wrangler types\` | Generate TypeScript types |

Run \`wrangler types\` after changing bindings in wrangler.jsonc.

## Local Explorer (Debugging & Inspection)

When running \`npx wrangler dev\`, a Local Explorer API is available for inspecting and debugging local Workers, bindings, and storage state. The API base URL is printed in the terminal when the dev server starts.
const cloudflareDocsIndex = [
"https:",
"",
"developers.cloudflare.com",
"llms.txt",
].join("/");

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.

📝 Info: JSDoc detached from getAgentsMd

The doc comment with @returns The AGENTS.md content as a string now sits above the newly inserted cloudflareDocsIndex constant, not the exported getAgentsMd. The function is left undocumented and the constant carries a misleading @returns.

(Refers to this code)

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +16 to +20
export const getAgentsMd = (): string => `# Cloudflare Workers

If the application uses Durable Objects or Workflows, refer to the relevant best practices:
Always retrieve current Cloudflare documentation before writing or changing Cloudflare code. Do not rely on training data for APIs, configuration, limits, or best practices.

- Durable Objects: https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/
- Workflows: https://developers.cloudflare.com/workflows/build/rules-of-workflows/
Start at ${cloudflareDocsIndex}. Choose the relevant product's \`llms.txt\`, then retrieve only the specific Markdown pages needed for the task.

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.

🔍 Stale Local Explorer synchronization references

The Wrangler hint and Vite hint still tell maintainers to sync with a section getAgentsMd no longer generates.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

4 participants