Skip to content

Generate default AGENTS.md in new projects - #17122

Merged
matthewp merged 5 commits into
mainfrom
default-agents-md
Jun 19, 2026
Merged

matthewp merged 5 commits into
mainfrom
default-agents-md

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • create-astro now generates an AGENTS.md in new projects with dev server background mode instructions and links to commonly needed Astro docs.
  • Creates a CLAUDE.md symlink pointing to AGENTS.md, with a hard link fallback for Windows environments without Developer Mode.

Testing

  • Added generateAgentsMd tests verifying the background dev command and documentation links are present.

Docs

  • No docs update needed. This is a scaffolding change that generates a file for AI coding agents, not a user-facing API.

@changeset-bot

changeset-bot Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 152cff7

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

This PR includes changesets to release 1 package
Name Type
create-astro Minor

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-actions github-actions Bot added the pkg: create-astro Related to the `create-astro` package (scope) label Jun 18, 2026
@matthewp
matthewp marked this pull request as ready for review June 18, 2026 19:47
@ArmandPhilippot

Copy link
Copy Markdown
Member

I wonder if we could have this opt-in instead? I mean a CLI option in create-astro to create those files and maybe a CLI flag to automatically approve those files (then, we'll need docs, at least for the CLI flag).

Not everyone use AI, and not everyone use Claude. I think some people might complain about these files and an opt-in option would be more useful to everyone.

To be clear, I don't think this is a bad idea! But, I'm more in favor of letting people choose. As a Linux user, I hate tools that clutters my ~/ instead of following XDG conventions. As a dev, I prefer a minimal clean up when starting a new project. I don't think I'm the only one... but I could be wrong. 😄

@ematipico

Copy link
Copy Markdown
Member

Myself and Matthew discussed this (I was the opt-in faction), and agreed that adding this document doesn't make any harm.

This is an additive document that doesn't make any harm to people that don't use AI or something else.

Also, asking that to the user might cause friction during the installation process (we've been removing questions instead of adding them).

Plus, the file is small on purpose.

@ArmandPhilippot ArmandPhilippot 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.

Oh, the file size wasn't an issue for me! I wouldn't mind if it contained more instructions (e.g. astro add, check for new features / what we recommend in https://docs.astro.build/en/guides/build-with-ai/#tips-for-ai-powered-astro-development).

I preferred to be cautious as I know some people are already wondering why there is a .astro folder in their project (probably something we should mention in "Project structure"), or "why I have a session log when I haven't enabled it", etc.

But, yeah, more questions during installation can be an issue too... So, no problem!

Comment thread packages/create-astro/src/actions/template.ts Outdated
Comment thread packages/create-astro/src/actions/template.ts Outdated

Full documentation: https://docs.astro.build

Commonly needed references:

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.

Honest question: why those references and not others? Is it based on most popular pages on the docs website? Things AI struggle the most?

I mean https://docs.astro.build/en/guides/styling/ (especially for Tailwind users...) or https://docs.astro.build/en/guides/framework-components/ (a lot of users use them) sounds like common needed references too. I know we can't be exhaustive. I was just wondering if it was random or if there was a reason behind it. 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah i was trying to balance between providing some useful links for common and non-obvious things (Content collections being the big one I thought was needed) and not just literally linking to every guide on the site. We can definitely curate this more but think it should stay at <10 at least.

This prompt can use some improvement to more strongly suggest referencing those pages for certain task. I agree that styling would be good, I'll add it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I've updated them to be more task-oriented so the agent knows to read them for those tasks, and added styling as well.

@matthewp

matthewp commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@ArmandPhilippot The reason for submitting this PR now is because in Astro 7 we have a new --background feature that is very useful for AI tools. When you run just astro dev we detect if it is running within an agent and automatically treat it like --background. However, not all agents are detectable, OpenCode for example is currently not. This means that if you just prompt "start the dev server", it won't know to do it in the background.

So setting up new projects to know to do this was the main motivation for this change.

As far as making it an option, I don't think that's the right call for a few reasons:

  • Software development is overwhelming moving towards using AI tools. There are a vocal number of people who do not like them, but they are the minority and becoming more so over time. Here's an article from last year that showed (at the time) that 84% of engineers were using or planning to use AI tools. This is likely growing.
  • It just adds a markdown file. If someone isn't using AI tools it doesn't affect them, other than perhaps some people not liking that the file is there. They can just delete the file.
  • We have debated for years about every option and have strived to not have too many options. Adding options adds friction. Previously we had an option that asked if the user wanted TypeScript or not. We removed it because very few people didn't want TypeScript. I think we're in a similar situation now. Asking this question adds friction for very little benefit. We're really only talking about some people who might be mad about a file existing because they dislike AI. I don't think we should make decisions for the framework to cater to that.

@ArmandPhilippot

Copy link
Copy Markdown
Member

Software development is overwhelming moving towards using AI tools. There are a vocal number of people who do not like them, but they are the minority and becoming more so over time. Here's an article from last year that showed (at the time) that 84% of engineers were using or planning to use AI tools. This is likely growing.

Yeah, I was thinking more about people who are not software engineers and who create a website for their association or family members. I mean, I think this is also one of our target (that's why we explain in the tutorial they need a code editor, they can use a GitHub repository, etc.).

I wasn't aware that this had already been discussed with Ema, and I appreciate you taking the time to provide the context. Everything is fine here!

@github-actions github-actions Bot added feat: markdown Related to Markdown (scope) pkg: svelte Related to Svelte (scope) pkg: vue Related to Vue (scope) pkg: example Related to an example package (scope) pkg: react Related to React (scope) pkg: preact Related to Preact (scope) pkg: solid Related to Solid (scope) pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Jun 19, 2026
@matthewp
matthewp force-pushed the default-agents-md branch from 64d1987 to 74215c1 Compare June 19, 2026 12:54
@github-actions github-actions Bot removed feat: markdown Related to Markdown (scope) pkg: svelte Related to Svelte (scope) pkg: vue Related to Vue (scope) pkg: example Related to an example package (scope) pkg: react Related to React (scope) pkg: preact Related to Preact (scope) pkg: solid Related to Solid (scope) pkg: integration Related to any renderer integration (scope) labels Jun 19, 2026
@github-actions github-actions Bot removed the pkg: astro Related to the core `astro` package (scope) label Jun 19, 2026
@codspeed

codspeed Bot commented Jun 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing default-agents-md (64d1987) with main (0fd535d)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (7e7ab87) during the generation of this report, so 0fd535d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@ArmandPhilippot ArmandPhilippot 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.

Seems good to me, thanks for the update!

@matthewp

Copy link
Copy Markdown
Contributor Author

@ArmandPhilippot Appreciate the conversation and review!

@matthewp
matthewp merged commit cbd6123 into main Jun 19, 2026
24 checks passed
@matthewp
matthewp deleted the default-agents-md branch June 19, 2026 14:02
@ematipico

Copy link
Copy Markdown
Member

I wasn't aware that this had already been discussed with Ema

We have a regular 1:1 :)

@astrobot-houston astrobot-houston mentioned this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: create-astro Related to the `create-astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants