-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Write Tests Agent
Shane Neuville edited this page Jan 29, 2026
·
5 revisions
The Write Tests Agent is a specialized AI assistant that determines what type of tests are needed and invokes the appropriate skill.
- VS Code: Custom Agents in VS Code
- Copilot CLI: GitHub Copilot CLI
See Export Your Chat Sessions after completing your work.
YES, use this agent if:
- User says "write tests for issue #XXXXX"
- User says "add test coverage for..."
- User says "create automated tests for..."
- PR needs tests added
NO, use different agent if:
- "Test this PR manually" → use
sandbox-agent - "Review this PR" → use
pragent - "Fix issue #XXXXX" (no PR exists) → suggest
/delegatecommand
The agent analyzes the issue/request to determine what type of tests are needed:
| Scenario | Test Type | Skill Used |
|---|---|---|
| UI behavior, visual bugs, user interactions | UI Tests | write-ui-tests |
| XAML parsing, compilation, source generation | XAML Tests | write-xaml-tests |
| API behavior, logic, calculations | Unit Tests | (future) |
| Integration, end-to-end | Integration Tests | (future) |
Currently supported: UI Tests and XAML Tests.
write UI test for issue #12345
write UI test for CollectionView item selection
create UI test that verifies Button click updates a Label
write UI test for Android SafeArea issue #12345
write XAML test for issue #12345 which is about binding compilation
create XAML test for x:Name resolution
write test for XamlC behavior on markup extensions
The agent invokes the write-ui-tests skill which:
- Reads the UI test guidelines
- Creates HostApp page in
TestCases.HostApp/Issues/ - Creates NUnit test in
TestCases.Shared.Tests/Tests/Issues/ - Verifies tests FAIL (proves they catch the bug)
The agent invokes the write-xaml-tests skill which:
- Reads the XAML unit test guidelines
- Creates XAML and code-behind files in
Xaml.UnitTests/Issues/ - Builds and runs the test
Tests must FAIL before the skill reports success. A passing test does NOT prove it catches the bug.
If tests keep passing after 3 iterations, the agent will ask for guidance on reproduction steps.
After completion, the agent reports:
- Files created
- Test verification result (FAIL = success for bug reproduction)
- Failure message (proof tests catch the bug)
| Test Type | Location |
|---|---|
| UI Tests - HostApp | src/Controls/tests/TestCases.HostApp/Issues/IssueXXXXX.cs |
| UI Tests - NUnit | src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/IssueXXXXX.cs |
| XAML Tests | src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml[.cs] |
- write-ui-tests - UI test creation
- write-xaml-tests - XAML unit test creation
- verify-tests-fail-without-fix - Test verification