Agent skill

Mg Local DB Restore

by modelguide in modelguide/modelguide

Trigger phrases - "reset local db", "recreate local postgres", "restore dump to local", "reset local database", "load backup locally"

MITAuto-check passedDevOps & Cloud

Install Mg Local DB Restore

skills CLI
$ npx skills add modelguide/modelguide --skill mg-local-db-restore -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install modelguide/modelguide mg-local-db-restore --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/modelguide/modelguide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mg-local-db-restore .claude/skills/mg-local-db-restore && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mg-local-db-restore
GitHub stars
108
Token cost
~645 tokens
SKILL.md length
269 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Trigger phrases - "reset local db", "recreate local postgres", "restore dump to local", "reset local database", "load backup locally"

  • Works in 9 steps: List available backups (if no file… → Confirm with user → Stop Postgres and remove volume → …
  • Phrases - reset local db
  • SKILL.md covers Inputs, Procedure and Notes
  • Calls docker, make and psql; needs POSTGRES_PASSWORD

What it does

Mg Local DB Restore is an agent skill from modelguide/modelguide. Trigger phrases - "reset local db", "recreate local postgres", "restore dump to local", "reset local database", "load backup locally"

Its SKILL.md is about 650 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Containers and Backup and disaster recovery. It works with PostgreSQL and Docker. The repository describes itself as: Open-source voice agent orchestration framework - build production voice AI pipelines without vendor lock-in. The licence is MIT.

When your agent uses it

  • Phrases - reset local db
  • Recreate local postgres
  • Restore dump to local
  • Reset local database

Example prompts

  • “reset local db”
  • “recreate local postgres”
  • “restore dump to local”
  • “/mg-local-db-restore”

Requirements

  • Docker

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. List available backups (if no file specified)
  2. Confirm with user
  3. Stop Postgres and remove volume
  4. Start Postgres
  5. Wait for healthcheck
  6. Read credentials from docker-compose.yml
  7. Restore the dump
  8. Verify restoration
  9. Report success

What it can do on your machine

Read from SKILL.md and the folder at commit 554caa0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • docker
    • make
    • psql

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • POSTGRES_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mg Local DB Restore loads about 645 tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 269 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~645

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from modelguide/modelguide at commit 554caa0, republished under its MIT licence (© modelguide). 269 words, ~645 tokens.

Download SKILL.mdSave it as .claude/skills/mg-local-db-restore/SKILL.md (or your agent's skills folder).
name
mg-local-db-restore
description
Trigger phrases - "reset local db", "recreate local postgres", "restore dump to local", "reset local database", "load backup locally"

Recreate Local Postgres from Dump

Reset the local Docker Postgres and restore it from a .dump backup file.

Inputs

Ask the user if not provided:

  • backup file — path to a .dump.gz file. If not specified, list files matching .claude/local/*.dump.gz and ask the user to pick one.

Procedure

1. List available backups (if no file specified)
bash
ls -lh .claude/local/*.dump.gz

Ask the user which backup to use.

2. Confirm with user

This destroys all local database data. Ask the user to confirm before proceeding.

3. Stop Postgres and remove volume

Only target the postgres service to avoid affecting other containers:

bash
docker compose down -v postgres
4. Start Postgres
bash
docker compose up -d postgres
5. Wait for healthcheck

Poll until the container is healthy (~5-10 seconds):

bash
until docker compose ps postgres | grep -q healthy; do sleep 1; done
6. Read credentials from docker-compose.yml

Read docker-compose.yml at the project root and extract:

  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_DB
  • Host port (the published port mapped to container port 5432)

Never hardcode credentials — always read them from the compose file.

7. Restore the dump

Never pass credentials in command-line arguments. Use PGPASSWORD as an inline env var:

bash
gunzip -c <backup-file> | PGPASSWORD=<password> pg_restore --clean --if-exists --no-owner --no-acl \
  -h localhost -p <port> -U <user> -d <db>
8. Verify restoration

Query pg_tables via psql to confirm tables exist:

bash
PGPASSWORD=<password> psql -h localhost -p <port> -U <user> -d <db> \
  -c "SELECT schemaname, tablename FROM pg_tables WHERE schemaname = 'public' ORDER BY tablename;"

Report the table count and list to the user.

9. Report success

Tell the user the restore is complete. Remind them:

  • Run make db-migrate if the dump may be behind on migrations
  • Run make db-seed if they need fresh seed data on top of the backup

Notes

  • Docker compose file is at the project root (docker-compose.yml)
  • The init.sql script automatically creates the modelguide_app role on a fresh volume, so the restore should work without manual role creation
  • If pg_restore reports errors about missing roles or permissions, these are usually safe to ignore with --no-owner --no-acl

© modelguide, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/mg-local-db-restore of modelguide/modelguide.

Open the folder on GitHubat commit 554caa0

Compare with similar skills

Mg Local DB Restore next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mg Local DB Restore compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mg Local DB Restore this skillmodelguide/modelguide108—~645Automated safety check: PassMIT
Postgres Backup Restorefmflurry/settings-opencode171—~2.3kAutomated safety check: PassMIT
Supabasemagnus919/agent-skills116—~2.2kAutomated safety check: PassMIT
Cb Build TestBlkLeg/CircuitBreaker201—~1.9kAutomated safety check: PassMIT
Monstermq Broker Configvogler75/monster-mq143—~2.2kAutomated safety check: PassGPL-3.0
Unraiddinglebear-ai/unraid135—~2.8kAutomated safety check: PassMIT

Similar skills

  • Postgres Backup Restore

    fmflurry/settings-opencode

    PostgreSQL backup & restore playbook for the docker instance: pgdump/pgdumpall recipes, WAL archiving + PITR setup (archivemode, archivecommand, recovery.signal, recoverytargettime, timelines)…

    171 GitHub stars~2.3k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Supabase

    magnus919/agent-skills

    A skill your agent uses when developing applications with Supabase, running the Supabase CLI, designing migrations and RLS policies, testing database behavior, generating client types, deploying the…

    116 GitHub stars~2.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Cb Build Test

    BlkLeg/CircuitBreaker

    How Circuit Breaker is built, tested, packaged, and kept secret-safe — the make dev/verify/test targets, the PostgreSQL integration test database and its fixtures, the mono Docker image and native…

    201 GitHub stars~1.9k tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Monstermq Broker Config

    vogler75/monster-mq

    Guide for configuring, deploying, and operating the MonsterMQ broker.

    143 GitHub stars~2.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Unraid

    dinglebear-ai/unraid

    Query and monitor an Unraid NAS/homelab server — array health, disk temperatures, Docker containers, virtual machines, system metrics, notifications, alerts, shares, UPS status, log files, network…

    135 GitHub stars~2.8k tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed
  • Infrastructure Setup

    pavel-molyanov/molyanov-ai-dev

    Provides project infrastructure conventions and review criteria for local setup, Docker, Git hooks, CI/CD, service delivery, release artifacts, monitoring, backups, and operations.

    297 GitHub stars~1.9k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check: notes

More from modelguide/modelguide

  • Mg CLI

    modelguide/modelguide

    Generate YAML configuration files and run CLI commands to onboard organizations into ModelGuide.

    108 GitHub stars~3.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Mg Connector

    modelguide/modelguide

    A skill your agent uses when the user asks to add a connector, create a connector, implement a connector for a service, add a tool to a connector, update a connector tool, or asks about connector…

    108 GitHub stars~4.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Mg Integrity Check

    modelguide/modelguide

    Use before committing significant code changes to verify project integrity.

    108 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check: notes
  • Mg Railway DB Backup

    modelguide/modelguide

    Backup a PostgreSQL database from a Railway environment. An agent skill from modelguide/modelguide.

    108 GitHub stars~534 tokensUpdated 3 mo ago
    Auto-check passed
  • Mg Railway DB Restore

    modelguide/modelguide

    Restore a PostgreSQL database backup to a Railway environment.

    108 GitHub stars~562 tokensUpdated 3 mo ago
    Auto-check passed
  • Mg Railway Deploy All

    modelguide/modelguide

    Deploy all ModelGuide services (API, UI, LB) to a Railway environment.

    108 GitHub stars~667 tokensUpdated 3 mo ago
    Auto-check passed

Categories

Questions about Mg Local DB Restore

What does Mg Local DB Restore do?

Trigger phrases - "reset local db", "recreate local postgres", "restore dump to local", "reset local database", "load backup locally". Mg Local DB Restore is an agent skill from modelguide/modelguide.

When should I use Mg Local DB Restore?

Mg Local DB Restore fits situations like: phrases - reset local db; recreate local postgres; restore dump to local; reset local database.

How do I install Mg Local DB Restore in Claude Code?

Run `npx skills add modelguide/modelguide --skill mg-local-db-restore -a claude-code`. Or copy the skill folder (.claude/skills/mg-local-db-restore in modelguide/modelguide) into .claude/skills/mg-local-db-restore in your project. Claude Code loads it when a task matches its description.

How do I install Mg Local DB Restore in Codex?

Run `npx skills add modelguide/modelguide --skill mg-local-db-restore -a codex`. Or copy the skill folder (.claude/skills/mg-local-db-restore in modelguide/modelguide) into .agents/skills/mg-local-db-restore in your project. Codex loads it when a task matches its description.

Can I use Mg Local DB Restore in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add modelguide/modelguide --skill mg-local-db-restore -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mg-local-db-restore, .gemini/skills/mg-local-db-restore, .github/skills/mg-local-db-restore and .opencode/skills/mg-local-db-restore in your project.

What does Mg Local DB Restore need to run?

Going by SKILL.md and its folder, Mg Local DB Restore needs the command-line tools its instructions call (docker, make and psql) and credentials named POSTGRES_PASSWORD. Our summary lists: Docker.

Does Mg Local DB Restore access the network?

SKILL.md contains no URLs. Its commands use docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Mg Local DB Restore safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mg Local DB Restore use?

Mg Local DB Restore is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mg Local DB Restore use?

About 645 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mg Local DB Restore?

Skills that share tags, products or a category with Mg Local DB Restore: Postgres Backup Restore (fmflurry/settings-opencode, 171 stars), Supabase (magnus919/agent-skills, 116 stars), Cb Build Test (BlkLeg/CircuitBreaker, 201 stars) and Monstermq Broker Config (vogler75/monster-mq, 143 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mg Local DB Restore?

modelguide (a GitHub organization) maintains it in modelguide/modelguide, which has 108 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on June 20, 2026.

Source: modelguide/modelguide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.