Agent skill

Mg Railway DB Restore

by modelguide in modelguide/modelguide

Restore a PostgreSQL database backup to a Railway environment.

MITAuto-check passedDatabases

Install Mg Railway DB Restore

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

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

GitHub CLI
$ gh skill install modelguide/modelguide mg-railway-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-railway-db-restore .claude/skills/mg-railway-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-railway-db-restore
GitHub stars
108
Token cost
~562 tokens
SKILL.md length
165 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Restore a PostgreSQL database backup to a Railway environment.

  • Works in 4 steps: List available backups (if user didn't… → Link to the correct project and… → Restore the backup — credentials piped… → …
  • The user asks to restore db
  • SKILL.md covers Inputs, Procedure and Notes
  • Calls railway

What it does

Mg Railway DB Restore is an agent skill from modelguide/modelguide. Restore a PostgreSQL database backup to a Railway environment. Use when the user asks to "restore db", "load database", "restore backup to railway", "import db", or "restore db to environment".

Its SKILL.md is about 560 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 Databases, covering Database administration. It works with PostgreSQL. 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

  • The user asks to restore db
  • Restore backup to railway
  • Restore db to environment

Example prompts

  • “restore db”
  • “load database”
  • “restore backup to railway”
  • “/mg-railway-db-restore”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. List available backups (if user didn't specify a file)
  2. Link to the correct project and environment using Railway MCP link-environment tool
  3. Restore the backup — credentials piped from Railway CLI (never write credential values in commands)
  4. Report success or any errors to the user.

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:

    • railway

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

  • Network

    No URLs in SKILL.md.

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Mg Railway DB Restore loads about 562 tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 165 words of instructions outside code blocks.

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

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). 165 words, ~562 tokens.

Download SKILL.mdSave it as .claude/skills/mg-railway-db-restore/SKILL.md (or your agent's skills folder).
name
mg-railway-db-restore
description
Restore a PostgreSQL database backup to a Railway environment. Use when the user asks to "restore db", "load database", "restore backup to railway", "import db", or "restore db to environment".

Railway DB Restore

Restore a local PostgreSQL backup file to a Railway environment.

Inputs

Ask the user if not provided:

  • project — Railway project name
  • environment — Railway destination environment name (e.g., demo-upgrade, staging)
  • backup file — Path to the .dump.gz file (check .claude/local/ for available backups)

Procedure

  1. List available backups (if user didn't specify a file):

    bash
    ls -lh <project-root>/.claude/local/*.dump.gz
  2. Link to the correct project and environment using Railway MCP link-environment tool:

    • workspacePath: <project-root>
    • environmentName: <environment>
  3. Restore the backup — credentials piped from Railway CLI (never write credential values in commands):

    bash
    VARS=$(railway variables -s Postgres -e <environment> --kv 2>/dev/null) && \
    export PGPASSWORD=$(echo "$VARS" | grep '^PGPASSWORD=' | cut -d= -f2-) && \
    PGUSER=$(echo "$VARS" | grep '^PGUSER=' | cut -d= -f2-) && \
    PGDATABASE=$(echo "$VARS" | grep '^PGDATABASE=' | cut -d= -f2-) && \
    DB_URL=$(echo "$VARS" | grep '^DATABASE_PUBLIC_URL=' | cut -d= -f2-) && \
    PGHOST=$(echo "$DB_URL" | sed 's|postgresql://[^@]*@||;s|:.*||') && \
    PGPORT=$(echo "$DB_URL" | sed 's|.*:||;s|/.*||') && \
    gunzip -c <backup-file-path> | pg_restore --clean --if-exists --no-owner --no-acl \
      -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE"

    This reads credentials from railway variables into shell vars at runtime — no secrets ever appear in the command text.

  4. Report success or any errors to the user.

Notes

  • Railway runs PostgreSQL 17 — if local pg_restore version is too old, use the one from postgresql@17 homebrew package
  • --clean --if-exists drops existing objects before recreating (safe for existing databases)
  • --no-owner --no-acl ensures compatibility across environments
  • This does NOT run Drizzle migrations — run migrations separately if schema changes are needed

© 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-railway-db-restore of modelguide/modelguide.

Open the folder on GitHubat commit 554caa0

Compare with similar skills

Mg Railway 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 Railway DB Restore compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mg Railway DB Restore this skillmodelguide/modelguide108—~562Automated safety check: PassMIT
DB AdminEliasOulkadi/shokunin114—~2kAutomated safety check: NotesMIT
Postgres Expertcin12211/orca-q224—~5.5kAutomated safety check: PassMIT
Postgres ExpertRightNow-AI/openfang18k—~830Automated safety check: PassApache-2.0
Optimizing Database Connection Poolingjeremylongshore/tons-of-skills-marketplace2.8k—~1.9kAutomated safety check: PassMIT
Postgres Optimizationrohitg00/awesome-claude-code-toolkit2.7k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • DB Admin

    EliasOulkadi/shokunin

    PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

    114 GitHub stars~2k tokensUpdated 5 days ago
    DatabasesAuto-check: notes
  • Postgres Expert

    cin12211/orca-q

    PostgreSQL query optimization, JSONB operations, advanced indexing strategies, partitioning, connection management, and database administration.

    224 GitHub stars~5.5k tokensUpdated 18 days ago
    DatabasesAuto-check passed
  • Postgres Expert

    RightNow-AI/openfang

    PostgreSQL expert for query optimization, indexing, extensions, and database administration

    18k GitHub stars~830 tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Optimizing Database Connection Pooling

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with connection management.

    2.8k GitHub stars~1.9k tokensUpdated today
    DatabasesAuto-check passed
  • Postgres Optimization

    rohitg00/awesome-claude-code-toolkit

    PostgreSQL optimization including indexes, query plans, partitioning, JSONB operations, and connection pooling

    2.7k GitHub stars~1.1k tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Digoal

    digoal/blog

    Portable digital employee distilled from digoal's personal blog for PostgreSQL, PolarDB, DuckDB, AI+database, vector/RAG, database operations, source-code reading, technical content creation…

    8.6k GitHub stars~2.2k tokensUpdated yesterday
    DatabasesAuto-check passed

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 Local DB Restore

    modelguide/modelguide

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

    108 GitHub stars~645 tokensUpdated 3 mo ago
    Auto-check passed
  • 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 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

Works with

Categories

Questions about Mg Railway DB Restore

What does Mg Railway DB Restore do?

Restore a PostgreSQL database backup to a Railway environment. Mg Railway DB Restore is an agent skill from modelguide/modelguide. Restore a PostgreSQL database backup to a Railway environment.

When should I use Mg Railway DB Restore?

Mg Railway DB Restore fits situations like: the user asks to restore db; restore backup to railway; restore db to environment.

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

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

How do I install Mg Railway DB Restore in Codex?

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

Can I use Mg Railway 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-railway-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-railway-db-restore, .gemini/skills/mg-railway-db-restore, .github/skills/mg-railway-db-restore and .opencode/skills/mg-railway-db-restore in your project.

What does Mg Railway DB Restore need to run?

Going by SKILL.md and its folder, Mg Railway DB Restore needs the command-line tools its instructions call (railway).

Does Mg Railway DB Restore access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mg Railway 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 Railway DB Restore use?

Mg Railway 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 Railway DB Restore use?

About 562 tokens (SKILL.md is roughly 2.2k 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 Railway DB Restore?

Skills that share tags, products or a category with Mg Railway DB Restore: DB Admin (EliasOulkadi/shokunin, 114 stars), Postgres Expert (cin12211/orca-q, 224 stars), Postgres Expert (RightNow-AI/openfang, 18k stars) and Optimizing Database Connection Pooling (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mg Railway 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.