Skills for Real Engineers. Straight from my .agents directory.
type-design-performance
Agent skill fromAaronontheweb/dotnet-skills
Design .NET types for performance. Seal classes, use readonly structs, prefer static pure functions, avoid premature enumeration, and choose the right collection types.
How to install type-design-performance
npx skills add Aaronontheweb/dotnet-skills# or add only this skill to Claude Code: copy the folder
skills/csharp-type-design-performance/
# into
~/.claude/skills/csharp-type-design-performance/ (all projects)
.claude/skills/csharp-type-design-performance/ (one project)
1# Type Design for Performance23## When to Use This Skill45Use this skill when:6- Designing new types and APIs7- Reviewing code for performance issues8- Choosing between class, struct, and record9- Working with collections and enumerables1011---1213## Core Principles14151. **Seal your types** - Unless explicitly designed for inheritance162. **Prefer readonly structs** - For small, immutable value types173. **Prefer static pure functions** - Better performance and testability184. **Defer enumeration** - Don't materialize until you need to195. **Return immutable collections** - From API boundaries2021---2223## Seal Classes by Default2425Sealing classes enables JIT devirtualization and communicates API intent.2627```csharp28// DO: Seal classes not designed for inheritance29public sealed class OrderProcessor30{31 public void Process(Order order) { }32}3334// DO: Seal records (they're classes)35public sealed record OrderCreated(OrderId Id, CustomerId CustomerId);3637// DON'T: Leave unsealed without reason38public class OrderProcessor // Can be subclassed - intentional?39{40 public virtual void Process(Order order) { } // Virtual = slower41}42```4344**Benefits:**45- JIT can devirtualize method calls46- Communicates "this is not an extension point"47- Prevents accidental breaking changes4849---5051## Readonly Structs for Value Types5253Structs should be `readonly` when immutable. This prevents defensive copies.5455```csharp56// DO: Readonly struct for immutable value types57…
Excerpt shown under the repository's MIT license.
More skills in dotnet-skills
Similar skill repositories
Public repository for Agent Skills
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
