neon-postgres-branches

Create and manage Neon Postgres branches for migration testing and isolated development environments.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/zomeru/zomlab --skill neon-postgres-branches-zomeru
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neon-postgres-branches
Source: https://github.com/zomeru/zomlab/tree/main/.agents/skills/neon-postgres-branches
Command: npx skills add https://github.com/zomeru/zomlab --skill neon-postgres-branches-zomeru

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing database migrations against production data is risky, and copying sensitive data into test environments creates compliance problems. This Skill guides you through choosing and creating the right Neon branch type so you can validate schema changes safely without touching production. ## Core Features & Use Cases - Branch Type Selection: Decide between normal branches (full data copy for realistic migration testing) and schema-only branches (structure without sensitive rows) based on your data sensitivity needs. - CLI and MCP Workflows: Create branches via the Neon CLI by default, with Neon MCP server and REST API fallbacks when the CLI is unavailable. - Reset from Parent: Refresh a drifted child branch with the parent's latest schema and data, with optional backup branch preservation. - CI/CD Patterns: Apply branch-per-PR, branch-per-test-run, and ephemeral lifecycle patterns with expiration and declarative neon.ts configuration. - Use Case: You need to test a risky migration before merging. Create a normal branch from main with an expiration date, run your migration against production-like data, and let the branch auto-expire after validation. ## Quick Start Ask the AI to create a Neon branch for testing your migration, specifying whether you need realistic production data or only the schema structure.

Frequently Asked Questions about neon-postgres-branches

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Neon branch for testing migrations?▼

Create a normal Neon branch with `neon branches create --name <name> --parent <parent> --expires-at <timestamp>` after verifying the CLI with `neon --version`. Normal branches copy production-like data, which exposes edge cases that seed scripts miss during migration testing.

What is a schema-only branch in Neon?▼

A schema-only branch clones only the database structure without copying any rows, created with the `--schema-only` flag on `neon branches create`. It is in Beta and designed for compliance workflows where production data must not be duplicated into test environments.

Should I use the Neon CLI or Neon MCP server for branching?▼

Default to the Neon CLI, verifying it with `neon --version` and `neon projects list`. Switch to the Neon MCP server only when the CLI is unavailable, cannot be authenticated, or is explicitly requested, and fall back to the Neon REST API if neither works.

How do I reset a Neon branch from its parent?▼

Run `neon branches reset <id|name> --parent --preserve-under-name <backup-name>` to replace the child branch with the parent's latest state. Only child branches can be reset, and reset is blocked if the target branch has children of its own.

Can Neon branches expire automatically in CI pipelines?▼

Yes, set `--expires-at` on branch creation or configure `ttl` declaratively in a `neon.ts` file using `@neon/config`. This supports ephemeral patterns like branch-per-PR and branch-per-test-run, preventing old branches from accumulating storage costs.

Why can't I reset a schema-only branch from its parent?▼

Schema-only branches are independent root branches with no parent and no shared history, so reset-from-parent does not apply to them. Root branches and schema-only root branches are excluded from the reset operation by design.