Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu48k · #5284

neon-postgres-branches

Skill này làm gì

Công cụ này giúp bạn tạo 'branch' (bản sao tách biệt) trong Neon Postgres. Các branch này hữu ích để thử nghiệm thay đổi hoặc phát triển tính năng mới mà không ảnh hưởng đến cơ sở dữ liệu chính.

Khi nào nên dùng

  • ✓Khi thử nghiệm cách các thay đổi (migration) hoạt động với dữ liệu thật.
  • ✓Khi tạo một môi trường riêng để thử nghiệm mà không đụng đến cơ sở dữ liệu chính.
  • ✓Khi làm việc với dữ liệu nhạy cảm và chỉ cần cấu trúc (schema) chứ không cần dữ liệu.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/neon-postgres-branches/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/neon-postgres-branches/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn tạo một branch để thử nghiệm migration cơ sở dữ liệu với dữ liệu production.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ trước tiên quyết định loại branch phù hợp nhất với bạn (có dữ liệu thật hoặc chỉ có cấu trúc). Sau đó, nó dùng các công cụ như Neon CLI hoặc MCP để tạo branch mới cho bạn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Neon Postgres Branching

When to Use

Use 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...

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.

  • Normal branch for realistic migration and query testing with real data.
  • Schema-only branch (Beta) for sensitive data workflows where structure is needed without copying rows.

Branch Type Decision

Use this decision rule first:

  1. If the user wants to test complex migrations, performance, or behavior against production-like data, choose a normal branch.
  2. If the user needs to avoid copying sensitive data, choose a schema-only branch.

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?"

Tool Selection: CLI or MCP

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

Selection order

  1. Check MCP first in MCP-enabled environments:
    • If Neon MCP tools are available and authenticated (for example, listing projects works), use MCP.
  2. If MCP is unavailable or not authenticated, check CLI:
    • Run neon --version to confirm CLI is installed.
    • Run neon projects list to confirm auth/context.
  3. If CLI is missing, direct installation via quickstart.
  4. If CLI is installed but not authenticated, guide the user through neon auth (or API key auth), then continue.
  5. If both MCP and CLI paths are unsuccessful, use the Neon REST API:

MCP branch flow

  1. Choose normal vs schema-only based on data sensitivity and migration-testing goals.
  2. Use branch tools (for example, create_branch) to create the branch.
  3. Validate with read tools (for example, describe_branch).
  4. For migration workflows, prefer branch-based migration flows before applying to main.

Create a Normal Branch (Preferred for Real-Data Migration Testing)

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

Steps

  1. Use MCP if already available/authenticated; otherwise verify CLI with neon --version.
  2. Ensure project context is set (neon set-context --project-id <your-project-id>) or include --project-id on commands.
  3. Create branch:
neon branches create \
  --name <branch-name> \
  --parent <parent-branch-id-or-name> \
  --expires-at 2026-12-15T18:02:16Z
  1. Optionally fetch a connection string for the new branch:
neon connection-string <branch-name>

Create a Schema-Only Branch (Beta, Sensitive Data)

Use this when users must not copy production rows into the test branch.

Link: https://neon.com/docs/guides/branching-schema-only.md

Steps

  1. Use MCP if already available/authenticated; otherwise verify CLI with neon --version.
  2. Create schema-only branch:
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:

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

Beta Support Guidance (Mandatory)

Schema-only branching is in Beta. If users report unexpected behavior, errors, or missing capabilities:

  1. Ask them to share feedback in the Neon Console:
  2. Recommend opening a support conversation in the Neon Discord:

Reset from parent

Use this when a child branch has drifted and the user wants a clean refresh from the parent branch's latest schema and data.

…

Câu hỏi thường gặp

Khác biệt giữa branch thông thường và branch 'chỉ có schema' là gì?

Branch thông thường sao chép dữ liệu thật để kiểm thử đầy đủ. Branch 'chỉ có schema' chỉ sao chép cấu trúc cơ sở dữ liệu (bảng, cột), phù hợp với dữ liệu nhạy cảm.

Công cụ quyết định dùng Neon CLI hay MCP bằng cách nào?

Nó ưu tiên dùng MCP trước nếu MCP có sẵn và đã được cấu hình. Nếu không, nó kiểm tra xem Neon CLI đã được cài và cấu hình chưa rồi dùng công cụ đó.

Điều gì xảy ra nếu tôi chưa cài Neon CLI?

Công cụ sẽ hướng dẫn bạn cài đặt và thiết lập Neon CLI để bạn có thể tạo branch.

Chi tiết

Mô tả gốc của tác giả

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.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5284
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự