schema-unify

Migrates gbrain brains from gbrain-base to the gbrain-base-v2 canonical 15-type taxonomy.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/AMC-JTC/gbrain-1 --skill schema-unify-amc-jtc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-unify
Source: https://github.com/AMC-JTC/gbrain-1/tree/main/plugin/skills/schema-unify
Command: npx skills add https://github.com/AMC-JTC/gbrain-1 --skill schema-unify-amc-jtc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Production gbrain brains accumulate dozens of noisy page types over years of ingestion, making search, filtering, and maintenance unreliable. This Skill provides the playbook for migrating an existing brain to the gbrain-base-v2 taxonomy, collapsing 94 legacy types into 15 canonical types with subtypes, alias rows, and real link rows. ## Core Features & Use Cases - Guided Migration Workflow: Walks through discovery, dry-run preview, protected job submission, verification, and post-migration checks using gbrain CLI commands. - Safe Rollback Paths: Preserves frontmatter.legacy_type on every retyped page, soft-deletes converted pages with a 72-hour restore window, and supports reverting the active pack flip. - Use Case: An agent runs gbrain onboard --check and sees a pack_upgrade_available or type_proliferation warning; this Skill directs the exact sequence of commands to preview and apply the unify-types migration safely. ## Quick Start Ask the agent to run gbrain onboard --check --explain to preview the type unification, then submit the unify-types job with apply set to true.

Frequently Asked Questions about schema-unify

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate my gbrain brain to gbrain-base-v2?

Run gbrain onboard --check --explain to preview the changes, then submit the migration with gbrain jobs submit unify-types --allow-protected --follow --params '{"target_pack":"gbrain-base-v2","apply":true}'. Verify afterward with gbrain onboard --check and gbrain schema stats.

How do I clean up page type proliferation in gbrain?

Use the unify-types handler, which collapses up to 94 legacy page types into 15 canonical types with subtypes moved to frontmatter. Unknown long-tail types are retyped to note with frontmatter.legacy_type preserved for rollback.

Can I roll back the gbrain-base-v2 type migration?

Yes. Every retyped page keeps frontmatter.legacy_type, soft-deleted source pages are restorable for 72 hours via gbrain restore, and the active pack flip can be reverted with gbrain schema use gbrain-base. Postgres deployments can also bulk-restore types with SQL.

Why does my unify-types job stay queued forever?

On PGLite or any setup without a running worker daemon, jobs never execute unless submitted with --follow, which runs the job inline. Resubmit with --follow to execute the migration immediately.

Does the type migration break existing queries and wikilinks?

No. The expandTypeFilter helper expands legacy type filters like article to media plus subtype automatically, and old redirect slugs keep resolving through the slug_aliases table without rewriting body-text wikilinks.