• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdatabase

claimable-postgres

プラグイン
neon
ソース
GitHub で見る ↗
説明

クレーム可能なPostgres(Neon社の neon.new)を通じて、ログインやサインアップ、クレジットカードなしで、一時的なPostgresデータベースをすぐに用意できます。REST API、CLI、SDK に対応しています。 次のような場合に使用: - ユーザーが迅速なPostgres環境を求めている - プロトタイピングやテスト用に使い捨てのデータベースURL(DATABASE_URL)が必要 - 「今すぐデータベースをくれ」といった急な要望 トリガーキーワード(このスキルが動作する合図): 「quick postgres」「temporary postgres」「no signup database」「no credit card database」「instant DATABASE_URL」「npx neon-new」「neon.new」「neon.new API」「claimable postgres API」

原文を表示

Provision instant temporary Postgres databases via Claimable Postgres by Neon (neon.new) with no login, signup, or credit card. Supports REST API, CLI, and SDK. Use when users ask for a quick Postgres environment, a throwaway DATABASE_URL for prototyping/tests, or "just give me a DB now". Triggers include: "quick postgres", "temporary postgres", "no signup database", "no credit card database", "instant DATABASE_URL", "npx neon-new", "neon.new", "neon.new API", "claimable postgres API".

ユースケース
  • 迅速なPostgres環境を求めているとき
  • プロトタイピングやテスト用の使い捨てDBが必要
  • クレジットカードなしでDBをすぐ用意したい
  • REST API、CLI、SDKでDB構築する
本文(日本語訳)

Claimable Postgres

ローカル開発、デモ、プロトタイピング、テスト環境用の即座に利用できるPostgres(データベース)。アカウント登録は不要。データベースは72時間後に自動削除されますが、Neonアカウントに登録することで保持できます。

クイックスタート

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

JSON形式の応答から connection_string(接続文字列)と claim_url(登録用URL)を取得します。connection_string をプロジェクトの .env ファイルに DATABASE_URL として記入してください。

その他の方法(CLI、SDK、Viteプラグイン)については、後述の「どの方法を選ぶ?」を参照してください。

どの方法を選ぶ?

  • REST API: 構造化されたJSON形式で返される。curl以外に追加の実行環境が不要。エージェントが予測可能な出力とエラー処理を必要とするときに推奨。
  • CLI (npx neon-new@latest --yes): データベースをプロビジョニング(構築・準備)し、.env ファイルへ書き込みを1つのコマンドで完了。Node.js が利用でき、ユーザーがシンプルなセットアップを望むときに便利。
  • SDK (neon-new/sdk): Node.js でのスクリプトまたはプログラム的なプロビジョニング。
  • Vite プラグイン (vite-plugin-neon-new): vite dev の実行時に、DATABASE_URL が見つからなければ自動的にプロビジョニング。ユーザーが Vite プロジェクト(フロントエンド開発ツール)を持っているときに使用。
  • ブラウザ: ユーザーが CLI や API を実行できない場合は、https://neon.new に直接案内。

自動プロビジョニング

エージェントがタスク完遂のためにデータベースが必要(例: 「実際のデータベースを使ったTODOアプリを作ってほしい」)で、ユーザーが接続文字列を提供していない場合、API を通じてプロビジョニングし、ユーザーに通知します。登録用URL を含めて、ユーザーがデータベースを保持できるようにしてください。

エージェントワークフロー

API経由の手順

  1. 意図確認: リクエストが曖昧な場合、ユーザーが一時的で無登録のデータベースを望んでいることを確認してください。「クイック」または「一時的な」といった表現が明確にある場合はこのステップをスキップ。
  2. プロビジョニング: https://neon.new/api/v1/database に {"ref": "agent-skills"} を POST。
  3. 応答を解析: JSON応答から connection_string、claim_url、expires_at(失効日時)を取得。
  4. .env に書き込み: DATABASE_URL=<connection_string> をプロジェクトの .env(またはユーザー指定のファイルとキー)に書き込み。既存キーは確認なしで上書きしないこと。
  5. シード処理(必要に応じて): ユーザーがシード SQL ファイル(初期データ定義)を持っている場合、新しいデータベースに対して実行:
    psql "$DATABASE_URL" -f seed.sql
    
  6. 報告: 後述の「出力チェックリスト」の全項目を含める。
  7. オプション: 簡単な接続テスト(例: SELECT 1)を提案。

CLI経由の手順

  1. .env をチェック: 対象の .env ファイルで既存の DATABASE_URL(または指定キー)を確認。存在する場合は実行しない。削除、--env、または --key の使用オプションを提案し、確認を取得(「実行前チェック」参照)。
  2. 意図確認: リクエストが曖昧な場合、ユーザーが一時的で無登録のデータベースを望んでいることを確認。「クイック」または「一時的な」といった表現が明確にある場合はスキップ。
  3. オプション収集: 文脈に別の指示がなければデフォルトを使用(例: ユーザーがカスタムenvファイル、シードSQL、またはロジカルレプリケーション(変更内容の複製機能)を言及した場合)。
  4. 実行: @latest --yes と確認済みオプションで実行。古いキャッシュバージョンを避けるため常に @latest を使用。--yes はエージェントを停止させるインタラクティブなプロンプトをスキップ。
    npx neon-new@latest --yes --ref agent-skills --env .env.local --seed ./schema.sql
    
  5. 確認: 接続文字列が対象ファイルに書き込まれたことを確認。
  6. 報告: 「出力チェックリスト」の全項目を含める。
  7. オプション: 簡単な接続テスト(例: SELECT 1)を提案。

