Schema Unify
Use this skill when the user asks to clean up page types, migrate to a canonical taxonomy, or inspect whether the brain schema has drifted.
This port is adapted from garrytan/gbrain at commit 814258dda67945ffec9457a1e73980e947b7e462.
Workflow
- Identify the substrate:
- repo-local file-backed
brain/ - upstream
gbrainCLI database - another user-specified brain store
- repo-local file-backed
- Run read-only discovery:
- local: inspect frontmatter/type fields and run
python3 scripts/brain_doctor.py - upstream CLI:
gbrain schema active,gbrain schema stats, andgbrain onboard --check --explainwhen available
- local: inspect frontmatter/type fields and run
- Produce a migration plan before applying anything:
- current type inventory
- target taxonomy
- aliases or redirects
- rollback path
- validation commands
- Apply only after explicit approval.
- when an upstream protected migration handler defaults to a dry run, keep preview and apply distinct and pass its explicit apply flag only after approval
- Verify and summarize what changed.
Codex Adaptation
- This repo's current local brain substrate is lightweight Markdown, so the default path is audit-and-plan, not automatic database migration.
- Upstream protected handlers such as
unify-typesrequire explicit local approval and should not be launched from a remote or ambiguous context.
Guardrails
- Do not bulk-retype pages without a dry-run inventory.
- Do not collapse semantically different page types just to reduce counts.
- Preserve legacy type information or a rollback note for every applied migration.
- Do not treat upstream
gbrain-base-v2availability as proof that this repo should adopt it unchanged.