ASD

Claimable Postgres

Provisiona bases de datos Postgres temporales al instante con Claimable Postgres de Neon (neon.new), sin login, registro ni tarjeta de crédito, vía API REST, CLI o SDK.

Oficial

Reemplaza a: Aprovisionamiento manual de Postgres con cuenta y tarjeta de crédito, neon.ts para infraestructura duradera (una vez que la base se reclama)

Estrellas
82

en todo el repo

Actividad
65

0–100, la ruta de este skill

Actualizado
hace 14 días

último commit aquí

Commits
7

últimos 90 días

Contexto
3.1k tok

123 tok en reposo

Paquete
1 archivo

12 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add neondatabase/agent-skills --skill claimable-postgres --agent claude-code

Se instala solo en este repositorio.

Este skill makes network requests, reads environment config.

Qué hace

  • Provisiona bases de datos Postgres temporales al instante vía la API REST de neon.new, sin login ni tarjeta
  • Escribe connection_string como DATABASE_URL en .env (o variable elegida) del proyecto
  • Soporta CLI (npx neon-new), SDK de Node.js y plugin de Vite para auto-provisión
  • Ejecuta seed SQL opcional contra la nueva base y ofrece una prueba de conexión (SELECT 1)
  • Da la claim_url para reclamar la base a una cuenta Neon antes de que expire en 72 horas

Úsalo cuando

  • El usuario pide un entorno Postgres rápido o un DATABASE_URL desechable para prototipos/tests
  • El usuario dice frases como "quick postgres", "no signup database" o "just give me a DB now"
  • El agente necesita una base de datos real para cumplir una tarea y el usuario no dio connection string
  • El usuario tiene un proyecto Vite y quiere auto-provisión al ejecutar vite dev

No lo uses cuando

  • Para cargas de producción, se recomienda el aprovisionamiento estándar de Neon en vez de bases claimable temporales

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • Dame una base Postgres rápida sin registrarme
  • Necesito un DATABASE_URL temporal para probar esta app
  • Crea una base de datos de prueba con npx neon-new
  • Ejecuta este seed.sql en una Postgres desechable

SKILL.md

En inglés

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:

npx skills add neondatabase/agent-skills --skill neon

Claimable Postgres

Instant Postgres databases for local development, demos, prototyping, and test environments. No account required. Databases expire after 72 hours unless claimed to a Neon account.

Quick Start

curl -s -X POST "https://neon.new/api/v1/database" \
  -H "Content-Type: application/json" \
  -d '{"ref": "agent-skills"}'

Parse connection_string and claim_url from the JSON response. Write connection_string to the project's .env as DATABASE_URL.

For other methods (CLI, SDK, Vite plugin), see Which Method? below.

Which Method?

  • REST API: Returns structured JSON. No runtime dependency beyond curl. Preferred when the agent needs predictable output and error handling.
  • CLI (npx neon-new@latest --yes): Provisions and writes .env in one command. Convenient when Node.js is available and the user wants a simple setup.
  • SDK (neon-new/sdk): Scripts or programmatic provisioning in Node.js.
  • Vite plugin (vite-plugin-neon-new): Auto-provisions on vite dev if DATABASE_URL is missing. Use when the user has a Vite project.
  • Browser: User cannot run CLI or API. Direct to https://neon.new.

Auto-provisioning

If the agent needs a database to fulfill a task (e.g. "build me a todo app with a real database") and the user has not provided a connection string, provision one via the API and inform the user. Include the claim URL so they can keep it.

Agent Workflow

API path

  1. Confirm intent: If the request is ambiguous, confirm the user wants a temporary, no-signup database. Skip this if they explicitly asked for a quick or temporary database.
  2. Provision: POST to https://neon.new/api/v1/database with {"ref": "agent-skills"}.
  3. Parse response: Extract connection_string, claim_url, and expires_at from the JSON response.
  4. Write .env: Write DATABASE_URL=<connection_string> to the project's .env (or the user's preferred file and key). Do not overwrite an existing key without confirmation.
  5. Seed (if needed): If the user has a seed SQL file, run it against the new database:
    psql "$DATABASE_URL" -f seed.sql
    
  6. Report: Cover every item in the Output Checklist.
  7. Optional: Offer a quick connection test (e.g. SELECT 1).

CLI path

  1. Check .env: Check the target .env for an existing DATABASE_URL (or chosen key). If present, do not run. Offer remove, --env, or --key and get confirmation (see Pre-run Check).
  2. Confirm intent: If the request is ambiguous, confirm the user wants a temporary, no-signup database. Skip this if they explicitly asked for a quick or temporary database.
  3. Gather options: Use defaults unless context suggests otherwise (e.g., user mentions a custom env file, seed SQL, or logical replication).
  4. Run: Execute with @latest --yes plus the confirmed options. Always use @latest to avoid stale cached versions. --yes skips interactive prompts that would stall the agent.
    npx neon-new@latest --yes --ref agent-skills --env .env.local --seed ./schema.sql
    
  5. Verify: Confirm the connection string was written to the intended file.
  6. Report: Cover every item in the Output Checklist.
  7. Optional: Offer a quick connection test (e.g. SELECT 1).

