Official agent skill

MAUI XAML Unit Test Writer

by dotnet in dotnet/maui

Writes a paired .xaml and .xaml.cs unit test for a .NET MAUI issue that is about XAML behavior itself, such as parsing, XamlC output or generated code.

OfficialMITAuto-check passedTesting & QA

Install MAUI XAML Unit Test Writer

skills CLI
$ npx skills add dotnet/maui --skill write-xaml-tests -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dotnet/maui write-xaml-tests --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dotnet/maui.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/write-xaml-tests .claude/skills/write-xaml-tests && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
write-xaml-tests
GitHub stars
23k
Token cost
~742 tokens
SKILL.md length
200 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Writes a paired .xaml and .xaml.cs unit test for a .NET MAUI issue that is about XAML behavior itself, such as parsing, XamlC output or generated code.

  • Works in 4 steps: Read the XAML Unit Test Guidelines → Create Test Files → Verify Tests Compile and Run → …
  • Testing XAML parsing or inflation behavior for a reported bug
  • SKILL.md covers When to Use, When NOT to Use, Required Input and Workflow, plus 2 more sections
  • Calls dotnet

What it does

The skill is for bugs that are specific to XAML, such as bindings, markup extensions or x:Name, and not for UI interactions or rendering, which belong to the write-ui-tests skill. The input is an issue number, a description of the broken XAML behavior and the expected versus actual result. The agent first reads the repository's XAML unit test guidelines, which set file naming, the Issues folder under src/Controls/tests/Xaml.UnitTests, the XamlInflator values pattern, MockCompiler for XamlC tests, MockSourceGenerator for generator tests and special extensions for invalid codegen.

It then creates a paired .xaml and .xaml.cs test file for the issue, builds the test project with dotnet and runs the tests. A bug reproduction test should fail before the fix and pass after it, while a regression test should simply pass. At the end the agent reports the files it created in a fixed summary format. Building and running the xUnit tests needs the .NET SDK.

When your agent uses it

  • Testing XAML parsing or inflation behavior for a reported bug
  • Checking XamlC compilation output for a XAML construct
  • Verifying source generator output for a XAML-specific issue

Example prompts

  • “Add a XAML unit test for issue 12345, where an x:Name reference fails to resolve.”
  • “Write a regression test for this markup extension bug in Controls.Xaml.UnitTests.”
  • “Create a source generator test that reproduces the binding problem described in the issue.”

Requirements

  • .NET SDK for building and running xUnit tests
  • Compatibility (from SKILL.md): Requires .NET SDK for building and running xUnit tests.

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Read the XAML Unit Test Guidelines
  2. Create Test Files
  3. Verify Tests Compile and Run
  4. Verify Test Behavior

What it can do on your machine

Read from SKILL.md and the folder at commit 7d38fd0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires .NET SDK for building and running xUnit tests.

    From compatibility in the SKILL.md frontmatter.

Context cost

MAUI XAML Unit Test Writer loads about 742 tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 200 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~742

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dotnet/maui at commit 7d38fd0, republished under its MIT licence (© dotnet). 200 words, ~742 tokens.

