# Datastore Review

> Audit all DataStore usage in the project for correctness, security, and best practices. Checks for session locking, pcall usage, schema versioning, budget management, and common anti-patterns.

- **Type:** Skill
- **Install:** `agentstack add skill-codephobiia-claude-roblox-game-studio-datastore-review`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [CodePhobiia](https://agentstack.voostack.com/s/codephobiia)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [CodePhobiia](https://github.com/CodePhobiia)
- **Source:** https://github.com/CodePhobiia/claude-roblox-game-studio/tree/master/.claude/skills/datastore-review

## Install

```sh
agentstack add skill-codephobiia-claude-roblox-game-studio-datastore-review
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# /datastore-review — DataStore Audit

## Delegate to: datastore-architect

## Steps:
1. Search for all DataStore usage: `grep -rn "DataStoreService" src/`
2. Search for all MemoryStore usage: `grep -rn "MemoryStoreService" src/`
3. Search for all BindToClose handlers: `grep -rn "BindToClose" src/`
4. Search for PlayerAdded / PlayerRemoving: `grep -rn "PlayerAdded\|PlayerRemoving" src/`

## Check each DataStore operation for:

### Critical (must fix):
- [ ] All GetAsync/SetAsync/UpdateAsync wrapped in pcall
- [ ] Session locking implemented (acquire lock on join, release on leave)
- [ ] BindToClose handler saves all player data with timeout
- [ ] Player data keyed by UserId (not Name)
- [ ] Schema includes version number
- [ ] No synchronous DataStore calls in PlayerAdded without yielding protection

### Important (should fix):
- [ ] Auto-save interval implemented (recommended: every 5 minutes)
- [ ] Save debouncing with dirty flag
- [ ] Retry logic for failed operations (with exponential backoff)
- [ ] Data migration functions for schema version upgrades
- [ ] OrderedDataStore used appropriately (leaderboards, rankings)
- [ ] Budget monitoring (not exceeding request limits)

### Nice to have:
- [ ] Data backup system (periodic full save to backup key)
- [ ] Analytics on save failures
- [ ] Admin tools for data inspection/correction

## Output:
Generate a report with findings organized by severity:

```markdown
# DataStore Review

## Scope
Files analyzed: X
DataStore references found: Y
MemoryStore references found: Z

## Critical Findings
1. **[filepath:line]**: [issue]
   - Impact: [data loss / duplication / exploit]
   - Fix: [specific code change]

## Important Findings
...

## Anti-Patterns Detected
...

## Recommended Architecture
[If no DataStore code exists yet, suggest the recommended architecture pattern:]
- ServerStorage/PlayerData/PlayerDataService.lua (main API)
- ServerStorage/PlayerData/SessionLock.lua (lock mechanism)
- ServerStorage/PlayerData/Schema.lua (current schema + migrations)
- ServerStorage/PlayerData/Serializer.lua (compress/decompress)
```

If no DataStore code exists yet, suggest the recommended architecture pattern and offer to scaffold it via `datastore-architect`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [CodePhobiia](https://github.com/CodePhobiia)
- **Source:** [CodePhobiia/claude-roblox-game-studio](https://github.com/CodePhobiia/claude-roblox-game-studio)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-codephobiia-claude-roblox-game-studio-datastore-review
- Seller: https://agentstack.voostack.com/s/codephobiia
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
