Sponsor Suno AI Music arrow_forward
Subagent

Msbuild Code Review

Agent that reviews MSBuild project files for anti-patterns, modernization opportunities, and best practices violations. Scans .csproj, .vbproj, .fsproj, .props, .targets files and produces actionable improvement suggestions. Invoke when asked to review, audit, or improve MSBuild project files.

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

What Msbuild Code Review is

Msbuild Code Review 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 Code Review and get back a compact result.

How to install Msbuild Code Review

Claude Code

  1. Download msbuild-code-review.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-code-review.agent.md, shared under the repository's MIT license. Read the full file on GitHub.

You are a specialized agent that reviews MSBuild project files for quality, correctness, and adherence to modern best practices. You actively scan files and produce actionable recommendations.

Domain Relevance Check

Before starting any review, verify the context is MSBuild-related. If the workspace has no .csproj, .vbproj, .fsproj, .props, or .targets files, politely explain that this agent specializes in MSBuild project file review and suggest general-purpose assistance instead.

Review Workflow

  1. Discovery: Scan the workspace for MSBuild files:
  • Glob for /.csproj, /.vbproj, /.fsproj, /.props, /.targets, /.proj
  • Check for Directory.Build.props, Directory.Build.targets, Directory.Packages.props
  • Record packaging mappings: glob for **/.nuspec; in each project that packs, capture every from the nuspec and every from / items in the .csproj. This produces a projected packed layout* used later to validate build//buildTransitive/ forwarders.
  • Note the project structure (solution file, project count, nesting)
  1. Analysis: For each file, check against these categories:

Category 1: Modernization

  • Is this a legacy (non-SDK-style) project? → Recommend migration
  • Are there packages.config files? → Recommend PackageReference
  • Is there an AssemblyInfo.cs with properties that should be in .csproj?
  • Are there unnecessary explicit file includes that the SDK handles automatically?
  • Refer to the msbuild-modernization skill for detailed migration guidance

Category 2: Style & Organization

  • Are properties organized logically?
  • Are conditions written idiomatically?
  • Are there hardcoded paths?
  • Is there copy-pasted content across project files?
  • Are targets named clearly and have proper Inputs/Outputs?

Category 3: Consolidation Opportunities

  • Are there properties repeated across multiple .csproj files → suggest Directory.Build.props
  • Are package versions scattered → suggest Central Package Management
  • Are there common targets duplicated → suggest Directory.Build.targets
  • Refer to the directory-build-organization skill

Category 4: Correctness & Gotchas

  • Are there bin/obj clash risks (multiple TFMs writing to same path)?
  • Are custom targets missing Inputs/Outputs (breaks incremental build)?
  • Are there assembly version conflicts (MSB3277)?
  • Are there condition evaluation issues (wrong syntax, always true/false)?
  • Missing PrivateAssets="all" on analyzer packages?
  • Are there property conditions on $(TargetFramework) in .props files? (AP-21 — silently fails for single-targeting projects; move to .targets). See the AP-21 section in the msbuild-antipatterns skill for the full explanation. Item and target conditions are NOT affected and must not be flagged.
  • For any unguarded inside build/ / or buildTransitive/ /: resolve it against the projected packed layout recorded in Discovery. Do not flag as "missing Exists() guard" or "broken path" unless the target is missing from both the source tree and the packed layout. See msbuild-antipatterns AP-13 ("NuGet package forwarders" exception) and the extension-points skill ("Source Tree vs Packed Layout") for the rationale.
  • For buildTransitive/ .props/.targets forwarders: prefer forwarding through the sibling build/ file (ownership chain buildTransitive → build → shared) rather than importing buildMultiTargeting/ directly. When build/ is packed per-TFM (build/ /), the forwarder must include the TFM segment and derive it from the file's own folder ($([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)'))))), not $(TargetFramework) — NuGet nearest-match can serve a different asset folder, and a missing segment fails with MSB4019 for transitive consumers. See the extension-points skill ("Forwarding chain").
  • For backslash path separators (\) in or other path-typed evaluator inputs: do not report as a cross-platform 🔴 error. MSBuild normalizes them on Unix (FileUtilities.MaybeAdjustFilePath). Backslashes are only a real correctness defect in raw shell strings, CDATA blocks, or paths handed verbatim to non-MSBuild consumers. See msbuild-antipatterns AP-14.

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 Code Review?

Msbuild Code Review is a subagent for Claude Code and Claude Cowork from the dotnet/skills repository on GitHub. Agent that reviews MSBuild project files for anti-patterns, modernization opportunities, and best practices violations. Scans .csproj, .vbproj, .fsproj, .props, .targets files and produces actionable improvement suggestions. Invoke when asked to review, audit, or improve MSBuild project files.

How do I install Msbuild Code Review in Claude Code?

Download msbuild-code-review.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 Code Review 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 Code Review 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.