skills/neon-postgres-branches/SKILL.md
Choose and create the right Neon branch type for testing and development. Use when users ask about Neon branching, migration testing with real data, isolated test environments, schema-only branch workflows for sensitive data, or branch creation via Neon CLI or Neon MCP. Triggers include "Neon branch", "test migrations safely", "branch production data", "schema-only branch", "reset branch" and "sensitive data testing".
npx skillsauth add neondatabase/agent-skills neon-postgres-branchesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The outcome of this skill should be a created Neon branch (or a clear, actionable next step if creation cannot proceed). Choose the correct branch type, then execute branch creation via MCP or CLI.
Use this decision rule first:
If the request is ambiguous, ask one clarifying question: "Do you need realistic data for testing, or only schema structure because the data is sensitive?"
Always support both Neon CLI and Neon MCP server. Prefer the tool the user already has installed and authenticated.
MCP link: https://neon.com/docs/ai/neon-mcp-server.md CLI link: https://neon.com/docs/reference/cli-quickstart
neonctl --version to confirm CLI is installed.neonctl projects list to confirm auth/context.neonctl auth (or API key auth), then continue.create_branch) to create the branch.describe_branch).Use this when the user needs realistic testing conditions. Real production-like data can expose edge cases your seed or data migration scripts miss, which helps catch migration issues before going live.
Link: https://neon.com/docs/introduction/branching.md
neonctl --version.neonctl set-context --project-id <your-project-id>) or include --project-id on commands.neonctl branches create \
--name <branch-name> \
--parent <parent-branch-id-or-name> \
--expires-at 2026-12-15T18:02:16Z
neonctl connection-string <branch-name>
Use this when users must not copy production rows into the test branch.
Link: https://neon.com/docs/guides/branching-schema-only.md
neonctl --version.neonctl branches create \
--name <schema-only-branch-name> \
--parent <parent-branch-id-or-name> \
--schema-only \
--expires-at 2026-12-15T18:02:16Z
If multiple projects exist, include:
neonctl branches create \
--name <schema-only-branch-name> \
--parent <parent-branch-id-or-name> \
--schema-only \
--project-id <your-project-id> \
--expires-at 2026-12-15T18:02:16Z
Schema-only branching is in Beta. If users report unexpected behavior, errors, or missing capabilities:
Use this when a child branch has drifted and the user wants a clean refresh from the parent branch's latest schema and data.
Link: https://neon.com/docs/guides/reset-from-parent.md
neonctl branches reset <id|name> --parent --preserve-under-name <backup-branch-name>
If project context is not already set, include project ID:
neonctl branches reset <id|name> --parent --preserve-under-name <backup-branch-name> --project-id <project-id>
--preserve-under-name keeps the pre-reset state as a backup branch for rollback, but adds one extra branch to clean up later.
Optional context setup to avoid repeating --project-id:
neonctl set-context --project-id <project-id>
source_branch_id to the parent branch ID.If the user asks for process recommendations (not just a single command), suggest these:
After branch creation, ask whether the user wants to update local environment credentials to point at the new branch.
.env DATABASE_URL to this new branch connection string?"Common CI/CD use cases for Neon branches:
DATABASE_URL into the deployed app is hosting-provider-specific — see preview-branches-with-cloudflare, preview-branches-with-vercel, or preview-branches-with-fly for tested patterns.User input: "I need to test a risky migration against production-like data."
Agent output shape:
neonctl --version).neonctl branches create --name migration-test --parent main --expires-at 2026-12-15T18:02:16Zneonctl connection-string migration-testUser input: "We cannot copy production data because of compliance."
Agent output shape:
neonctl --version).neonctl branches create --name compliance-dev --parent main --schema-only --project-id <your-project-id> --expires-at 2026-12-15T18:02:16Ztools
Guides and best practices for working with Neon Serverless Postgres. Covers setup, connection methods, branching, autoscaling, scale-to-zero, read replicas, connection pooling, Neon Auth, and the Neon CLI, MCP server, REST API, TypeScript SDK, and Python SDK. Use when users ask about "Neon setup", "connect to Neon", "Neon project", "DATABASE_URL", "serverless Postgres", "Neon CLI", "neonctl", "Neon MCP", "Neon Auth", "@neondatabase/serverless", "@neondatabase/neon-js", "scale to zero", "Neon autoscaling", "Neon read replica", or "Neon connection pooling".
tools
Provision instant temporary Postgres databases via Claimable Postgres by Neon (neon.new) with no login, signup, or credit card. Supports REST API, CLI, and SDK. Use when users ask for a quick Postgres environment, a throwaway DATABASE_URL for prototyping/tests, or "just give me a DB now". Triggers include: "quick postgres", "temporary postgres", "no signup database", "no credit card database", "instant DATABASE_URL", "npx neon-new", "neon.new", "neon.new API", "claimable postgres API".
development
Diagnose and fix excessive Postgres egress (network data transfer) in a codebase. Use when a user mentions high database bills, unexpected data transfer costs, network transfer charges, egress spikes, "why is my Neon bill so high", "database costs jumped", SELECT * optimization, query overfetching, reduce Neon costs, optimize database usage, or wants to reduce data sent from their database to their application. Also use when reviewing query patterns for cost efficiency, even if the user doesn't explicitly mention egress or data transfer.
data-ai
--- name: score-eval disable-model-invocation: true --- Score the eval diff at $ARGUMENTS against the eval rubric. 1. Read the diff file at the path provided 2. Read the eval rubric at eval-rubric.md 3. Read the original fixture app in fixtures/hono-drizzle-app/ for comparison 4. For each problem P1-P5, answer the Detected? and Fixed? questions from the rubric as yes or no 5. Append a row to results.csv — fill in all fields you can determine from the diff and context. Leave fields you can't de