Skip to content

Using AI to Work on .NET MAUI

Shane Neuville edited this page Jan 29, 2026 · 11 revisions

Using AI to Work on .NET MAUI

This guide helps you use GitHub Copilot effectively when working on the .NET MAUI repository.

Table of Contents


Export Your Chat Sessions

If you use any of our agents or just Copilot in general to work on an issue:

  1. End with a message summarizing your experience
  2. Export the chat session (how-to)
  3. Attach the JSON to your PR

Custom Agents

The .NET MAUI repository includes specialized AI agents designed to help with specific development tasks. These agents are available through GitHub Copilot and provide expert assistance for common workflows.

How to Use Custom Agents

In VS Code: Custom Agents in VS Code

In GitHub Copilot CLI: GitHub Copilot CLI

Available Agents

Agent Description Location
PR Agent End-to-end workflow for fixing issues and reviewing PRs .github/agents/pr.md
Write Tests Agent Determines test type and invokes appropriate testing skill .github/agents/write-tests-agent.md
Sandbox Agent Manual testing and PR validation with Sandbox app .github/agents/sandbox-agent.md
Learn From PR Agent Extracts lessons from PRs and applies improvements .github/agents/learn-from-pr.md

Purpose: End-to-end workflow for investigating issues and reviewing/working on PRs.

When to use: When you need to fix an issue (with or without an existing PR), review a PR with independent analysis, or continue work on an in-progress fix.

The PR Agent uses a 5-phase workflow:

  1. Pre-Flight - Context gathering from issues/PRs
  2. Tests - Create or verify reproduction tests exist
  3. Gate - Verify tests catch the issue (mandatory checkpoint)
  4. Fix - Explore fix alternatives using try-fix skill
  5. Report - Create PR or write review report

Example prompts:

  • fix issue #12345
  • review PR #12345
  • work on issue #12345
  • continue working on #12345

Purpose: Determines what type of tests are needed and invokes the appropriate skill.

When to use: When creating new tests for issues or PRs.

Supported test types:

  • UI Tests - via write-ui-tests skill (visual bugs, user interactions)
  • XAML Tests - via write-xaml-tests skill (XAML parsing, compilation, source generation)

Example prompts:

  • write tests for issue #12345
  • create tests for this PR
  • add test coverage for CollectionView selection

Purpose: Test and validate PR functionality using the Sandbox app with automated deployment and testing.

When to use: When you want to manually verify a fix works on device/simulator, reproduce an issue, or validate PR functionality.

Example prompts:

  • test PR #12345 on Android
  • reproduce issue #12345 in Sandbox
  • test this PR on iOS

Purpose: Extracts lessons from completed PRs and applies improvements to the repository.

When to use: After complex PRs, when agents struggled to find solutions, or to improve instruction files and skills based on lessons learned.

Example prompts:

  • learn from PR #12345 and apply improvements
  • improve repo based on what we learned
  • update skills based on PR

Reusable Skills

Skills are modular capabilities that can be invoked directly or used by agents. They provide specialized functionality for common workflows.

Skills vs Agents

Aspect Skills Agents
Invoke Direct request or by agents Delegate to agent
Output Analysis, recommendations, actions Complete workflows with state tracking
Interaction Single-purpose operations Multi-phase orchestration

Available Skills

Skill Purpose Location
write-ui-tests Creates UI tests for GitHub issues .github/skills/write-ui-tests/
write-xaml-tests Creates XAML unit tests .github/skills/write-xaml-tests/
verify-tests-fail-without-fix Verifies tests catch the bug .github/skills/verify-tests-fail-without-fix/
try-fix Attempts alternative fixes .github/skills/try-fix/
pr-finalize Verifies PR title/description match implementation .github/skills/pr-finalize/
pr-build-status Retrieves Azure DevOps build info for PRs .github/skills/pr-build-status/
run-device-tests Runs device tests locally .github/skills/run-device-tests/
find-reviewable-pr Finds PRs that need review .github/skills/find-reviewable-pr/
issue-triage Queries and triages open issues .github/skills/issue-triage/
learn-from-pr Analyzes PRs for lessons learned (analysis only) .github/skills/learn-from-pr/
ai-summary-comment Posts progress comments on PRs .github/skills/ai-summary-comment/

See Skills for detailed documentation on each skill.


Using Copilot with Git

GitHub Copilot can handle git operations for you - committing changes, squashing commits, rebasing branches, resolving conflicts, and creating PR descriptions.

See the Using Copilot with Git Guide for detailed examples and prompts.


Repository Structure

All agent and skill definitions live in the .github/ directory:

.github/
├── agents/                    # Custom agent definitions
│   ├── pr.md                  # PR Agent (Phases 1-3)
│   ├── pr/post-gate.md        # PR Agent (Phases 4-5)
│   ├── sandbox-agent.md       # Sandbox testing agent
│   ├── write-tests-agent.md   # Test writing agent
│   └── learn-from-pr.md       # Learning agent
│
├── skills/                    # Reusable skills
│   ├── ai-summary-comment/    # PR comment posting
│   ├── find-reviewable-pr/    # PR discovery
│   ├── issue-triage/          # Issue triage
│   ├── learn-from-pr/         # PR analysis
│   ├── pr-build-status/       # Build status retrieval
│   ├── pr-finalize/           # PR finalization
│   ├── run-device-tests/      # Device test execution
│   ├── try-fix/               # Fix exploration
│   ├── verify-tests-fail-without-fix/  # Test verification
│   ├── write-ui-tests/        # UI test creation
│   └── write-xaml-tests/      # XAML test creation
│
├── instructions/              # Context-specific guidance
│   ├── uitests.instructions.md
│   ├── xaml-unittests.instructions.md
│   ├── sandbox.instructions.md
│   └── ...
│
└── copilot-instructions.md    # Main repository instructions

Clone this wiki locally