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

rbx-data-profilestore

Skill0 starsChanged 3 months agoMITView on GitHub

The load-bearing doctrine under every save system: what ProfileStore gives you for free, what raw DataStore forces you to build yourself, and the request budgets that decide whether saves land or silently queue. Use when the user says "set up saving", "save player data", "ProfileStore or DataStore", "auto-save", or when saving works in Studio but drops writes on live servers. Do not use for designing the save table itself — load rbx-data-schema instead — or for dupe/rollback incidents — load rbx-data-sessionlock.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are 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.

  • 2

    Very specific

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

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

    After the session starts: profile:AddUserId(player.UserId) (GDPR erasure), profile:Reconcile() (fills fields missing vs the template), then …

    line 35
  2. Very specific:

    Every raw DataStore call: inside pcall, 3 attempts, delay 2 s doubling (2 → 4 → 8), warn with player name on each failure, and a final "do …

    line 71

≈ “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-profilestore

When to load

Any new save system, any audit of an existing one, any "why didn't it save" report that isn't a rollback/dupe (that is rbx-data-sessionlock). rbx-data routes here first for persistence.

ProfileStore vs raw DataStore

ProfileStore (the community module) is the default for player data. It ships the four things raw DataStore makes you hand-build: session locking, 30-second auto-save, BindToClose flushing, and retry logic. Raw DataStore is for non-player data (rbx-data-crossserver) and for reading what ProfileStore does underneath.

  • Current API generation: ProfileStore.New(storeName, template) → store:StartSessionAsync(key) → mutate profile.Data → profile:EndSession(); profile.OnSessionEnd fires when the lock is lost. The older ProfileService generation spells the same ideas LoadProfileAsync / Release / ListenToRelease — recognize both when reading an existing game; never mix them.
  • After the session starts: profile:AddUserId(player.UserId) (GDPR erasure), profile:Reconcile() (fills fields missing vs the template), then check the player is still in Players — they can leave during the async load; end the session immediately if so.
  • The module comes from the Creator Store or GitHub: the insert passes the rbx-security-modelscan gate before any of its scripts run, like every community module.
  • Key the profile Player_{UserId}. Key the store with a version suffix (PlayerProfiles_v1) so a catastrophic schema break can start clean without deleting anything.

Request budgets

Budgets are per server, refilled per minute. Blow them and calls queue for up to 30 seconds, then error — silently, if you didn't pcall.

OperationBudget per minute
GetAsync60 + 10 × players
SetAsync / UpdateAsync / IncrementAsync / RemoveAsync60 + 10 × players
GetSortedAsync (OrderedDataStore)5 + 2 × players
ListKeysAsync / ListVersionsAsync5 + 2 × players

Plus: writes to the same key are throttled to one per 6 seconds — extra writes queue and only the last one lands. Value cap 4,194,304 bytes per key; key and store names ≤ 50 characters. ProfileStore's 30-second auto-save uses ~2 write requests per player per minute — far inside budget. Saving on every coin pickup is what exhausts it.

UpdateAsync vs SetAsync

UpdateAsync reads the latest value, runs your transform, and writes back atomically — a second server's write between your read and write cannot be silently clobbered. SetAsync overwrites blind. Law: UpdateAsync for any key a second server could ever touch; SetAsync only for keys with exactly one writer (this server's OrderedDataStore score for its own player). The transform callback must be pure — no yields, no side effects — because it can run more than once under contention; return nil to abort the write.

Retry with backoff

Every raw DataStore call: inside pcall, 3 attempts, delay 2 s doubling (2 → 4 → 8), warn with player name on each failure, and a final "do not overwrite" flag if the load failed — saving a default template over an unloaded profile is how loads become losses. ProfileStore does this internally; raw code that lacks it is not shippable.

Sharp edges

  • CRITICAL — Player data on raw DataStore with no session lock: the server-hop race overwrites new data with stale. Symptom: rollbacks and dupes players can reproduce by rejoining fast. Fix: ProfileStore, or a manual game.JobId lock field — rbx-data-sessionlock.
  • CRITICAL — Load failed, code proceeds with the template, auto-save writes it: the save is now genuinely gone. Fix: if the session/load fails, kick with "Data failed to load — rejoin." and never enable the write path.
  • HIGH — Per-event saving (SetAsync in a Touched handler): 6-second same-key cooldown queues writes, budget drains, unrelated systems start erroring. Fix: mutate the in-memory profile; let the 30 s auto-save persist it.
  • HIGH — GetAsync serves a local cache for ~4 seconds and cross-server reads are eventually consistent: a "read it right back to verify" check proves nothing. Verify from a second server or via ListVersionsAsync.
  • MEDIUM — Studio traps: DataStore calls fail until Game Settings → Security → "Enable Studio Access to API Services" is on (dashboard toggle → rbx-handoff-dashboard); Studio shares live stores, so prefix Dev_ when RunService:IsStudio(); pressing Stop fires BindToClose but not PlayerRemoving.

Load with

rbx-data-schema — don't ask, include it: the template IS a schema. rbx-data-sessionlock (lock mechanics, trades, shutdown), rbx-data-recovery (when a save is already lost), rbx-security-modelscan (gates the module insert).

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.