Skip to content

Cross-format serialization guide for .NET covering System.Text.Json source generators, Protobuf, and MessagePack with AOT-safe patterns.

CCM score
49 of 100
skills.sh installs
532
GitHub stars
94
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers format selection across JSON, Protobuf, and MessagePack, with a comparison of size, speed, and AOT safety
  • Includes setup and usage for System.Text.Json source generators, Protobuf .proto contracts, and MessagePack [Key] objects
  • Enforces AOT-safe choices by steering away from Newtonsoft.Json reflection and BinaryFormatter, and by requiring schema-based formats for cross-process data
  • Designed for .NET teams migrating from Newtonsoft.Json or building gRPC services and Native AOT applications

Install

$ npx -y skills add wshaddix/dotnet-skills --skill serialization -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Serialization in .NET

When to Use This Skill

Use this skill when:

  • Choosing a serialization format for APIs, messaging, or persistence
  • Migrating from Newtonsoft.Json to System.Text.Json
  • Implementing AOT-compatible serialization
  • Designing wire formats for distributed systems
  • Optimizing serialization performance

Serialization Format Comparison

FormatLibraryAOT-SafeHuman-ReadableRelative SizeRelative SpeedBest For
JSONSystem.Text.Json (source gen)YesYesLargestGoodAPIs, config, web clients
ProtobufGoogle.ProtobufYesNoSmallestFastestService-to-service, gRPC wire format
MessagePackMessagePack-CSharpYes (with AOT resolver)NoSmallFastHigh-throughput caching, real-time
JSONNewtonsoft.JsonNo (reflection)YesLargestSlowerLegacy only -- do not use for AOT

When to Choose What

Details

Repository
github.com/wshaddix/dotnet-skills
Categories
.NET & C#, Backend & APIs
First seen
Jun 3, 2026

More from wshaddix/dotnet-skills

All 13

Similar to Serialization

More .NET & C#