Type Design Performance
Performance-focused .NET type design rules covering sealing, readonly structs, pure static functions, and collection choice.
- CCM score
- 65 of 100
- skills.sh installs
- 716
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers sealing classes, readonly structs, static pure functions, deferred enumeration, and immutable collection return types
- Includes code samples contrasting
DOandDON'Tpatterns, plusValueTaskversusTaskandSpan/Memoryguidance - Enforces sealed classes by default and warns that mutable structs cause defensive copies
- Designed for .NET developers reviewing API design or performance issues in new types and collection-heavy code
Install
$ npx -y skills add aaronontheweb/dotnet-skills --skill type-design-performance -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Type Design for Performance
When to Use This Skill
Use this skill when:
- Designing new types and APIs
- Reviewing code for performance issues
- Choosing between class, struct, and record
- Working with collections and enumerables
Core Principles
- Seal your types - Unless explicitly designed for inheritance
- Prefer readonly structs - For small, immutable value types
- Prefer static pure functions - Better performance and testability
- Defer enumeration - Don't materialize until you need to
- Return immutable collections - From API boundaries
Seal Classes by Default
Sealing classes enables JIT devirtualization and communicates API intent.
// DO: Seal classes not designed for inheritance
public sealed class OrderProcessor
{
public void Process(Order order) { }
}
// DO: Seal records (they're classes)
public sealed record OrderCreated(OrderId Id, CustomerId CustomerId);
// DON'T: Leave unsealed without reason
public class OrderProcessor // Can be subclassed - intentional?
{
public virtual void Process(Order order) { } // Virtual = slower
}
Details
- Repository
- github.com/aaronontheweb/dotnet-skills
- Categories
- .NET & C#, Code Review & Quality
- First seen
- Jun 3, 2026
Questions
Where does the type-design-performance skill rank in the .NET & C# category?
The type-design-performance skill ranks in the top 100 of the .NET & C# category on Claude Marketplaces. It covers sealing classes, using readonly structs, preferring static pure functions, deferring enumeration and choosing collection return types for performance.
What does the type-design-performance skill help an agent do?
It helps an agent design .NET types for performance by sealing classes, using readonly structs and preferring static pure functions. It also guides avoiding premature enumeration, choosing the right collection types and returning immutable collections from APIs.
How do I install the type-design-performance skill?
Run npx -y skills add aaronontheweb/dotnet-skills --skill type-design-performance -y in a project to install it. Once installed, the agent can apply the skill when designing new types and APIs or reviewing code for performance issues.
When should I use the type-design-performance skill?
Use it when designing new types and APIs, choosing between class, struct and record, or working with collections and enumerables. It also suits reviewing .NET code for performance issues.
More from aaronontheweb/dotnet-skills
All 34- Api Design715
- Ilspy Decompile684
- Microsoft Extensions Configuration636
- Package Management635
- Serialization622
- Testcontainers Integration Tests615
- Dotnet Slopwatch611
- Crap Analysis605
- Playwright Blazor Testing582
- Dotnet Local Tools573
- Aspire Integration Testing545
- Mjml Email Templates535
- Aspire Service Defaults520
- Snapshot Testing509
- Aspire Configuration508
- Dotnet Devcert Trust480
- Skills Index Snippets478
- Playwright Ci Caching476
- Akka Net Best Practices472
- Mailpit Integration465
- Verify Email Snapshots458
- OpenTelemetry NET Instrumentation456
- Akka Hosting Actor Patterns455
- Akka Net Testing Patterns452
Similar to Type Design Performance
More .NET & C#modern-csharp-coding-standardsSkillaaronontheweb/dotnet-skills2.4K installsModern C# coding standards for records, pattern matching, value objects, async, and Span<T>/Memory<T> with a functional style.
typescriptSkillpproenca/dot-skills1.8K installsTypeScript performance guide covering 45 rules for tsconfig, type errors, async patterns, and modules, prioritized by impact.
analyzing-dotnet-performanceSkilldotnet/skills6.7K installsScans .NET code for about 50 performance anti-patterns with tiered severity and concrete fixes.
m05-type-drivenSkillactionbook/rust-skills3.8K installsRust type-driven design patterns that make invalid states unrepresentable at compile time.
csharp-asyncSkillgithub/awesome-copilot11.2K installsReview and guidance checklist for C# async code covering naming, return types, exceptions, and pitfalls.
handbook-dotnetPluginNikiforovAll/claude-code-rules143 stars.NET development skills: dotnet run file support, selective unit testing, coverage, API inspection, analyzers and Roslyn queries