agentleFS
blushneybusiness-glitchblushneybusiness-glitch/roblox-omniskills/skills/rbx-data-schema/SKILL.md

rbx-data-schema

Skill0 starsChanged 3 months agoMITView on GitHub

Save schemas that survive years of updates — versioned plain-table templates with a forward-only migration chain, so no player's save ever breaks on a new build. Use when the user says "design the save data", "add a field to saves", "rename a stat", "migrate old data", or when veteran players error on join while fresh accounts work fine. Do not use for the load/save/locking machinery — load rbx-data-profilestore — or for restoring data already lost — load rbx-data-recovery instead.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read: the game's projects.md block — current schema version, field map, and any manual steps pending: around data.

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

rbx-data-schema

Laws

  1. JSON-safe or it doesn't exist. Numbers, strings, booleans, tables with all-string or all-sequential-integer keys. No Instances, Vector3/CFrame/Color3, mixed-key tables, cycles, or NaN — serialize to ids ("IronSword"), component arrays ({x, y, z}), and hex strings.
  2. version from day one. Integer, starts at 1, lives at the schema root. A schema without it cannot be migrated, only guessed at.
  3. Migrations are a forward-only chain. migrations[n] transforms version n → n+1; a while loop walks the save from its stored version to CURRENT_VERSION on every load. A shipped migration is frozen forever — new changes get a new entry, never an edit to an old one.
  4. Reconcile handles additions; migrations handle everything else. A brand-new field with a default belongs in the template (ProfileStore Reconcile() deep-fills it). Renames, moves, splits, and type changes need a migration — Reconcile cannot know Money became Cash.
  5. Never persist what you can recompute. Leaderstats, stat totals, equipped-bonus caches: derive on load. Every derived field saved is a future desync bug.
  6. No nil sentinels. DataStore drops nil keys on serialize; "unset" becomes "indistinguishable from never existed". Use 0, "", false.

Passes

  1. Inventory the state. List every value the game must remember across sessions; strike everything derivable. Sort survivors into groups: Currency, Progression, Inventory, Settings, Statistics. Read the game's block in projects.md first — extend the shipped schema, never fork it.
  2. Shape the template. One nested table per group. Non-stackable inventory items are { id = "IronSword", uuid = "...", meta = {} } — the uuid is what trading and rollback logs key on. Stackables are { id = "Potion", count = 3 }.
  3. Write the chain. One ModuleScript, DataMigrations, CONFIG-top with CURRENT_VERSION:

    migrations[1] = function(data) -- v1 → v2: Money split into Cash + Gems
        data.Cash, data.Gems, data.Money = data.Money or 0, 0, nil
        return data
    end

    The runner: while v < CURRENT_VERSION do data = migrations[v](data); v += 1 end, then stamp data.version = CURRENT_VERSION. If the stored version is newer than the code (old server after an update), warn and do not touch the data.

  4. Wire the order. Load → migrate → Reconcile() → use. Migrate-on-load only; no bulk rewrite jobs over the whole store — untouched saves migrate whenever their player returns.
  5. Prove it. In execute_luau, fabricate a v1 save, run the chain, assert the final shape field-by-field; then a fresh template through the same path (must no-op). Read get_console_output — a silent migration failure is a slow-motion wipe.

Performance budget

Chain runs once per player load: a 4-version walk over a 100-field save ≤ 5 ms. Save tables ≤ 100 KB typical, 4 MB hard cap — past ~500 KB, split inventory to its own key before it becomes an incident. One migration module per game, not per system.

Load with

rbx-data-profilestore — don't ask, include it: the template plugs into its session flow. rbx-data-sessionlock when trading or teleports touch these fields; rbx-data-recovery the moment a bad migration has already shipped; rbx-luau-types for typing the template.

AI-tells

  • ☐ No version field, or version stored as a string ("1.2.3")
  • ☐ Rename done by editing the template only — Reconcile silently zeroes every veteran
  • ☐ Migration chain with gaps (v2 → v4) or an edited already-shipped migration
  • ☐ Instances, Vector3s, or CFrames assigned straight into the save table
  • ☐ Derived values persisted (leaderstats mirrors, stat totals)
  • ☐ Bulk store-wide rewrite job instead of migrate-on-load
  • ☐ nil used to mean "unset"
  • ☐ Inventory items without uuids in a game that has, or will have, trading

Memory

Read: the game's projects.md block — current schema version, field map, and any manual steps pending: around data. Write: the shipped template shape and new CURRENT_VERSION into that block the moment a migration ships, one line per migration ("v3→v4: Wins → Statistics.Wins, 2026-08-23"); the reusable DataMigrations runner into module-library.md.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.