[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A703F7WVXQK8XF43FE0EE1":3,"skill-same:01M7A703F7WVXQK8XF43FE0EE1":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M7A703F7WVXQK8XF43FE0EE1","neon-postgres-branches",null,"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...","MHassan0000\u002FSkills","MHassan0000","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F224296448?v=4","01M7A14DTC1EZCRN04582533RD","Muhammad Hassan Yousaf","01M7A14DV10KTW8NHQTJPD08X0",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fneon-postgres-branches\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: neon-postgres-branches\ndescription: 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...\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills\u002Ftree\u002Fmain\u002Fskills\u002Fneon-postgres-branches\nsource_repo: neondatabase\u002Fagent-skills\nsource_type: official\ndate_added: 2026-07-01\nlicense: Apache-2.0\nlicense_source: https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills\u002Fblob\u002Fmain\u002FLICENSE\n---\n\n# Neon Postgres Branching\n## When to Use\n\nUse this skill when you need 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...\n\n\nThe outcome of this skill should be a created Neon branch (or a clear, actionable next step if creation cannot proceed).\nChoose the correct branch type, then execute branch creation via MCP or CLI.\n\n- **Normal branch** for realistic migration and query testing with real data.\n- **Schema-only branch (Beta)** for sensitive data workflows where structure is needed without copying rows.\n\n## Branch Type Decision\n\nUse this decision rule first:\n\n1. If the user wants to test complex migrations, performance, or behavior against production-like data, choose a **normal branch**.\n2. If the user needs to avoid copying sensitive data, choose a **schema-only branch**.\n\nIf the request is ambiguous, ask one clarifying question:\n\"Do you need realistic data for testing, or only schema structure because the data is sensitive?\"\n\n## Tool Selection: CLI or MCP\n\nAlways support both Neon CLI and Neon MCP server. Prefer the tool the user already has installed and authenticated.\n\nMCP link: https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fneon-mcp-server.md\nCLI link: https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fcli-quickstart\n\n### Selection order\n\n1. Check MCP first in MCP-enabled environments:\n   - If Neon MCP tools are available and authenticated (for example, listing projects works), use MCP.\n2. If MCP is unavailable or not authenticated, check CLI:\n   - Run `neon --version` to confirm CLI is installed.\n   - Run `neon projects list` to confirm auth\u002Fcontext.\n3. If CLI is missing, direct installation via quickstart.\n4. If CLI is installed but not authenticated, guide the user through `neon auth` (or API key auth), then continue.\n5. If both MCP and CLI paths are unsuccessful, use the Neon REST API:\n   - https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranching-neon-api.md\n\n### MCP branch flow\n\n1. Choose normal vs schema-only based on data sensitivity and migration-testing goals.\n2. Use branch tools (for example, `create_branch`) to create the branch.\n3. Validate with read tools (for example, `describe_branch`).\n4. For migration workflows, prefer branch-based migration flows before applying to main.\n\n## Create a Normal Branch (Preferred for Real-Data Migration Testing)\n\nUse this when the user needs realistic testing conditions.\nReal production-like data can expose edge cases your seed or data migration scripts miss, which helps catch migration issues before going live.\n\nLink: https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching.md\n\n### Steps\n\n1. Use MCP if already available\u002Fauthenticated; otherwise verify CLI with `neon --version`.\n2. Ensure project context is set (`neon set-context --project-id \u003Cyour-project-id>`) or include `--project-id` on commands.\n3. Create branch:\n\n```bash\nneon branches create \\\n  --name \u003Cbranch-name> \\\n  --parent \u003Cparent-branch-id-or-name> \\\n  --expires-at 2026-12-15T18:02:16Z\n```\n\n4. Optionally fetch a connection string for the new branch:\n\n```bash\nneon connection-string \u003Cbranch-name>\n```\n\n## Create a Schema-Only Branch (Beta, Sensitive Data)\n\nUse this when users must not copy production rows into the test branch.\n\nLink: https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranching-schema-only.md\n\n### Steps\n\n1. Use MCP if already available\u002Fauthenticated; otherwise verify CLI with `neon --version`.\n2. Create schema-only branch:\n\n```bash\nneon branches create \\\n  --name \u003Cschema-only-branch-name> \\\n  --parent \u003Cparent-branch-id-or-name> \\\n  --schema-only \\\n  --expires-at 2026-12-15T18:02:16Z\n```\n\nIf multiple projects exist, include:\n\n```bash\nneon branches create \\\n  --name \u003Cschema-only-branch-name> \\\n  --parent \u003Cparent-branch-id-or-name> \\\n  --schema-only \\\n  --project-id \u003Cyour-project-id> \\\n  --expires-at 2026-12-15T18:02:16Z\n```\n\n### Beta Support Guidance (Mandatory)\n\nSchema-only branching is in Beta. If users report unexpected behavior, errors, or missing capabilities:\n\n1. Ask them to share feedback in the Neon Console:\n   - https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fprojects?modal=feedback\n2. Recommend opening a support conversation in the Neon Discord:\n   - https:\u002F\u002Fdiscord.gg\u002F92vNTzKDGp\n\n## Reset from parent\n\nUse this when a child branch has drifted and the user wants a clean refresh from the parent branch's latest schema and data.\n\nLink: https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Freset-from-parent.md\n\n### What it does\n\n- Fully replaces the child branch schema and data with the parent's latest state.\n- Does not merge; local changes on the child branch are lost.\n- Keeps the same connection details, but active connections are briefly interrupted during reset.\n\n### When to recommend it\n\n- Development or staging branch is too far behind production.\n- User wants to start a new feature from a clean parent-aligned state.\n- Team wants to refresh staging from production for consistent testing baselines.\n\n### Hard constraints and blockers\n\n- Only child branches can be reset (root branches and schema-only root branches cannot be reset from parent).\n- If the target branch has children, reset is blocked until those child branches are removed.\n- After a parent branch is restored from snapshot, reset-from-parent may be unavailable for up to 24 hours.\n- Reset-from-parent always uses the current parent state; use Instant restore for point-in-time recovery needs.\n\n### CLI usage\n\n```bash\nneon branches reset \u003Cid|name> --parent --preserve-under-name \u003Cbackup-branch-name>\n```\n\nIf project context is not already set, include project ID:\n\n```bash\nneon branches reset \u003Cid|name> --parent --preserve-under-name \u003Cbackup-branch-name> --project-id \u003Cproject-id>\n```\n\n`--preserve-under-name` keeps the pre-reset state as a backup branch for rollback, but adds one extra branch to clean up later.\n\nOptional context setup to avoid repeating `--project-id`:\n\n```bash\nneon set-context --project-id \u003Cproject-id>\n```\n\n### Console and API usage\n\n- **Console:** Open the target child branch, then select **Reset from parent** from **Actions**.\n- **API:** Use the restore endpoint for the branch and set `source_branch_id` to the parent branch ID.\n\n## Notes and Caveats\n\n- Schema-only branches are for structure-only cloning and sensitive\u002Fcompliant data controls.\n- Schema-only branches are independent root branches (no parent branch and no shared history), so reset-from-parent does not apply.\n- For migration testing that depends on real-world row shapes, volumes, and edge cases, prefer normal branches.\n- Root branch allowances and per-branch storage limits can cap how many schema-only branches users can create.\n- If a user is unsure, default recommendation is:\n  - **Normal branch** for migration validation.\n  - **Schema-only branch** for compliance and privacy constraints.\n\n## Useful Workflow Patterns\n\nIf the user asks for process recommendations (not just a single command), suggest these:\n\n- **One branch per PR:** Create branch when PR opens, delete when merged\u002Fclosed, keep migration tests isolated.\n- **One branch per test run:** Create branch at pipeline start, run migrations\u002Ftests, delete at end for deterministic CI.\n- **One branch per developer:** Isolated dev environments with production-like shape; avoid team collisions on shared test data.\n- **PII-aware branching:** If production has sensitive data, derive dev\u002FPR branches from an anonymized branch or use schema-only branches.\n- **Ephemeral lifecycle hygiene:** Set branch expiration and automate cleanup so old branches do not accumulate avoidable storage\u002Fhistory cost.\n\n### Post-creation environment update prompt\n\nAfter branch creation, ask whether the user wants to update local environment credentials to point at the new branch.\n\n- Ask: \"Do you want me to update your `.env` `DATABASE_URL` to this new branch connection string?\"\n- If yes, write the new branch connection string to the requested env file\u002Fkey.\n- If no, leave credentials unchanged and share the connection string for manual use.\n- Never overwrite an existing env key without explicit confirmation.\n\n## Neon Infrastructure as Code (`neon.ts`)\n\nBeyond creating branches imperatively (CLI \u002F MCP \u002F 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.\n\n```bash\nnpm i @neon\u002Fconfig\n```\n\n```typescript\n\u002F\u002F neon.ts\nimport { defineConfig } from \"@neon\u002Fconfig\u002Fv1\";\n\nexport default defineConfig({\n  branch: (branch) => {\n    if (branch.exists) return {}; \u002F\u002F never reconcile existing branches\n    if (branch.isDefault) return { protected: true };\n    if (branch.name.startsWith(\"preview\u002F\") || branch.name.startsWith(\"dev\")) {\n      return {\n        parent: \"main\",\n        ttl: \"7d\", \u002F\u002F ephemeral: auto-expire 7 days after creation (max 30d)\n        postgres: {\n          computeSettings: {\n            autoscalingLimitMinCu: 0.25, \u002F\u002F scale to zero\n            autoscalingLimitMaxCu: 1, \u002F\u002F keep throwaway branches cheap\n            suspendTimeout: \"5m\",\n          },\n        },\n      };\n    }\n    return {};\n  },\n});\n```\n\nThe 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 \u002F 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.\n\nBecause `neon checkout` applies this policy when it **creates** a branch, a fresh `preview\u002F*` 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.\n\n## Branching in CI\u002FCD\n\nCommon CI\u002FCD use cases for Neon branches:\n\n- **Per-PR preview deployments:** Branch on PR open, deploy the preview against it, delete on close. Each PR gets an isolated database branch. Injecting the branch's `DATABASE_URL` into the deployed app is hosting-provider-specific — see [preview-branches-with-cloudflare](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fpreview-branches-with-cloudflare), [preview-branches-with-vercel](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fpreview-branches-with-vercel), or [preview-branches-with-fly](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fpreview-branches-with-fly) for tested patterns.\n- **Migration testing in CI:** Run risky schema changes against a branch with production-like data before merge.\n- **Schema diff visibility:** Use the [schema-diff GitHub Action](https:\u002F\u002Fgithub.com\u002Fmarketplace\u002Factions\u002Fneon-schema-diff-github-action) to auto-comment a DB-layer diff on the PR.\n\n## Examples\n\n### Example 1: Migration testing with realistic data\n\n**User input:** \"I need to test a risky migration against production-like data.\"\n\n**Agent output shape:**\n\n1. Recommend a normal branch and explain why.\n2. Share docs link: https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching\n3. Check the available\u002Fauthenticated tool path first (MCP, otherwise CLI with `neon --version`).\n4. Provide commands:\n   - `neon branches create --name migration-test --parent main --expires-at 2026-12-15T18:02:16Z`\n   - `neon connection-string migration-test`\n\n### Example 2: Sensitive data development workflow\n\n**User input:** \"We cannot copy production data because of compliance.\"\n\n**Agent output shape:**\n\n1. Recommend schema-only branch and explain why.\n2. Share docs link: https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranching-schema-only\n3. Check the available\u002Fauthenticated tool path first (MCP, otherwise CLI with `neon --version`).\n4. Provide command:\n   - `neon branches create --name compliance-dev --parent main --schema-only --project-id \u003Cyour-project-id> --expires-at 2026-12-15T18:02:16Z`\n5. Mention Beta support path:\n   - https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fprojects?modal=feedback\n   - https:\u002F\u002Fdiscord.gg\u002F92vNTzKDGp\n\n## Further reading\n\n- https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranch-expiration.md\n- https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fneon-github-integration.md\n- https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fneon-mcp-server.md\n- https:\u002F\u002Fneon.com\u002Fbranching\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream product or API scope.\n- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.\n- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n","# Neon Postgres Branching\n## When to Use\n\nUse this skill when you need 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...\n\n\nThe outcome of this skill should be a created Neon branch (or a clear, actionable next step if creation cannot proceed).\nChoose the correct branch type, then execute branch creation via MCP or CLI.\n\n- **Normal branch** for realistic migration and query testing with real data.\n- **Schema-only branch (Beta)** for sensitive data workflows where structure is needed without copying rows.\n\n## Branch Type Decision\n\nUse this decision rule first:\n\n1. If the user wants to test complex migrations, performance, or behavior against production-like data, choose a **normal branch**.\n2. If the user needs to avoid copying sensitive data, choose a **schema-only branch**.\n\nIf the request is ambiguous, ask one clarifying question:\n\"Do you need realistic data for testing, or only schema structure because the data is sensitive?\"\n\n## Tool Selection: CLI or MCP\n\nAlways support both Neon CLI and Neon MCP server. Prefer the tool the user already has installed and authenticated.\n\nMCP link: https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fneon-mcp-server.md\nCLI link: https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fcli-quickstart\n\n### Selection order\n\n1. Check MCP first in MCP-enabled environments:\n   - If Neon MCP tools are available and authenticated (for example, listing projects works), use MCP.\n2. If MCP is unavailable or not authenticated, check CLI:\n   - Run `neon --version` to confirm CLI is installed.\n   - Run `neon projects list` to confirm auth\u002Fcontext.\n3. If CLI is missing, direct installation via quickstart.\n4. If CLI is installed but not authenticated, guide the user through `neon auth` (or API key auth), then continue.\n5. If both MCP and CLI paths are unsuccessful, use the Neon REST API:\n   - https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranching-neon-api.md\n\n### MCP branch flow\n\n1. Choose normal vs schema-only based on data sensitivity and migration-testing goals.\n2. Use branch tools (for example, `create_branch`) to create the branch.\n3. Validate with read tools (for example, `describe_branch`).\n4. For migration workflows, prefer branch-based migration flows before applying to main.\n\n## Create a Normal Branch (Preferred for Real-Data Migration Testing)\n\nUse this when the user needs realistic testing conditions.\nReal production-like data can expose edge cases your seed or data migration scripts miss, which helps catch migration issues before going live.\n\nLink: https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching.md\n\n### Steps\n\n1. Use MCP if already available\u002Fauthenticated; otherwise verify CLI with `neon --version`.\n2. Ensure project context is set (`neon set-context --project-id \u003Cyour-project-id>`) or include `--project-id` on commands.\n3. Create branch:\n\n```bash\nneon branches create \\\n  --name \u003Cbranch-name> \\\n  --parent \u003Cparent-branch-id-or-name> \\\n  --expires-at 2026-12-15T18:02:16Z\n```\n\n4. Optionally fetch a connection string for the new branch:\n\n```bash\nneon connection-string \u003Cbranch-name>\n```\n\n## Create a Schema-Only Branch (Beta, Sensitive Data)\n\nUse this when users must not copy production rows into the test branch.\n\nLink: https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranching-schema-only.md\n\n### Steps\n\n1. Use MCP if already available\u002Fauthenticated; otherwise verify CLI with `neon --version`.\n2. Create schema-only branch:\n\n```bash\nneon branches create \\\n  --name \u003Cschema-only-branch-name> \\\n  --parent \u003Cparent-branch-id-or-name> \\\n  --schema-only \\\n  --expires-at 2026-12-15T18:02:16Z\n```\n\nIf multiple projects exist, include:\n\n```bash\nneon branches create \\\n  --name \u003Cschema-only-branch-name> \\\n  --parent \u003Cparent-branch-id-or-name> \\\n  --schema-only \\\n  --project-id \u003Cyour-project-id> \\\n  --expires-at 2026-12-15T18:02:16Z\n```\n\n### Beta Support Guidance (Mandatory)\n\nSchema-only branching is in Beta. If users report unexpected behavior, errors, or missing capabilities:\n\n1. Ask them to share feedback in the Neon Console:\n   - https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fprojects?modal=feedback\n2. Recommend opening a support conversation in the Neon Discord:\n   - https:\u002F\u002Fdiscord.gg\u002F92vNTzKDGp\n\n## Reset from parent\n\nUse this when a child branch has drifted and the user wants a clean refresh from the parent branch's latest schema and data.\n\nLink: https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Freset-from-parent.md\n\n### What it does\n\n- Fully replaces the child branch schema and data with the parent's latest state.\n- Does not merge; local changes on the child branch are lost.\n- Keeps the same connection details, but active connections are briefly interrupted during reset.\n\n### When to recommend it\n\n- Development or staging branch is too far behind production.\n- User wants to start a new feature from a clean parent-aligned state.\n- Team wants to refresh staging from production for consistent testing baselines.\n\n### Hard constraints and blockers\n\n- Only child branches can be reset (root branches and schema-only root branches cannot be reset from parent).\n- If the target branch has children, reset is blocked until those child branches are removed.\n- After a parent branch is restored from snapshot, reset-from-parent may be unavailable for up to 24 hours.\n- Reset-from-parent always uses the current parent state; use Instant restore for point-in-time recovery needs.\n\n### CLI usage\n\n```bash\nneon branches reset \u003Cid|name> --parent --preserve-under-name \u003Cbackup-branch-name>\n```\n\nIf project context is not already set, include project ID:\n\n```bash\nneon branches reset \u003Cid|name> --parent --preserve-under-name \u003Cbackup-branch-name> --project-id \u003Cproject-id>\n```\n\n`--preserve-under-name` keeps the pre-reset state as a backup branch for rollback, but adds one extra branch to clean up later.\n\nOptional context setup to avoid repeating `--project-id`:\n\n```bash\nneon set-context --project-id \u003Cproject-id>\n```\n\n### Console and API usage\n\n- **Console:** Open the target child branch, then select **Reset from parent** from **Actions**.\n- **API:** Use the restore endpoint for the branch and set `source_branch_id` to the parent branch ID.\n\n## Notes and Caveats\n\n- Schema-only branches are for structure-only cloning and sensitive\u002Fcompliant data controls.\n- Schema-only branches are independent root branches (no parent branch and no shared history), so reset-from-parent does not apply.\n- For migration testing that depends on real-world row shapes, volumes, and edge cases, prefer normal branches.\n- Root branch allowances and per-branch storage limits can cap how many schema-only branches users can create.\n- If a user is unsure, default recommendation is:\n  - **Normal branch** for migration validation.\n  - **Schema-only branch** for compliance and privacy constraints.\n\n## Useful Workflow Patterns\n\nIf the user asks for process recommendations (not just a single command), suggest these:\n\n- **One branch per PR:** Create branch when PR opens, delete when merged\u002Fclosed, keep migration tests isolated.\n- **One branch per test run:** Create branch at pipeline start, run migrations\u002Ftests, delete at end for deterministic CI.\n- **One branch per developer:** Isolated dev environments with production-like shape; avoid team collisions on shared test data.\n- **PII-aware branching:** If production has sensitive data, derive dev\u002FPR branches from an anonymized branch or use schema-only branches.\n- **Ephemeral lifecycle hygiene:** Set branch expiration and automate cleanup so old branches do not accumulate avoidable storage\u002Fhistory cost.\n\n### Post-creation environment update prompt\n\nAfter branch creation, ask whether the user wants to update local environment credentials to point at the new branch.\n\n- Ask: \"Do you want me to update your `.env` `DATABASE_URL` to this new branch connection string?\"\n- If yes, write the new branch connection string to the requested env file\u002Fkey.\n- If no, leave credentials unchanged and share the connection string for manual use.\n- Never overwrite an existing env key without explicit confirmation.\n\n## Neon Infrastructure as Code (`neon.ts`)\n\nBeyond creating branches imperatively (CLI \u002F MCP \u002F 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.\n\n```bash\nnpm i @neon\u002Fconfig\n```\n\n```typescript\n\u002F\u002F neon.ts\nimport { defineConfig } from \"@neon\u002Fconfig\u002Fv1\";\n\nexport default defineConfig({\n  branch: (branch) => {\n    if (branch.exists) return {}; \u002F\u002F never reconcile existing branches\n    if (branch.isDefault) return { protected: true };\n    if (branch.name.startsWith(\"preview\u002F\") || branch.name.startsWith(\"dev\")) {\n      return {\n        parent: \"main\",\n        ttl: \"7d\", \u002F\u002F ephemeral: auto-expire 7 days after creation (max 30d)\n        postgres: {\n          computeSettings: {\n            autoscalingLimitMinCu: 0.25, \u002F\u002F scale to zero\n            autoscalingLimitMaxCu: 1, \u002F\u002F keep throwaway branches cheap\n            suspendTimeout: \"5m\",\n          },\n        },\n      };\n    }\n    return {};\n  },\n});\n```\n\nThe 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 \u002F 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.\n\nBecause `neon checkout` applies this policy when it **creates** a branch, a fresh `preview\u002F*` 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.\n\n## Branching in CI\u002FCD\n\nCommon CI\u002FCD use cases for Neon branches:\n\n- **Per-PR preview deployments:** Branch on PR open, deploy the preview against it, delete on close. Each PR gets an isolated database branch. Injecting the branch's `DATABASE_URL` into the deployed app is hosting-provider-specific — see [preview-branches-with-cloudflare](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fpreview-branches-with-cloudflare), [preview-branches-with-vercel](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fpreview-branches-with-vercel), or [preview-branches-with-fly](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fpreview-branches-with-fly) for tested patterns.\n- **Migration testing in CI:** Run risky schema changes against a branch with production-like data before merge.\n- **Schema diff visibility:** Use the [schema-diff GitHub Action](https:\u002F\u002Fgithub.com\u002Fmarketplace\u002Factions\u002Fneon-schema-diff-github-action) to auto-comment a DB-layer diff on the PR.\n\n## Examples\n\n### Example 1: Migration testing with realistic data\n\n**User input:** \"I need to test a risky migration against production-like data.\"\n\n**Agent output shape:**\n\n1. Recommend a normal branch and explain why.\n2. Share docs link: https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching\n3. Check the available\u002Fauthenticated tool path first (MCP, otherwise CLI with `neon --version`).\n4. Provide commands:\n   - `neon branches create --name migration-test --parent main --expires-at 2026-12-15T18:02:16Z`\n   - `neon connection-string migration-test`\n\n### Example 2: Sensitive data development workflow\n\n**User input:** \"We cannot copy production data because of compliance.\"\n\n**Agent output shape:**\n\n1. Recommend schema-only branch and explain why.\n2. Share docs link: https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranching-schema-only\n3. Check the available\u002Fauthenticated tool path first (MCP, otherwise CLI with `neon --version`).\n4. Provide command:\n   - `neon branches create --name compliance-dev --parent main --schema-only --project-id \u003Cyour-project-id> --expires-at 2026-12-15T18:02:16Z`\n5. Mention Beta support path:\n   - https:\u002F\u002Fconsole.neon.tech\u002Fapp\u002Fprojects?modal=feedback\n   - https:\u002F\u002Fdiscord.gg\u002F92vNTzKDGp\n\n## Further reading\n\n- https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fbranch-expiration.md\n- https:\u002F\u002Fneon.com\u002Fdocs\u002Fguides\u002Fneon-github-integration.md\n- https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fneon-mcp-server.md\n- https:\u002F\u002Fneon.com\u002Fbranching\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream product or API scope.\n- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.\n- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n",{"name":5,"risk":24,"source":25,"license":15,"date_added":26,"description":7,"source_repo":27,"source_type":28,"license_source":29},"critical","https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills\u002Ftree\u002Fmain\u002Fskills\u002Fneon-postgres-branches",1782864000000,"neondatabase\u002Fagent-skills","official","https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills\u002Fblob\u002Fmain\u002FLICENSE","main","a4404a75dc81d6b7e58c5906b6aaffbcb5e84747","Claude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fneon-postgres-branches",0,"https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills","https:\u002F\u002Fgithub.com\u002FMHassan0000","https:\u002F\u002Fhassanyousaf.vercel.app","Full Stack Developer building web apps, SaaS, AI systems, and automations. Passionate about clean code, UI\u002FUX, backend systems, and turning ideas into products.","2026-08-07 20:42:05",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add MHassan0000\u002FSkills --skill neon-postgres-branches",{"tool":45,"command":46},"bunx","bunx skills add MHassan0000\u002FSkills --skill neon-postgres-branches",{"tool":48,"command":49},"pnpm","pnpm dlx skills add MHassan0000\u002FSkills --skill neon-postgres-branches","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fneon-postgres-branches\u002FSKILL.md",true,[],[54,62,69,76,84,92],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":58,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7AGBX58S04DX8DKKME8N311","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","MIT","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":58,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7AGBREE890608Z7YDMAKH27","stop-slop","Remove AI writing patterns from prose. Use when drafting, editing, or reviewing text to eliminate predictable AI tells and produce more human-like writing.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fstop-slop\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":58,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7AGAS972A2AN7Q5EW8HEAXK","ogilvy-copywriting","Apply David Ogilvy's advertising principles when writing or reviewing copy, headlines, product descriptions, landing pages, ads, emails, or any persuasive text. Use when the goal is copy that sells, not copy that wins awards. Covers positioning, headlines, promises, brand voice, long-form copy, and visual logic. Source: How to Create Advertising That Sells (1972) + Ogilvy on Advertising.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fogilvy\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AGAF12803G5JPVMK79AYJB","frontend-design","Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\u002FCSS layouts, or when styling\u002Fbeautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Ffrontend-design\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7AG88WWVWCGJY9WA9CH7EY4","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7AG7ZTNV7XQCWDQ9674FBYB","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[]]