Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 13, 2025

This PR adds comprehensive GitHub Copilot instructions to help coding agents work effectively with the MSBuild repository. The instructions provide essential guidance for building, testing, and developing with MSBuild across Windows, macOS, and Linux platforms.

Key Features

Cross-Platform Build Support:

  • Complete build instructions for both Windows (build.cmd) and Unix systems (build.sh)
  • Platform-specific bootstrap environment setup scripts
  • Precise timing guidance (2-3 minutes for full build, 9 minutes for tests)
  • Timeout specifications to prevent premature cancellation of long-running operations

Performance and Coding Standards:

  • Emphasis on MSBuild's performance-first approach (minimize allocations, avoid LINQ)
  • Modern C# features guidance (C# 13, collection expressions, prefer [] over new Type[])
  • Testing requirements with xUnit and Shouldly assertions
  • Code style conventions matching .NET Runtime guidelines
  • Nullable type guidance for new code without aggressive refactoring

Streamlined Development Workflow:

  • Correct MSBuild executable paths using the bootstrap environment (artifacts/bin/bootstrap/core/MSBuild.dll)
  • Simplified build commands without redundant flags
  • Focus on individual test execution over full test suite
  • Essential file structure and key project understanding

Practical Troubleshooting:

  • Solutions for common SDK resolution issues
  • Guidance on using repository sample projects for testing
  • Certificate error handling for external projects

The instructions have been refined based on maintainer feedback to focus on the most essential information for effective development while removing sections that add unnecessary complexity to the context window.

Fixes #12338.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@dotnet-policy-service
Copy link
Contributor

Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo.

Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Copilot AI changed the title [WIP] ✨Set up Copilot instructions Add GitHub Copilot instructions for MSBuild repository Aug 13, 2025
Copilot AI requested a review from YuliiaKovalova August 13, 2025 12:34
@rainersigwald
Copy link
Member

This is what I've been using locally, but I haven't gotten enough experimentation time with it to know how much it helps:

This repo contains the code for the MSBuild build engine, including its public C# API, its internal implementation of the MSBuild programming language, and core targets and tasks used for builds for .NET and Visual Studio.

Performance is very important--minimize allocations, avoid LINQ, and use the most efficient algorithms possible. The code should be easy to read and understand, but performance is the top priority.

The code is written in C# and should follow the .NET coding conventions. Use the latest C# features where appropriate, including C# 13 features and especially collection expressions--prefer [] to new Type[].

You should generally match the style of surrounding code when making edits, but if making a substantial change, you can modernize more aggressively.

Generate tests for new codepaths, and add tests for any bugs you fix. Use the existing test framework, which is xUnit with Shouldly assertions. Use Shouldly assertions for all assertions in modified code, even if the file is predominantly using xUnit assertions.

@YuliiaKovalova
Copy link
Member

This is what I've been using locally, but I haven't gotten enough experimentation time with it to know how much it helps:

This repo contains the code for the MSBuild build engine, including its public C# API, its internal implementation of the MSBuild programming language, and core targets and tasks used for builds for .NET and Visual Studio.
Performance is very important--minimize allocations, avoid LINQ, and use the most efficient algorithms possible. The code should be easy to read and understand, but performance is the top priority.
The code is written in C# and should follow the .NET coding conventions. Use the latest C# features where appropriate, including C# 13 features and especially collection expressions--prefer [] to new Type[].
You should generally match the style of surrounding code when making edits, but if making a substantial change, you can modernize more aggressively.
Generate tests for new codepaths, and add tests for any bugs you fix. Use the existing test framework, which is xUnit with Shouldly assertions. Use Shouldly assertions for all assertions in modified code, even if the file is predominantly using xUnit assertions.

@copilot check it out and apply

Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 13, 2025

This is what I've been using locally, but I haven't gotten enough experimentation time with it to know how much it helps:

This repo contains the code for the MSBuild build engine, including...

Applied @rainersigwald's guidance from the previous comment. Added:

  • Performance emphasis (minimize allocations, avoid LINQ, efficient algorithms)
  • Modern C# features preference (C# 13, collection expressions, [] over new Type[])
  • Testing requirements (xUnit with Shouldly assertions)
  • Code style guidance (match surrounding code, modernize on substantial changes)
  • Repository description focusing on MSBuild build engine and API
    All integrated into the comprehensive instructions. 095a415

Copilot AI changed the title Add GitHub Copilot instructions for MSBuild repository Add comprehensive GitHub Copilot instructions with cross-platform support for MSBuild repository Aug 13, 2025
Copilot AI requested a review from YuliiaKovalova August 13, 2025 14:42
@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review August 13, 2025 15:31
Copilot AI review requested due to automatic review settings August 13, 2025 15:31
@YuliiaKovalova YuliiaKovalova requested a review from a team as a code owner August 13, 2025 15:31
Copy link
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

This PR introduces comprehensive GitHub Copilot instructions to enhance AI-assisted development in the MSBuild repository. It provides detailed guidance for building, testing, and developing MSBuild across Windows, macOS, and Linux platforms, with emphasis on performance-first coding practices and proper development workflows.

Key changes:

  • Cross-platform build and bootstrap instructions with specific timing guidance
  • Performance-focused coding standards emphasizing allocation minimization and modern C# features
  • Comprehensive troubleshooting section addressing common development environment issues

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…fy content, and remove network connectivity references

Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
Copilot AI changed the title Add comprehensive GitHub Copilot instructions with cross-platform support for MSBuild repository Add streamlined GitHub Copilot instructions for MSBuild repository development Aug 13, 2025
Copilot AI requested a review from rainersigwald August 13, 2025 22:14
Copy link
Member

@JanProvaznik JanProvaznik left a comment

Choose a reason for hiding this comment

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

Few edits that I think would be beneficial. I'm curious to see if this file will help the agent. I wouldn't keep this for much longer in review, we can always improve or turn it off.

Co-authored-by: Jan Provazník <janprovaznik@microsoft.com>
…ble guidance, update version examples

Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 20, 2025

This is what I've been using locally, but I haven't gotten enough experimentation time with it to know how much it helps:

This repo contains the code for the MSBuild build engine, including...

Applied @rainersigwald's guidance. The instructions now include performance emphasis (minimize allocations, avoid LINQ), modern C# features preference (C# 13, collection expressions), testing requirements (xUnit with Shouldly assertions), and code style guidance. f96a492

@YuliiaKovalova YuliiaKovalova merged commit c7d7974 into main Aug 20, 2025
6 of 9 checks passed
@YuliiaKovalova YuliiaKovalova deleted the copilot/fix-12338 branch August 20, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨Set up Copilot instructions

4 participants