Skip to content

Update copilot-instructions.md with comprehensive .NET for Android guidance #10190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 12, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 11, 2025

Enhanced the GitHub Copilot instructions to provide comprehensive guidance for AI assistants working on the .NET for Android repository. The updated instructions significantly improve Copilot's ability to understand and assist with this complex, multi-faceted codebase.

Key Improvements

Repository Context & Structure:

  • Clear overview of .NET for Android (formerly Xamarin.Android) and its purpose
  • Detailed directory structure explanation (src/, tests/, build-tools/, external/, etc.)
  • Documentation of project types: Android API bindings, MSBuild tasks, native libraries, Java support code, build tools, and tests

Development Guidelines:

  • Android API Bindings: Patterns for Java-to-C# API bindings, namespace conventions, [Register] attributes
  • MSBuild Tasks: Task development patterns, error code conventions (XA####), incremental build support
  • Native Code: CMake patterns, Android NDK conventions, JNI interop guidelines
  • Testing: Unit test organization, device integration testing, NUnit patterns

Technical Standards:

  • Build System: MSBuild, .NET Arcade SDK, CMake, and Gradle usage patterns
  • Error Handling: Standardized error codes, logging patterns, actionable error messages
  • Documentation: XML documentation standards, Android API level requirements, example patterns

Workflow & Contribution Guidelines:

  • Commit Messages: Format following Documentation/workflow/commit-messages.md patterns
  • Troubleshooting: Common build issues, MSBuild task development tips, native development best practices
  • Cross-platform: Windows/macOS/Linux compatibility considerations

Example Enhancement

Before: Basic nullable reference types and formatting rules only.

After: Comprehensive guidance covering repository structure, Android development patterns, build system usage, error handling conventions, and troubleshooting scenarios.

The instructions now help Copilot understand:

  • How to work with Android API bindings in src/Mono.Android/
  • MSBuild task development patterns in src/Xamarin.Android.Build.Tasks/
  • Native C/C++ development in src/native/ with CMake
  • Testing approaches for this Android-focused .NET project
  • Repository-specific error code patterns and commit message formats

This makes Copilot significantly more helpful for contributors working on Android development tooling, native runtime components, build infrastructure, and the extensive test suite that spans unit tests, integration tests, and device testing.

Fixes #10189.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…idance

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Update copilot-instructions.md Update copilot-instructions.md with comprehensive .NET for Android guidance Jun 11, 2025
@Copilot Copilot AI requested a review from jonathanpeppers June 11, 2025 22:10
Copilot finished work on behalf of jonathanpeppers June 11, 2025 22:11
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Add a note to always update copilot-instructions.md in future changes where appropriate

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

Copilot AI commented Jun 12, 2025

Add a note to always update copilot-instructions.md in future changes where appropriate

Added a new Contributing Guidelines section with instructions to update copilot-instructions.md when making relevant changes in commit eaca27b

Copilot finished work on behalf of jonathanpeppers June 12, 2025 00:26
…info

Co-authored-by: grendello <184788+grendello@users.noreply.github.com>
Copilot finished work on behalf of grendello June 12, 2025 07:52
Added armeabi-v7a and x86 back to the ABI list as they are still targeted by the Mono native runtime, while keeping the note that CoreCLR components only target 64-bit platforms.

Co-authored-by: grendello <184788+grendello@users.noreply.github.com>
Copilot finished work on behalf of grendello June 12, 2025 08:40
@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 12, 2025 13:41
@jonathanpeppers
Copy link
Member

I added a PR trigger:
image

@copilot go through the repo one more time and add any more changes you feel important.

We could link somewhere to Android docs:

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

Copilot AI commented Jun 12, 2025

I added a PR trigger:
image

...

Added comprehensive Android development guidance including Android documentation links, debugging patterns, device testing workflows, performance diagnostics, and API management guidance in commit 11f326b

Copilot finished work on behalf of jonathanpeppers June 12, 2025 13:47
@jonathanpeppers jonathanpeppers enabled auto-merge (squash) June 12, 2025 13:59
@jonathanpeppers jonathanpeppers merged commit cfa4209 into main Jun 12, 2025
59 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-10189 branch June 12, 2025 15:07
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 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.

Update copilot-instructions.md
3 participants