# .NET Performance Scan

Scans .NET code for about fifty performance anti-patterns with severity tiers.

- Repository: https://github.com/dotnet/skills (5787 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add dotnet/skills --skill analyzing-dotnet-performance -g -a claude-code -y`
Codex: `npx skills add dotnet/skills --skill analyzing-dotnet-performance -g -a codex -y`
Cursor: `npx skills add dotnet/skills --skill analyzing-dotnet-performance -g -a cursor -y`
Gemini CLI: `npx skills add dotnet/skills --skill analyzing-dotnet-performance -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add dotnet/skills`

## Description

Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# .NET Performance Patterns

Scan C#/.NET code for performance anti-patterns and produce prioritized findings with concrete fixes. Patterns sourced from the official .NET performance blog series, distilled to customer-actionable guidance.

## When to Use

- Reviewing C#/.NET code for performance optimization opportunities
- Auditing hot paths for allocation-heavy or inefficient patterns
- Systematic scan of a codebase for known anti-patterns before release
- Second-opinion analysis after manual performance review

## When Not to Use

- **Algorithmic complexity analysis**, this skill targets API usage patterns, not algorithm design
- **Code not on a hot path** with no performance requirements, avoid premature optimization

## Inputs

| Input | Required | Description |
|-------|----------|-------------|
| Source code | Yes | C# files, code blocks, or repository paths to scan |
| Hot-path context | Recommended | Which code paths are performance-critical |
| Target framework | Recommended | .NET version (some patterns require .NET 8+) |
| Scan depth | Optional | `critical-only`, `standard` (default), or `comprehensive` |

## Workflow

### Step 1: Load Critical Reference

Resolve bundled paths from the directory that contains this `SKILL.md`, not from the user's workspace. Load this reference file first:

- `references/critical-patterns.md`

If a direct read fails, list this skill's `references/` directory once and retry only when the listing shows the expected file. Do not use workspace file or text search to locate the skill installation.

### Step 2: Detect Code Signals and Select Topic Recipes

Scan the code for signals that indicate which pattern categories to check. Use the `## Detection` section from the critical reference when available and the inline recipes in Step 3 for initial signal detection.

After detecting signals, load only the topic-specific references selected by scan depth:

The rest: https://github.com/dotnet/skills/blob/HEAD/plugins/dotnet-diag/skills/analyzing-dotnet-performance/SKILL.md
