postgres-game-schema

postgres-game-schema is a skill for Claude Code from fcsouza/agent-skills. It costs 81 tokens per session (2,147 once invoked), scanned A, original, MIT.

A skill for designing PostgreSQL database structures and player data models for games, including inventories and leaderboards, with Drizzle ORM, a tool for accessing databases from code.

In plain words
What is it for?
Use it when designing game schemas, player records, inventory systems, leaderboards, or Drizzle-based PostgreSQL code.
Why use it?
It gives focused guidance for representing game data consistently in the database.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the game-dev plugin — 39 skills shipped together

Good fit Use it when designing game schemas, player records, inventory systems, leaderboards, or Drizzle-based PostgreSQL code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fcsouza/agent-skills/postgres-game-schema
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fcsouza/agent-skills --skill postgres-game-schema
Clone the repo
git clone --depth 1 https://github.com/fcsouza/agent-skills

Made for: Claude Code.

Or install game-dev, the plugin that ships this one along with the rest of its 39 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres-game-schema

README.md
[![agentmods](https://agentmods.dev/badge/skills/fcsouza/agent-skills/postgres-game-schema/github.svg)](https://agentmods.dev/skills/fcsouza/agent-skills/postgres-game-schema)
Your own site
<a href="https://agentmods.dev/skills/fcsouza/agent-skills/postgres-game-schema"><img src="https://agentmods.dev/badge/skills/fcsouza/agent-skills/postgres-game-schema/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres-game-schema

Your own site · 80×15
<a href="https://agentmods.dev/skills/fcsouza/agent-skills/postgres-game-schema"><img src="https://agentmods.dev/badge/skills/fcsouza/agent-skills/postgres-game-schema.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,147 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02147
Opus 5.5 $0.00032 $0.00859
Sonnet 5.5 $0.00016 $0.00429
Haiku 4.5 $0.00008 $0.00215

Measured 19d ago against content hash 2c184c3ce9de, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-game-schema scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (boilerplate/schema.ts, templates/entity-template.ts, templates/query-patterns.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/postgres-game-schema/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Game Schema

The schema is the value of this skill. Install, driver setup, config and migrations come from the vendor: use the neon-drizzle skill if it is installed, otherwise https://orm.drizzle.team/docs/get-started.

Target the stable Drizzle line, drizzle-orm 0.45.x. The Drizzle docs install lines use drizzle-orm@rc and drizzle-kit@rc; pin the 0.45 versions instead (see "Drizzle 1.0" below).

Conventions

Every table and query in a game project follows these. Other skills (stripe-game-payments, gameplay-analytics, game-economy-design) build on them.

  • Naming. Tables are plural snake_case (item_definitions). Columns are snake_case in SQL and camelCase in TypeScript: playerId: text("player_id"). Indexes are named <table>_<columns>_idx.
  • IDs. text("id").primaryKey().$defaultFn(() => crypto.randomUUID()). Player-facing identifiers are never auto-increment integers; sequential ids let anyone enumerate players and items.
  • Timestamps. timestamp(...).notNull().defaultNow(). Entity and catalog tables (players, item_definitions, guilds) carry createdAt and updatedAt; append-only and state rows carry the time that matters (events.createdAt, sessions.startedAt, guild_members.joinedAt). Give a new mutable table both columns. Set updatedAt in every update; a column default fills it only on insert.
  • Soft delete. players has deletedAt: timestamp("deleted_at"); a deleted player keeps their rows for history. Every read that returns players, including joins, filters isNull(players.deletedAt). Add deletedAt to a new entity when its history matters (templates/entity-template.ts pattern 1).
  • JSONB. Typed columns for anything you filter, sort, join or sum. jsonb(...).$type<...>().default({}) for per-genre extras: stats, baseStats, properties, metadata. Never add genre columns (swordDamage) to core tables. Use jsonb, not json: PostgreSQL stores jsonb decomposed, processes it faster and can index it.
  • Enums. pgEnum for fixed sets that code switches on (rarity, guild role, leaderboard period). Plain text for open sets designers extend (event type, currency type).
  • Foreign keys. onDelete: "cascade" from player-owned rows to players. Analytics rows (events) use onDelete: "set null" so history survives. Catalog references (itemDefinitionId) have no cascade.
  • Indexes. Index the owner key (playerId) of every player-owned table. Add a composite index for each common filter, leading with the owner: events (playerId, type), leaderboards (category, period, score). Put a unique index on every natural key an upsert targets (currencies (playerId, currencyType)): PostgreSQL infers the ON CONFLICT target from a unique index.
  • Money and currency. Integer amounts, never read-modify-write. Credit with the atomic amount = amount + n upsert (addCurrency in templates/query-patterns.ts). Debit with spendCurrency: one UPDATE ... WHERE amount >= cost, and it reports failure when no row was updated, so two parallel spends cannot overdraw. The currencies table also has CHECK (amount >= 0), so a debit that bypasses the guard fails instead of going negative.
  • Idempotency. processed_events holds one row per external event or job already applied (a Stripe event id, a reward job key), with id as the primary key, a kind and created_at. Insert it in the same transaction as the change it guards; a primary-key conflict means the change already happened. stripe-game-payments and bullmq-game-queues use this table.

Read the full file on GitHub · 80 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 19d ago Changed · -49 lines · +29 tokens per session 2c184c3ce9de
  2. 3mo ago First seen · 129 lines · 52 tokens per session scan A 124fd2a7e1c0

Subscribe to this mod's changes

postgres-game-schema is a skill published in the GitHub repository fcsouza/agent-skills (29 stars, last pushed today), licensed MIT. It adds 81 tokens to every session and 2,147 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

postgres-game-schema compared with skills from other repositories

postgres-game-schema next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
postgres-game-schemafcsouza/agent-skillsSkill29todayMITA81Claude Code
postgresql-table-designHermeticOrmus/claude-code-game-developmentSkill842mo agoMITA31Claude Code
sql-optimization-patternsHermeticOrmus/claude-code-game-developmentSkill842mo agoMITA44Claude Code
alloydb-basicsgoogle/skillsSkill26ktodayApache-2.0A72Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43kyesterdayMITA37Claude Code
db-repairgarrytan/gbrainSkill34ktodayMITA96Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill496yesterdayApache-2.0A63Claude Code, Codex