[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-5ffbd2e1-081a-4b01-a6d1-2208501ea06c":3,"$fnrKCmRc7C3SMou-_cMWcTTjXVuolvKvXx49HHitPJsg":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"5ffbd2e1-081a-4b01-a6d1-2208501ea06c","claimable-postgres","通过Neon的Claimable Postgres（pg.new）提供即时临时Postgres数据库。无需登录或信用卡。用于快速Postgres环境和原型设计的可丢弃DATABASE_URL。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: claimable-postgres\ndescription: Provision instant temporary Postgres databases via Claimable Postgres by Neon (pg.new). No login or credit card required. Use for quick Postgres environments and throwaway DATABASE_URL for prototyping.\nrisk: unknown\nsource: community\n---\n\n# Claimable Postgres\n\nInstant Postgres databases for local development, demos, prototyping, and test environments. No account required. Databases expire after 72 hours unless claimed to a Neon account.\n\n## Quick Start\n\n```bash\ncurl -s -X POST \"https:\u002F\u002Fpg.new\u002Fapi\u002Fv1\u002Fdatabase\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"ref\": \"agent-skills\"}'\n```\n\nParse `connection_string` and `claim_url` from the JSON response. Write `connection_string` to the project's `.env` as `DATABASE_URL`.\n\nFor other methods (CLI, SDK, Vite plugin), see [Which Method?](#which-method) below.\n\n## Which Method?\n\n- **REST API**: Returns structured JSON. No runtime dependency beyond `curl`. Preferred when the agent needs predictable output and error handling.\n- **CLI** (`npx get-db@latest --yes`): Provisions and writes `.env` in one command. Convenient when Node.js is available and the user wants a simple setup.\n- **SDK** (`get-db\u002Fsdk`): Scripts or programmatic provisioning in Node.js.\n- **Vite plugin** (`vite-plugin-db`): Auto-provisions on `vite dev` if `DATABASE_URL` is missing. Use when the user has a Vite project.\n- **Browser**: User cannot run CLI or API. Direct to https:\u002F\u002Fpg.new.\n\n## REST API\n\n**Base URL:** `https:\u002F\u002Fpg.new\u002Fapi\u002Fv1`\n\n### Create a database\n\n```bash\ncurl -s -X POST \"https:\u002F\u002Fpg.new\u002Fapi\u002Fv1\u002Fdatabase\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"ref\": \"agent-skills\"}'\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `ref` | Yes | Tracking tag that identifies who provisioned the database. Use `\"agent-skills\"` when provisioning through this skill. |\n| `enable_logical_replication` | No | Enable logical replication (default: false, cannot be disabled once enabled) |\n\nThe `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.\n\n**Response:**\n\n```json\n{\n  \"id\": \"019beb39-37fb-709d-87ac-7ad6198b89f7\",\n  \"status\": \"UNCLAIMED\",\n  \"neon_project_id\": \"gentle-scene-06438508\",\n  \"connection_string\": \"postgresql:\u002F\u002F...\",\n  \"claim_url\": \"https:\u002F\u002Fpg.new\u002Fclaim\u002F019beb39-...\",\n  \"expires_at\": \"2026-01-26T14:19:14.580Z\",\n  \"created_at\": \"2026-01-23T14:19:14.580Z\",\n  \"updated_at\": \"2026-01-23T14:19:14.580Z\"\n}\n```\n\n### Check status\n\n```bash\ncurl -s \"https:\u002F\u002Fpg.new\u002Fapi\u002Fv1\u002Fdatabase\u002F{id}\"\n```\n\nReturns the same response shape. Status transitions: `UNCLAIMED` -> `CLAIMING` -> `CLAIMED`. After the database is claimed, `connection_string` returns `null`.\n\n### Error responses\n\n| Condition | HTTP | Message |\n|-----------|------|---------|\n| Missing or empty `ref` | 400 | `Missing referrer` |\n| Invalid database ID | 400 | `Database not found` |\n| Invalid JSON body | 500 | `Failed to create the database.` |\n\n## CLI\n\n```bash\nnpx get-db@latest --yes\n```\n\nProvisions 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).\n\n### Pre-run Check\n\nCheck if `DATABASE_URL` (or the chosen key) already exists in the target `.env`. The CLI exits without provisioning if it finds the key.\n\nIf the key exists, offer the user three options:\n\n1. Remove or comment out the existing line, then rerun.\n2. Use `--env` to write to a different file (e.g. `--env .env.local`).\n3. Use `--key` to write under a different variable name.\n\nGet confirmation before proceeding.\n\n### Options\n\n| Option | Alias | Description | Default |\n|--------|-------|-------------|---------|\n| `--yes` | `-y` | Skip prompts, use defaults | `false` |\n| `--env` | `-e` | .env file path | `.\u002F.env` |\n| `--key` | `-k` | Connection string env var key | `DATABASE_URL` |\n| `--prefix` | `-p` | Prefix for generated public env vars | `PUBLIC_` |\n| `--seed` | `-s` | Path to seed SQL file | none |\n| `--logical-replication` | `-L` | Enable logical replication | `false` |\n| `--ref` | `-r` | Referrer id (use `agent-skills` when provisioning through this skill) | none |\n\nAlternative package managers: `yarn dlx get-db@latest`, `pnpm dlx get-db@latest`, `bunx get-db@latest`, `deno run -A get-db@latest`.\n\n### Output\n\nThe CLI writes to the target `.env`:\n\n```\nDATABASE_URL=postgresql:\u002F\u002F...              # pooled (use for application queries)\nDATABASE_URL_DIRECT=postgresql:\u002F\u002F...       # direct (use for migrations, e.g. Prisma)\nPUBLIC_POSTGRES_CLAIM_URL=https:\u002F\u002Fpg.new\u002Fclaim\u002F...\n```\n\n## SDK\n\nUse for scripts and programmatic provisioning flows.\n\n```typescript\nimport { instantPostgres } from 'get-db';\n\nconst { databaseUrl, databaseUrlDirect, claimUrl, claimExpiresAt } = await instantPostgres({\n  referrer: 'agent-skills',\n  seed: { type: 'sql-script', path: '.\u002Finit.sql' },\n});\n```\n\nReturns `databaseUrl` (pooled), `databaseUrlDirect` (direct, for migrations), `claimUrl`, and `claimExpiresAt` (Date object). The `referrer` parameter is required.\n\n## Vite Plugin\n\nFor Vite projects, `vite-plugin-db` auto-provisions a database on `vite dev` if `DATABASE_URL` is missing. Install with `npm install -D vite-plugin-db`. See the [Claimable Postgres docs](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fclaimable-postgres#vite-plugin) for configuration.\n\n## Agent Workflow\n\n### API path\n\n1. **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.\n2. **Provision:** POST to `https:\u002F\u002Fpg.new\u002Fapi\u002Fv1\u002Fdatabase` with `{\"ref\": \"agent-skills\"}`.\n3. **Parse response:** Extract `connection_string`, `claim_url`, and `expires_at` from the JSON response.\n4. **Write .env:** Write `DATABASE_URL=\u003Cconnection_string>` to the project's `.env` (or the user's preferred file and key). Do not overwrite an existing key without confirmation.\n5. **Seed (if needed):** If the user has a seed SQL file, run it against the new database:\n   ```bash\n   psql \"$DATABASE_URL\" -f seed.sql\n   ```\n6. **Report:** Tell the user where the connection string was written, which key was used, and share the claim URL. Remind them: the database works now; claim within 72 hours to keep it permanently.\n7. **Optional:** Offer a quick connection test (e.g. `SELECT 1`).\n\n### CLI path\n\n1. **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.\n2. **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.\n3. **Gather options:** Use defaults unless context suggests otherwise (e.g., user mentions a custom env file, seed SQL, or logical replication).\n4. **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.\n   ```bash\n   npx get-db@latest --yes --ref agent-skills --env .env.local --seed .\u002Fschema.sql\n   ```\n5. **Verify:** Confirm the connection string was written to the intended file.\n6. **Report:** Tell the user where the connection string was written, which key was used, and that a claim URL is in the env file. Remind them: the database works now; claim within 72 hours to keep it permanently.\n7. **Optional:** Offer a quick connection test (e.g. `SELECT 1`).\n\n### Output Checklist\n\nAlways report:\n\n- Where the connection string was written (e.g. `.env`)\n- Which variable key was used (`DATABASE_URL` or custom key)\n- The claim URL (from `.env` or API response)\n- That unclaimed databases are temporary (72 hours)\n\n## Claiming\n\nClaiming 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.\n\n- **API\u002FSDK:** Give the user the `claim_url` from the create response.\n- **CLI:** `npx get-db@latest claim` reads the claim URL from `.env` and opens the browser automatically.\n\nUsers cannot claim into Vercel-linked orgs; they must choose another Neon org.\n\n## Defaults and Limits\n\n| Parameter | Value |\n|-----------|-------|\n| Provider | AWS |\n| Region | us-east-2 |\n| Postgres | 17 |\n\nRegion cannot be changed for claimable databases. Unclaimed databases have stricter quotas. Claiming resets limits to free plan defaults.\n\n| | Unclaimed | Claimed (Free plan) |\n|---|-----------|---------------------|\n| Storage | 100 MB | 512 MB |\n| Transfer | 1 GB | ~5 GB |\n| Branches | No | Yes |\n| Expiration | 72 hours | None |\n\n## Auto-provisioning\n\nIf 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.\n\n## Safety and UX Notes\n\n- Do not overwrite existing env vars. Check first, then use `--env` or `--key` (CLI) or skip writing (API) to avoid conflicts.\n- Ask before running destructive seed SQL (`DROP`, `TRUNCATE`, mass `DELETE`).\n- For production workloads, recommend standard Neon provisioning instead of temporary claimable databases.\n- If users need long-term persistence, instruct them to open the claim URL right away.\n- 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.\n\n\n## When to Use\nUse this skill when tackling tasks related to its primary domain or functionality as described above.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,116,1872,"2026-05-16 13:10:41",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"58e1fc0f-cd2b-45af-8931-1314341ab840","1.0.0","claimable-postgres.zip",4112,"uploads\u002Fskills\u002F5ffbd2e1-081a-4b01-a6d1-2208501ea06c\u002Fclaimable-postgres.zip","81b35bc479a9dafef7104b49f07573ba9f90bd5133ef07bc567488aa7cffc82f","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":10091}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]