1. Habit
  2. Skills
  3. Neon Postgres Branches skill
neondatabase · 29K installs

Neon Postgres Branches skill
Runs by itself, pull request opened.

Each PR gets its own database.

Install the Neon Postgres Branches skill and make it a habit: follow https://gethabit.dev/skills/neondatabase/neon-postgres-branches.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

29K installs103 starsApache-2.0 licenceSource on GitHub ↗

Neon Postgres Branches

by neondatabase · 29K installs

The skill

The neon postgres branches skill helps developers pick and create the right Neon branch, normal or schema-only, reset branches from parent and set branch lifecycles for CI and pull requests.

Only when you ask.

The habit

Each PR gets its own database.

↻ Runs by itselfpull request opened

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleOne branch per pull request per run, one retry on create.

  1. 01

    Load parent skill

    The agent uses the parent neon skill first for the Neon overview.

  2. 02

    Choose type

    Normal branch for real-data migration tests, schema-only branch when data is sensitive; it asks if unclear.

  3. 03

    Check the CLI

    Run neon --version and neon projects list, and fall back to Neon MCP only if the CLI cannot be used.

  4. 04

    Create branch

    Run neon branches create with --name, --parent and --expires-at, plus --schema-only when needed.

  5. 05

    Validate

    Fetch the branch with neon connection-string or describe_branch.

  6. 06

    Ask about .env

    Ask before writing the new DATABASE_URL and never overwrite a key without your yes.

  7. 07

    Clean up

    On PR close, delete the branch listed in the run log.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the Neon Postgres Branches skill helps.

Use it when

  • ✓ You test risky migrations on real data
  • ✓ Production data is sensitive
  • ✓ You want a database branch per pull request

Skip it when

  • – Your database is not on Neon
  • – You need point-in-time recovery

Questions

Neon Postgres Branches skill, answered.

Can a schema-only branch be reset from parent?

No. Schema-only branches are independent root branches, so reset from parent does not apply.

Can new branches expire on their own?

Yes. Set --expires-at on create, or a ttl for matching branches in neon.ts.

How do I install the Neon Postgres Branches skill?

Copy the prompt at the top into your agent. It installs the skill from neondatabase/agent-skills and sets up the habit. Or run npx skills add neondatabase/agent-skills --skill neon-postgres-branches.

Is the Neon Postgres Branches skill free?

Yes. It is published under Apache-2.0. Habit is free too.

Neon Postgres Branches. Now as a habit.

Install the Neon Postgres Branches skill and make it a habit: follow https://gethabit.dev/skills/neondatabase/neon-postgres-branches.md

  • Free
  • No account
  • Undo in one line

All neondatabase skills →More ops skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by neondatabase, published under Apache-2.0. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.