-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Using AI to Work on .NET MAUI
This guide helps you use GitHub Copilot effectively when working on the .NET MAUI repository.
- Custom Agents - Specialized agents for specific MAUI tasks
- Reusable Skills - Modular capabilities for common workflows
- Using Copilot with Git - Let Copilot handle your git operations
If you use any of our agents or just Copilot in general to work on an issue:
- End with a message summarizing your experience
- Export the chat session (how-to)
- Attach the JSON to your PR
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.
In VS Code: Custom Agents in VS Code
In GitHub Copilot CLI: GitHub Copilot CLI
| 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:
- Pre-Flight - Context gathering from issues/PRs
- Tests - Create or verify reproduction tests exist
- Gate - Verify tests catch the issue (mandatory checkpoint)
-
Fix - Explore fix alternatives using
try-fixskill - Report - Create PR or write review report
Example prompts:
fix issue #12345review PR #12345work on issue #12345continue 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-testsskill (visual bugs, user interactions) -
XAML Tests - via
write-xaml-testsskill (XAML parsing, compilation, source generation)
Example prompts:
write tests for issue #12345create tests for this PRadd 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 Androidreproduce issue #12345 in Sandboxtest 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 improvementsimprove repo based on what we learnedupdate skills based on PR
Skills are modular capabilities that can be invoked directly or used by agents. They provide specialized functionality for common workflows.
| 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 |
| 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.
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.
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