Serialization Safety (Grade A) logo

Serialization Safety (Grade A)Security-tested data-ai skill for Claude AI. Grade A. Unity serialization rules — FormerlySerializedAs on renames, SerializeField vs public, SerializeReference for polymorphism, Unity null check (== n

(0)
Daniel NikulshynReviewed by Daniel Nikulshyn·Updated July 2026

Overview

Serialization Safety is a security-tested data-AI skill for Claude AI, focusing on Unity serialization rules to prevent silent data loss. It ensures that all configured values in scenes, prefabs, and ScriptableObjects are properly serialized and deserialized, avoiding resets to default values without warning. The skill emphasizes the importance of following specific rules to maintain data integrity. Rule 1 highlights the need to use the FormerlySerializedAs attribute when renaming fields to prevent breaking the name-value mapping. Rule 2 explains the difference between Unity's null check and C#'s null check, emphasizing the importance of using Unity's null check to detect destroyed objects. The skill also outlines what Unity serializes, including public fields, SerializeField private and protected fields, and certain types such as int, float, and string. It notes that properties, static fields, readonly fields, and const fields are not serialized. Additionally, it discusses the use of SerializeReference for polymorphism and NonSerialized for cached data. By following these rules, developers can ensure that their data is properly serialized and deserialized, preventing silent data loss and maintaining the integrity of their applications. The skill is particularly important for Unity developers, as it helps them to avoid common pitfalls and ensure that their applications function as intended. Overall, Serialization Safety is a critical skill for any Unity developer, as it provides a foundation for building robust and reliable applications. By understanding and following the rules outlined in this skill, developers can write more effective and efficient code, and avoid common errors that can lead to data loss and other issues. The skill is designed to work with Claude AI, providing a security-tested data-AI solution for Unity developers. By leveraging this skill, developers can improve the overall quality and reliability of their applications, and ensure that their data is properly serialized and deserialized.

Key features

  • FormerlySerializedAs attribute for renaming fields
  • Unity null check (== null) for destroyed objects
  • SerializeField vs public fields
  • SerializeReference for polymorphism
  • NonSerialized for cached data
  • ISerializationCallbackReceiver for dictionaries

Pricing

Model
Free
Category
Skills
Rating
No reviews yet

Use cases

Renaming fields in Unity scripts

Use FormerlySerializedAs attribute to prevent data loss when renaming fields in Unity scripts.

Handling null checks in Unity

Use Unity null check (== null) to detect destroyed objects and prevent crashes or undefined behavior.

Pros & Cons

Pros

  • Prevents silent data loss
  • Ensures correct serialization of fields
  • Provides guidelines for handling polymorphism and null checks

Cons

  • Requires manual implementation of serialization rules
  • May require additional attributes and code changes

Reviews

Sign in to leave a review.

No reviews yet. Be the first!

Q&A

What Unity types are serialized automatically, and how do I exclude cached data?

Unity serializes public fields, private fields marked with SerializeField, and fields marked with SerializeReference for polymorphism. To exclude non‑essential or cached data, annotate the field with the NonSerialized attribute.

Asked by Larisa Ionescu · May 6, 2026

How can I serialize polymorphic fields without losing data?

Apply the SerializeReference attribute to the field; this tells Unity to store type information and reference data, allowing proper serialization and deserialization of polymorphic objects.

Asked by Miriam Cohen · May 2, 2026

What Unity-specific null check should I use to detect destroyed objects?

Use Unity's overloaded == null check (e.g., if (myObject == null)) rather than C#'s reference check, because Unity overrides the operator to return true for objects that have been destroyed but still hold a managed reference.

Asked by Anya Sokolova · Mar 31, 2026

How does Serialization Safety prevent silent data loss when renaming fields in Unity?

It requires adding the FormerlySerializedAs attribute to the renamed field, preserving the original name‑value mapping so existing scene, prefab, or ScriptableObject data is correctly deserialized instead of reverting to defaults.

Asked by Zara Ahmed · Mar 22, 2026

Ask a question

Skills alternatives

Manage Headers (Grade A) logo
Manage Headers (Grade A)Skills

Security-tested development skill for Claude AI. Grade A. Inspects and configures the security headers a Power Pages site sends to browsers — Content Security Policy, frame and clickjacking protection

(0)
Free
Using Git Worktrees (Grade A) logo
Using Git Worktrees (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktre

(0)
Free
Ga4 Bigquery Schema (Grade A) logo
Ga4 Bigquery Schema (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. GA4 BigQuery Export Schema Reference — complete field reference, nested structures, query patterns, and performance tips

(0)
Free
Meta Capi (Grade A) logo
Meta Capi (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Meta Conversions API (CAPI) Setup Reference — architecture, event types, customer information hashing, deduplication, implementation examples, AEM

(0)
Free
Callees (Grade A) logo
Callees (Grade A)Skills

Security-tested development skill for Claude AI. Grade A. Lista o que uma funcao/metodo chama (call graph direto)

(0)
Free
Test Module Name (Grade A) logo
Test Module Name (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Name Haskell test modules after the module under test with a Spec suffix in the same namespace. Use when writing or reviewing Haskell test module

(0)
Free
Board Of Directors (Grade A) logo
Board Of Directors (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Simulate a 5-member expert board deliberation for major decisions. Use when evaluating plans, architecture choices, feature designs, or any decisi

(0)
Free
Advpl Mvc Avancado (Grade A) logo
Advpl Mvc Avancado (Grade A)Skills

Security-tested development skill for Claude AI. Grade A. MVC avançado via PE (Pontos de Entrada) — adicionar grids customizadas em telas MVC padrão (CNTA300/MATA070/MATA440/MATA460/FINA040 via *STRU)

(0)
Free