migrate-schema

migrate-schema is a command for coding agents from authzed/authzed-marketplace. It costs 17 tokens per session (10,667 once invoked), scanned A, original, Apache-2.0.

A command that converts an existing authorisation model into a SpiceDB schema, a file describing permissions and relationships. It also produces a map connecting old identifiers to new ones.

In plain words
What is it for?
Use it to convert an authorisation model, create a .zed schema, emit the identifier map, and start schema validation after the migration analysis stage.
Why use it?
It provides the schema-conversion stage of a migration while keeping decisions in a machine-readable migration record for later stages and review.

Command

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.

agentmods
npx agentmods add commands/authzed/authzed-marketplace/migrate-schema
Clone the repo
git clone --depth 1 https://github.com/authzed/authzed-marketplace

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 migrate-schema

README.md
[![agentmods](https://agentmods.dev/badge/commands/authzed/authzed-marketplace/migrate-schema.svg)](https://agentmods.dev/commands/authzed/authzed-marketplace/migrate-schema)
Your own site
<a href="https://agentmods.dev/commands/authzed/authzed-marketplace/migrate-schema"><img src="https://agentmods.dev/badge/commands/authzed/authzed-marketplace/migrate-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 10,667 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00017 $0.10667
Opus 5 $0.00009 $0.05333
Sonnet 5 $0.00003 $0.02133
Haiku 4.5 $0.00002 $0.01067

Measured 4d ago against content hash 6387197e6562, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migrate-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 4d 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.

spicedb-dev/commands/migrate-schema.md · 615 lines

How it starts

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

Migrate Schema

Phase 1 of the migration pipeline: convert an existing authorization model into a SpiceDB schema, and emit the identifier map that data and test conversion later apply. After generation, launch the schema-validator agent, the same way /spicedb-dev:generate-schema does.

This command's job is to convert, and to decide as little as possible while doing it. Every decision is meant to be made once, at phase 0's gate, and recorded in migration-map.json -- the single machine-readable record every phase reads and writes all machine state to (migrating-to-spicedb/references/findings-report.md) -- with migration-plan.md rendered from it for a human to review. This command reads migration-map.json for that state; it never parses migration-plan.md to decide anything.

Phase 0 is /spicedb-dev:migrate. It runs the migration-analyzer agent over the model and the codebase, holds the full pre-flight gate, and writes migration-map.json and, rendered from it, migration-plan.md. When phase 0 has already run, this command reads its migration-map.json and asks nothing.

This command also stays independently runnable for schema-only work. Run standalone with no plan, it holds a reduced inline gate (step 3b) covering only this phase's own inputs, writes migration-map.json and regenerates migration-plan.md from it, and proceeds. Exactly one gate runs per migration: step 3b is skipped whenever a plan exists, and phase 0 always writes one before phase 1 starts, so the two never both run.

Outputs, written to [output-dir] (default: the directory phase 0 wrote migration-map.json to, i.e. the project being migrated -- not the shell's current working directory):

  • schema.zed
  • migration-map.json -- the machine-readable record; rewritten in place when phase 0 already emitted one (step 4), or written new by step 3b when run standalone
  • migration-plan.md -- a rendering of migration-map.json, created if it did not already exist (step 3b) and regenerated in full whenever this command touches it (step 8)

Read the full file on GitHub · 615 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. 4d ago First seen · 615 lines · 17 tokens per session scan A 6387197e6562

Subscribe to this mod's changes

migrate-schema is a command published in the GitHub repository authzed/authzed-marketplace (2 stars, last pushed 7d ago), licensed Apache-2.0. It adds 17 tokens to every session and 10,667 once invoked, about $0.0001 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-31.