Official agent skill

MAUI UI Test Shard Rebalancer

by dotnet in dotnet/maui

Splits a slow .NET MAUI UI-test category into method-level CI shards sized from historical Azure DevOps timings so each job fits a target duration.

OfficialMITAuto-check passedTesting & QA

Install MAUI UI Test Shard Rebalancer

skills CLI
$ npx skills add dotnet/maui --skill rebalance-ui-test-categories -a claude-code

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

GitHub CLI
$ gh skill install dotnet/maui rebalance-ui-test-categories --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/rebalance-ui-test-categories .claude/skills/rebalance-ui-test-categories && 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
rebalance-ui-test-categories
GitHub stars
23k
Token cost
~995 tokens
SKILL.md length
361 words
Files
4 (incl. scripts)
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Splits a slow .NET MAUI UI-test category into method-level CI shards sized from historical Azure DevOps timings so each job fits a target duration.

  • A UI test category in maui-pr-uitests takes too long on a single CI leg
  • SKILL.md covers Rules and Commands
  • Runs PowerShell scripts from its folder; calls pwsh
  • Spreading a category's test methods across shards that fit a time budget

What it does

The skill rebalances a category in the maui-pr-uitests pipeline that needs several ordinary matrix legs, each of which must finish within a target duration. It requires historical Azure test results and never substitutes source test counts for timing evidence. Every test method gets one ShardedTestCategory attribute that tags it with both the umbrella category and a single numbered shard, and that attribute is never placed on a class.

A PowerShell script, Rebalance-UITestCategories.ps1, can gather builds, plan, report and apply in one run. It uses a conservative p80 of recent run times per test and platform, adds measured job overhead, and assigns methods and ordered fixtures by deterministic longest-processing-time scheduling while keeping a safety margin (2 minutes by default) under the target. It fails if one test plus overhead exceeds the target or the shard cap cannot meet it, and it validates the plan against the source after editing. Evidence can come from recent builds or from an offline evidence file.

When your agent uses it

  • A UI test category in maui-pr-uitests takes too long on a single CI leg
  • Spreading a category's test methods across shards that fit a time budget
  • Rebalancing an existing shard matrix without changing its job count

Example prompts

  • “Rebalance the CollectionView UI tests so every shard finishes within 60 minutes.”
  • “Plan new shards for this category using the last few completed pipeline builds.”
  • “Rebalance offline using the evidence file we saved last week.”

Requirements

  • PowerShell 7
  • Azure CLI with the azure-devops extension
  • Historical test results from Azure DevOps or an evidence file
  • Compatibility (from SKILL.md): Requires PowerShell 7 and Azure CLI with the azure-devops extension.

What it can do on your machine

Read from SKILL.md and the folder at commit 54ab39e. 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

    Ships 2 files in scripts/ (PowerShell), which the agent can run.

    Shell commands in SKILL.md call:

    • pwsh

    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 PowerShell 7 and Azure CLI with the azure-devops extension.

    From compatibility in the SKILL.md frontmatter.

Context cost

MAUI UI Test Shard Rebalancer loads about 995 tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 361 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from dotnet/maui at commit 54ab39e, republished under its MIT licence (© dotnet). 361 words, ~995 tokens.

Download SKILL.mdSave it as .claude/skills/rebalance-ui-test-categories/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
rebalance-ui-test-categories
description
Rebalances a UI-test umbrella category into additive method-level CI shards using historical Azure DevOps test durations.
compatibility
Requires PowerShell 7 and Azure CLI with the azure-devops extension.
metadata.author
dotnet-maui
metadata.version
1.0

Rebalance UI Test Categories

Use this skill when a category in maui-pr-uitests needs multiple ordinary matrix legs and each leg must fit a target duration.