Download SKILL.mdSave it as .claude/skills/write-xaml-tests/SKILL.md (or your agent's skills folder).
name
write-xaml-tests
description
Creates XAML unit tests for GitHub issues in the Controls.Xaml.UnitTests project. Tests XAML parsing, compilation (XamlC), and source generation. Use when testing XAML-specific behavior, not UI interactions.
compatibility
Requires .NET SDK for building and running xUnit tests.
metadata.author
Stephane Delcroix
metadata.version
1.0

Write XAML Tests Skill

Creates XAML unit tests that verify XAML parsing, XamlC compilation, and source generation behavior.

When to Use

  • ✅ Testing XAML parsing/inflation behavior
  • ✅ Testing XamlC (IL generation) correctness
  • ✅ Testing Source Generator output
  • ✅ XAML-specific bugs (bindings, markup extensions, x:Name, etc.)

When NOT to Use

  • ❌ Testing UI interactions or visual behavior → Use write-ui-tests skill
  • ❌ Testing runtime behavior after page loads → Use write-ui-tests skill
  • ❌ Testing platform-specific rendering → Use write-ui-tests skill

Required Input

Before invoking, ensure you have:

  • Issue number (e.g., 12345)
  • Issue description - what XAML behavior is broken
  • Expected vs actual behavior

Workflow

Step 1: Read the XAML Unit Test Guidelines
bash
cat .github/instructions/xaml-unittests.instructions.md

This contains the authoritative conventions for:

  • File naming (MauiXXXXX.xaml and MauiXXXXX.xaml.cs)
  • File location (src/Controls/tests/Xaml.UnitTests/Issues/)
  • Test patterns with [Values] XamlInflator
  • XamlC testing with MockCompiler
  • Source Generator testing with MockSourceGenerator
  • Special file extensions for invalid codegen (.rt.xaml, .rtsg.xaml, .rtxc.xaml)
Step 2: Create Test Files

Following the conventions from Step 1, create:

  • src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml
  • src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml.cs
Step 3: Verify Tests Compile and Run
bash
# Build the test project
dotnet build src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj -c Debug --no-restore -v q

# Run specific test
dotnet test src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj --filter "FullyQualifiedName~MauiXXXXX" --no-build
Step 4: Verify Test Behavior
  • For bug reproduction tests: Tests should FAIL before fix, PASS after fix
  • For regression tests: Tests should PASS to confirm behavior works

Output

After completion, report:

markdown
✅ XAML unit test created for Issue #XXXXX

**Files:**
- `src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml`
- `src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml.cs`

**Test method:** `DescriptiveTestName`
**Inflators tested:** Runtime, XamlC, SourceGen
**Verification:** Tests [PASS/FAIL] as expected

References

  • Full conventions: .github/instructions/xaml-unittests.instructions.md
  • Test project: src/Controls/tests/Xaml.UnitTests/
  • Existing issue tests: src/Controls/tests/Xaml.UnitTests/Issues/

© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/write-xaml-tests of dotnet/maui.

Open the folder on GitHubat commit 7d38fd0

Compare with similar skills

MAUI XAML Unit Test Writer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MAUI XAML Unit Test Writer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MAUI XAML Unit Test Writer this skilldotnet/maui23k—~742Automated safety check: PassMIT
ScottPlot Test RunnerScottPlot/ScottPlot6.8k—~308Automated safety check: PassMIT
Run Testsrunceel/ReactiveProperty944—~3.6kAutomated safety check: PassMIT
Code Testing Agentmicrosoft/testfx1k—~2.7kAutomated safety check: PassMIT
Run Testsmicrosoft/testfx1k—~4.2kAutomated safety check: PassMIT
Test Taggingmicrosoft/testfx1k—~4.3kAutomated safety check: PassMIT

Similar skills

  • ScottPlot Test Runner

    ScottPlot/ScottPlot

    Run or add ScottPlot 5 tests. Use for unit-test and cookbook-test work; unless explicitly asked otherwise, restrict manual test execution to the Unit Tests…

    6.8k GitHub stars~308 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Run Tests

    runceel/ReactiveProperty

    Runs .NET tests with dotnet test. An agent skill from runceel/ReactiveProperty.

    944 GitHub stars~3.6k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Code Testing Agent

    microsoft/testfx

    Official

    Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling…

    1k GitHub stars~2.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Run Tests

    microsoft/testfx

    Official

    For dotnet test: figures out which test platform (VSTest vs Microsoft.Testing.Platform) a project uses from Directory.Build.props, global.json, and .csproj, then picks the matching command syntax.

    1k GitHub stars~4.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Test Tagging

    microsoft/testfx

    Official

    Analyzes test suites in any language and tags each test with a standardized set of traits (positive, negative, critical-path, boundary, smoke, regression, integration, performance, security).

    1k GitHub stars~4.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Official

    Detects duplicate boilerplate, copy-paste tests, and structural maintainability issues across .NET test suites.

    5.6k GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check passed

More from dotnet/maui

All 27 skills in this repo
  • Mines local Copilot CLI session logs for dotnet/maui to rank costly or failing runs, tag recurring failure modes, propose repo edits and emit guard evals.

    23k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Official

    Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.

    23k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Official

    Produces evidence-backed ship-readiness verdicts for .NET MAUI Servicing Releases and Previews, and drafts public-safe release handoff pages from the result.

    23k GitHub stars~15k tokensUpdated yesterday
    Auto-check passed
  • Official

    Interprets pinned managed benchmark evidence for a dotnet/maui pull request and writes a narrative for the performance review workflow, without running or publishing anything.

    23k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • PR Finalize

    dotnet/maui

    Official

    Checks that a pull request's title and description match its implementation and reviews the code for best practices before merge, without posting anything.

    23k GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Official

    Adds MAUI-specific guardrails on top of the maestro-cli skill and Maestro MCP tools for darc, BAR, and channel or feed lookups in dotnet/maui.

    23k GitHub stars~10k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about MAUI XAML Unit Test Writer

What does MAUI XAML Unit Test Writer do?

Writes a paired .xaml and .xaml.cs unit test for a .NET MAUI issue that is about XAML behavior itself, such as parsing, XamlC output or generated code. The skill is for bugs that are specific to XAML, such as bindings, markup extensions or x:Name, and not for UI interactions or rendering, which belong to the write-ui-tests skill. The input is an issue number, a description of the broken XAML behavior and the expected versus actual result.

When should I use MAUI XAML Unit Test Writer?

MAUI XAML Unit Test Writer fits situations like: testing XAML parsing or inflation behavior for a reported bug; checking XamlC compilation output for a XAML construct; verifying source generator output for a XAML-specific issue.

How do I install MAUI XAML Unit Test Writer in Claude Code?

Run `npx skills add dotnet/maui --skill write-xaml-tests -a claude-code`. Or copy the skill folder (.github/skills/write-xaml-tests in dotnet/maui) into .claude/skills/write-xaml-tests in your project. Claude Code loads it when a task matches its description.

How do I install MAUI XAML Unit Test Writer in Codex?

Run `npx skills add dotnet/maui --skill write-xaml-tests -a codex`. Or copy the skill folder (.github/skills/write-xaml-tests in dotnet/maui) into .agents/skills/write-xaml-tests in your project. Codex loads it when a task matches its description.

Can I use MAUI XAML Unit Test Writer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/maui --skill write-xaml-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-xaml-tests, .gemini/skills/write-xaml-tests, .github/skills/write-xaml-tests and .opencode/skills/write-xaml-tests in your project.

What does MAUI XAML Unit Test Writer need to run?

Going by SKILL.md and its folder, MAUI XAML Unit Test Writer needs the command-line tools its instructions call (dotnet). Our summary lists: .NET SDK for building and running xUnit tests. Compatibility (from SKILL.md): Requires .NET SDK for building and running xUnit tests..

Does MAUI XAML Unit Test Writer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is MAUI XAML Unit Test Writer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does MAUI XAML Unit Test Writer use?

MAUI XAML Unit Test Writer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MAUI XAML Unit Test Writer use?

About 742 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to MAUI XAML Unit Test Writer?

Skills that share tags, products or a category with MAUI XAML Unit Test Writer: ScottPlot Test Runner (ScottPlot/ScottPlot, 6.8k stars), Run Tests (runceel/ReactiveProperty, 944 stars), Code Testing Agent (microsoft/testfx, 1k stars) and Run Tests (microsoft/testfx, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MAUI XAML Unit Test Writer?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/maui, which has 23,322 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 7, 2026.

Source: dotnet/maui on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.