neon-toolkit

Erstellt und verwaltet temporäre Neon-Datenbanken für Tests, CI/CD-Pipelines und isolierte Entwicklungsumgebungen. Verwenden Sie dies beim Erstellen temporärer Datenbanken für…

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.

Mehr Skills von neondatabase

add-neon-docs
neondatabase
Verwenden Sie diese Fähigkeit, wenn der Benutzer darum bittet, Dokumentation hinzuzufügen, Docs hinzuzufügen, Referenzen hinzuzufügen oder Dokumentation über Neon zu installieren. Fügt Referenzlinks zu Neon-Best-Practices hinzu…
official
neon-auth
neondatabase
Richtet Neon Auth für Ihre Anwendung ein. Konfiguriert die Authentifizierung, erstellt Auth-Routen und generiert UI-Komponenten. Verwenden Sie dies, wenn Sie Authentifizierung zu Next.js hinzufügen, …
official
neon-drizzle
neondatabase
Erstellt ein voll funktionsfähiges Drizzle ORM-Setup mit einer bereitgestellten Neon-Datenbank. Installiert Abhängigkeiten, stellt Datenbankanmeldeinformationen bereit, konfiguriert Verbindungen,…
official
neon-js
neondatabase
Richtet das vollständige Neon JS SDK mit einheitlicher Authentifizierung und PostgREST-artigen Datenbankabfragen ein. Konfiguriert Auth-Client, Daten-Client und Typgenerierung. Verwenden, wenn…
official
neon-serverless
neondatabase
Konfiguriert den Neon Serverless Driver für Next.js, Vercel Edge Functions, AWS Lambda und andere serverlose Umgebungen. Installiert @neondatabase/serverless, richtet…
official
logging-best-practices
neondatabase
Bewährte Verfahren für das Logging mit Fokus auf breite Ereignisse (kanonische Logzeilen) für leistungsstarkes Debugging und Analysen
official
skill-creator
neondatabase
Leitf
official
claimable-postgres
neondatabase
Sofort einsatzbereite Postgres-Datenbanken für lokale Entwicklung, Demos, Prototyping und Testumgebungen. Kein Konto erforderlich. Datenbanken laufen nach 72 Stunden ab, sofern sie nicht an ein Neon-Konto gebunden werden.
official