Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 59 additions & 42 deletions .github/README-AI.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,54 @@ The PR reviewer agent conducts thorough, constructive code reviews of .NET MAUI

## How to Use

### Option 1: GitHub Copilot CLI (Local)
### Option 1: Multi-Agent Mode (Recommended)

**Let GitHub Copilot automatically delegate to the right agent:**

Instead of manually selecting an agent, you can prompt Copilot directly and it will automatically delegate to the appropriate specialized agent. This is often more efficient because Copilot can coordinate multiple agents if needed.

**How to use it:**

```bash
# Start GitHub Copilot CLI
copilot

# Prompt naturally without selecting an agent
Can you reproduce https://github.com/dotnet/maui/issues/32941 inside the sandbox?
Please make sure to check if there's an agent you can use for each step of your plan.

# Or for other tasks
Please review PR #12345
Please write UI tests for issue #67890
Please investigate and fix this bug: https://github.com/dotnet/maui/issues/XXXXX
```

**💡 Pro tip - Ask for the plan first:**

Sometimes it's helpful to see the execution plan before work begins. Add this to your prompt:

```bash
Can you reproduce https://github.com/dotnet/maui/issues/32941 inside the sandbox?
Please tell me your plan before you start.
```

This gives you a chance to adjust the plan or provide additional context before execution.

**Setting yourself up for success:**

When using multi-agent mode, craft your prompts to guide proper delegation:
- ✅ "Can you reproduce <URL> inside the sandbox? Please check if there's an agent for each step."
- ✅ "Please test this PR and make sure to use agents where appropriate"
- ✅ "Write UI tests for this issue, using the uitest agent if available"

The key phrases like "check if there's an agent", "use agents", and "inside the sandbox" help Copilot understand you want specialized agent delegation.

### Option 2: GitHub Copilot CLI (Direct Agent Selection)

**Sandbox Agent:**
```bash
# Start GitHub Copilot CLI with agent support
copilot --allow-all-tools --allow-all-paths
copilot

# Invoke the sandbox-agent
/agent sandbox-agent
Expand All @@ -36,7 +78,7 @@ please reproduce issue #12345
**UI Test Coding Agent:**
```bash
# Start GitHub Copilot CLI with agent support
copilot --allow-all-tools --allow-all-paths
copilot

# Invoke the uitest-coding-agent
/agent uitest-coding-agent
Expand All @@ -49,7 +91,7 @@ please run the UI tests from PR #32479
**Issue Resolver Agent:**
```bash
# Start GitHub Copilot CLI with agent support
copilot --allow-all-tools --allow-all-paths
copilot

# Invoke the issue-resolver agent
/agent issue-resolver
Expand All @@ -61,7 +103,7 @@ please investigate and fix https://github.com/dotnet/maui/issues/XXXXX
**PR Reviewer Agent:**
```bash
# Start GitHub Copilot CLI with agent support
copilot --allow-all-tools --allow-all-paths
copilot

