schema-unify
Fungsinya
Skill ini memigrasikan brain yang sudah menumpuk banyak jenis halaman ke kumpulan yang lebih kecil dan konsisten, yaitu 15 jenis. Skill ini ditujukan bagi brain yang daftar jenisnya sudah berantakan seiring waktu.
Kapan dipakai
- βSaat brain Anda menampilkan peringatan tentang terlalu banyak jenis halaman atau pembaruan paket yang tersedia.
- βKetika Anda ingin membersihkan jenis halaman dan berpindah ke kumpulan standar.
- βSaat Anda bertanya bagaimana menata jenis halaman ke dalam struktur yang lebih rapi.
Link skill
https://github.com/garrytan/gbrain/blob/master/plugin/skills/schema-unify/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBrain saya punya puluhan jenis halaman. Tunjukkan cara memindahkannya ke kumpulan jenis standar dengan aman.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memeriksa kondisi saat ini, lalu menjalankan migrasi yang memetakan jenis lama ke jenis baru memakai alias dan tautan. Agent menyelesaikannya dengan memeriksa alias yang tertinggal dan tidak lagi mengarah ke mana pun.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Schema Unification (gbrain-base β gbrain-base-v2)
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.
brain_first: exempt
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.
When this skill fires
- Agent runs
gbrain onboard --checkand seespack_upgrade_availableortype_proliferationwarnings - User asks "what is the canonical taxonomy / how do I clean up my page types / migrate to v2"
- A
dangling_aliasesfinding surfaces (post-unify GC) - An agent ingesting from a custom pack wants to consult the v2 taxonomy as a reference
Mental model (one paragraph)
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.
Workflow
Phase 1: Discovery
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 --check
Look for the pack_upgrade_available finding. If it's ok, there's no successor declared for the active pack β done.
Phase 2: Preview
Run the per-cluster narrative:
gbrain onboard --check --explain
This invokes the unify-types handler in dry-run mode and prints:
- How many pages would retype per cluster (tweets, articles, companies, etc.)
- How many concept-redirect pages would become alias rows
- How many edge-shaped pages would convert to real links
- The synthesized catch-all rules for unknown types
Review the output. If the proposed changes look wrong, don't proceed β file an issue or write a custom pack with adjusted mapping_rules.
Phase 3: Apply
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 queue
Pertanyaan umum
Berapa banyak jenis yang tersisa?
Kumpulan target memiliki 15 jenis kanonik, termasuk jenis catatan umum untuk segala hal lainnya.
Apakah migrasi mempertahankan halaman saya?
Migrasi memetakan jenis lama ke jenis baru, sehingga halaman tetap ada di bawah struktur yang baru.
Apakah saya perlu memeriksa hasilnya?
Ya. Skill menyertakan pemeriksaan alias yang tertinggal setelah migrasi selesai.
Detail
Deskripsi asli dari pembuat
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 pack_upgrade_available, type_proliferation, or asks "what is the canonical taxonomy / how do I clean up my page types".
repo: garrytan/gbrain
Popularitas
- Bintang GitHub
- 31k
- Peringkat
- #9310
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
gbrain
31kMemungkinkan agent Anda mencari fakta tentang orang, proyek, dan keputusan di basis pengetahuan bersama perusahaan, serta menyimpan catatan penting.
brain-ingest-gate
31kMemeriksa konten baru terhadap basis pengetahuan yang sudah ada sebelum ditambahkan, untuk menghindari duplikat dan menyelesaikan entitas bernama lebih dulu.
brain-link-discipline
31kMemastikan agent Anda menyertakan tautan yang berfungsi ke setiap halaman basis pengetahuan yang dilaporkannya, dalam pesan yang sama, agar Anda bisa langsung membukanya.
brain-ops
31kMemberi agent Anda rutinitas inti untuk basis pengetahuan: memeriksa konteks yang ada terlebih dahulu, menyimpan catatan eksplisit beserta sumbernya, dan menautkan halaman terkait.
Skill serupa
technical-documentation
394kMembantu agent Anda menulis dan meninjau dokumentasi teknis serta file instruksi agent yang jelas, agar orang dan alat AI dapat mengikutinya dengan mudah.
architecture-decision-records
280kMembuat agent Anda mencatat keputusan penting terkait struktur proyek. Membantu memahami alasan di balik pilihan dan menjaga riwayat perubahan yang jelas.
code-tour
280kMembuat agent Anda menyusun panduan kode langkah demi langkah dengan referensi file dan nomor baris yang tepat. Berguna untuk pengenalan, penjelasan, dan review.