Skip to content

Rewrite Copilot instructions and move to AGENTS.md#53630

Open
lbussell wants to merge 11 commits intodotnet:mainfrom
lbussell:improve-instructions
Open

Rewrite Copilot instructions and move to AGENTS.md#53630
lbussell wants to merge 11 commits intodotnet:mainfrom
lbussell:improve-instructions

Conversation

@lbussell
Copy link
Copy Markdown
Member

@lbussell lbussell commented Mar 30, 2026

The bulk of .github/copilot-instructions.md was written before most frontier models were released. In my limited experience working with this repo, the existing instructions were mostly a waste of context/tokens and sometimes even reduced the quality of Copilot's output.

I have rewritten the instructions based on Write effective instructions | Claude Code documentation.

Before: ~700 tokens
After: ~500 tokens

The new instructions focus on telling agents the basics of how to work in the repo, and avoid overloading them with instructions. Research shows that LLMs' ability to follow instructions degrades the more rules that they are given (see: How Many Instructions Can LLMs Follow at Once?).

Comment thread AGENTS.md Outdated
Copy link
Copy Markdown
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

Thanks, I think that it's a smart idea to improve the instructions we have nowadays! Left some questions to ponder.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread .github/copilot-instructions.md
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

This puts the built SDK on your PATH so `dotnet build`, `dotnet test`, etc. use your local changes.

### Running Tests
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.

One use case that I have encountered a number of times recently is simulating the Helix run environment. This is described in https://github.com/dotnet/sdk/blob/main/documentation/project-docs/repro-helix-failure.md. Scenarios in which this is important is to flush out dependencies on test-assets where the available content is limited. Thoughts on if this scenario should be called out?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is that document up-to-date? If so I can link to it here.

Comment thread AGENTS.md Outdated

By default (without `-pack`), the build skips crossgen and installers (`SkipUsingCrossgen=true`, `SkipBuildingInstallers=true`) to speed up inner-loop iteration. Build output goes to `artifacts/bin/redist/<Configuration>/dotnet/`.

Key flags:
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.

There are some secondary flags that can be important. e.g. BuildSdkDeb, BuildSdkRpm. I am sure there are others. Is it worth noting these or giving hints on how to self discover these?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

How do you discover these? Are they documented somewhere centrally? Or do you just need to inspect some of the msbuild files in the repo?

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.

I don't know of them being called out in any docs. I always look at the build definition to see what build options/parameters it uses. For the ones I called out, they are specified here - https://github.com/dotnet/sdk/blob/main/eng/pipelines/templates/jobs/sdk-job-matrix.yml#L26

Copy link
Copy Markdown
Member Author

@lbussell lbussell Apr 6, 2026

Choose a reason for hiding this comment

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

Feel free to propose more specific changes if you know what you want to see here.

@lbussell lbussell force-pushed the improve-instructions branch from f3f0691 to 9cac85c Compare April 6, 2026 17:46
@lbussell lbussell requested a review from MichaelSimons April 6, 2026 17:59
@lbussell lbussell marked this pull request as ready for review April 6, 2026 17:59
Copilot AI review requested due to automatic review settings April 6, 2026 17:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates repository-level agent guidance by replacing the previous Copilot instructions file with a new AGENTS.md focused on repo orientation and local build/test workflow.

Changes:

  • Add AGENTS.md with repo overview, build/test commands, and a high-level project layout map.
  • Remove .github/copilot-instructions.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
AGENTS.md Introduces new repo overview + local workflow guidance intended for agent use.
.github/copilot-instructions.md Removes the prior Copilot instruction content.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
@lbussell lbussell requested a review from nagilson April 16, 2026 15:19
@lbussell
Copy link
Copy Markdown
Member Author

/ba-g docs-only change.

@lbussell lbussell requested a review from marcpopMSFT April 17, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants