/lihfolk:roblox-datastore-safetyfrom lihfolk
Prevents Roblox DataStore data loss and duplication with session locks, retries, autosave, BindToClose, and migration patterns. Use when building or auditing player data persistence.
Ships in lihfolk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Player data lives in server memory during a session and is written back periodically. That is only safe if one server at a time owns each player's data, if a failed load can never save over real data, and if every grant happens at most once. Build or review against those three guarantees.
VAULT: LihFolk Vault V2, the knowledge base in the plugin root's LihFolk Vault V2/ folder: <base directory>/../../LihFolk Vault V2, where the base directory is the one Claude Code shows when this skill loads. Resolve it to an absolute path before any Read, Grep or command (the vault is in the plugin, not the user's project). Start with VAULT/INDEX.md to find notes fast.Find every writer. Grep for GetDataStore, SetAsync, UpdateAsync, IncrementAsync, RemoveAsync. Player data must be written by exactly one module. Every other writer (admin tools, support tools, trading, gifts) is a finding unless it goes through that module and respects the lock.
Wrap every call. Every data store call runs in pcall with bounded retries, exponential backoff with jitter, and no retry on permanent errors. Never retry throttled calls in a tight loop. Check GetRequestBudgetForRequestType before non-urgent bursts.
Use UpdateAsync with a lease. Not GetAsync then SetAsync. Inside the same UpdateAsync transform:
ExpiresAt from os.time()),keyInfo:GetUserIds() and keyInfo:GetMetadata() through, or they vanish.Separate the three load outcomes. Load returns ready, locked or failed. "New player" means the read succeeded and returned nil. A thrown error is never a new player. A profile that did not reach ready has no save path at all: kick with a clear message (the reference project's choice) or play on defaults that never save (the docs sample). Never save defaults over real data.
Autosave correctly.
lease / 3.Save on leave and shutdown.
PlayerRemoving: save immediately with lease release; do not yield before the save.BindToClose: save all players in parallel with a deadline, and wait for in-flight leave-saves. The server waits at most 30 seconds (Roblox docs). In Studio, do not hold BindToClose open (every Stop then takes about 25 seconds); Studio stop is not a test of shutdown saving.Version the schema.
Schema integer on every profile and CURRENT_SCHEMA in code.DEFAULT table).Vector3 and CFrame cannot be saved); keep arrays dense; store enums by name; never store NaN or infinity.#HttpService:JSONEncode(profile) and cap growing lists.Make purchases idempotent.
ProcessReceipt assignment in the codebase.NotProcessedYet if it cannot be saved.PurchaseId together, in the same key, in the same write.PurchaseGranted only after a confirmed save.UpdateAsync.Protect live data from Studio. Either keep Studio API access off on the live experience, or route Studio to a test key or test store. Fuzzers and migration tests never touch live keys.
Plan recovery. Take a snapshot before any release that touches data code. Know that per-key version history exists but versions older than 30 days after being superseded are gone. Never restore with SetAsync while the player is online; restores respect leases. Verify saves with an uncached read (UseCache = false).
SetAsync for player profiles.UpdateAsync transform.PurchaseId in the same write.UpdateAsync; saves fenced.ready / locked / failed are distinct; failed never saves.BindToClose saves in parallel with a deadline.PurchaseGranted only after a confirmed save.04 Data and Persistence/DataStore Fundamentals.md04 Data and Persistence/Session Locking and Profile Libraries.md04 Data and Persistence/Saving Correctly - Autosave and BindToClose.md04 Data and Persistence/Data Schema Design and Migrations.md04 Data and Persistence/Schema Migrations - Worked Case Studies.md04 Data and Persistence/Purchase Data and Receipts.md04 Data and Persistence/Data Loss Prevention and Recovery.md04 Data and Persistence/Trading Systems Without Duplication.md23 Debugging Deep Dives/Debugging DataStore Problems.md29 Luau Cookbook/Cookbook - Data and Saving.md24 Worked Builds/Saved Inventory End to End.mdDisputed (see Open Questions - Whole Vault.md): the experience write budget base (300 vs 250 plus a per-CCU amount on two docs pages), and the old "one write per key every 6 seconds" rule versus the documented per-key throughput limits. Design with headroom under both.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/council-methodLihFolk Council: blind multi-agent verdict for high-stakes Roblox decisions, ship-readiness, "be objective", "second opinion". Not for routine coding./lihfolkLihFolk Roblox knowledge router (1,300+ notes; "check the vault"). Use before non-trivial Roblox work: Luau, Studio, remotes, data, UI, building, VFX, animation, design, money, performance, security, publishing./lihfolk-assetsFind and import assets from the local LihFolk Asset Pack (models, materials, skies, animations, VFX). Use for "LihFolk asset", "what assets do we have".npx claudepluginhub lihfolk-cy/v2-vault --plugin lihfolk2 plugins ship this exact skill · first indexed Oct 30, 2026
Other plugins' skills for the same job