Output Checklist

Always report:

  • Where the connection string was written (e.g. .env)
  • Which variable key was used (DATABASE_URL or custom key)
  • The claim URL (from .env or API response)
  • That unclaimed databases are temporary (72 hours): the database works now, and claiming within 72 hours keeps it permanently

Safety and UX Notes

  • Do not overwrite existing env vars. Check first, then use --env or --key (CLI) or skip writing (API) to avoid conflicts.
  • Ask before running destructive seed SQL (DROP, TRUNCATE, mass DELETE).
  • For production workloads, recommend standard Neon provisioning instead of temporary claimable databases.
  • If users need long-term persistence, instruct them to open the claim URL right away.
  • After writing credentials to an .env file, check that it's covered by .gitignore. If not, warn the user. Do not modify .gitignore without confirmation.

REST API

Base URL: https://neon.new/api/v1

Create a database

curl -s -X POST "https://neon.new/api/v1/database" \
  -H "Content-Type: application/json" \
  -d '{"ref": "agent-skills"}'
Parameter Required Description
ref Yes Tracking tag that identifies who provisioned the database. Use "agent-skills" when provisioning through this skill.
enable_logical_replication No Enable logical replication (default: false, cannot be disabled once enabled)

The connection_string returned by the API is a pooled connection URL. For a direct (non-pooled) connection (e.g. Prisma migrations), remove -pooler from the hostname. The CLI writes both pooled and direct URLs automatically.

Response:

{
  "id": "019beb39-37fb-709d-87ac-7ad6198b89f7",
  "status": "UNCLAIMED",
  "neon_project_id": "gentle-scene-06438508",
  "connection_string": "postgresql://...",
  "claim_url": "https://neon.new/claim/019beb39-...",
  "expires_at": "2026-01-26T14:19:14.580Z",
  "created_at": "2026-01-23T14:19:14.580Z",
  "updated_at": "2026-01-23T14:19:14.580Z"
}

Check status

curl -s "https://neon.new/api/v1/database/{id}"

Returns the same response shape. Status transitions: UNCLAIMED -> CLAIMING -> CLAIMED. After the database is claimed, connection_string returns null.

Error responses

Condition HTTP Message
Missing or empty ref 400 Missing referrer
Invalid database ID 400 Database not found
Invalid JSON body 500 Failed to create the database.

CLI

npx neon-new@latest --yes

Provisions a database and writes the connection string to .env in one step. Always use @latest and --yes (skips interactive prompts that would stall the agent).

Pre-run Check

Check if DATABASE_URL (or the chosen key) already exists in the target .env. The CLI exits without provisioning if it finds the key.

If the key exists, offer the user three options:

  1. Remove or comment out the existing line, then rerun.
  2. Use --env to write to a different file (e.g. --env .env.local).
  3. Use --key to write under a different variable name.

Get confirmation before proceeding.

Options

Option Alias Description Default
--yes -y Skip prompts, use defaults false
--env -e .env file path ./.env
--key -k Connection string env var key DATABASE_URL
--prefix -p Prefix for generated public env vars PUBLIC_
--seed -s Path to seed SQL file none
--logical-replication -L Enable logical replication false
--ref -r Referrer id (use agent-skills when provisioning through this skill) none

Alternative package managers: yarn dlx neon-new@latest, pnpm dlx neon-new@latest, bunx neon-new@latest, deno run -A neon-new@latest.

Output

The CLI writes to the target .env:

DATABASE_URL=postgresql://...              # pooled (use for application queries)
DATABASE_URL_DIRECT=postgresql://...       # direct (use for migrations, e.g. Prisma)
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/...

SDK

Use for scripts and programmatic provisioning flows.

import { instantPostgres } from "neon-new";

const { databaseUrl, databaseUrlDirect, claimUrl, claimExpiresAt } =
  await instantPostgres({
    referrer: "agent-skills",
    seed: { type: "sql-script", path: "./init.sql" },
  });

Returns databaseUrl (pooled), databaseUrlDirect (direct, for migrations), claimUrl, and claimExpiresAt (Date object). The referrer parameter is required.

Vite Plugin

For Vite projects, vite-plugin-neon-new auto-provisions a database on vite dev if DATABASE_URL is missing. Install with npm install -D vite-plugin-neon-new. See the Claimable Postgres docs for configuration.

Claiming

Claiming is optional. The database works immediately without it. To optionally claim, the user opens the claim URL in a browser, where they sign in or create a Neon account to claim the database.

  • API/SDK: Give the user the claim_url from the create response.
  • CLI: npx neon-new@latest claim reads the claim URL from .env and opens the browser automatically.