Rules

  • Historical Azure test results are required. Never substitute source test counts for timing evidence.
  • Use one method-level [ShardedTestCategory(UITestCategories.Category, shard: N)] attribute. It exposes both the umbrella and exactly one numbered shard category to NUnit. Never put sharded categories on a class.
  • Use a conservative per-test/platform p80 of recent valid run totals.
  • Aggregate measured fixed job overhead with nearest-rank p80.
  • Reserve a configurable safety margin (2 minutes by default), so every projection is strictly below TargetMinutes - SafetyMarginMinutes.
  • Assignment is deterministic multidimensional longest-processing-time scheduling over individual methods and cohesive ordered fixtures. It minimizes the worst projected platform/shard duration.
  • Fail if one test plus overhead exceeds the target or if -MaxShards cannot satisfy the target.
  • Applying a category maintains the analyzer's reusable shard-prefix set, preserving previously registered umbrellas, and performs mandatory plan-to-source validation after editing.
  • Before splitting methods from one fixture across shards, ensure fixture setup independently reaches the state required by every selected method. Never rely on an Order(1) test to initialize the remaining shard.
  • Dedicated configuration stages that use testConfigurationArgs, such as ios_ui_tests_mono_cv1, reuse the numbered shard filters but remain outside ordinary category-matrix projection data. Their samples and overhead are recorded separately so they cannot make ordinary shard projections look artificially cheaper.
Show full SKILL.md (134 more words)Show less

Commands

Gather, plan, report, and apply in one operation:

powershell
pwsh .github/skills/rebalance-ui-test-categories/scripts/Rebalance-UITestCategories.ps1 `
  -Mode All -Category CollectionView -TargetMinutes 60 `
  -SafetyMarginMinutes 2 -BuildId 1561395,1563447 `
  -UnmeasuredTestPolicy ClassPlatformMax `
  -OutputPath artifacts/CollectionView-rebalance.json -Apply

Use -RecentBuildCount N instead of -BuildId to query recent completed builds from pipeline definition 313. To work offline, explicitly pass -EvidencePath path/to/evidence.json; absence of Azure access or an evidence file is an error.

Use -MinimumShards N -MaxShards N when rebalancing an existing matrix without changing its job count.

Separate deterministic phases are also available:

powershell
# Azure -> evidence JSON
... -Mode Gather -Category CollectionView -BuildId 1563447 `
  -OutputPath artifacts/CollectionView-evidence.json

# Evidence -> assignment report
... -Mode Plan -Category CollectionView `
  -EvidencePath artifacts/CollectionView-evidence.json `
  -OutputPath artifacts/CollectionView-plan.json

# Existing report -> source/YAML/constants
... -Mode Apply -Category CollectionView `
  -PlanPath artifacts/CollectionView-plan.json -Apply

Review the JSON report's projectedShardMinutes, fixedOverheadMinutes, safetyMarginMinutes, separately recorded configuration-stage evidence, unmatched evidence, and source mapping before accepting the result.

The planner fails when active source tests have no historical sample. For a known-complete historical run where such methods were not reported, the explicit -UnmeasuredTestPolicy ClassPlatformMax option conservatively imputes the maximum measured method duration from the same class/platform (falling back to the platform-wide maximum) and records every imputation in the report.

© 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

SKILL.md and 3 other files (scripts) in .github/skills/rebalance-ui-test-categories of dotnet/maui.

  • SKILL.md
  • CollectionView-rebalance-summary.json
  • scripts/Rebalance-UITestCategories.ps1
  • scripts/Rebalance-UITestCategories.psm1

Open the folder on GitHubat commit 54ab39e

Compare with similar skills

MAUI UI Test Shard Rebalancer 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 UI Test Shard Rebalancer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MAUI UI Test Shard Rebalancer this skilldotnet/maui23k—~995Automated safety check: PassMIT
Analyze Azdo BuildDataDog/dd-trace-dotnet572—~3.5kAutomated safety check: PassApache-2.0
Nuget Trusted Publishingdotnet/skills5.6k2 repos~2.3kAutomated safety check: PassMIT
CI CDcodewithmukesh/dotnet-claude-kit7561 repos~1.4kAutomated safety check: PassMIT
Dotnet Devopsnovotnyllc/dotnet-artisan232—~1.1kAutomated safety check: PassMIT
Promotion Branches E2E Testhardisgroupcom/sfdx-hardis403—~11kAutomated safety check: NotesAGPL-3.0

Similar skills

  • Analyze Azdo Build

    DataDog/dd-trace-dotnet

    Official

    Analyze Azure DevOps CI build failures in dd-trace-dotnet pipeline.

    572 GitHub stars~3.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Official

    Set up NuGet trusted publishing (OIDC) on a GitHub Actions repo — replaces long-lived API keys with short-lived tokens.

    5.6k GitHub starsUsed in 2 repos~2.3k tokens
    DevOps & CloudAuto-check passed
  • CI CD

    codewithmukesh/dotnet-claude-kit

    CI/CD pipelines for .NET applications. An agent skill from codewithmukesh/dotnet-claude-kit.

    756 GitHub starsUsed in 1 repo~1.4k tokens
    DevOps & CloudAuto-check passed
  • Dotnet Devops

    novotnyllc/dotnet-artisan

    Configures .NET CI/CD pipelines (GitHub Actions with setup-dotnet, NuGet cache, reusable workflows; Azure DevOps with DotNetCoreCLI, templates, multi-stage), containerization (multi-stage…

    232 GitHub stars~1.1k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Promotion Branches E2E Test

    hardisgroupcom/sfdx-hardis

    Runs a full end-to-end test of sfdx-hardis promotion branches and backpromote against real Salesforce orgs and a throwaway repository, then writes a report.

    403 GitHub stars~11k tokensUpdated today
    Testing & QAAuto-check: notes
  • Azsdk Common Pipeline Analysis

    Azure/azure-sdk-tools

    Official

    Analyze Azure SDK CI/CD pipeline failures into a structured diagnosis, and define the required output format.

    134 GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-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 today
    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 today
    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 today
    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 today
    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 today
    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 today
    Auto-check passed

Questions about MAUI UI Test Shard Rebalancer

What does MAUI UI Test Shard Rebalancer do?

Splits a slow .NET MAUI UI-test category into method-level CI shards sized from historical Azure DevOps timings so each job fits a target duration. The skill rebalances a category in the maui-pr-uitests pipeline that needs several ordinary matrix legs, each of which must finish within a target duration. It requires historical Azure test results and never substitutes source test counts for timing evidence.

When should I use MAUI UI Test Shard Rebalancer?

MAUI UI Test Shard Rebalancer fits situations like: A UI test category in maui-pr-uitests takes too long on a single CI leg; spreading a category's test methods across shards that fit a time budget; rebalancing an existing shard matrix without changing its job count.

How do I install MAUI UI Test Shard Rebalancer in Claude Code?

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

How do I install MAUI UI Test Shard Rebalancer in Codex?

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

Can I use MAUI UI Test Shard Rebalancer 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 rebalance-ui-test-categories -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rebalance-ui-test-categories, .gemini/skills/rebalance-ui-test-categories, .github/skills/rebalance-ui-test-categories and .opencode/skills/rebalance-ui-test-categories in your project.

What does MAUI UI Test Shard Rebalancer need to run?

Going by SKILL.md and its folder, MAUI UI Test Shard Rebalancer needs PowerShell for the scripts in its folder and the command-line tools its instructions call (pwsh). Our summary lists: PowerShell 7; Azure CLI with the azure-devops extension; Historical test results from Azure DevOps or an evidence file. Compatibility (from SKILL.md): Requires PowerShell 7 and Azure CLI with the azure-devops extension..

Does MAUI UI Test Shard Rebalancer 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 UI Test Shard Rebalancer 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does MAUI UI Test Shard Rebalancer use?

MAUI UI Test Shard Rebalancer 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 UI Test Shard Rebalancer use?

About 995 tokens (SKILL.md is roughly 4k 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 UI Test Shard Rebalancer?

Skills that share tags, products or a category with MAUI UI Test Shard Rebalancer: Analyze Azdo Build (DataDog/dd-trace-dotnet, 572 stars), Nuget Trusted Publishing (dotnet/skills, 5.6k stars), CI CD (codewithmukesh/dotnet-claude-kit, 756 stars) and Dotnet Devops (novotnyllc/dotnet-artisan, 232 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MAUI UI Test Shard Rebalancer?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/maui, which has 23,321 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 10, 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.