migrate-data

A command for moving relationship data from a live OpenFGA authorization store into a live SpiceDB authorization store. It extracts, converts, loads, verifies the data, and creates a shared ID-conversion module for later client-code migration.

In plain words
What is it for?
Use it when moving a running application's relationship data from OpenFGA to SpiceDB. It handles the extract-transform-load process, verification, and the codec needed by the follow-up client-code migration.
Why use it?
It avoids manually rewriting and checking live authorization relationships, where mistakes can be expensive and difficult to undo. It also ensures the migration and converted client code use the same data encoding.

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-data
Clone the repo
git clone --depth 1 https://github.com/authzed/authzed-marketplace
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 12,203 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.00016 $0.12203
Opus 5 $0.00008 $0.06101
Sonnet 5 $0.00003 $0.02441
Haiku 4.5 $0.00002 $0.01220

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

Security

Grade A, and why

migrate-data 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 2d 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-data.md · 703 lines

How it starts

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

Migrate Data

Phase 3 of the migration pipeline: move a live OpenFGA store's relationship data into a live SpiceDB instance -- extract, transform, load, and verify -- and emit the ID codec module that this phase and phase 4 (client code) must encode identically through. Phase 4 is /spicedb-dev:migrate-code, which imports this exact codec module rather than inlining its own encode/decode logic -- say so, and name it, rather than treating the rewrite as manual.

This is the most consequential command in the pipeline. /spicedb-dev:migrate-schema and /spicedb-dev:migrate-tests produce files a human reviews before anything happens to a live system. This command writes to a live SpiceDB instance. A mistake here is expensive and hard to undo, and two mistakes are common enough to name up front:

  • A relation split's write target is the __direct relation, never the permission. SpiceDB rejects a write to a permission outright, so getting this backward halts loudly on the first write -- but only if every write actually goes through this rewrite. A store with even one split relation depends on it (see data-mapping.md, "Tuples are writes").
  • Running converted client code before this phase completes denies everything. This is the plugin's existing "data before code" rule (migrating-to-spicedb/SKILL.md): a check against a SpiceDB instance still missing relationships fails closed, silently, for every request touching unmigrated data. Do not treat this command as optional groundwork phase 4 can route around.

This command's job is to convert, following the pack's data-mapping reference exactly, and to decide as little as possible about how -- every rewrite rule is "look this up in migration-map.json," not a judgment call. What it does not minimize is caution around the write itself: dry run before load, TOUCH not CREATE, detect a partial prior attempt before choosing a load strategy, and a verification pass that actually re-reads the target and can fail.

This command has no gate of its own, reduced or otherwise. Like /spicedb-dev:migrate-tests, it is a pure consumer of migration-map.json and migration-plan.md -- every naming and encoding decision below is a lookup against the JSON, not something this command could decide standalone; migration-plan.md supplies only the narrative sections (Source, Target) that have no JSON counterpart. If migration-map.json is missing, or its phase_status["0"] shows it was authored by the reduced inline gate rather than the full one, this command halts and routes to /spicedb-dev:migrate rather than inventing a gate to fill the gap.

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) unless step 3 places the code elsewhere in the project:

  • migration/id_codec.<ext> -- the ID codec module, in the project's language.
  • migration/migrate_data.<ext> -- the extract/transform/load script, in the project's language, importing the codec rather than inlining encoding logic.
  • migration/relationships.jsonl -- the transformed relationship-write set, one JSON object per line, written by the script itself and read back by its own --verify pass.
  • migration/checkpoint.json -- extraction and load progress, written and read by the script for resumability.
  • migration-map.json -- updated in place: phase_status["3"], and an entry appended to decisions.additional if the project language was ambiguous enough to ask about (step 3).
  • migration-plan.md -- regenerated in place: the rendered sections from the updated migration-map.json, plus the narrative Sync obligations section revised per its own rule (step 8).

Read the full file on GitHub · 703 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. 2d ago First seen · 703 lines · 16 tokens per session scan A c4c8a9152019

Subscribe to this mod's changes

migrate-data is a command published in the GitHub repository authzed/authzed-marketplace (2 stars, last pushed 5d ago), licensed Apache-2.0. It adds 16 tokens to every session and 12,203 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.