# Invoke the pr-reviewer agent
/agent pr-reviewer
Expand All @@ -70,7 +112,7 @@ copilot --allow-all-tools --allow-all-paths
please review https://github.com/dotnet/maui/pull/XXXXX
```

### Option 2: GitHub Copilot Agents (Web)
### Option 3: GitHub Copilot Agents (Web)

1. **Navigate to the agents tab** at https://github.com/copilot/agents

Expand Down Expand Up @@ -188,52 +230,31 @@ Agents work with **time budgets as estimates for planning**, not hard deadlines:
- **`agents/pr-reviewer.md`** - PR reviewer agent (inline instructions)
- **`agents/README.md`** - Agent selection guide and quick reference

### Agent Instruction Packages

Each agent has a progressive disclosure structure for optimal learning:

**PR Reviewer Agent** (11 files, 3,463 lines):
- `pr-reviewer-agent/README.md` - Quick lookup by scenario (7 task-oriented scenarios)
- `pr-reviewer-agent/quick-start.md` - Essential reading (workflow, checkpoints, rules)
- `pr-reviewer-agent/quick-ref.md` - Command templates and patterns
- `pr-reviewer-agent/core-guidelines.md` - Philosophy and principles
- `pr-reviewer-agent/testing-guidelines.md` - Testing procedures
- `pr-reviewer-agent/error-handling.md` - Common mistakes (9 critical patterns)
- `pr-reviewer-agent/platforms/` - Platform-specific guides (Android, iOS, Windows, MacCatalyst)
- `pr-reviewer-agent/output-format.md` - Review output formatting

**Issue Resolver Agent** (8 files, 3,479 lines):
- `issue-resolver-agent/README.md` - Quick lookup by scenario
- `issue-resolver-agent/quick-start.md` - Essential reading
- `issue-resolver-agent/quick-ref.md` - Command templates
- `issue-resolver-agent/core-guidelines.md` - Philosophy
- `issue-resolver-agent/testing-guidelines.md` - Testing procedures
- `issue-resolver-agent/error-handling.md` - Common mistakes
- `issue-resolver-agent/platforms/` - Platform-specific guides
- `issue-resolver-agent/output-format.md` - PR description formatting
### Agent Files

Agents are now self-contained single files:

- **`agents/pr-reviewer.md`** - PR review workflow with hands-on testing (~400 lines)
- **`agents/issue-resolver.md`** - Issue resolution workflow with checkpoints (~620 lines)
- **`agents/sandbox-agent.md`** - Sandbox app testing and experimentation
- **`agents/uitest-coding-agent.md`** - UI test writing and execution

### Shared Instruction Files

These provide specialized guidance for specific scenarios used by all agents:

- **`instructions/common-testing-patterns.md`** - Command sequences (UDID extraction, builds, deploys, error checking)
- **`instructions/uitests.instructions.md`** - UI testing guidelines (when to use HostApp vs Sandbox)
- **`instructions/safearea-testing.md`** - SafeArea testing patterns (measure children, not parents)
- **`instructions/instrumentation.md`** - Code instrumentation for debugging and testing
- **`instructions/appium-control.md`** - Standalone Appium scripts for manual debugging
- **`instructions/sandbox.instructions.md`** - Sandbox app testing patterns
- **`instructions/templates.instructions.md`** - Template modification rules
- **`instructions/sandbox-testing-patterns.md`** - Sandbox app testing patterns
- **`instructions/edge-case-testing.md`** - Edge case testing strategies
- **`instructions/xaml-unittests.instructions.md`** - XAML unit testing guidelines
- **`instructions/collectionview-handler-detection.instructions.md`** - CollectionView handler configuration

### Shared Scripts

Automated PowerShell scripts for testing workflows:

- **`scripts/BuildAndRunSandbox.ps1`** - Build, deploy, and test Sandbox app (Android/iOS)
- **`scripts/BuildAndRunHostApp.ps1`** - Build, deploy, and run UI tests (Android/iOS)
- **`scripts/shared/Start-Emulator.ps1`** - Detect and start Android emulators or iOS simulators
- **`scripts/shared/Build-AndDeploy.ps1`** - Build and deploy apps to devices
- **`scripts/shared/shared-utils.ps1`** - Common output formatting functions
- **`scripts/templates/RunWithAppiumTest.template.cs`** - Template for Appium test scripts

### Log Directories
Expand Down Expand Up @@ -265,9 +286,6 @@ All agent logs are consolidated under `CustomAgentLogsTmp/`:
- **`copilot-instructions.md`** - General coding standards, build requirements, file conventions for the entire repository

### Prompts
- **`prompts/maui-pr-reviewer.prompt.md`** - Prompt for comprehensive PR reviews with testing
- **`prompts/maui-sandbox-test.prompt.md`** - Prompt for testing PRs in Sandbox app
- **`prompts/maui-uitest-write.prompt.md`** - Prompt for writing new UI tests
- **`prompts/maui-release-notes.prompt.md`** - Prompt for generating release notes

## For GitHub Copilot (General Development)
Expand Down Expand Up @@ -303,7 +321,6 @@ When updating agent instructions or guidelines:

## Related Documentation

- **Repository root**: `AGENTS.md` - Universal guidance for all AI coding assistants
- **Development**: `DEVELOPMENT.md` - Development environment setup
- **Contributing**: `CONTRIBUTING.md` - Contribution guidelines
- **Wiki**: [.NET MAUI GitHub Wiki](https://github.com/dotnet/maui/wiki) - Additional resources
Expand Down
Loading