Install any skill in seconds. Free to start, no credit card required.
Get Started Free →The outcome of this skill should be a created Neon branch (or a clear, actionable next step if creation cannot proceed).
.claude/skills/neon-postgres-branches/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 140% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 86% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 125% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 394% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 183% | 0% |
FIRST: Use the parent neon skill for a Neon overview, getting started with Neon, Neon development best practices, and more.
If the neon skill is not installed, fetch it from https://neon.com/docs/ai/skills/neon/SKILL.md or install it with:
bashnpx skills add neondatabase/agent-skills --skill neon
Outcome: a created Neon branch — or a clear, actionable next step if creation cannot proceed. Choose the correct branch type, then execute branch creation with the CLI (or MCP where the CLI isn't usable).
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?"
Support both the Neon CLI and the Neon MCP server, but default to the CLI. Use MCP only when the CLI is unavailable or blocked in your environment, cannot be authenticated, or the user explicitly asks for MCP.
neon --version to confirm the CLI is installed.neon projects list to confirm auth/context.neon 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
neon --version, and fall back to MCP only if the CLI isn't usable.neon set-context --project-id <your-project-id>) or include --project-id on commands.bash neon branches create \ --name <branch-name> \ --parent <parent-branch-id-or-name> \ --expires-at 2026-12-15T18:02:16Z
bash neon 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
neon --version, and fall back to MCP only if the CLI isn't usable.bash neon 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 --project-id:
bash neon 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
bashneon branches reset <id|name> --parent --preserve-under-name <backup-branch-name>
If project context is not already set, include the project ID:
bashneon 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:
bashneon 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?"neon.ts)Beyond creating branches imperatively (CLI / MCP / API above), you can program what configuration new branches receive declaratively in neon.ts — Neon's infrastructure-as-code file (see the neon skill for the full reference). The branch property is a function of the branch being evaluated that returns its settings, so every branch born from your project gets a consistent lifecycle and compute profile without per-branch flags.
bashnpm i @neon/config
typescript// neon.ts import { defineConfig } from "@neon/config/v1"; export default defineConfig({ branch: (branch) => { if (branch.exists) return {}; // never reconcile existing branches if (branch.isDefault) return { protected: true }; if (branch.name.startsWith("preview/") || branch.name.startsWith("dev")) { return { parent: "main", ttl: "7d", // ephemeral: auto-expire 7 days after creation (max 30d) postgres: { computeSettings: { autoscalingLimitMinCu: 0.25, // scale to zero autoscalingLimitMaxCu: 1, // keep throwaway branches cheap suspendTimeout: "5m", }, }, }; } return {}; }, });
The closure receives a read-only descriptor of the target branch — name, exists, isDefault, parentId, and more — and returns the tuning to apply: parent, ttl (auto-expiry), protected, and postgres.computeSettings. This is the declarative complement to the Ephemeral lifecycle hygiene and per-PR / per-test patterns above: instead of remembering --expires-at on every neon branches create, the TTL and compute profile live in version control and apply to every matching branch.
Because neon checkout applies this policy when it creates a branch, a fresh preview/* or dev-* branch comes up already expiring and scaled-to-zero. Checking out an _existing_ branch doesn't reconcile it — run neon deploy (alias for neon config apply) to apply changes to a branch that already exists.
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:
neon --version; MCP only if the CLI isn't usable).neon branches create --name migration-test --parent main --expires-at 2026-12-15T18:02:16Zneon connection-string migration-testUser input: "We cannot copy production data because of compliance."
Agent output shape:
neon --version; MCP only if the CLI isn't usable).neon branches create --name compliance-dev --parent main --schema-only --project-id <your-project-id> --expires-at 2026-12-15T18:02:16Z| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 11,491 | 10,348 | -10% | 1 | 1 | 0% | 1,983 | 4,761 | +140% | 0 | 0 | — |
case-02 | fail→pass | 14,485 | 8,006 | -45% | 1 | 1 | 0% | 2,614 | 4,868 | +86% | 0 | 0 | — |
case-03 | fail→pass | 11,201 | 6,937 | -38% | 1 | 1 | 0% | 2,005 | 4,518 | +125% | 0 | 0 | — |
case-04 | fail→pass | 5,192 | 7,571 | +46% | 1 | 1 | 0% | 967 | 4,780 | +394% | 0 | 0 | — |
case-05 | fail→pass | 9,185 | 5,515 | -40% | 1 | 1 | 0% | 1,530 | 4,332 | +183% | 0 | 0 | — |
case-06 | fail→fail | 12,111 | 9,662 | -20% | 1 | 1 | 0% | 2,238 | 5,215 | +133% | 0 | 0 | — |
case-07 | fail→pass | 8,718 | 3,573 | -59% | 1 | 1 | 0% | 1,405 | 3,851 | +174% | 0 | 0 | — |
case-08 | fail→pass | 10,022 | 5,262 | -47% | 1 | 1 | 0% | 1,791 | 4,232 | +136% | 0 | 0 | — |
case-09 | fail→pass | 29,083 | 4,759 | -84% | 1 | 1 | 0% | 2,765 | 4,200 | +52% | 0 | 0 | — |
case-10 | fail→pass | 15,730 | 4,918 | -69% | 1 | 1 | 0% | 3,113 | 4,295 | +38% | 0 | 0 | — |
case-11 | fail→pass | 11,439 | 4,172 | -64% | 1 | 1 | 0% | 1,879 | 4,106 | +119% | 0 | 0 | — |
case-12 | fail→pass | 8,581 | 4,096 | -52% | 1 | 1 | 0% | 1,472 | 3,981 | +170% | 0 | 0 | — |
case-13 | fail→pass | 12,344 | 6,409 | -48% | 1 | 1 | 0% | 1,959 | 4,293 | +119% | 0 | 0 | — |
case-14 | fail→pass | 13,476 | 7,900 | -41% | 1 | 1 | 0% | 2,264 | 4,780 | +111% | 0 | 0 | — |
case-15 | pass→pass | 5,938 | 5,058 | -15% | 1 | 1 | 0% | 1,049 | 4,252 | +305% | 0 | 0 | — |
case-16 | pass→pass | 17,869 | 10,159 | -43% | 1 | 1 | 0% | 3,004 | 5,041 | +68% | 0 | 0 | — |
case-17 | pass→pass | 14,833 | 8,262 | -44% | 1 | 1 | 0% | 2,342 | 4,820 | +106% | 0 | 0 | — |
case-18 | pass→pass | 11,956 | 7,319 | -39% | 1 | 1 | 0% | 2,348 | 4,788 | +104% | 0 | 0 | — |
case-19 | pass→pass | 9,075 | 5,334 | -41% | 1 | 1 | 0% | 1,599 | 4,287 | +168% | 0 | 0 | — |
case-20 | pass→fail | 16,726 | 12,068 | -28% | 1 | 1 | 0% | 2,750 | 5,483 | +99% | 0 | 0 | — |
case-21 | pass→pass | 13,278 | 11,117 | -16% | 1 | 1 | 0% | 2,440 | 5,272 | +116% | 0 | 0 | — |
case-22 | pass→pass | 13,829 | 9,620 | -30% | 1 | 1 | 0% | 2,445 | 4,892 | +100% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +55 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/23/2026 | +60% |
Other measured skills in the registry, with their headline benchmark lift.