# serialization

Guides your assistant on selecting and configuring .NET serialization formats, focusing on Native AOT, source generators, Protobuf, and MessagePack.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 527 installs · ★ 86
- Author: wshaddix
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/serialization/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/wshaddix-serialization

## What it does

This skill equips your coding agent with decision guidelines and code structures for modern .NET serialization. It guides the choice between text and binary formats based on payload size, network throughput, and client requirements.

The skill covers `JsonSerializerContext` declarations, polymorphic type mapping, ASP.NET Core integration, and Google.Protobuf schemas. It also includes explicit field-numbering conventions to prevent contract breakages across distributed updates.

Newtonsoft.Json relies on runtime reflection and breaks under Native AOT. This skill keeps codebases strictly aligned with compile-time source generation.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill serialization -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/serialization/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/serialization/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill serialization -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/serialization/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill serialization -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/serialization/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wshaddix/dotnet-skills serialization
```

2. **Manually: put the files in place**
- File: `.github/skills/serialization/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill serialization -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/serialization
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/serialization/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill serialization -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/serialization/SKILL.md

## When to use it
- configure System.Text.Json source generators for Native AOT
- design Protobuf messages with safe field versioning rules
- register custom JsonSerializerContext into ASP.NET Core APIs
- replace reflection-based serializers with compile-time code generation

## Example prompts
- Set up a source-generated JsonSerializerContext for Order records with polymorphic types
- Draft a proto3 schema for order items while reserving deleted field numbers
- Configure ASP.NET Core Minimal APIs to use source generators instead of reflection

## Similar
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [claude-api](https://affpapa.org/en/nevibecode/skills/claude-api.md) — skill · 74198 installs
- [lark-im](https://affpapa.org/en/nevibecode/skills/lark-im.md) — skill · 472900 installs
- [lark-event](https://affpapa.org/en/nevibecode/skills/lark-event.md) — skill · 466800 installs
- [caveman-discover](https://affpapa.org/en/nevibecode/skills/caveman-discover.md) — skill · 104400 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs

## Other versions with the same name
- [serialization · aaronontheweb](https://affpapa.org/en/nevibecode/skills/serialization.md) — 569 installs

From the same set: [wshaddix/dotnet-skills](https://affpapa.org/en/nevibecode/by/wshaddix/dotnet-skills.md) — 13 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
