data-modeling
Skill3 starsChanged 3 months agoMITView on GitHub
Use when modeling game data — ScriptableObject patterns, runtime state management, serialization strategies, config vs instance data, and save/load architecture.
17 other projects use a version of this.
Adopted by
Most recently taken up by
- nisarth/claude-skills-storetheir own version, first seen Nov 8, 2026
- getditto/agent-skillstheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- timmywheels/skillstheir own version, first seen Nov 1, 2026
- vindreshsingh/engineering-skillstheir own version, first seen Oct 20, 2026
- MartinOlivero/saas-buildertheir own version, first seen Oct 13, 2026
Used with
Projects with it also use containerization, incident-response and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
mmondoraSkillcontainerization
Docker best practices for cloud-native applications. Multi-stage builds, distroless images, security scanning, non-root users, Cloud Run orchestration. Use when writing Dockerfiles, configuring container builds, or deploying to Cloud Run/GKE.
Also in 3 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 7 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 6 projects that use this
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 5 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 8 projects that use this
AnthropicSkilldocumentation
Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- microsoft/rayfin★ 646same name
- microsoft/awesome-rayfin★ 114same name
- nimadorostkar/Claude-Skills-collection★ 37same name
- jdm4pku/RE-Skills★ 26same name
- khuynh22/agent-dev-team★ 9same name
- getditto/agent-skills★ 4same name
- MartinOlivero/saas-builder★ 4same name
- bjornjee/skills★ 2same name
- mmondora/claude-skills★ 1same name
- nisarth/claude-skills-store★ 1same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- animation-workflowSkill
- component-designSkill
- prefab-architectureSkill
- prefab-workflowSkill
- scene-architectureSkill
- scene-authoringSkill
- tool-referenceSkill
- unity-addressablesSkill
- unity-ai-behaviorSkill
- unity-architectSkill
- unity-audioSkill
- unity-ecsSkill
- unity-inputSkill
- unity-networkingSkill
- unity-performanceSkill
- unity-reviewerSkill
- unity-shaders-hdrpSkill
- unity-shaders-urpSkill
- unity-testingSkill
- unity-uiSkill
- unity-vfxSkill
- unity-workflowSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 3 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Do NOT activate for pure component-structure questions (single MB vs.
- Very specific: line 26
Call search_by_name("*.asset") to discover existing ScriptableObject assets and understand naming conventions
- Very specific: line 27
Call graph_query(edgeKind: "references", edgeTargetNamePattern: "ScriptableObject", edgeTargetKind: "Class") to find SO-derived types …
- Very specific: line 28
Call get_project_summary() to understand project scale — asset count and assembly structure inform whether a lightweight pattern or a …
- Very specific: line 31
Call recall_memory("data modeling serialization save") to find documented data and save conventions
- Very specific: line 32
Check validation status — if a recalled decision shows warning, surface the conflict to the user before proceeding
- Distinctive: line 35
If the project already has a save system → extend it rather than introduce a parallel one
- Distinctive: line 36
If the project has established SO naming conventions → follow them in new assets
- Very specific: line 37
After agreeing on a new pattern, call propose_memory_update to record the decision
- Very specific: line 129
Versioning rule: always include a version integer in the save root.
- Very specific: line 143
Never expose fields with public just to see them in the Inspector — always use [SerializeField] private.
- Distinctive: line 165
Not available while the Editor is in Play Mode — refused uniformly like every other mutating Hades tool, since a change made during Play …
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Modeling
Guidance for structuring game data in Unity: choosing the right ScriptableObject pattern, separating config from runtime state, and designing a save system that survives versioning.
When to Apply
Activate when the conversation involves:
- Deciding whether to use a ScriptableObject, a plain C# class, or MonoBehaviour fields to hold data
- Designing item stats, enemy configs, ability definitions, or other designer-facing data
- Building or extending a save/load system
- Choosing how to serialize data (JSON, binary, PlayerPrefs, SQLite)
- Managing a runtime registry of active entities (current enemies, items in world, etc.)
- Inspector annotation and editor-time data authoring conventions
Do NOT activate for pure component-structure questions (single MB vs. split) — those go to hades:component-design. Do NOT activate for prefab organization questions — those go to hades:prefab-architecture.
Project Context Check
Before making recommendations:
- Check existing assets and types in the graph:
- Call
search_by_name("*.asset")to discover existing ScriptableObject assets and understand naming conventions - Call
graph_query(edgeKind: "references", edgeTargetNamePattern: "ScriptableObject", edgeTargetKind: "Class")to find SO-derived types already defined in the project - Call
get_project_summary()to understand project scale — asset count and assembly structure inform whether a lightweight pattern or a formal save-system layer is appropriate
- Call
- Check team decisions in memory:
- Call
recall_memory("data modeling serialization save")to find documented data and save conventions - Check validation status — if a recalled decision shows
warning, surface the conflict to the user before proceeding
- Call
- Adapt recommendations based on findings:
- If the project already has a save system → extend it rather than introduce a parallel one
- If the project has established SO naming conventions → follow them in new assets
- After agreeing on a new pattern, call
propose_memory_updateto record the decision - To actually create and configure new asset instances (not just the C# class), use
scriptable_object_apply— see "Creating and Configuring Instances" below
Decision Framework
ScriptableObject Pattern Selection
What role does this data play?
│
├── Static config authored by designers, read at runtime, never written back
│ └── Data Container SO
│ - One asset = one config variant (ItemConfig, EnemyConfig, AbilityData)
│ - [CreateAssetMenu] lets designers create instances without code
│ - MonoBehaviour holds a [SerializeField] reference to the SO
│ - Never write to SO fields at runtime — it mutates the asset file on disk
│
├── Live registry of active runtime instances (enemies alive, items in world)
│ └── Runtime Set SO
│ - SO holds a List<T> that components register/unregister themselves into
│ - Register in OnEnable, unregister in OnDisable — handles scene loads cleanly
│ - Any system that needs "all current enemies" holds a reference to the SO
│ - Reset the list in OnDisable on the SO itself (or in a scene init call)
│
├── Broadcast communication between decoupled systems
│ └── Event Channel SO (see hades:component-design for full implementation)
│ - Raised by sender; any listener SO receives the call
│ - Payload variants: GameEvent (void), GameEventInt, GameEventFloat, etc.
│
└── Named constants that need inspector drop-down ergonomics (like an enum, but extensible)
└── SO Enum / Enum-Like Collection
- Each value is a separate SO asset (DamageType_Fire.asset, DamageType_Ice.asset)
- Reference by SO asset rather than int — serializes by GUID, not by order
- New values added without recompile or enum renumbering
- Best for: damage types, status effects, faction tags, audio categoriesRuntime State Management
Where should mutable instance state live?
│
├── State belongs to one specific GameObject instance
│ └── MonoBehaviour fields
│ - [SerializeField] private float _currentHealth;
│ - Owned and modified by the same component that uses it
│ - Appropriate for the vast majority of per-instance state
│
├── State is complex, involves business logic, or needs to be tested without Unity
│ └── Dedicated plain C# class (POCO / record)
│ - MonoBehaviour creates and owns the class instance
│ - All domain logic lives in the plain class; MB only wires it to Unity lifecycle
│ - Fully testable with EditMode tests (no scene required)
│ - Also the correct shape for save-data records
│
└── State is shared across all instances of a system and has a single owner
└── Static field or singleton service (use sparingly)
- Appropriate for game-wide singletons (AudioManager, SceneLoader)
- Prefer an SO-based service (SO acts as a service locator) over a static class
- Never use static for state that needs to reset between playtests in EditorSave System Architecture
Structure first:
SaveData (plain C# [Serializable] class)
├── version: int — increment when the schema changes
├── playerData: PlayerSaveData
├── worldData: WorldSaveData
└── settingsData: SettingsSaveDataStorage decision:
How large and complex is the save data?
│
├── Small config-style (volume, key bindings, resolution)
│ └── PlayerPrefs — acceptable; never use for gameplay state
│
├── Moderate structured data (player stats, inventory, world flags)
│ └── JSON via JsonUtility or Newtonsoft.Json
│ - Application.persistentDataPath + filename
│ - Human-readable; easy to debug
│ - Add a version field from day one
│
└── Large relational data (quest logs, procedural worlds, analytics)
└── SQLite via Hades bundled Mono.Data.Sqlite DLLs
- Structured queries; handles large datasets efficiently
- See project SQLite dependency notes in memoryVersioning rule: always include a version integer in the save root. On load, compare SaveData.version to the current expected version and migrate or warn if they differ.
Inspector Exposure Rules
| Attribute | Use For |
[SerializeField] | Any field that should appear in the Inspector but remain private in code |
[Header("Section Name")] | Group related fields visually with a bold label |
[Tooltip("...")] | Document what a field controls; write for a designer, not a programmer |
[Range(min, max)] | Numeric fields with known valid bounds (damage, speed, volume) |
[TextArea(minLines, maxLines)] | Multi-line string fields (dialogue, descriptions) |
[HideInInspector] | Public field that should not be editable in the Inspector |
[Space] | Add vertical breathing room between groups |
Never expose fields with public just to see them in the Inspector — always use [SerializeField] private.
Creating and Configuring Instances
Once a ScriptableObject class exists in code (defined here, or already present in the project per the Project Context Check above), create and configure actual .asset instances with scriptable_object_apply — never by hand-writing .asset YAML or generating a .meta file yourself; both are forbidden, and Unity's serialization dialect (backing-field names, managedReferences, array syntax) is not something to guess at.
create { path, type }makes a new asset of a ScriptableObject-derived type.typeis a short (ItemConfig) or namespace-qualified (Game.Items.ItemConfig) class name — ambiguous matches refuse rather than guess.setProperties { path, values }sets fields on an existing asset —{ fieldName: value }, the same value grammarscene_apply.setPropertiesuses, including object references by asset path.Both ops batch in one call with one Undo group, and later ops can reference assets
created earlier in the same batch:{ "operations": [ { "op": "create", "path": "Assets/Data/Fire.asset", "type": "DamageType" }, { "op": "create", "path": "Assets/Data/Sword.asset", "type": "ItemConfig" }, { "op": "setProperties", "path": "Assets/Data/Sword.asset", "values": { "displayName": "Iron Sword", "damage": 12, "damageType": "Assets/Data/Fire.asset" } } ] }One call, three assets' worth of wiring — the natural way to seed "ten enemy configs from this template."
- Gotcha:
createrefuses a path that already exists. Ifcreatesucceeds but a latersetPropertiesin the same batch fails, re-running the identical batch fails atcreate— drop thecreateop and re-runsetPropertiesalone, orasset_manage(delete)the half-made asset and start over. asset_managecovers the two operations that follow creation:delete(removes the asset; recoverable from the OS trash on macOS/Windows) andduplicate(works for any asset type, not just the type-specific duplicates onmaterial_apply/scene_manage).- Not available while the Editor is in Play Mode — refused uniformly like every other mutating Hades tool, since a change made during Play may or may not persist depending on what changed.
Code Examples
ScriptableObject Config Pattern (Full Implementation)
Designer-authored item stats. One asset per item type, no code changes to add new items.
using UnityEngine;
/// <summary>
/// Static configuration for an item type. Create one asset per item.
/// Assets > Items > Item Config
/// </summary>
[CreateAssetMenu(menuName = "Items/Item Config", fileName = "New ItemConfig")]
public class ItemConfig : ScriptableObject
{
[Header("Identity")]
[SerializeField] private string _displayName;
[SerializeField] [TextArea(2, 4)] private string _description;
[SerializeField] private Sprite _icon;
[Header("Stats")]
[SerializeField] [Range(1, 999)] private int _maxStackSize = 1;
[SerializeField] [Range(0f, 9999f)] private float _baseValue = 10f;
[SerializeField] private ItemRarity _rarity = ItemRarity.Common;
[Header("Behaviour")]
[SerializeField] private bool _isConsumable;
[SerializeField] private float _consumeHealthRestore;
// Read-only public surface
public string DisplayName => _displayName;
public string Description => _description;
public Sprite Icon => _icon;
public int MaxStackSize => _maxStackSize;
public float BaseValue => _baseValue;
public ItemRarity Rarity => _rarity;
public bool IsConsumable => _isConsumable;
public float ConsumeHealthRestore => _consumeHealthRestore;
}
public enum ItemRarity { Common, Uncommon, Rare, Epic, Legendary }SO Runtime Set (Full Implementation)
Tracks all currently active enemies without any scene coupling.
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// A runtime registry of active MonoBehaviours of type T.
/// Components register themselves in OnEnable and unregister in OnDisable,
/// so the list stays accurate across scene loads and pooled objects.
/// Create one asset per tracked type: Assets > Runtime Sets > Enemy Runtime Set
/// </summary>
[CreateAssetMenu(menuName = "Runtime Sets/Enemy Runtime Set", fileName = "EnemyRuntimeSet")]
public class EnemyRuntimeSet : ScriptableObject
{
[System.NonSerialized]
private readonly List<EnemyController> _items = new();
public IReadOnlyList<EnemyController> Items => _items;
public int Count => _items.Count;
public void Register(EnemyController enemy)
{
if (!_items.Contains(enemy))
_items.Add(enemy);
}
public void Unregister(EnemyController enemy) =>
_items.Remove(enemy);
/// <summary>Called from a scene init script to clear stale entries between playtests.</summary>
public void Reset() => _items.Clear();
}
/// <summary>
/// Add to every enemy prefab. Wires registration automatically.
/// </summary>
public class EnemyController : MonoBehaviour
{
[SerializeField] private EnemyRuntimeSet _runtimeSet;
private void OnEnable() => _runtimeSet.Register(this);
private void OnDisable() => _runtimeSet.Unregister(this);
}
/// <summary>
/// Example consumer: a wave manager that checks how many enemies remain.
/// No scene coupling — it just holds a reference to the SO asset.
/// </summary>
public class WaveManager : MonoBehaviour
{
[SerializeField] private EnemyRuntimeSet _enemies;
private void Update()
{
if (_enemies.Count == 0)
StartNextWave();
}
private void StartNextWave() { /* ... */ }
}SO Event Channel (Full Implementation)
Typed event channel for broadcasting a float payload — extend for any type.
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Event channel that carries a float payload (e.g. health changed, score delta).
/// Create via Assets > Events > Float Event Channel.
/// </summary>
[CreateAssetMenu(menuName = "Events/Float Event Channel", fileName = "NewFloatEventChannel")]
public class FloatEventChannel : ScriptableObject
{
private readonly List<FloatEventListener> _listeners = new();
public void Raise(float value)
{
for (int i = _listeners.Count - 1; i >= 0; i--)
_listeners[i].OnEventRaised(value);
}
public void Register(FloatEventListener listener)
{
if (!_listeners.Contains(listener))
_listeners.Add(listener);
}
public void Unregister(FloatEventListener listener) =>
_listeners.Remove(listener);
}
/// <summary>
/// Drop on any GameObject to respond to a FloatEventChannel asset.
/// </summary>
public class FloatEventListener : MonoBehaviour
{
[SerializeField] private FloatEventChannel _channel;
[SerializeField] private UnityEngine.Events.UnityEvent<float> _response;
private void OnEnable() => _channel.Register(this);
private void OnDisable() => _channel.Unregister(this);
public void OnEventRaised(float value) => _response?.Invoke(value);
}Simple JSON Save System (Full Implementation)
Minimal save/load with versioning using JsonUtility and Application.persistentDataPath.
using System.IO;
using UnityEngine;
/// <summary>
/// Root save container. Increment CurrentVersion whenever the schema changes.
/// </summary>
[System.Serializable]
public class SaveData
{
public const int CurrentVersion = 1;
public int version = CurrentVersion;
public PlayerSaveData player = new();
public SettingsSaveData settings = new();
}
[System.Serializable]
public class PlayerSaveData
{
public float health = 100f;
public int coins = 0;
public float posX, posY, posZ;
}
[System.Serializable]
public class SettingsSaveData
{
public float masterVolume = 1f;
public bool subtitlesOn = false;
}
/// <summary>
/// Static save manager. Call from any MonoBehaviour — no scene dependency.
/// </summary>
public static class SaveSystem
{
private static readonly string SavePath =
Path.Combine(Application.persistentDataPath, "save.json");
public static void Save(SaveData data)
{
data.version = SaveData.CurrentVersion;
string json = JsonUtility.ToJson(data, prettyPrint: true);
File.WriteAllText(SavePath, json);
Debug.Log($"[SaveSystem] Saved to {SavePath}");
}
public static SaveData Load()
{
if (!File.Exists(SavePath))
{
Debug.Log("[SaveSystem] No save file found — returning defaults.");
return new SaveData();
}
string json = File.ReadAllText(SavePath);
SaveData data = JsonUtility.FromJson<SaveData>(json);
if (data.version != SaveData.CurrentVersion)
{
Debug.LogWarning($"[SaveSystem] Save version mismatch: " +
$"file={data.version}, current={SaveData.CurrentVersion}. " +
$"Migration may be required.");
data = Migrate(data);
}
return data;
}
public static void Delete()
{
if (File.Exists(SavePath))
File.Delete(SavePath);
}
/// <summary>Apply schema migrations here as versions increment.</summary>
private static SaveData Migrate(SaveData old)
{
// Example: v0 → v1 added subtitlesOn; keep other fields, default new ones.
if (old.version < 1)
{
old.settings.subtitlesOn = false;
old.version = 1;
}
return old;
}
}Usage:
// Save
var data = new SaveData();
data.player.health = playerHealth.Current;
data.player.coins = inventory.Coins;
SaveSystem.Save(data);
// Load
SaveData loaded = SaveSystem.Load();
playerHealth.SetHealth(loaded.player.health);SO Enum Pattern (Full Implementation)
Named constants that are extensible without recompile and safe against enum reordering.
using UnityEngine;
/// <summary>
/// A single damage type value. Create one asset per type:
/// DamageType_Physical.asset, DamageType_Fire.asset, etc.
/// Assets > Combat > Damage Type
/// References serialize by GUID, not by int — adding new types never breaks existing assets.
/// </summary>
[CreateAssetMenu(menuName = "Combat/Damage Type", fileName = "New DamageType")]
public class DamageType : ScriptableObject
{
[SerializeField] [Tooltip("Display name shown in debug logs and UI.")]
private string _displayName;
[SerializeField] [Range(0f, 2f)]
[Tooltip("Multiplier applied to all damage of this type (1 = normal, 0.5 = resistant, 2 = vulnerable).")]
private float _defaultMultiplier = 1f;
public string DisplayName => _displayName;
public float DefaultMultiplier => _defaultMultiplier;
}
/// <summary>
/// Example usage — a hit event carries a DamageType SO reference.
/// </summary>
[System.Serializable]
public struct HitInfo
{
public float Amount;
public DamageType Type; // drag asset in inspector; no enum cast needed
public GameObject Source;
}
/// <summary>
/// An armor component that has per-type resistance overrides.
/// </summary>
public class Armor : MonoBehaviour
{
[System.Serializable]
private struct Resistance
{
public DamageType Type;
[Range(0f, 2f)] public float Multiplier;
}
[SerializeField] private Resistance[] _resistances;
public float GetMultiplier(DamageType type)
{
foreach (Resistance r in _resistances)
{
if (r.Type == type)
return r.Multiplier;
}
return type != null ? type.DefaultMultiplier : 1f;
}
}Anti-Examples
Storing Mutable State on a SO Asset
// BAD — writing to a SO field at runtime mutates the asset on disk in Editor
// and causes stale state between playtests.
[CreateAssetMenu]
public class PlayerStatsSO : ScriptableObject
{
public float currentHealth = 100f; // written at runtime — DO NOT DO THIS
}
// GOOD — SO holds only config; runtime state lives in a MonoBehaviour
[CreateAssetMenu]
public class PlayerStatsSO : ScriptableObject
{
[SerializeField] private float _maxHealth = 100f;
public float MaxHealth => _maxHealth; // read-only
}
public class PlayerHealth : MonoBehaviour
{
[SerializeField] private PlayerStatsSO _config;
private float _currentHealth; // mutable state lives here, not on the SO
private void Awake() => _currentHealth = _config.MaxHealth;
}Using PlayerPrefs for Complex Save Data
// BAD — PlayerPrefs is a flat key-value store. Complex structures require
// manual key management, no versioning, and no migration path.
PlayerPrefs.SetFloat("health", health);
PlayerPrefs.SetInt("coins", coins);
PlayerPrefs.SetFloat("posX", pos.x);
// ... 50 more keys, all without version control
// GOOD — use a SaveData class + JSON to get structure and versioning.
var data = new SaveData();
data.player.health = health;
data.player.coins = coins;
SaveSystem.Save(data);Serializing MonoBehaviours Directly
// BAD — MonoBehaviours contain Unity-internal state that JsonUtility cannot
// serialize correctly. The output is incomplete and may throw on load.
string json = JsonUtility.ToJson(this); // 'this' is a MonoBehaviour — unreliable
// GOOD — extract the data you need into a plain [Serializable] class first.
[System.Serializable]
public class PlayerSaveData { public float health; public int coins; }
// In MonoBehaviour:
public PlayerSaveData ExtractSaveData() =>
new PlayerSaveData { health = _health.Current, coins = _inventory.Coins };Cross-References
- Related skills:
hades:component-design,hades:unity-architect,hades:prefab-architecture - Hades MCP tools:
search_by_name,graph_query,get_project_summary,recall_memory,propose_memory_update,scriptable_object_apply,asset_manage - Unity docs: ScriptableObject, JsonUtility, Application.persistentDataPath, CreateAssetMenu
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

