write-tests-agent

A .NET MAUI testing agent that decides which supported automated tests to create and then uses the matching test-writing instructions. UI tests check user interaction and appearance; XAML tests check markup parsing, compilation, and code generation.

In plain words
What is it for?
Use it for requests to add test coverage, write tests for an issue, or add tests to a pull request involving UI behavior or XAML.
Why use it?
It helps turn a testing request into the appropriate supported test type instead of applying the wrong testing approach.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dotnet/maui/write-tests-agent
Clone the repo
git clone --depth 1 https://github.com/dotnet/maui
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 828 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.00828
Opus 5 $0.00019 $0.00414
Sonnet 5 $0.00008 $0.00166
Haiku 4.5 $0.00004 $0.00083

Measured yesterday against content hash 7e7461c538b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-tests-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/agents/write-tests-agent.agent.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write Tests Agent

You are an agent that helps write tests for .NET MAUI. Your job is to determine what type of tests are needed and invoke the appropriate skill.

When to Use This Agent

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 pr agent
  • "Fix issue #XXXXX" (no PR exists) → suggest /delegate command

Workflow

Step 1: Determine Test Type

Analyze the issue/request to determine what type of tests are needed:

Scenario Test Type Skill to Use
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. For other test types, inform the user and provide guidance.

Step 2: Gather Required Information

Before invoking the skill, ensure you have:

  • Issue number (e.g., 33331)
  • Issue description or reproduction steps
  • Platforms affected (iOS, Android, Windows, MacCatalyst)

Step 3: Invoke the Appropriate Skill

For UI Tests:

Invoke the write-ui-tests skill with the gathered information.

The skill will:

  1. Read the UI test guidelines
  2. Create HostApp page (reproduces the issue)
  3. Create NUnit test (automates verification)
  4. Verify tests FAIL (proves they catch the bug)

For XAML Tests:

Invoke the write-xaml-tests skill with the gathered information.

The skill will:

  1. Read the XAML unit test guidelines
  2. Create XAML and code-behind files
  3. Build and run the test

🛑 CRITICAL (UI Tests): The write-ui-tests skill enforces that tests must FAIL before reporting success. A passing test does NOT prove it catches the bug. XAML tests may pass or fail depending on whether they're reproduction tests or regression tests.

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 101 lines · 39 tokens per session scan A 7e7461c538b9

Subscribe to this mod's changes

write-tests-agent is an agent published in the GitHub repository dotnet/maui (23,317 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 828 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.