Skip to content

Conversation

@TheCodeTraveler
Copy link
Collaborator

Description of Change

This PR adds natural language instructions for CoPilot to assist with its automated code reviews.

More the the docs:

About coding guidelines

You can customize Copilot code review with custom coding guidelines written in natural language. For more information on Copilot code review, see Using GitHub Copilot code review.

With coding guidelines, Copilot can give feedback based on your organization's specific coding style and best practices.

Because Copilot code review is powered by a large language model, it can help with enforcing coding guidelines that are not covered by your linter or static analysis tool.

Coding guidelines are configured at the repository level. You can create and enable up to 6 coding guidelines per repository.

Linked Issues

PR Checklist

  • Rebased on top of main at time of PR

Additional Information

The work done on this PR is attributed to @GeorgeLeithead

Copilot AI review requested due to automatic review settings March 7, 2025 19:15
@TheCodeTraveler TheCodeTraveler changed the title Add Co-Pilot Prompts [Housekeeping] Add Co-Pilot Prompts Mar 7, 2025
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.

PR Overview

This PR introduces a set of natural language prompts and guidelines to enhance GitHub Copilot's automated code review and development assistance for the .NET MAUI Community Toolkit. The changes include:

  • A new async best practices cheat sheet.
  • Detailed usage instructions for GitHub Copilot with .NET MAUI.
  • Prompts covering memory leak patterns and control usage issues.
  • An aggregated index of available prompts.

Reviewed Changes

File Description
.github/prompts/dotnet/async.prompt.md Adds asynchronous programming best practices and guidelines.
.github/copilot-instructions.md Introduces instructions for setting up and using GitHub Copilot with .NET MAUI.
.github/prompts/dotnet/maui/maui-memory-leaks.prompt.md Provides guidance and examples for avoiding memory leaks in MAUI apps.
.github/prompts/dotnet/maui/maui-controls.prompt.md Implements a XAML snippet and best practices for page life-cycle and control usage.
.github/prompts/prompts.prompt.md Aggregates links to all the prompt instructions.

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
<toolkit:EventToCommandBehavior
EventName="Appearing"
Command="{Binding AppearingCommand}" />
</ContentPage.Behaviors>
Copy link
Collaborator

Choose a reason for hiding this comment

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

this xaml is not finished. is it expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

@VladislavAntonyuk You are correct, but the example code in the prompts are there only to guide CoPilot and aren't there for direct user reading. Think of them like the old Visual Studio 'snippets'. This one however, is easy to 'complete' and I will complete it.

@GeorgeLeithead
Copy link
Contributor

Description of Change

This PR adds natural language instructions for CoPilot to assist with its automated code reviews.

@TheCodeTraveler I think you may have ever so slightly missed where this is primarily directed. All of the prompts and instructions are available to the contributor at the time of them actually WRITING code and asking CoPilot for help. This should help contributors actually write code with the help of CoPilot, and with the 'instructions' it can help reduce the amount of effort required for code review, as it can enforce the standards we want in place.

@GeorgeLeithead
Copy link
Contributor

Additional Information

The work done on this PR is attributed to @GeorgeLeithead

@TheCodeTraveler I have added MORE prompts to my fork, as I [always] get a 403 when I try to push to this branch [actually, I get a 403 when I try to push to ANY branch in the repository]! I have added prompts for xUnit and also for Code Style. I think the xUnit will be of real benefit...but they ALL need review, clarification and adding to.

@TheCodeTraveler
Copy link
Collaborator Author

Amazing! Thanks George!

Could you open a PR from your fork so that we get the new things merged too? Once you've opened the new PR, I'll close this one.

@GeorgeLeithead
Copy link
Contributor

Amazing! Thanks George!

Could you open a PR from your fork so that we get the new things merged too? Once you've opened the new PR, I'll close this one.

Brandon. Will do very shortly!

@TheCodeTraveler
Copy link
Collaborator Author

Closing in favor of #2576

@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants