Official agent skill

Trx Analysis

by microsoft in microsoft/vstest

Parse and analyze Visual Studio TRX test result files. An agent skill from microsoft/vstest.

OfficialMITAuto-check passedTesting & QA

Install Trx Analysis

skills CLI
$ npx skills add microsoft/vstest --skill trx-analysis -a claude-code

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

GitHub CLI
$ gh skill install microsoft/vstest trx-analysis --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/microsoft/vstest.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/trx-analysis .claude/skills/trx-analysis && 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
trx-analysis
GitHub stars
969
Token cost
~1.8k tokens
SKILL.md length
287 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Parse and analyze Visual Studio TRX test result files. An agent skill from microsoft/vstest.

  • Asked about slow tests
  • SKILL.md covers TRX File Format, Loading a TRX File, Common Queries and Cross-File Duplicate Analysis, plus 1 more section
  • Reaches microsoft.com
  • Failure analysis

What it does

Trx Analysis is an agent skill from microsoft/vstest, published by the product's own GitHub organization. Parse and analyze Visual Studio TRX test result files. Use when asked about slow tests, test durations, test frequency, flaky tests, failure analysis, or test execution patterns from TRX files.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Root cause analysis and Failing and flaky tests. The repository describes itself as: Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console. The licence is MIT.

When your agent uses it

  • Asked about slow tests
  • Failure analysis
  • Test execution patterns from TRX files

Example prompts

  • “/trx-analysis”

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are powershell).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • microsoft.com

    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.

Context cost

Trx Analysis loads about 1.8k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 287 words of instructions outside code blocks.

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

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 microsoft/vstest at commit 05cd781, republished under its MIT licence (© microsoft). 287 words, ~1,772 tokens.

