Official agent skill

Build Perf Diagnostics

by microsoft in microsoft/testfx

Diagnose MSBuild build performance bottlenecks using binary log analysis.

OfficialMITAuto-check passedDevelopment

Install Build Perf Diagnostics

skills CLI
$ npx skills add microsoft/testfx --skill build-perf-diagnostics -a claude-code

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

GitHub CLI
$ gh skill install microsoft/testfx build-perf-diagnostics --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/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/build-perf-diagnostics .claude/skills/build-perf-diagnostics && 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
build-perf-diagnostics
GitHub stars
1k
Used in
2 other repos
Token cost
~2.6k tokens
SKILL.md length
958 words
Files
1
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

Diagnose MSBuild build performance bottlenecks using binary log analysis.

  • Works in 7 steps: ResolveAssemblyReference (RAR) Slowness → Roslyn Analyzers and Source Generators → Serialization Bottlenecks… → …
  • : identifying why builds are slow by analyzing binlog performance summaries
  • SKILL.md covers Performance Analysis Methodology, Key Metrics and Thresholds, Common Bottlenecks and Using Binlog Replay for…, plus 2 more sections
  • Calls dotnet

What it does

Build Perf Diagnostics is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Diagnose MSBuild build performance bottlenecks using binary log analysis. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking 5s, Roslyn analyzers consuming 30% of Csc time, single targets dominating 50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target/Task Performance Summary interpretation, and 7 common bottleneck categories. Use after…

Its SKILL.md is about 2.6k 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 Development. It works with Model Context Protocol and .NET. The repository describes itself as: This repository holds the source code of Microsoft.Testing.Platform (MTP), a lightweight alternative to VSTest, as well as MSTest adapter and framework. The licence is MIT.

When your agent uses it

  • : identifying why builds are slow by analyzing binlog performance summaries
  • Detecting ResolveAssemblyReference (RAR) taking 5s
  • Roslyn analyzers consuming 30% of Csc time
  • Single targets dominating 50% of build time

Example prompts

  • “/build-perf-diagnostics”

Workflow steps

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

  1. ResolveAssemblyReference (RAR) Slowness
  2. Roslyn Analyzers and Source Generators
  3. Serialization Bottlenecks (Single-threaded targets)
  4. Excessive File I/O (Copy tasks)
  5. Evaluation Overhead
  6. NuGet Restore in Build
  7. Large Project Count and Graph Shape

What it can do on your machine

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

Context cost

Build Perf Diagnostics loads about 2.6k tokens when it runs. Until then it costs about 197 tokens; SKILL.md has 958 words of instructions outside code blocks.

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

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/testfx at commit 44b9dcc, republished under its MIT licence (© microsoft). 958 words, ~2,601 tokens.

