Reversible Migration
JuliusBrussee/caveman
Implement reversible compatibility-safe transitions. Use for schema, data, API, protocol, configuration, or dependency migrations requiring rollback and…
Migrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler.
$ npx skills add garrytan/gbrain --skill schema-unify -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install garrytan/gbrain schema-unify --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/schema-unify .claude/skills/schema-unify && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "schema-unify" agent skill from https://github.com/garrytan/gbrain/tree/master/skills/schema-unify into .claude/skills/schema-unify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-unify", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/garrytan/gbrain/tree/master/skills/schema-unifyType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add garrytan/gbrain --skill schema-unify -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install garrytan/gbrain schema-unify --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/schema-unify .agents/skills/schema-unify && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "schema-unify" agent skill from https://github.com/garrytan/gbrain/tree/master/skills/schema-unify into .agents/skills/schema-unify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-unify", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add garrytan/gbrain --skill schema-unify -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install garrytan/gbrain schema-unify --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/schema-unify .cursor/skills/schema-unify && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "schema-unify" agent skill from https://github.com/garrytan/gbrain/tree/master/skills/schema-unify into .cursor/skills/schema-unify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-unify", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/garrytan/gbrain.git --path skills/schema-unify--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add garrytan/gbrain --skill schema-unify -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install garrytan/gbrain schema-unify --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/schema-unify .gemini/skills/schema-unify && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "schema-unify" agent skill from https://github.com/garrytan/gbrain/tree/master/skills/schema-unify into .gemini/skills/schema-unify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-unify", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install garrytan/gbrain schema-unifyInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add garrytan/gbrain --skill schema-unify -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/schema-unify .github/skills/schema-unify && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "schema-unify" agent skill from https://github.com/garrytan/gbrain/tree/master/skills/schema-unify into .github/skills/schema-unify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-unify", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add garrytan/gbrain --skill schema-unify -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install garrytan/gbrain schema-unify --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/schema-unify .opencode/skills/schema-unify && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "schema-unify" agent skill from https://github.com/garrytan/gbrain/tree/master/skills/schema-unify into .opencode/skills/schema-unify/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-unify", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
schema-unifyMigrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler.
Schema Unify is an agent skill from garrytan/gbrain. Migrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler. Collapses 94 noisy types to 15 canonical with subtypes, alias rows, and link rows. Triggers when an agent notices packupgradeavailable, typeproliferation, or asks "what is the canonical taxonomy / how do I clean up my page types".
Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
The repository describes itself as: Garry's Opinionated OpenClaw/Hermes Agent Brain. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit fc54831. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
jqFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Schema Unify loads about 3.4k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 1,345 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from garrytan/gbrain at commit fc54831, republished under its MIT licence (© garrytan). 1,345 words, ~3,416 tokens.
.claude/skills/schema-unify/SKILL.md (or your agent's skills folder).v0.41.22 ships gbrain-base-v2 — a 15-type DRY/MECE taxonomy (14 canonical + note catch-all) — as the install default for new brains. Existing brains on gbrain-base can opt in via the pack_upgrade_available onboard finding + the unify-types PROTECTED Minion handler.
This skill is the playbook for that migration.
This skill is ABOUT the brain's shape — it can't depend on the brain it's reshaping. No gbrain search lookup first; jump straight to onboard.
gbrain onboard --check and sees pack_upgrade_available or type_proliferation warningsdangling_aliases finding surfaces (post-unify GC)A production gbrain brain accreted 94 distinct pages.type values over years of ingestion: tweet / tweet-thread / tweet-bundle / tweet-single / media/x-tweet/bundle / tweet-stub all coexisting; 5.5K concept-redirect pages; atom-partner-link pages that should be links; civic / framework / insight / memo / anecdote one-offs. The cure: collapse to 15 canonical types (person, company, media, tweet, social-digest, analysis, atom, concept, source, deal, email, slack, writing, project, note) with subtypes/format/origin pushed to frontmatter, alias-rows for redirects, real link-rows for edge-shaped pages, and a catch-all that bins long-tail unknowns to note with frontmatter.legacy_type = <original> for rollback.
Confirm the brain is actually on gbrain-base (not already on v2).
gbrain schema active --json | jq -r '.identity'Expected: gbrain-base@1.0.0+<sha>. If you see gbrain-base-v2@..., the brain is already on v2 — skip the migration.
Then run onboard to see what would change:
gbrain onboard --checkLook for the pack_upgrade_available finding. If it's ok, there's no successor declared for the active pack — done.
Run the per-cluster narrative:
gbrain onboard --check --explainThis invokes the unify-types handler in dry-run mode and prints:
Review the output. If the proposed changes look wrong, don't proceed — file an issue or write a custom pack with adjusted mapping_rules.
Managed brains: stop after the preview. Applying the migration is not
supported on a managed brain (managed persistence on) yet: the retype writes
pages directly instead of through the coordinated writer, so the apply job is
refused (writer_coordinator_required) before it changes anything. The
pack_upgrade_available finding says so on those brains. Keep using
gbrain onboard --check --explain to preview, tell the user the pack upgrade
waits for coordinated retype support, and don't submit the apply job below.
One exception: when the preview shows nothing to retype, link or alias, the
apply job only switches the active pack, so it may be submitted with the
user's agreement.
The handler is PROTECTED (manual_only) — autopilot will never auto-fire it. Submit explicitly:
gbrain jobs submit unify-types \
--params '{"target_pack":"gbrain-base-v2","apply":true}'On PGLite (the install default), or on any setup without a running gbrain jobs work worker or supervisor daemon, add --follow so the job executes inline:
gbrain jobs submit unify-types \
--follow \
--params '{"target_pack":"gbrain-base-v2","apply":true}'The persistent worker daemon is Postgres-only. Without --follow on PGLite, the job sits queued forever and the migration never runs.
apply defaults to false (dry-run) per the handler contract, so
"apply":true is required here or the job reports success having retyped
nothing and left the active pack unflipped. Omit it to preview.
Watch progress per phase (worker-daemon runs; with --follow the same progress streams inline):
gbrain jobs get <job_id> # one job: status, progress, result
gbrain jobs watch --follow # live dashboard of the whole queueA job that stays queued here means no worker is running; resubmit with --follow to execute it inline.
On a 186K-page brain expect ~10 minutes. The handler runs:
mapping_rules:)gbrain-unify db-lock (60min TTL)gbrain onboard --check
gbrain schema statsExpected:
pack_upgrade_available → ok (active pack is now v2)type_proliferation → ok (≤16 distinct typed values)dangling_aliases → ok (slug_aliases all point at active canonicals)gbrain schema stats shows ≤16 distinct typesSearch and query --type article keep returning those pages post-unify: media declares article as an alias, so the type filter expands through the active pack's alias closure (the results also include other media pages). Direct SQL against pages.type needs updating to the canonical types.
Search queries get a small ranking signal: pages reached via slug_aliases (canonicals of one or more aliases) get a 1.05x boost. Visible via gbrain search --explain.
Every retyped page preserves frontmatter.legacy_type = <original>.
Restore types in bulk (Postgres/Supabase deployments only; requires direct DB access):
UPDATE pages SET type = frontmatter->>'legacy_type'
WHERE source_id = 'default' AND frontmatter->>'legacy_type' IS NOT NULL;On PGLite there is no SQL shell, so use the CLI surface instead: frontmatter.legacy_type persists per page, so individual retypes can be reverted through the normal put_page/CLI surface, and the soft-delete restore and pack-flip revert below work on every engine.
Page-to-alias and page-to-link source pages soft-delete with 72h TTL. Restore within that window:
gbrain restore <slug>Revert the active pack flip:
gbrain schema use gbrain-base*unknown*) for the long tail. Pages get retyped to note with legacy_type preserved.[[old-redirect-slug]] keeps working via engine.resolveSlugWithAlias short-circuit.--explain before applying. The trust delta is real.gbrain-unify db-lock serializes them; the second submission rejects with "already in progress."Active pack already gbrain-base-v2?
→ Skip migration.
Custom pack with own mapping_rules?
→ Run --check --explain to see if your pack declares migration_from
for the active pack. If yes, target_pack = your pack name.
Brain has many custom types not covered by gbrain-base-v2 mapping_rules?
→ The catch-all retype binds them to `note` with legacy_type preserved.
Review by inspecting frontmatter.legacy_type after the migration.
Federated brain (multiple sources)?
→ Add --params source_id to scope the migration per-source. Each
source can be migrated independently.
Worried about a specific cluster's mapping?
→ Fork gbrain-base-v2 (`gbrain schema fork gbrain-base-v2 my-pack`),
edit mapping_rules in your fork, then target the fork.Inputs:
gbrain-base (or any pack with migration_from: gbrain-base-v2).gbrain jobs submit grants the PROTECTED-handler opt-in itself for protected names; the remote MCP submit_job op cannot.Outputs:
frontmatter.legacy_type preserved (per-page rollback signal).slug_aliases rows for concept-redirect pages (alias table IS the resolver — no link rewrite).links rows for edge-shaped pages (atom-partner-link, symlink, etc.).gbrain-base-v2 atomically at end of successful run.Side effects:
gbrain restore <slug>).cache.ttl_seconds.--type X expands through the active pack's alias closure (back-compat).Failure modes:
gbrain-unify db-lock; second call exits gracefully.page_to_link + page_to_alias source types (caught in E2E pre-merge).active_pack_flipped; partial state restorable via op_checkpoint resume.Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
gbrain-unify lock is held ("already in progress"): wait for the running job (gbrain jobs get <id>); do not resubmit.active_pack_flipped: the pack did not change; resume from the checkpoint rather than restarting from scratch.DON'T:
unify-types via the remote MCP submit_job op. PROTECTED handlers require trusted local callers (gbrain jobs submit on the brain host); remote MCP rejection is the intentional trust boundary.mapping_rules in gbrain-base-v2.yaml to skip clusters you don't trust. Fork the pack instead (gbrain schema fork) so the source-of-truth migration stays consistent across brains.unify-types from inside an autopilot tick. The check is manual_only — autopilot deliberately never auto-fires it because pack upgrades are one-time consenting taxonomy decisions.gbrain restore <slug> first if rollback is needed.frontmatter.legacy_type survives every roundtrip. The marker is canonical for the immediate post-migration window; downstream re-imports may overwrite it.Per phase, the handler emits to stderr:
[unify-types] phase=retype-explicit applied=N skipped=M cost=USD ttl=Ns
[unify-types] phase=retype-catch-all applied=N
[unify-types] phase=page-to-link converted=N pages soft-deleted
[unify-types] phase=page-to-alias aliased=N pages soft-deleted
[unify-types] phase=sync residual=N
[unify-types] active_pack flipped from gbrain-base to gbrain-base-v2Final celebration summary to stderr:
═══════════════════════════════════════════════════════════
gbrain-base-v2 migration complete
═══════════════════════════════════════════════════════════
Before: 94 distinct page types
After: 15 canonical types
Retyped: 25,632 pages
Aliased: 5,521 redirects → slug_aliases table
Linkified: 65 ghost pages → real link rows
Soft-deleted: 5,586 pages (restorable for 72h)
═══════════════════════════════════════════════════════════For structured JSON, gbrain call get_job '{"id": <id>}' returns the job row; its result field carries the UnifyTypesResult shape with per_phase, pack_identity_after, active_pack_flipped (gbrain jobs get <id> prints the same result inline).
© garrytan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/schema-unify of garrytan/gbrain.
Open the folder on GitHubat commit fc54831
Schema Unify next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Schema Unify this skillgarrytan/gbrain | 31k | — | ~3.4k | Automated safety check: Pass | MIT | |
| Reversible MigrationJuliusBrussee/caveman | 111k | 1 repos | ~196 | Automated safety check: Pass | Apache-2.0 | |
| Database Migrationsaffaan-m/ECC | 276k | 4 repos | ~3k | Automated safety check: Pass | MIT | |
| Database Migrationsaffaan-m/ECC | 276k | 1 repos | ~2.4k | Automated safety check: Pass | MIT | |
| Safe Database Migration Patternsaffaan-m/ECC | 276k | — | ~3.3k | Automated safety check: Pass | MIT | |
| gbrain Syncgarrytan/gstack | 136k | — | ~15k | Automated safety check: Notes | MIT |
JuliusBrussee/caveman
Implement reversible compatibility-safe transitions. Use for schema, data, API, protocol, configuration, or dependency migrations requiring rollback and…
affaan-m/ECC
Safe, reversible database migration patterns: forward-only production changes, expand-contract zero-downtime renames, concurrent indexes, batched backfills, and per-tool workflows for PostgreSQL…
affaan-m/ECC
Şema değişiklikleri, veri migration'ları, rollback'ler ve PostgreSQL, MySQL ve yaygın ORM'ler (Prisma, Drizzle, Django, TypeORM, golang-migrate) arasında sıfır kesinti deployment'ları için…
affaan-m/ECC
Rules and examples for safe, reversible schema changes in production: zero-downtime column and index changes, large data backfills and ORM migration workflows.
garrytan/gstack
Re-indexes a repository into gbrain and refreshes the agent search guidance in CLAUDE.md, safe to run again whenever search results look stale.
ruvnet/ruflo
Create a new sequentially numbered database migration with up/down SQL files
garrytan/gbrain
Traces a factual error the user points out back to its source (a brain page, a memory file, SOUL.md or USER.md, or a hallucination) and fixes that source instead of just noting the correction.
garrytan/gbrain
Searches and writes a company-wide knowledge brain through the gbrain CLI, so durable decisions and facts about people, projects and history stay findable beyond one session.
garrytan/gbrain
Ingest links, articles, tweets, and ideas into the brain. An agent skill from garrytan/gbrain.
garrytan/gbrain
Sends what your notes already know about a topic to Perplexity, so the cited web search reports only what is new, such as entity updates or deal changes.
garrytan/gbrain
Run gbrain skillpack-check to produce an agent-readable JSON health report for the gbrain install.
garrytan/gbrain
Lift a proven skill from a host repo (e.g. An agent skill from garrytan/gbrain.
Migrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler. Schema Unify is an agent skill from garrytan/gbrain. Migrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler.
Schema Unify fits situations like: an agent notices packupgradeavailable; typeproliferation; asks what is the canonical taxonomy / how do I clean up my page types.
Run `npx skills add garrytan/gbrain --skill schema-unify -a claude-code`. Or copy the skill folder (skills/schema-unify in garrytan/gbrain) into .claude/skills/schema-unify in your project. Claude Code loads it when a task matches its description.
Run `npx skills add garrytan/gbrain --skill schema-unify -a codex`. Or copy the skill folder (skills/schema-unify in garrytan/gbrain) into .agents/skills/schema-unify in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add garrytan/gbrain --skill schema-unify -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/schema-unify, .gemini/skills/schema-unify, .github/skills/schema-unify and .opencode/skills/schema-unify in your project.
Going by SKILL.md and its folder, Schema Unify needs the command-line tools its instructions call (jq).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Schema Unify is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Schema Unify: Reversible Migration (JuliusBrussee/caveman, 111k stars), Database Migrations (affaan-m/ECC, 276k stars), Database Migrations (affaan-m/ECC, 276k stars) and Safe Database Migration Patterns (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
garrytan (a GitHub user) maintains it in garrytan/gbrain, which has 30,701 GitHub stars. The repository holds 47 skills in this directory. The repository was last updated on October 9, 2026.
Source: garrytan/gbrain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.