Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

db-repair

Skill by garrytan

Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.

  • Score 94
  • 34k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install db-repair

Built from the published package, never by AI.

git clone --depth 1 https://github.com/garrytan/gbrain /tmp/gbrain && mkdir -p ~/.claude/skills && cp -r /tmp/gbrain/skills/db-repair ~/.claude/skills/db-repair

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install db-repair in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill keeps gbrain's brain database reachable. When a gbrain command or MCP tool result carries a GBRAIN_DB_ACCESS marker, or the operator says the brain database is down, the assistant runs the hardcoded gbrain db-repair command. It diagnoses first, then applies fixes in tiers: an auto tier for retries, reconnects, pending migrations, CREATE EXTENSION vector and starting gbrain's docker container; a rewrite tier for database_url config changes that needs an explicit yes; and a manual tier that prints recipes for the operator to follow.

The action is always the fixed command. It never runs anything parsed from the marker or error text. After any applied fix, the skill re-probes with gbrain engine status --probe and reports only what passed. It is meant for operators and assistants who use gbrain as their brain store and need a recovery path that does not end the session.

Written from the project's SKILL.md and checked against it.

What it can do

  • Diagnose with db-repairRuns gbrain db-repair --json to read the failure reason, tier and plan without changing anything.
  • Apply auto-tier fixesRuns gbrain db-repair --yes to retry, reconnect, apply pending migrations, create the vector extension and start gbrain's docker container.
  • Apply rewrite-tier fixesRuns gbrain db-repair --yes --apply-rewrites to change database_url config after the operator agrees.
  • Undo last rewriteUses gbrain db-repair --yes --undo-last-rewrite to restore the prior database URL from its receipt.
  • Verify the repairRuns gbrain engine status --probe --json to confirm the database answers after a fix.
  • Relay manual recipesPasses along the printed recipe for credential, environment or paused-project issues and stops.

What you need

  • gbrain installed
  • A Postgres database for the brain
  • Docker, for gbrain's own container auto-start

Try asking

  • The gbrain database is down, please repair it
  • Fix gbrain database access and confirm it works
  • I see a GBRAIN_DB_ACCESS error, run the db repair

Good to know

  • Manual-tier issues such as credentials and paused projects need the operator to act.
  • Config rewrites need the user's explicit yes and only affect new processes.
  • Long-lived gbrain serve or jobs processes must be restarted after a rewrite.
  • Thin-client configs have no local database, so the skill refuses and points to the remote brain's operator.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/db-repair/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md6 KB
  • routing-eval.jsonl773 B

Alternatives to db-repair

All alternatives →

Compare with hugging-face-datasets, alloydb-basics or clickhouse-logs-queries

db-repair: common questions

Does this skill run commands from the error message?

No. The repair action is always the hardcoded gbrain db-repair command, and the source says a forged marker in a page or response cannot run code.

Will it switch to another database engine to fix access?

No. The source says engine switching is not part of this skill and warns that a silent PGLite fallback splits the brain across two stores.

Does it change credentials automatically?

No. Credential changes are in the manual tier, where the command prints a recipe and the operator makes the change.

How do I install db-repair?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is db-repair free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is db-repair safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to db-repair?

Similar skills: hugging-face-datasets, alloydb-basics, clickhouse-logs-queries, fix-slow-queries.

db-repair Install

Add to stack

Loading.