world-of-claudecraft: Agent for Claude Code

.claude/agents/migration-safety.md

migration-safety is an agent for Claude Code from levy-street/world-of-claudecraft. It costs 106 tokens per session (3,158 once invoked), scanned A, original, MIT.

A read-only checker for database schema and saved-state changes in World of ClaudeCraft, a project using PostgreSQL. It understands that this project defines its database structure in application code and reapplies it at startup rather than using separate migration files.

In plain words
What is it for?
Use it to review changes to the PostgreSQL schema and persisted JSONB state, verify that dependent definitions run in the right order, and identify migration or compatibility risks without modifying files.
Why use it?
It helps catch unsafe changes to tables, relationships, startup ordering, and JSONB data before they can damage existing saved data. It also follows the project's advisory-lock and schema-application conventions.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; positional $N argument.

This is levy-street/world-of-claudecraft's own configuration. It tells Claude Code how to work on world-of-claudecraft itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything world-of-claudecraft configures →

About the project

World of ClaudeCraft is a browser-based classic-style multiplayer online game with a persistent shared world that can also run locally or be controlled through a Python reinforcement-learning interface. Players can quest and raid in the online world, while developers can host it themselves and train AI agents to play. The catalogue skills, agents, instructions, hooks, and setting support workflows for interacting with and developing the game.

levy-street/world-of-claudecraft · 2,251 stars · on GitHub · worldofclaudecraft.com

Reuse

Borrowing it

Nothing to install: this file belongs to levy-street/world-of-claudecraft. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/levy-street/world-of-claudecraft/main/.claude/agents/migration-safety.md
Clone the repo
git clone --depth 1 https://github.com/levy-street/world-of-claudecraft

Made for: Claude Code.

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 migration-safety

README.md
[![agentmods](https://agentmods.dev/badge/agents/levy-street/world-of-claudecraft/migration-safety/github.svg)](https://agentmods.dev/agents/levy-street/world-of-claudecraft/migration-safety)
Your own site
<a href="https://agentmods.dev/agents/levy-street/world-of-claudecraft/migration-safety"><img src="https://agentmods.dev/badge/agents/levy-street/world-of-claudecraft/migration-safety/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 migration-safety

Your own site · 80×15
<a href="https://agentmods.dev/agents/levy-street/world-of-claudecraft/migration-safety"><img src="https://agentmods.dev/badge/agents/levy-street/world-of-claudecraft/migration-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,158 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.00106 $0.03158
Opus 5 $0.00053 $0.01579
Sonnet 5 $0.00021 $0.00632
Haiku 4.5 $0.00011 $0.00316

Measured 13d ago against content hash cdffc1cae0ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

migration-safety 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 13d ago.

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.

.claude/agents/migration-safety.md · 245 lines

How it starts

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

You are a database schema and persistence auditor for World of ClaudeCraft (PostgreSQL, accessed via pg). Your job is to review schema and persisted-state changes for safety, correctness, and compliance with project conventions. You are strictly read-only: you analyze code but never modify files.

How this project's schema works (read this first)

  • There is no migrations directory. The schema is inline SQL applied in order by ensureSchema() (server/db.ts) as separate client.query(...) calls, NOT one concatenated batch: SCHEMA (server/db.ts) first, then the domain *_SCHEMA / *_SQL modules it imports. Do NOT work from a memorized module list (it drifts as domains are added): read the ensureSchema() body for the authoritative set and order. The order is load-bearing both within and across the schemas: a new ALTER/CREATE must come after the table it depends on, and the domain schemas run after SCHEMA so they may ALTER or FK-reference a table that SCHEMA creates (for example social_db.ts alters characters).
  • The DDL is re-applied on every boot by ensureSchema(), inside a transaction held under a Postgres advisory lock (pg_advisory_xact_lock(...)) so concurrent realm boots serialize. It therefore MUST be safe to run repeatedly.
  • Character state (level, gear, bags, quests, position, money, talents, arena, lifetimeXp, and so on) is stored as JSONB in characters.state. Most "schema" changes are really changes to the shape of that JSONB blob, handled by the serialize/deserialize code in server/db.ts / server/game.ts, not by DDL.
  • characters.state is not the only persisted JSONB shape. world_state.data is a key/value store of JSONB rows: the World Market (via saveMarketState / loadMarketState / MarketSave in server/db.ts) and the mail system (via saveMailState / loadMailState / MailSave, saved in one transaction with the market); accounts.cosmetics is JSONB too. The same back-compat rules (default new fields on load, keep reading old keys, write on every save) apply to all of them.
  • Saves happen on a ~30s cadence (accumulated inside the sim loop via AUTOSAVE_SECONDS, not a standalone interval), and also on player leave and on SIGINT/SIGTERM shutdown.
  • The CREATE INDEX CONCURRENTLY builds are NOT part of ensureSchema(): the exported runConcurrentIndexMigrations() (server/db.ts) runs AFTER the realm is listening (fired from server/main.ts), on its own dedicated client with SET statement_timeout = 0, holding the session-level form of the schema advisory lock, and iterates the CONCURRENT_INDEX_MIGRATIONS registry in server/concurrent_indexes.ts (each entry drops an INVALID carcass from an interrupted build before rebuilding). Failure is loud but NOT fatal: the next boot retries. The deliberate consequence of running after listen: a realm can briefly serve a reader whose index does not exist yet, so a reader that depends on one of these indexes must carry its own query bound (the GUILD_BANK_LOG_TIMEOUT_MS pattern) instead of assuming the index. Ordering and lock discipline are pinned by tests/schema_wiring.test.ts.

Read the full file on GitHub · 245 lines

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. 13d ago First seen · 245 lines · 106 tokens per session scan A cdffc1cae0ec

Subscribe to this mod's changes

migration-safety is an agent published in the GitHub repository levy-street/world-of-claudecraft (2,251 stars, last pushed yesterday), licensed MIT. It adds 106 tokens to every session and 3,158 once invoked, about $0.0005 per session on Opus 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

Other agents, from other repositories

database-reviewer

Use when writing SQL queries, creating migrations, or troubleshooting database performance in Supabase/PostgreSQL projects. Reviews indexes, RLS policies, schema types, N+1 patterns. Read-only reviewer with EXPLAIN ANALYZE capability.

sangrokjung/claude-forge · 52 tokens

pgvector-schema-reviewer

PostgreSQL + pgvector migration reviewer. Extends postgresql-database-reviewer with vector-specific checks. Use PROACTIVELY when any migration file touches a vector column, vector index, or embedding pipeline. Checks operator-index alignment, dimension vs model match, null guards, embeddingmodel metadata column, and…

kumaran-is/claude-code-onboarding · 0 tokens

database-reviewer

PostgreSQL database specialist — query optimization, schema design, index strategy, migration safety, anti-patterns.

RaNDoM6913/claude-code-superkit · 25 tokens

database-reviewer

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.

loulanyue/awesome-claude-notes · 48 tokens

database-reviewer

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.

Nmor/the-claude-council · 48 tokens

db-reviewer

Reviews Postgres/Supabase schema, migrations, queries, and RLS for safety and performance. Use when DB code changes, before applying a migration, or inside /migration-loop and /db-tune.

m-binimran/dev-pack · 46 tokens