neon-toolkit

Tạo và quản lý các cơ sở dữ liệu Neon tạm thời cho mục đích kiểm thử, đường ống CI/CD và môi trường phát triển biệt lập. Sử dụng khi xây dựng cơ sở dữ liệu tạm thời cho…

npx skills add https://github.com/neondatabase/ai-rules --skill neon-toolkit

Neon Toolkit Skill

Automates creation, management, and cleanup of temporary Neon databases using the Neon Toolkit.

When to Use

  • Creating fresh databases for each test run
  • Spinning up databases in CI/CD pipelines
  • Building isolated development environments
  • Rapid prototyping without manual setup

Not recommended for: Production databases, shared team environments, local-only development (use Docker), or free tier accounts (requires paid projects).

Code Generation Rules

When generating TypeScript/JavaScript code:

  • BEFORE generating import statements, check tsconfig.json for path aliases (compilerOptions.paths)
  • If path aliases exist (e.g., "@/": ["./src/"]), use them (e.g., import { x } from '@/lib/utils')
  • If NO path aliases exist or unsure, ALWAYS use relative imports (e.g., import { x } from '../../../lib/utils')
  • Verify imports match the project's configuration
  • Default to relative imports - they always work regardless of configuration

Reference Documentation

Primary Resource: See [neon-toolkit.mdc](https://raw.githubusercontent.com/neondatabase-labs/ai-rules/main/neon-toolkit.mdc) in project root for comprehensive guidelines including:

  • Core concepts (Organization, Project, Branch, Endpoint)
  • Installation and authentication setup
  • Database lifecycle management patterns
  • API client usage examples
  • Error handling strategies

Quick Setup

Installation

npm install @neondatabase/toolkit

Basic Usage

import { NeonToolkit } from '@neondatabase/toolkit';

const neon = new NeonToolkit({ apiKey: process.env.NEON_API_KEY! });

// Create ephemeral database
const db = await neon.createEphemeralDatabase();
console.log(`Database URL: ${db.url}`);

// Use the database...

// Cleanup
await db.delete();

Templates & Scripts

  • templates/toolkit-workflow.ts - Complete ephemeral database workflow
  • scripts/create-ephemeral-db.ts - Create a temporary database
  • scripts/destroy-ephemeral-db.ts - Clean up ephemeral database

Common Use Cases

Testing

const db = await neon.createEphemeralDatabase();
// Run tests with fresh database
await db.delete();

CI/CD Integration

export NEON_API_KEY=${{ secrets.NEON_API_KEY }}
npm test  # Uses ephemeral database

Related Skills

  • neon-serverless - For connecting to databases
  • neon-drizzle - For schema and migrations

Want best practices in your project? Run neon-plugin:add-neon-docs with parameter SKILL_NAME="neon-toolkit" to add reference links.

Thêm skills từ neondatabase

claimable-postgres
neondatabase
Cơ sở dữ liệu Postgres tức thì cho phát triển cục bộ, demo, tạo mẫu và môi trường thử nghiệm. Không yêu cầu tài khoản. Cơ sở dữ liệu hết hạn sau 72 giờ trừ khi được claim vào tài khoản Neon.
neon
neondatabase
Tổng quan về nền tảng Neon dành cho ứng dụng và tác nhân, bao gồm Postgres, Auth, Data API, và các dịch vụ mới: Object Storage, Compute Functions, và AI Gateway. Sử dụng bất cứ khi nào "Neon" được đề cập để có cái nhìn tổng quan về cách làm việc với Neon và cách bắt đầu. Nếu không, các khả năng riêng lẻ là các kích hoạt: "object storage" hoặc "S3-compatible storage", "serverless functions", "background jobs", hoặc "run code near my database", "AI gateway", "LLM proxy", "model routing", hoặc "call an LLM" →...
apidatabasedevelopment
plugin-manager
neondatabase
Quản lý cấu trúc và cấu hình plugin cho kho lưu trữ này trên cả Cursor và Claude Code. Sử dụng khi tạo, cập nhật hoặc xem xét các thư mục plugin…
skill-creator
neondatabase
Hướng dẫn tạo kỹ năng hiệu quả. Kỹ năng này nên được sử dụng khi người dùng muốn tạo một kỹ năng mới (hoặc cập nhật kỹ năng hiện có) để mở rộng khả năng của Claude…
using-neon
neondatabase
Hướng dẫn và các phương pháp tốt nhất khi làm việc với Neon Serverless Postgres. Bao gồm bắt đầu, phát triển cục bộ với Neon, chọn phương thức kết nối, Neon…
neon-js-react
neondatabase
Thiết lập đầy đủ Neon SDK với xác thực VÀ truy vấn cơ sở dữ liệu trong các ứng dụng React (Vite, CRA). Tạo client có kiểu, sinh kiểu cơ sở dữ liệu, và cấu hình…
postgres-best-practices
neondatabase
Các phương pháp và hướng dẫn tốt nhất khi làm việc với Postgres. Bao gồm thiết kế lược đồ, chiến lược lập chỉ mục, tối ưu hóa truy vấn, di chuyển dữ liệu và các lỗi thường gặp. Sử dụng…
neon-postgres-egress-optimizer
neondatabase
Hướng dẫn người dùng chẩn đoán và khắc phục các mẫu truy vấn phía ứng dụng gây ra việc truyền dữ liệu quá mức (egress) từ cơ sở dữ liệu Postgres của họ. Hầu hết các hóa đơn egress cao đến từ việc ứng dụng lấy nhiều dữ liệu hơn mức nó sử dụng.