Download SKILL.mdSave it as .claude/skills/build-perf-diagnostics/SKILL.md (or your agent's skills folder).
name
build-perf-diagnostics
description
Diagnose MSBuild build performance bottlenecks using binary log analysis. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking >5s, Roslyn analyzers consuming >30% of Csc time, single targets dominating >50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target/Task Performance Summary interpretation, and 7 common bottleneck categories. Use after build-perf-baseline has established measurements. DO NOT USE FOR: establishing initial baselines (use build-perf-baseline first), fixing incremental build issues (use incremental-build), parallelism tuning (use build-parallelism), non-MSBuild build systems.
license
MIT

Performance Analysis Methodology

  1. Generate a binlog: dotnet build /bl:{} -m
  2. Use the binlog MCP server (Microsoft.AITools.BinlogMcp, exposed under the binlog MCP namespace) which is bundled with this plugin
Alternate flow when MCP is unavailable: binlog replay to text logs
  1. Generate a binlog: dotnet build /bl:{} -m
  2. Replay to diagnostic log with performance summary:
    bash
    dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary
  3. Read the performance summary (at the end of full.log):
    bash
    grep "Target Performance Summary\|Task Performance Summary" -A 50 full.log
  4. Find expensive targets and tasks: The PerformanceSummary section lists all targets/tasks sorted by cumulative time
  5. Check for node utilization: grep for scheduling and node messages
    bash
    grep -i "node.*assigned\|building with\|scheduler" full.log | head -30
  6. Check analyzers: grep for analyzer timing
    bash
    grep -i "analyzer.*elapsed\|Total analyzer execution time\|CompilerAnalyzerDriver" full.log

Key Metrics and Thresholds

  • Build duration: what's "normal" — small project <10s, medium <60s, large <5min
  • Node utilization: ideal is >80% active time across nodes. Low utilization = serialization bottleneck
  • Single target domination: if one target is >50% of build time, investigate
  • Analyzer time vs compile time: analyzers should be <30% of Csc task time. If higher, consider removing expensive analyzers
  • RAR time: ResolveAssemblyReference >5s is concerning. >15s is pathological

Common Bottlenecks

1. ResolveAssemblyReference (RAR) Slowness
  • Symptoms: RAR taking >5s per project
  • Root causes: too many assembly references, network-based reference paths, large assembly search paths
  • Fixes: reduce reference count, use <DesignTimeBuild>false</DesignTimeBuild> for RAR-heavy analysis, set <ResolveAssemblyReferencesSilent>true</ResolveAssemblyReferencesSilent> for diagnostic
  • Advanced: <DesignTimeBuild> and <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
  • Key insight: RAR runs unconditionally even on incremental builds because users may have installed targeting packs or GACed assemblies (see dotnet/msbuild#2015). With .NET Core micro-assemblies, the reference count is often very high.
  • Reduce transitive references: Set <DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences> to avoid pulling in the full transitive closure (note: projects may need to add direct references for any types they consume). Use ReferenceOutputAssembly="false" on ProjectReferences that are only needed at build time (not API surface). Trim unused PackageReferences.
2. Roslyn Analyzers and Source Generators
  • Symptoms: Csc task takes much longer than expected for file count (>2× clean compile time)
  • Diagnosis: Check the Task Performance Summary in the replayed log for Csc task time; grep for analyzer timing messages; compare Csc duration with and without analyzers (/p:RunAnalyzers=false)
  • Fixes:
    • Conditionally disable in dev: <RunAnalyzers Condition="'$(ContinuousIntegrationBuild)' != 'true'">false</RunAnalyzers>
    • Per-configuration: <RunAnalyzers Condition="'$(Configuration)' == 'Debug'">false</RunAnalyzers>
    • Code-style only: <EnforceCodeStyleInBuild Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</EnforceCodeStyleInBuild>
    • Remove genuinely redundant analyzers from inner loop
    • Severity config in .editorconfig for less critical rules
  • Key principle: Preserve analyzer enforcement in CI. Never just "remove" analyzers — configure them conditionally.
  • GlobalPackageReference: Analyzers added via GlobalPackageReference in Directory.Packages.props apply to ALL projects. Consider if test projects need the same analyzer set as production code.
  • EnforceCodeStyleInBuild: When set to true in Directory.Build.props, forces code-style analysis on every build. Should be conditional on CI environment (ContinuousIntegrationBuild) to avoid slowing dev inner loop.
3. Serialization Bottlenecks (Single-threaded targets)
  • Symptoms: Performance summary shows most build time concentrated in a single project; diagnostic log shows idle nodes while one works
  • Common culprits: targets without proper dependency declaration, single project on critical path
  • Fixes: split large projects, optimize the critical path project, ensure proper BuildInParallel
4. Excessive File I/O (Copy tasks)
  • Symptoms: Copy task shows high aggregate time
  • Root causes: copying thousands of files, copying across network drives, Copy task unintentionally running once per item (per-file) instead of as a single batch (see dotnet/msbuild#12884)
  • Fixes: use hardlinks (<CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>true</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>), reduce CopyToOutputDirectory items, use <UseCommonOutputDirectory>true</UseCommonOutputDirectory> when appropriate, set <SkipCopyUnchangedFiles>true</SkipCopyUnchangedFiles>, consider --artifacts-path (.NET 8+) for centralized output layout
  • Dev Drive: On Windows, switching to a Dev Drive (ReFS with copy-on-write and reduced Defender scans) can significantly reduce file I/O overhead for Copy-heavy builds. Recommend for both dev machines and self-hosted CI agents.
Show full SKILL.md (433 more words)Show less
5. Evaluation Overhead
  • Symptoms: build starts slow before any compilation
  • Root causes: complex Directory.Build.props, wildcard globs scanning large directories, NuGetSdkResolver overhead (adds 180-400ms per project evaluation even when restored — see dotnet/msbuild#4025)
  • Fixes: reduce Directory.Build.props complexity, use <EnableDefaultItems>false</EnableDefaultItems> for legacy projects with explicit file lists, avoid NuGet-based SDK resolvers if possible
  • See: eval-performance skill for detailed guidance
6. NuGet Restore in Build
  • Symptoms: restore runs every build even when unnecessary
  • Fixes:
    • Separate restore from build: dotnet restore then dotnet build --no-restore
    • Enable static graph evaluation: <RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation> in Directory.Build.props — can save significant time in large builds (results are workload-dependent)
7. Large Project Count and Graph Shape
  • Symptoms: many small projects, each takes minimal time but overhead adds up; deep dependency chains serialize the build
  • Consider: project consolidation, or use /graph mode for better scheduling
  • Graph shape matters: a wide dependency graph (few levels, many parallel branches) builds faster than a deep one (many levels, serialized). Refactoring from deep to wide can yield significant improvements in both clean and incremental build times.
  • Actions: look for unnecessary project dependencies, consider splitting a bottleneck project into two, or merging small leaf projects

Using Binlog Replay for Performance Analysis

Step-by-step workflow using text log replay:

  1. Replay with performance summary:
    bash
    dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary
  2. Read target/task performance summaries (at the end of full.log):
    bash
    grep "Target Performance Summary\|Task Performance Summary" -A 50 full.log
    This shows all targets and tasks sorted by cumulative time — equivalent to finding expensive targets/tasks.
  3. Find per-project build times:
    bash
    grep "done building project\|Project Performance Summary" full.log
  4. Check parallelism (multi-node scheduling):
    bash
    grep -i "node.*assigned\|RequiresLeadingNewline\|Building with" full.log | head -30
  5. Check analyzer overhead:
    bash
    grep -i "Total analyzer execution time\|analyzer.*elapsed\|CompilerAnalyzerDriver" full.log
  6. Drill into a specific slow target:
    bash
    grep 'Target "CoreCompile"\|Target "ResolveAssemblyReferences"' full.log

Quick Wins Checklist

  • Use /maxcpucount (or -m) for parallel builds
  • Separate restore from build (dotnet restore then dotnet build --no-restore)
  • Enable static graph restore (<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>)
  • Enable hardlinks for Copy (<CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>true</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>)
  • Disable analyzers conditionally in dev inner loop: <RunAnalyzers Condition="'$(ContinuousIntegrationBuild)' != 'true'">false</RunAnalyzers>
  • Enable reference assemblies (<ProduceReferenceAssembly>true</ProduceReferenceAssembly>)
  • Check for broken incremental builds (see incremental-build skill)
  • Check for bin/obj clashes (see check-bin-obj-clash skill)
  • Use graph build (/graph) for multi-project solutions
  • Use --artifacts-path (.NET 8+) for centralized output layout
  • Enable Dev Drive (ReFS) on Windows dev machines and self-hosted CI

Impact Categorization

When reporting findings, categorize by impact to help prioritize fixes:

  • 🔴 HIGH IMPACT (do first): Items consuming >10% of total build time, or a single target >50% of build time
  • 🟡 MEDIUM IMPACT: Items consuming 2-10% of build time
  • 🟢 QUICK WINS: Easy changes with modest impact (e.g., property flags in Directory.Build.props)

© 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 .agents/skills/build-perf-diagnostics of microsoft/testfx.

Open the folder on GitHubat commit 44b9dcc

Used in 2 other repositories

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in microsoft/testfx, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Build Perf Diagnostics 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.

Build Perf Diagnostics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Build Perf Diagnostics this skillmicrosoft/testfx1k2 repos~2.6kAutomated safety check: PassMIT
Dotnet Debuggingnovotnyllc/dotnet-artisan233—~2.1kAutomated safety check: PassMIT
Roslynkmrpmorris/Roslynk122—~3kAutomated safety check: PassMIT
Code Reviewsbroenne/mcp-windows105—~1.6kAutomated safety check: PassMIT
Vscode Extensionmicrosoft/aspire6.3k—~2.8kAutomated safety check: PassMIT
Code Reviewcodewithmukesh/dotnet-claude-kit751—~1.7kAutomated safety check: PassMIT

Similar skills

  • Dotnet Debugging

    novotnyllc/dotnet-artisan

    Debugs Windows and Linux/macOS applications (native, .NET/CLR, mixed-mode) with WinDbg MCP (crash dumps, !analyze, !syncblk, !dlk, !runaway, !dumpheap, !gcroot, BSOD), dotnet-dump, lldb with SOS…

    233 GitHub stars~2.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Roslynk

    mrpmorris/Roslynk

    How to use the Roslynk MCP tools (mcproslynk) effectively for .NET work.

    122 GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review

    sbroenne/mcp-windows

    Review pull requests in mcp-windows for concrete bugs in MCP and CLI contracts, Windows UI automation, element identity, snapshots, bounded searches, and service lifetime.

    105 GitHub stars~1.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Vscode Extension

    microsoft/aspire

    Official

    A skill your agent uses when investigating, developing, debugging, testing, or reviewing Aspire VS Code extension behavior under extension/, including extension UI, command, debugger, RPC, DCP, MCP…

    6.3k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review

    codewithmukesh/dotnet-claude-kit

    MCP-powered multi-dimensional code review for .NET projects.

    751 GitHub stars~1.7k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Sentry Fix Stack Traces

    getsentry/sentry-for-ai

    Official

    Make Sentry stack traces readable — upload source maps for JavaScript/TypeScript, or debug files for native and mobile (dSYM, ProGuard/R8, NDK symbols, Dart obfuscation maps, .NET PDBs).

    268 GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed

More from microsoft/testfx

All 44 skills in this repo
  • Official

    Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp.

    1k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Binlog Failure Analysis

    microsoft/testfx

    Official

    Analyze MSBuild binary logs to diagnose build failures. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~730 tokens
    Auto-check passed
  • Coverage Analysis

    microsoft/testfx

    Official

    Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects.

    1k GitHub stars~7.3k tokensUpdated today
    Auto-check passed
  • Incremental Build

    microsoft/testfx

    Official

    Guide for optimizing MSBuild incremental builds. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~3.7k tokens
    Auto-check passed
  • Msbuild Modernization

    microsoft/testfx

    Official

    Guide for modernizing and migrating MSBuild project files to SDK-style format.

    1k GitHub starsUsed in 3 repos~4.3k tokens
    Auto-check passed
  • Msbuild Antipatterns

    microsoft/testfx

    Official

    Catalog of MSBuild anti-patterns with detection rules and fix recipes.

    1k GitHub stars~4.5k tokensUpdated today
    Auto-check passed

Categories

Questions about Build Perf Diagnostics

What does Build Perf Diagnostics do?

Diagnose MSBuild build performance bottlenecks using binary log analysis. Build Perf Diagnostics is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Diagnose MSBuild build performance bottlenecks using binary log analysis.

When should I use Build Perf Diagnostics?

Build Perf Diagnostics fits situations like: : identifying why builds are slow by analyzing binlog performance summaries; detecting ResolveAssemblyReference (RAR) taking 5s; roslyn analyzers consuming 30% of Csc time; single targets dominating 50% of build time.

How do I install Build Perf Diagnostics in Claude Code?

Run `npx skills add microsoft/testfx --skill build-perf-diagnostics -a claude-code`. Or copy the skill folder (.agents/skills/build-perf-diagnostics in microsoft/testfx) into .claude/skills/build-perf-diagnostics in your project. Claude Code loads it when a task matches its description.

How do I install Build Perf Diagnostics in Codex?

Run `npx skills add microsoft/testfx --skill build-perf-diagnostics -a codex`. Or copy the skill folder (.agents/skills/build-perf-diagnostics in microsoft/testfx) into .agents/skills/build-perf-diagnostics in your project. Codex loads it when a task matches its description.

Can I use Build Perf Diagnostics 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/testfx --skill build-perf-diagnostics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/build-perf-diagnostics, .gemini/skills/build-perf-diagnostics, .github/skills/build-perf-diagnostics and .opencode/skills/build-perf-diagnostics in your project.

What does Build Perf Diagnostics need to run?

Going by SKILL.md and its folder, Build Perf Diagnostics needs the command-line tools its instructions call (dotnet).

Does Build Perf Diagnostics 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 Build Perf Diagnostics 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 Build Perf Diagnostics use?

Build Perf Diagnostics is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Build Perf Diagnostics use?

About 2.6k tokens (SKILL.md is roughly 10k 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 Build Perf Diagnostics?

Skills that share tags, products or a category with Build Perf Diagnostics: Dotnet Debugging (novotnyllc/dotnet-artisan, 233 stars), Roslynk (mrpmorris/Roslynk, 122 stars), Code Review (sbroenne/mcp-windows, 105 stars) and Vscode Extension (microsoft/aspire, 6.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Build Perf Diagnostics?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 7, 2026.

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