db-branching

db-branching is a skill for Claude Code from MadAppGang/magus. It costs 43 tokens per session (4,340 once invoked), scanned A, original, MIT.

A database-branching guide that creates an isolated Neon, Turso, or Supabase database for each Git worktree, a separate working copy of a repository.

In plain words
What is it for?
Use it when a worktree changes database schemas, models, columns, indexes, or migrations, and when you need to test those changes safely in isolation.
Why use it?
It prevents schema changes in one feature branch from affecting production or other branches.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool.

Part of the dev plugin — 18 skills, 14 commands, 13 agents shipped together

Good fit Use it when a worktree changes database schemas, models, columns, indexes, or migrations, and when you need to test those changes safely in isolation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/madappgang/magus/db-branching
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 MadAppGang/magus --skill db-branching
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/magus

Made for: Claude Code.

Or install dev, the plugin that ships this one along with the rest of its 18 skills, 14 commands, 13 agents.

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 db-branching

README.md
[![agentmods](https://agentmods.dev/badge/skills/madappgang/magus/db-branching/github.svg)](https://agentmods.dev/skills/madappgang/magus/db-branching)
Your own site
<a href="https://agentmods.dev/skills/madappgang/magus/db-branching"><img src="https://agentmods.dev/badge/skills/madappgang/magus/db-branching/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 db-branching

Your own site · 80×15
<a href="https://agentmods.dev/skills/madappgang/magus/db-branching"><img src="https://agentmods.dev/badge/skills/madappgang/magus/db-branching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,340 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
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 11 findings, 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 49
    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.
  • high Privilege Escalation · line 51
    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.
  • high Privilege Escalation · line 53
    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.
  • high Privilege Escalation · line 171
    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.
  • high Privilege Escalation · line 174
    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.
  • high Privilege Escalation · line 175
    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.
  • high Privilege Escalation · line 180
    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.
  • high Privilege Escalation · line 183
    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.
  • medium MCP Rug Pull · line 219
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 220
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 221
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00043 $0.04340
Opus 5 $0.00022 $0.02170
Sonnet 5 $0.00009 $0.00868
Haiku 4.5 $0.00004 $0.00434

Measured 7d ago against content hash 9c9cb502ae31, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

db-branching 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 7d 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.

plugins/dev/skills/backend/db-branching/SKILL.md · 575 lines

How it starts

The opening of the file, as written. The whole thing — 575 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Branching for Worktrees

Purpose: Automatically create and manage database branches when working with git worktrees that involve schema changes. Each worktree gets its own isolated database fork, preventing schema modifications from hitting production.

Supported Providers

Provider Database Branch Speed ORM Support Integration
Neon (recommended) PostgreSQL Instant (ms) Prisma, Drizzle, TypeORM, Django MCP tools (native)
Turso libSQL/SQLite Near-instant Drizzle, libSQL clients CLI (turso)
Supabase PostgreSQL Seconds Prisma, Drizzle, TypeORM, Django CLI (supabase)

When to Use

  • Creating a worktree that will modify schema files (Prisma, Drizzle, raw SQL migrations)
  • Adding new database models, columns, or indexes in a feature branch
  • Testing migrations in isolation before applying to production
  • Running multiple feature branches that each need different schemas
  • Any /dev:worktree create where schema changes are anticipated

When NOT to Use

  • Worktrees that only modify application code (no schema changes)
  • Quick bug fixes that don't touch the database
  • Read-only database work (queries, reports)
  • Projects using databases without branching support

Provider Detection

Auto-detect the provider from the project's .env file:

Pattern in *_DATABASE_URL Provider Action
neon.tech Neon Use MCP tools (preferred)
turso.io or libsql:// Turso Use turso CLI
supabase.co Supabase Use supabase CLI
Other hosts None Skip branching, warn user
# Detection logic
if grep -q "neon.tech" .env 2>/dev/null; then
  PROVIDER="neon"
elif grep -q "turso.io\|libsql://" .env 2>/dev/null; then
  PROVIDER="turso"
elif grep -q "supabase.co" .env 2>/dev/null; then
  PROVIDER="supabase"
else
  PROVIDER="none"
fi

Read the full file on GitHub · 575 lines

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. 7d ago First seen · 575 lines · 43 tokens per session scan A 9c9cb502ae31

Subscribe to this mod's changes

db-branching is a skill published in the GitHub repository MadAppGang/magus (9 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 4,340 once invoked, about $0.0002 per session on Opus 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-09-04.