What problem does it solve?
MSBuild evaluates and builds thousands of projects in enterprise solutions, and inefficient code in hot paths like Expander.cs or Evaluator.cs causes GC pressure and slow builds. This Skill provides concrete rules for writing allocation-aware, high-performance C# code in the MSBuild engine.
Core Features & Use Cases
- Allocation Awareness: Rules for avoiding LINQ, string allocations, and unnecessary enumerations on hot paths, with Span<T> and stackalloc guidance.
- String Comparison Standards: Correct comparer selection for case-insensitive MSBuild names, file paths on Windows vs Linux, and dictionary keys.
- Collection Type Selection: Decision tables for choosing arrays, ImmutableArray<T>, Dictionary, or linear scans based on access patterns.
- Use Case: When reviewing a PR that modifies Evaluator.cs, apply the anti-pattern table to catch double dictionary lookups, uncompiled Regex in loops, or string.Format in filtered log messages before merge.
Quick Start
Ask the AI to review my changes to Expander.cs for performance regressions and allocation issues on hot paths.