Users cannot claim into Vercel-linked orgs; they must choose another Neon org.

Neon Infrastructure as Code (neon.ts)

Claimable databases are deliberately throwaway and provisioned through neon.new (above), so they aren't managed by neon.ts. Once a user claims a database into a Neon account it becomes a normal Neon project — at which point neon.ts, Neon's infrastructure-as-code file, is how you manage it going forward (see the neon skill for the full reference): declare the services its branches should have, program per-branch compute, and get type-safe env vars.

npm i @neon/config
// neon.ts
import { defineConfig } from "@neon/config/v1";

export default defineConfig({
  auth: true, // Neon Auth, once you outgrow a bare connection string
  dataApi: true, // Data API
  branch: (branch) => (branch.exists ? {} : { ttl: "7d" }), // ephemeral non-default branches
});
neon config apply   # provision the declared services (neon deploy is an alias)

If a project needs branching, multiple services, or durable infrastructure tracked in version control, recommend claiming first and then adopting neon.ts — rather than re-provisioning throwaway claimable databases.

Defaults and Limits

Parameter Value
Provider AWS
Region us-east-2
Postgres 17

Region cannot be changed for claimable databases. Unclaimed databases have stricter quotas. Claiming resets limits to free plan defaults.

Unclaimed Claimed (Free plan)
Storage 100 MB 512 MB
Transfer 1 GB ~5 GB
Branches No Yes
Expiration 72 hours None

Reproducido de neondatabase/agent-skills bajo licencia Apache-2.0. Leer esta página en markdown.

Archivos

1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Requiere curl para la API, o Node.js para usar la CLI (npx neon-new), el SDK o el plugin de Vite.

Necesita en el PATH:curlnpmnpx

Variables de entorno:DATABASE_URL

Detalles

Categoría
Bases de datos
Licencia
Apache-2.0
Recursos incluidos
Solo SKILL.md
Código fuente
Ver SKILL.md

Más de neondatabase/agent-skills

Este repo incluye 9 skills. Si instalas uno, normalmente ya tienes los demás.

Funciones HTTP de Node.js long-running y serverless desplegadas en tu rama de Neon, con DATABASE_URL inyectado automáticamente y compute que corre junto a tus datos.

Costo de contexto al activarse
9.6k tok
Tamaño del paquete
6 archivos
Última actualización
hace 4 días
Oficialdevops infraestructura

Visión general de Neon: primitivas de backend en la nube (Lakebase Postgres, Auth, Data API, Object Storage, Functions, AI Gateway), CLI/MCP y flujo branch-first.

Costo de contexto al activarse
7.1k tok
Tamaño del paquete
1 archivo
Última actualización
hace 4 días
Oficialbases de datos

Una sola API y una sola credencial para modelos LLM frontera y de código abierto, integrada en tu rama de Neon y con tecnología de Databricks.

Costo de contexto al activarse
5k tok
Tamaño del paquete
1 archivo
Última actualización
hace 8 días
Oficialdesarrollo apis

Guías y buenas prácticas para trabajar con Lakebase Postgres, la base de datos detrás de Neon: setup, drivers, pooling, branching, migraciones, autoscaling, scale-to-zero y más.

Costo de contexto al activarse
2.3k tok
Tamaño del paquete
1 archivo
Última actualización
hace 6 días
Oficialbases de datos

Almacenamiento de objetos compatible con S3 que se ramifica junto a tu proyecto Neon, para que archivos y base de datos se mantengan sincronizados en cada branch.

Costo de contexto al activarse
3.1k tok
Tamaño del paquete
1 archivo
Última actualización
hace 4 días
Oficialbases de datos

Elige y crea el tipo correcto de branch de Neon para testing y desarrollo: pruebas con datos reales, entornos aislados, branches schema-only, reset y lifecycles de CI/CD.

Costo de contexto al activarse
3.4k tok
Tamaño del paquete
1 archivo
Última actualización
hace 14 días
Oficialbases de datos

Skills relacionados

Domina la optimización de consultas SQL, estrategias de indexado y análisis EXPLAIN para mejorar drásticamente el rendimiento de la base de datos y eliminar consultas lentas.

Costo de contexto al activarse
1.5k tok
Tamaño del paquete
2 archivos
Última actualización
hace 2 meses
bases de datos

Ejecuta migraciones de bases de datos entre ORMs y plataformas con estrategias zero-downtime, transformación de datos y procedimientos de rollback.

Costo de contexto al activarse
2k tok
Tamaño del paquete
2 archivos
Última actualización
hace 2 meses
bases de datos

Diseña e implementa event stores para sistemas de event sourcing: infraestructura, elección de tecnología y patrones de persistencia de eventos.

Costo de contexto al activarse
1k tok
Tamaño del paquete
2 archivos
Última actualización
hace 2 meses
bases de datos