出力チェックリスト

必ず以下を報告:

  • 接続文字列が書き込まれた場所(例: .env)
  • 使用された変数キー(DATABASE_URL またはカスタムキー)
  • 登録用URL(.env または API応答から)
  • 登録されないデータベースが一時的であること(72時間): データベースは今すぐ動作し、72時間以内に登録することで永続保持可能

セキュリティとUXに関する注意

  • 既存の環境変数を上書きしない。先に確認し、コンフリクト(競合)を避けるため --env または --key(CLI)を使用、または書き込みをスキップ(API)。
  • 破壊的なシード SQL(DROP、TRUNCATE、大規模 DELETE)を実行する前に確認。
  • 本番環境のワークロードについては、一時的な登録可能データベースではなく、標準的な Neon プロビジョニングを推奨。
  • ユーザーが長期保持を必要とする場合、登録用URL をすぐに開くよう指示。
  • 認証情報を .env ファイルに書き込んだ後、.gitignore(バージョン管理の除外設定)で保護されていることを確認。保護されていない場合はユーザーに警告。確認なしで .gitignore を修正しないこと。

REST API

ベースURL: https://neon.new/api/v1

データベースの作成

curl -s -X POST "https://neon.new/api/v1/database" \
  -H "Content-Type: application/json" \
  -d '{"ref": "agent-skills"}'
パラメータ 必須 説明
ref はい データベースをプロビジョニングした者を識別するトラッキングタグ。このスキルを通じたプロビジョニング時は "agent-skills" を使用。
enable_logical_replication いいえ ロジカルレプリケーション(変更内容の複製機能)を有効化(デフォルト: false、一度有効にするとその後無効化不可)

API が返す connection_string はプール接続URL(複数接続を効率管理する接続方式)です。ダイレクト接続(プール機能なし、例: Prisma マイグレーション)が必要な場合、ホスト名から -pooler を削除。CLI は プール接続とダイレクト接続の両方を自動的に書き込み。

応答:

{
  "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"
}

ステータス確認

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

同じ応答形式で返す。ステータス遷移: UNCLAIMED → CLAIMING → CLAIMED。データベースが登録されると、connection_string は null を返す。

エラー応答

状態 HTTP メッセージ
ref が見当たらないまたは空 400 Missing referrer
無効なデータベース ID 400 Database not found
無効な JSON本体 500 Failed to create the database.

CLI

npx neon-new@latest --yes

データベースをプロビジョニングし、接続文字列を .env に1ステップで書き込み。エージェントを停止させるインタラクティブなプロンプトを回避するため、常に @latest と --yes を使用。

実行前チェック

DATABASE_URL(または指定キー)が対象の .env に既に存在するか確認。CLI がキーを見つけるとプロビジョニング없이 終了。

キーが存在する場合、ユーザーに3つのオプションを提案:

  1. 既存行を削除またはコメントアウトし、再実行。
  2. --env で別ファイルに書き込み(例: --env .env.local)。
  3. --key で別の変数名に書き込み。

実行前に確認を取得。

オプション

オプション 短縮形 説明 デフォルト
--yes -y プロンプトをスキップ、デフォルトを使用 false
--env -e .env ファイルパス ./.env
--key -k 接続文字列の環境変数キー DATABASE_URL
--prefix -p 生成された公開環境変数のプレフィックス PUBLIC_
--seed -s シードSQL ファイルのパス なし
--logical-replication -L ロジカルレプリケーション(変更内容の複製機能)を有効化 false
--ref -r リファラー ID(このスキル経由でのプロビジョニング時は agent-skills) なし

別パッケージマネージャー: yarn dlx neon-new@latest、pnpm dlx neon-new@latest、bunx neon-new@latest、deno run -A neon-new@latest。

出力

CLI は対象の .env に書き込み:

DATABASE_URL=postgresql://...              # プール接続(アプリケーションクエリに使用)
DATABASE_URL_DIRECT=postgresql://...       # ダイレクト接続(マイグレーションで使用、例: Prisma)
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/...

SDK

スクリプトとプログラム的なプロビジョニングワークフロー向け。

import { instantPostgres } from "neon-new";

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

databaseUrl(プール接続)、databaseUrlDirect(ダイレクト接続、マイグレーション用)、claimUrl、claimExpiresAt(Date オブジェクト)を返す。referrer パラメータは必須。

Viteプラグイン

Vite プロジェクト向けに、vite-plugin-neon-new は vite dev 実行時に DATABASE_URL が見つからなければ自動的にデータベースをプロビジョニング。npm install -D vite-plugin-neon-new でインストール。詳細は Claimable Postgres ドキュメント を参照。

登録

登録はオプション。データベースは登録なしでも即座に動作。オプションで登録する場合、ユーザーはブラウザで登録用URL を開き、Neon アカウントにサインイン、または新規作成してデータベースを登録。

  • API/SDK: ユーザーに作成応答からの claim_url を提供。
  • CLI: npx neon-new@latest claim は .env から登録用URL を読み込み、自動的にブラウザを開く。

Vercel(Webホスティング)にリンクされた組織への登録はできません。別の Neon 組織を選択する必要があります

原文(English)を表示

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

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。