postgres-adopt

postgres-adopt is a skill for Claude Code from garrytan/gbrain. It costs 91 tokens per session (2,309 once invoked), scanned A, original, MIT.

A setup and migration guide for the database that stores a gbrain knowledge base. It compares PGLite, a simple local database, with Postgres, a database suited to shared or larger installations.

In plain words
What is it for?
Use it to check the current database, set up Postgres locally or through Supabase, or move an existing PGLite knowledge base safely.
Why use it?
It removes the guesswork and risk from choosing, installing, or switching databases, with checks to protect existing data.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: built for gbrain.

Part of the gbrain-coding plugin — 21 skills shipped together

Good fit Use it to check the current database, set up Postgres locally or through Supabase, or move an existing PGLite knowledge base safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/garrytan/gbrain/postgres-adopt
About the project

GBrain is a memory and retrieval layer for AI agents that searches, connects, and synthesizes information from stored sources. It is used to give coding agents and autonomous agents access to knowledge beyond their current code, including shared company information with access controls. The catalogue add-ons help agents operate GBrain and connect it to agent workflows.

garrytan/gbrain · 33,897 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add garrytan/gbrain --skill postgres-adopt
Clone the repo
git clone --depth 1 https://github.com/garrytan/gbrain

Made for: Claude Code.

Or install gbrain-coding, the plugin that ships this one along with the rest of its 21 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres-adopt

README.md
[![agentmods](https://agentmods.dev/badge/skills/garrytan/gbrain/postgres-adopt/github.svg)](https://agentmods.dev/skills/garrytan/gbrain/postgres-adopt)
Your own site
<a href="https://agentmods.dev/skills/garrytan/gbrain/postgres-adopt"><img src="https://agentmods.dev/badge/skills/garrytan/gbrain/postgres-adopt/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres-adopt

Your own site · 80×15
<a href="https://agentmods.dev/skills/garrytan/gbrain/postgres-adopt"><img src="https://agentmods.dev/badge/skills/garrytan/gbrain/postgres-adopt.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 59
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.02309
Opus 5.5 $0.00036 $0.00924
Sonnet 5.5 $0.00018 $0.00462
Haiku 4.5 $0.00009 $0.00231

Measured 6d ago against content hash 74c321f733f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-adopt scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin-variants/gbrain-coding/skills/postgres-adopt/SKILL.md · 187 lines

How it starts

The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on 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 --json answers 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_URL and 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) --probe says 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_engine differs from effective_engine → an env URL is overriding the config file; tell the operator which one wins — the signal is db_url_source (env:GBRAIN_DATABASE_URL / env:DATABASE_URL means env wins; env.note additionally 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 graduation block whose state is not none (in progress, interrupted, graduated or split) → Step 4.

Read the full file on GitHub · 187 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago Changed · +5 lines 74c321f733f9
  2. 1mo ago Changed 169da89a1ab0
  3. 1mo ago Changed · +1 lines 5131e2b2b8a8
  4. 2mo ago Changed · +42 lines · +6 tokens per session 44b7d29a135c
  5. 2mo ago Changed · +8 lines 1b4399fb449e
  6. 3mo ago First seen · 131 lines · 85 tokens per session scan A 4c402527bd0d

Subscribe to this mod's changes

postgres-adopt is a skill published in the GitHub repository garrytan/gbrain (33,897 stars, last pushed today), licensed MIT. It adds 91 tokens to every session and 2,309 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

postgres-adopt compared with skills from other repositories

postgres-adopt next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
postgres-adoptgarrytan/gbrainSkill34ktodayMITA91Claude Code
alloydb-basicsgoogle/skillsSkill26ktodayApache-2.0A72Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43k2d agoMITA37Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill496yesterdayApache-2.0A63Claude Code, Codex
dsqlawslabs/agent-pluginsSkill957yesterdayApache-2.0A247Claude Code
postgresdbericrisco/rsc-harnessSkill7072d agoMITA91Claude Code, Codex
analyzing-insights-across-teamsPostHog/posthog-fossSkill736todayMITA115Claude Code, Codex