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.
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-repairRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/garrytan/gbrain /tmp/gbrain && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/gbrain/skills/db-repair ~/.gemini/antigravity-cli/skills/db-repairAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Provides a PostgreSQL table design reference covering data types, indexing, constraints, partitioning and performance patterns. Built for developers who design or review PostgreSQL schemas.
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.
