Serialization
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
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
.protocontracts, 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 -yInstalls 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
| Format | Library | AOT-Safe | Human-Readable | Relative Size | Relative Speed | Best For |
|---|---|---|---|---|---|---|
| JSON | System.Text.Json (source gen) | Yes | Yes | Largest | Good | APIs, config, web clients |
| Protobuf | Google.Protobuf | Yes | No | Smallest | Fastest | Service-to-service, gRPC wire format |
| MessagePack | MessagePack-CSharp | Yes (with AOT resolver) | No | Small | Fast | High-throughput caching, real-time |
| JSON | Newtonsoft.Json | No (reflection) | Yes | Largest | Slower | Legacy 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- Microsoft Extensions Configuration529
- Package Management519
- Dotnet Testing Strategy625
- Dotnet Xunit625
- Modern Csharp Coding Standards596
- Csharp Wolverinefx576
- Testcontainers573
- Microsoft Extensions Dependency Injection557
- Logging Observability551
- Validation Patterns546
- Project Structure542
- Dotnet Domain Modeling539
Similar to Serialization
More .NET & C#csharp-wolverinefxSkillwshaddix/dotnet-skills576 installsPure-function .NET messaging and HTTP toolkit that covers handlers, outbox, event sourcing, and transports.
dotnet-aot-compatSkilldotnet/skills5K installsMake .NET projects compatible with Native AOT and trimming by systematically resolving IL trim/AOT analyzer warnings.
dump-collectSkilldotnet/skills4.9K installsConfigures and collects crash dumps for modern .NET apps, excluding analysis and .NET Framework processes.
azure-sdk-dotnetPluginmicrosoft/skills3.2K starsAzure SDK patterns and best practices for .NET developers covering AI, resource management, identity, messaging, and Key Vault libraries.
package-managementSkillwshaddix/dotnet-skills519 installsNuGet package management guide covering Central Package Management, dependency resolution, and CLI-driven version updates for .NET solutions.
AvrotizeMCP serverclemensv133 starsSchema conversion between dozens of formats, plus code generation, via four conversion tools.