dotnet-serialization

Evaluate serialization formats for .NET projects across APIs, messaging, and persistence.

3|Updated Jan 24, 2024
One-click install
npx skills add https://github.com/akoken/dotfiles --skill dotnet-serialization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-serialization
Source: https://github.com/akoken/dotfiles/tree/main/config/.copilot/skills/dotnet-serialization
Command: npx skills add https://github.com/akoken/dotfiles --skill dotnet-serialization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides .NET developers in selecting the most appropriate serialization format for APIs, messaging, and persistence, balancing performance, versioning, and compatibility.

Core Features & Use Cases

  • Schema-based vs reflection-based choices with concrete recommendations (Protobuf, MessagePack, System.Text.Json with source generation).
  • Decision framework for API design, microservices, and data persistence.
  • Real-world example: migrating from Newtonsoft.Json to System.Text.Json with AOT considerations in a microservice.

Quick Start

Run a quick evaluation against a sample data contract and compare Protobuf, MessagePack, and System.Text.Json with source generation to validate performance and compatibility.

Frequently Asked Questions about dotnet-serialization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to choose a .NET serialization format for my project?

The best way to choose a .NET serialization format is to evaluate performance, versioning, and cross-platform needs. This decision framework maps your technical criteria to schema-based formats like Protobuf and MessagePack, or System.Text.Json with source generation for specific use cases.

How do I migrate from Newtonsoft.Json to System.Text.Json for AOT compatibility?

To migrate from Newtonsoft.Json to System.Text.Json for AOT compatibility, evaluate source generators to eliminate reflection. This Skill provides a decision framework to apply this migration across APIs and microservices while validating compatibility and performance.

When do I need schema-based serialization like Protobuf or MessagePack instead of JSON?

You need schema-based serialization like Protobuf or MessagePack when strict versioning and maximum performance outweigh human readability. This Skill identifies the technical criteria for selecting these formats over System.Text.Json for your messaging and persistence layers.

Does System.Text.Json work with Native AOT in .NET microservices?

System.Text.Json works with Native AOT in .NET microservices by using source generators instead of reflection. This Skill evaluates source generation to ensure AOT compatibility and provides concrete recommendations for applying it in real-world service architectures.

How do I compare Protobuf, MessagePack, and System.Text.Json for my API design?

Compare Protobuf, MessagePack, and System.Text.Json by validating performance and compatibility against a sample data contract. This Skill's quick start evaluation applies technical criteria to identify the optimal format for API design, balancing reflection-free AOT support with versioning requirements.