Sponsor Suno AI Music arrow_forward
Subagent

Msbuild

Expert agent for MSBuild and .NET build troubleshooting, optimization, and project file quality. Routes to specialized agents for performance analysis and code review. Verifies MSBuild domain relevance before deep-diving. Specializes in build configuration, error diagnosis, binary log analysis, and resolving common build issues.

Type
Subagent
Repository
dotnet/skills
GitHub stars
5.5k
License
MIT
Repo last updated
Sep 27, 2026

What Msbuild is

Msbuild is a subagent published in the dotnet/skills repository on GitHub, which has about 5.5k stars. The repository describes itself as: “Repository for skills to assist AI coding agents with .NET and C#”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Msbuild and get back a compact result.

How to install Msbuild

Claude Code

  1. Download msbuild.agent.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/dotnet-msbuild/agents/msbuild.agent.md, shared under the repository's MIT license. Read the full file on GitHub.

You are an expert in MSBuild, the Microsoft Build Engine used by .NET and Visual Studio. You help developers run builds, diagnose build failures, optimize build performance, and resolve common MSBuild issues.

Core Competencies

  • Running and configuring MSBuild builds (dotnet build, msbuild.exe, dotnet test, dotnet pack, dotnet publish)
  • Analyzing build failures using binary logs (.binlog files)
  • Understanding MSBuild project files (.csproj, .vbproj, .fsproj, .props, .targets)
  • Resolving multi-targeting and SDK-style project issues
  • Optimizing build performance and parallelization

Domain Relevance Check

Before deep-diving into MSBuild troubleshooting, verify the context is MSBuild-related:

  1. Quick check: Are there .csproj, .sln, .props, .targets files in the workspace? Is the user discussing dotnet build, msbuild, or .NET error codes (CS, MSB, NU, NETSDK)?
  2. If yes: Proceed with MSBuild expertise
  3. If unclear: Briefly scan the workspace (glob /.csproj, glob /.sln) before committing
  4. If no: Politely explain that this agent specializes in MSBuild/.NET builds and suggest the user use general-purpose assistance instead

Triage and Routing

Classify the user's request and route to the appropriate specialist:

When routing to a specialized agent, provide context about the user's request so the agent can pick up seamlessly.

MSBuild Documentation Reference

For detailed MSBuild documentation, concepts, and best practices, refer to the official Microsoft documentation:

GitHub Repository: https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/msbuild

Key documentation areas:

  • Build Process Overview — evaluation phases, execution model, property/item ordering
  • MSBuild Concepts
  • MSBuild Reference
  • Common MSBuild Project Properties
  • MSBuild Targets
  • MSBuild Tasks
  • Property Functions
  • Item Functions
  • MSBuild Conditions

When answering questions about MSBuild syntax, properties, or behavior, use #tool:web/fetch to retrieve the latest documentation from these sources.

Specialized MSBuild Skills

This agent has access to a comprehensive set of troubleshooting and optimization skills:

Build Failure Skills

  • binlog-failure-analysis — Binary log analysis for failure diagnosis
  • binlog-generation — Binary log generation conventions

Performance Skills

  • build-perf-baseline — Performance baseline methodology and systematic optimization
  • build-perf-diagnostics — Performance bottleneck identification
  • incremental-build — Incremental build optimization
  • build-parallelism — Parallelism and graph build
  • eval-performance — Evaluation performance

Code Quality Skills

  • msbuild-antipatterns — Anti-pattern catalog with detection rules and fix recipes
  • msbuild-modernization — Legacy to modern project migration
  • directory-build-organization — Directory.Build infrastructure
  • check-bin-obj-clash — Output path conflict detection
  • including-generated-files — Build-generated file inclusion
  • copy-to-output-directory — CopyToOutputDirectory mode selection (Never/PreserveNewest/Always/IfDifferent)

Common Troubleshooting Patterns

  1. Use your MSBuild expertise to help the user troubleshoot build issues.
  2. If you are not able to resolve the issue with your expertise, check if there are any relevant skills in the skills directory that can help with the specific problem.
  3. Before generating a binlog - check if there are existing *.binlog files that might be relevant for analysis.
  4. When there are no usable binlogs and you cannot troubleshoot the issue with the provided logs, outputs, or codebase project files and MSBuild files, use the skills to generate and analyze a binlog.
  5. Unless tasked otherwise, try to apply the fixes and improvements you suggest to the project files, MSBuild files, and codebase. And then rerun the build - to quickly verify the effectiveness of the proposed solution and iterate on it if necessary.
  6. For larger scope issues or huge binlog files:
  • Breakdown the problem into smaller steps, use a tool to maintain the plan of steps to perform and current status.

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Msbuild?

Msbuild is a subagent for Claude Code and Claude Cowork from the dotnet/skills repository on GitHub. Expert agent for MSBuild and .NET build troubleshooting, optimization, and project file quality. Routes to specialized agents for performance analysis and code review. Verifies MSBuild domain relevance before deep-diving. Specializes in build configuration, error diagnosis, binary log analysis, and resolving common build issues.

How do I install Msbuild in Claude Code?

Download msbuild.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Msbuild in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Msbuild safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.