Serialization
This skill converts data structures into strings for storage or transmission, ensuring data integrity and enabling persistence across sessions.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add serialization npx -- -y @trustedskills/serialization
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"serialization": {
"command": "npx",
"args": [
"-y",
"@trustedskills/serialization"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides serialization capabilities within a .NET environment, converting data structures into strings for storage or transmission. It facilitates data persistence across sessions and enables the design of wire formats for distributed systems. The skill highlights considerations between schema-based (e.g., Protobuf, MessagePack) and reflection-based (e.g., Newtonsoft.Json) serialization approaches, recommending schema-based methods when crossing process boundaries.
When to use it
This skill is useful in the following scenarios:
- Choosing a serialization format for APIs, messaging, or data persistence.
- Migrating from Newtonsoft.Json to System.Text.Json.
- Implementing serialization compatible with Ahead-of-Time (AOT) compilation.
- Designing communication formats for distributed systems.
- Optimizing the performance of serialization processes.
Key capabilities
- Supports both schema-based and reflection-based serialization approaches.
- Provides recommendations for various use cases, including REST APIs, gRPC, actor messaging, event sourcing, caching, configuration, and logging.
- Highlights formats to avoid (BinaryFormatter, Newtonsoft.Json default, DataContractSerializer, XML) due to security vulnerabilities, versioning issues, or performance concerns.
- Offers guidance on using System.Text.Json with source generators for AOT compatibility and improved performance.
Example prompts
Here are some example prompts that could be used with an AI agent equipped with this skill:
- "What's the best serialization format for a gRPC service?"
- "How do I migrate from Newtonsoft.Json to System.Text.Json in my .NET application?"
- "Explain the difference between schema-based and reflection-based serialization."
Tips & gotchas
- For optimal performance and AOT compatibility, prioritize using System.Text.Json with source generators when working with JSON data.
- Be aware that reflection-based serialization can be slower than schema-based approaches due to runtime reflection overhead.
- Avoid using BinaryFormatter due to known security vulnerabilities.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.