postgres-adopt
यह क्या करती है
यह स्किल जांचती है कि आपका GBrain अपना बिल्ट-इन लोकल डेटाबेस इस्तेमाल करता है या Postgres। यह मौजूदा लोकल ब्रेन को उसका इतिहास बनाए रखते हुए Postgres पर ले जाने में मदद करती है।
कब इस्तेमाल करें
- ✓जब आप जानना चाहें कि आपका ब्रेन कौन-सा डेटाबेस इंजन इस्तेमाल कर रहा है।
- ✓जब आप लोकल ब्रेन को इतिहास बनाए रखते हुए Postgres पर ले जाना चाहें।
- ✓जब कई कंप्यूटर या लोग जिस ब्रेन का इस्तेमाल करेंगे, उसके लिए Postgres डेटाबेस चाहिए।
Skill का लिंक
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/postgres-adopt/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“जांचिए कि मेरा ब्रेन कौन-सा डेटाबेस इस्तेमाल करता है, और अगर वह बेसिक वाला है तो Postgres पर जाने की योजना बनाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले बिना कुछ बदले मौजूदा सेटअप पढ़ता है। फिर माइग्रेशन योजना दिखाता है और डेटा कॉपी करने व हर टेबल जांचने से पहले आपकी मंज़ूरी का इंतज़ार करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Postgres Adopt
The engine is the brain's foundation: PGLite is the zero-config floor, Postgres is where concurrency, multi-machine access, and 1000+ pages live. This skill answers "which one am I on?", prefers Postgres when the operator wants it, and moves data safely — never by flipping config.
Contract
This skill guarantees:
- Detection is engine-free and read-only:
gbrain engine status --jsonanswers with the database down (that is the point of the command). - Engine changes NEVER happen by editing config. A PGLite brain moves with
gbrain migrate --to postgres(alias--to supabase), which graduates it: plan first (exit 3), run only with the user's--yes --expect <plan_hash>, verify every table, then flip routing. This skill wraps it; it never reimplements it. - The target URL never appears in a command, transcript or output: it lives
in
GBRAIN_TARGET_URLand every command uses--url-env GBRAIN_TARGET_URL. - Provisioning consent is explicit: the docker rung needs
--allow-docker, creating a database on a local server needs--allow-create-db. Headless mutation of infrastructure the operator didn't opt into never happens.
Step 1 — Detect
gbrain engine status --json
Branch on the output:
effective_engine: "postgres"and (optionally)--probesays ok → report healthy, done.effective_engine: "postgres"but the probe fails → this is an ACCESS problem, not an adoption problem: route to db-repair.config_file_enginediffers fromeffective_engine→ an env URL is overriding the config file; tell the operator which one wins — the signal isdb_url_source(env:GBRAIN_DATABASE_URL/env:DATABASE_URLmeans env wins;env.noteadditionally fires when both env URLs are set or the cwd-.env shadow guard excluded one).thin_client: true→ the brain lives on a remote server; engine choices belong to that host. Stop.effective_engine: null(no brain) → Step 2.effective_engine: "pglite"with data → Step 3.- The output has a
graduationblock whosestateis notnone(in progress, interrupted, graduated or split) → Step 4.
Step 2 — Fresh install, Postgres-first
gbrain init --prefer-postgres
The ladder tries, in order: an env URL → Supabase Management-API discovery
(SUPABASE_ACCESS_TOKEN, plus SUPABASE_PROJECT_REF on multi-project
accounts and SUPABASE_DB_PASSWORD for the connection string) → a local
Postgres (only when PGHOST/PGPORT/PGUSER/PGPASSWORD are set or
--local-postgres is passed) → docker → PGLite. Each unusable rung prints a
one-line note and falls through; nothing is silent.
- Ask the operator BEFORE adding
--allow-docker(it creates and owns agbrain-postgrescontainer that survives reboots) or--allow-create-db(it runs CREATE DATABASE on their local server). --jsonreports{engine, ladder_rung, url_source}— relay which rung won.- If the ladder lands on PGLite, that is a fine outcome: say so, and note the upgrade path below is available whenever they want it.
Step 3 — Existing PGLite brain: plan, ask, run
Full reference: Move a PGLite brain to Postgres.
- Target URL. Ask the user to put the connection string in an
environment variable without pasting it into the conversation
(
read -rs GBRAIN_TARGET_URL && export GBRAIN_TARGET_URL). On Supabase use the transaction pooler; on an IPv4-only host also setGBRAIN_DIRECT_DATABASE_URLto the session pooler. - Plan. This changes nothing and exits 3 with the
confirmation_requireddocument:
Relaygbrain migrate --to postgres --url-env GBRAIN_TARGET_URL --jsonuser_message, what moves, what stays on this computer, blockers and the estimate. Stop and wait for the user. A blocker with its ownfixgets cleared first (ask when it saysask_user). - Run, after the user agrees. Use
fix.commandfrom the document:gbrain migrate --to postgres --url-env GBRAIN_TARGET_URL --yes --expect <plan_hash>preview_changedmeans the plan changed: go back to step 2. For thousands of pages run it in the background and pollgbrain migrate --status --json. - Report. Relay the target doctor verdict from the run's output, that
existing tokens, OAuth clients and local writers stay valid, the
gbrain mcp exposefoll
अक्सर पूछे जाने वाले सवाल
क्या मेरा डेटाबेस पता आउटपुट में दिखेगा?
नहीं। पता एक एनवायरनमेंट वेरिएबल में रखा जाता है और कमांड या परिणाम में कभी नहीं छपता।
क्या यह बिना पूछे डेटाबेस बनाती है?
नहीं। डेटाबेस बनाने या Docker कंटेनर शुरू करने के लिए आपके साफ़ फ़्लैग चाहिए।
क्या कॉन्फ़िग फ़ाइल बदलकर इंजन बदला जा सकता है?
नहीं। इंजन बदलाव कॉन्फ़िग एडिट करके नहीं होते। यह काम माइग्रेशन कमांड से होता है।
जानकारी
लेखक का मूल विवरण
Detect which gbrain engine is in use (PGLite vs Postgres), prefer Postgres for agent-harness installs, install/provision Postgres (Supabase discovery via SUPABASE_ACCESS_TOKEN, local Postgres, opt-in Docker), and move an existing PGLite brain to Postgres with its history (plan, ask, run). Detection is one engine-free command; the install ladder is one flag.
repo: garrytan/gbrain
लोकप्रियता
- GitHub स्टार
- 31k
- रैंकिंग में स्थान
- #9264
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
gbrain
31kयह आपके एजेंट को लोगों, प्रोजेक्ट और फ़ैसलों के बारे में तथ्य खोजने के लिए साझा कंपनी ज्ञान ब्रेन में खोजने और उसमें स्थायी नोट सहेजने देती है।
brain-ingest-gate
31kयह आपके एजेंट को नई सामग्री जोड़ने से पहले मौजूदा ज्ञान ब्रेन से जाँचने देती है, ताकि डुप्लिकेट न बनें और नामित इकाइयाँ पहले सुलझें।
brain-link-discipline
31kयह सुनिश्चित करती है कि आपका एजेंट हर उस ब्रेन पेज का काम करने वाला लिंक उसी संदेश में दे, जिसकी वह रिपोर्ट करता है, ताकि आप उसे तुरंत खोल सकें।
brain-ops
31kयह आपके एजेंट को ज्ञान ब्रेन की मुख्य दिनचर्या देती है: पहले मौजूदा संदर्भ जाँचना, स्पष्ट नोट उनके स्रोत के साथ सहेजना, और संबंधित पेज जोड़ना।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।