Download SKILL.mdSave it as .claude/skills/trx-analysis/SKILL.md (or your agent's skills folder).
name
trx-analysis
description
Parse and analyze Visual Studio TRX test result files. Use when asked about slow tests, test durations, test frequency, flaky tests, failure analysis, or test execution patterns from TRX files.

TRX Test Results Analysis

Parse .trx files (Visual Studio Test Results XML) to answer questions about test performance, frequency, failures, and patterns.

TRX File Format

TRX files use XML namespace http://microsoft.com/schemas/VisualStudio/TeamTest/2010. Key elements:

  • TestRun.Results.UnitTestResult — individual test executions with testName, duration (HH:mm:ss.fffffff), outcome (Passed/Failed/NotExecuted)
  • TestRun.TestDefinitions.UnitTest — test metadata including class and method info
  • TestRun.ResultSummary — aggregate pass/fail/skip counts

Loading a TRX File

powershell
[xml]$trx = Get-Content "path/to/file.trx"
$results = $trx.TestRun.Results.UnitTestResult

Common Queries

Top N slowest tests
powershell
$results | ForEach-Object {
    [PSCustomObject]@{
        Test     = $_.testName
        Seconds  = [TimeSpan]::Parse($_.duration).TotalSeconds
        Outcome  = $_.outcome
    }
} | Sort-Object Seconds -Descending | Select-Object -First 25 |
  Format-Table @{L='Sec';E={'{0,6:N1}' -f $_.Seconds}}, Outcome, Test -AutoSize
Slowest test from each distinct class (top N)
powershell
$results | ForEach-Object {
    $parts = $_.testName -split '\.'
    [PSCustomObject]@{
        Test      = $_.testName
        ClassName = ($parts[0..($parts.Length-2)] -join '.')
        Seconds   = [TimeSpan]::Parse($_.duration).TotalSeconds
    }
} | Sort-Object Seconds -Descending |
  Group-Object ClassName | ForEach-Object { $_.Group | Select-Object -First 1 } |
  Sort-Object Seconds -Descending | Select-Object -First 10 |
  Format-Table @{L='Sec';E={'{0,6:N1}' -f $_.Seconds}}, ClassName, Test -AutoSize
Most-executed tests (parameterization frequency)

Extract the base method name before parameterization and count runs:

powershell
$results | ForEach-Object {
    $name = $_.testName
    if ($name -match '^(\S+?)[\s(]') { $base = $Matches[1] } else { $base = $name }
    [PSCustomObject]@{ Base = $base; Seconds = [TimeSpan]::Parse($_.duration).TotalSeconds }
} | Group-Object Base | ForEach-Object {
    [PSCustomObject]@{
        Runs     = $_.Count
        TotalSec = ($_.Group | Measure-Object Seconds -Sum).Sum
        Test     = $_.Name
    }
} | Sort-Object TotalSec -Descending | Select-Object -First 20 |
  Format-Table @{L='Runs';E={$_.Runs}}, @{L='TotalSec';E={'{0,7:N1}' -f $_.TotalSec}}, Test -AutoSize
Failed tests
powershell
$results | Where-Object { $_.outcome -eq 'Failed' } | ForEach-Object {
    [PSCustomObject]@{
        Test    = $_.testName
        Seconds = [TimeSpan]::Parse($_.duration).TotalSeconds
        Error   = $_.Output.ErrorInfo.Message
    }
} | Format-Table -Wrap
Summary statistics
powershell
$summary = $trx.TestRun.ResultSummary.Counters
[PSCustomObject]@{
    Total    = $summary.total
    Passed   = $summary.passed
    Failed   = $summary.failed
    Skipped  = $summary.notExecuted
    Duration = $trx.TestRun.Times.finish
} | Format-List

Cross-File Duplicate Analysis

Compare two TRX files to find tests that appear in both and ran (were not skipped) in both. Useful for identifying redundant CI work across different configurations (e.g., net9.0 x64 vs net48 x86).

Load and find duplicates that ran in both files
powershell
[xml]$trx1 = Get-Content "path/to/file1.trx"
[xml]$trx2 = Get-Content "path/to/file2.trx"

$r1 = $trx1.TestRun.Results.UnitTestResult
$r2 = $trx2.TestRun.Results.UnitTestResult

# Build lookup: testName -> (outcome, duration) keeping best outcome per name
function Get-TestLookup($results) {
    $lookup = @{}
    foreach ($r in $results) {
        $name = $r.testName
        $outcome = $r.outcome
        $dur = [TimeSpan]::Parse($r.duration)
        if (-not $lookup.ContainsKey($name) -or ($lookup[$name].Outcome -eq 'NotExecuted' -and $outcome -ne 'NotExecuted')) {
            $lookup[$name] = [PSCustomObject]@{ Outcome = $outcome; Duration = $dur }
        }
    }
    $lookup
}

$t1 = Get-TestLookup $r1
$t2 = Get-TestLookup $r2

$skipped = @('NotExecuted','Pending','Disconnected','Warning','InProgress','Inconclusive')
$common = $t1.Keys | Where-Object { $t2.ContainsKey($_) -and $t1[$_].Outcome -notin $skipped -and $t2[$_].Outcome -notin $skipped }
Separate non-parametrized vs parametrized duplicates

Parametrized tests contain ( in their name (e.g., RunAllTests (Row: 0, Runner = net10.0, ...)). The base method name is everything before the first (.

powershell
$nonParam = $common | Where-Object { $_ -notmatch '\(' }
$param    = $common | Where-Object { $_ -match '\(' }
Non-parametrized duplicates ordered by duration
powershell
$nonParam | ForEach-Object {
    $d1 = $t1[$_].Duration; $d2 = $t2[$_].Duration
    [PSCustomObject]@{
        Test       = $_
        File1Sec   = $d1.TotalSeconds
        File2Sec   = $d2.TotalSeconds
        TotalSec   = $d1.TotalSeconds + $d2.TotalSeconds
    }
} | Sort-Object TotalSec -Descending |
  Format-Table @{L='File1';E={'{0,6:N1}' -f $_.File1Sec}},
               @{L='File2';E={'{0,6:N1}' -f $_.File2Sec}},
               @{L='Total';E={'{0,6:N1}' -f $_.TotalSec}}, Test -AutoSize
Parametrized duplicates squashed by base method

Tests with (Row: ...) or other parameterization are instances of the same test. Squash them into one row per base method, showing variant count, max single-instance duration, and total duration across all instances in both files.

powershell
$param | ForEach-Object {
    if ($_ -match '^(.+?)\s*\(') { $base = $Matches[1] } else { $base = $_ }
    $d1 = $t1[$_].Duration; $d2 = $t2[$_].Duration
    [PSCustomObject]@{ Base = $base; D1 = $d1.TotalSeconds; D2 = $d2.TotalSeconds; Max = [Math]::Max($d1.TotalSeconds, $d2.TotalSeconds) }
} | Group-Object Base | ForEach-Object {
    [PSCustomObject]@{
        Test         = $_.Name
        Variants     = $_.Count
        OneInstance   = ($_.Group | Measure-Object Max -Maximum).Maximum
        AllInstances  = ($_.Group | Measure-Object { $_.D1 + $_.D2 } -Sum).Sum
    }
} | Sort-Object AllInstances -Descending |
  Format-Table @{L='Variants';E={$_.Variants}},
               @{L='1 Instance';E={'{0,7:N1}s' -f $_.OneInstance}},
               @{L='All Instances';E={'{0,7:N1}s' -f $_.AllInstances}}, Test -AutoSize

Tips

  • Parameterized tests appear as separate UnitTestResult entries. Use regex '^(\S+?)[\s(]' to extract the base method name.
  • Sort by TotalSec (runs × avg duration) to find tests that consume the most CI time overall, even if each individual run is fast.
  • When comparing files, filter out NotExecuted tests — many parameterized tests are skipped in one configuration but not the other, so raw name overlap overstates true duplication.
  • TRX files from CI are typically found in TestResults/ or as pipeline artifacts.

© microsoft, 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/trx-analysis of microsoft/vstest.

Open the folder on GitHubat commit 05cd781

Compare with similar skills

Trx Analysis 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.

Trx Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trx Analysis this skillmicrosoft/vstest969—~1.8kAutomated safety check: PassMIT
Evanflow Debugevanklem/evanflow418—~760Automated safety check: PassCustom licence
Issue TracerZaxbyHub/opencode-swarm488—~383Automated safety check: PassMIT
Issue TracerZaxbyHub/opencode-swarm488—~397Automated safety check: PassMIT
Test Failure Investigatorproffesor-for-testing/agentic-qe494—~811Automated safety check: PassMIT
Pester Failure AnalysisPowerShell/PowerShell56k—~5.1kAutomated safety check: PassMIT

Similar skills

  • Evanflow Debug

    evanklem/evanflow

    Root-cause discipline for bugs, test failures, and unexpected behavior.

    418 GitHub stars~760 tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Issue Tracer

    ZaxbyHub/opencode-swarm

    A skill your agent uses when asked to trace, investigate, root-cause, reproduce, plan, fix, resolve, close, or prepare a PR for an issue, bug report, defect, regression, failing test, or confusing…

    488 GitHub stars~383 tokensUpdated today
    Testing & QAAuto-check passed
  • Issue Tracer

    ZaxbyHub/opencode-swarm

    A skill your agent uses when asked to trace, investigate, root-cause, reproduce, plan, fix, resolve, close, or prepare a PR for an issue, bug report, defect, regression, failing test, or confusing…

    488 GitHub stars~397 tokensUpdated today
    Testing & QAAuto-check passed
  • Test Failure Investigator

    proffesor-for-testing/agentic-qe

    A skill your agent uses when a test is failing and you need to determine root cause: is it flaky, an environment issue, or a real regression?

    494 GitHub stars~811 tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Pester Failure Analysis

    PowerShell/PowerShell

    Investigates failing Pester tests in PowerShell CI jobs by following a six-step workflow from pull request status to documented fix recommendations.

    56k GitHub stars~5.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Investigates a stubbornly failing Playwright test as a possible product bug, using error output, screenshots, traces and server code, and writes a structured bug report.

    41k GitHub stars~1.5k tokensUpdated today
    Testing & QAAuto-check passed

More from microsoft/vstest

  • Validate Skills

    microsoft/vstest

    Official

    Validate that commands documented in skill files actually work.

    969 GitHub stars~759 tokensUpdated yesterday
    Auto-check passed
  • Vstest Build Test

    microsoft/vstest

    Official

    Build, test, and validate changes in the vstest repository. An agent skill from microsoft/vstest.

    969 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Creating Skills

    microsoft/vstest

    Official

    Create custom agent capabilities when discovering novel tools, receiving task-agnostic tips from reviewers, or after researching specialized workflows not covered in existing instructions.

    969 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Expert Reviewing

    microsoft/vstest

    Official

    Route code and dependency changes to relevant review dimensions based on affected files and folders.

    969 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Trx Analysis

What does Trx Analysis do?

Parse and analyze Visual Studio TRX test result files. An agent skill from microsoft/vstest. Trx Analysis is an agent skill from microsoft/vstest, published by the product's own GitHub organization. Parse and analyze Visual Studio TRX test result files.

When should I use Trx Analysis?

Trx Analysis fits situations like: asked about slow tests; failure analysis; test execution patterns from TRX files.

How do I install Trx Analysis in Claude Code?

Run `npx skills add microsoft/vstest --skill trx-analysis -a claude-code`. Or copy the skill folder (.github/skills/trx-analysis in microsoft/vstest) into .claude/skills/trx-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Trx Analysis in Codex?

Run `npx skills add microsoft/vstest --skill trx-analysis -a codex`. Or copy the skill folder (.github/skills/trx-analysis in microsoft/vstest) into .agents/skills/trx-analysis in your project. Codex loads it when a task matches its description.

Can I use Trx Analysis 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 microsoft/vstest --skill trx-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trx-analysis, .gemini/skills/trx-analysis, .github/skills/trx-analysis and .opencode/skills/trx-analysis in your project.

What does Trx Analysis need to run?

SKILL.md names no scripts, command-line tools or credentials: Trx Analysis is instructions for the agent only.

Does Trx Analysis access the network?

SKILL.md names 1 domain. In commands or code: microsoft.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Trx Analysis 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 Trx Analysis use?

Trx Analysis 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 Trx Analysis use?

About 1.8k tokens (SKILL.md is roughly 7.1k 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 Trx Analysis?

Skills that share tags, products or a category with Trx Analysis: Evanflow Debug (evanklem/evanflow, 418 stars), Issue Tracer (ZaxbyHub/opencode-swarm, 488 stars), Issue Tracer (ZaxbyHub/opencode-swarm, 488 stars) and Test Failure Investigator (proffesor-for-testing/agentic-qe, 494 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trx Analysis?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/vstest, which has 969 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

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