Token导航 LogoToken导航

Agent Skill · 研究检索

supabase-prisma-database-management(Supabase Prisma 数据库 management)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

supabase-prisma-database-management 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 58,594。

总安装 412周安装 17GitHub Stars 3下载 135核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:supabase-prisma-database-management(Supabase Prisma 数据库 management)
来源仓库:https://github.com/hopeoverture/worldbuilding-app-skills
仓库路径:skills/supabase-prisma-database-management
安装命令:
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill supabase-prisma-database-management
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill supabase-prisma-database-management

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

辅助使用 Prisma ORM 管理 Supabase 数据库。支持 schema 同步、迁移生成和数据查询。写入操作前建议 dry-run 或事务保护。连接生产库时应使用只读账号降低风险。supabase-prisma-database-management 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/supabase-prisma-database-management

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

supabase-prisma-database-management 怎么安装?

在终端执行 npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill supabase-p…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

supabase-prisma-database-management 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

supabase-prisma-database-management 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

supabase-prisma-database-management 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

supabase-prisma-database-management 用的人多吗?

公开数据是累计安装 412 次,近一周安装 17 次,下载 135 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

supabase-prisma-database-management 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
supabase-prisma-database-management

Supabase Prisma 数据库 management · 本页

4123接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Supabase + Prisma Database Management

Overview

Manage database schema, migrations, and seed data using Prisma ORM with Supabase PostgreSQL, including shadow database configuration, seed files, and automated schema checks in CI.

Installation and Setup

1. Install Prisma

Install Prisma CLI and client:

npm install -D prisma
npm install @prisma/client

2. Initialize Prisma

Initialize Prisma in your project:

npx prisma init

This creates:

  • prisma/schema.prisma - Database schema definition
  • .env - Environment variables (add DATABASE_URL)

3. Configure Supabase Connection

Get your Supabase database URL from:

  • Supabase Dashboard > Project Settings > Database > Connection String > URI

Add to .env:

# Transaction pooler for Prisma migrations
DATABASE_URL="postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres"

# Session pooler for queries (with pgBouncer)
DIRECT_URL="postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:6543/postgres?pgbouncer=true"

Update prisma/schema.prisma to use both URLs:

datasource db {
  provider  = "postgresql"
  url       = env("DIRECT_URL")
  directUrl = env("DATABASE_URL")
}

Why two URLs?

  • DATABASE_URL: Direct connection for migrations (required)
  • DIRECT_URL: Pooled connection for application queries (optional, better performance)

4. Configure Shadow Database (Required for Migrations)

For migration preview and validation, configure a shadow database in prisma/schema.prisma:

datasource db {
  provider  = "postgresql"
  url       = env("DIRECT_URL")
  directUrl = env("DATABASE_URL")
  shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}

Add to .env:

SHADOW_DATABASE_URL="postgresql://postgres:[PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres"

Note: Supabase free tier allows using the same database for shadow. For production, use a separate database.

Schema Definition

1. Define Your Schema

Edit prisma/schema.prisma using the example from assets/example-schema.prisma. This example includes:

  • User profiles with auth integration
  • Timestamps with @default(now()) and @updatedAt
  • Relations between entities
  • Indexes for performance
  • Unique constraints

Key Prisma features:

  • @id @default(uuid()) - Auto-generated UUIDs
  • @default(now()) - Automatic timestamps
  • @updatedAt - Auto-update on modification
  • @@index([field]) - Database indexes
  • @relation - Define relationships

2. Link to Supabase Auth

To integrate with Supabase Auth, reference the auth.users table:

model Profile {
  id        String   @id @db.Uuid
  email     String   @unique
  // Other fields...

  // This doesn't create a foreign key, just documents the relationship
  // The actual user exists in auth.users (managed by Supabase)
}

Important: Don't create a foreign key to auth.users as it's in a different schema. Handle the relationship in application logic.

Migrations

1. Create Migration

After defining/modifying schema, create a migration:

npx prisma migrate dev --name add_profiles_table

This:

  • Generates SQL migration in prisma/migrations/
  • Applies migration to database
  • Regenerates Prisma Client
  • Runs seed script (if configured)

2. Review Migration SQL

Always review generated SQL in prisma/migrations/[timestamp]_[name]/migration.sql:

-- CreateTable
CREATE TABLE "Profile" (
    "id" UUID NOT NULL,
    "email" TEXT NOT NULL,
    -- ...

    CONSTRAINT "Profile_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "Profile_email_key" ON "Profile"("email");

Make manual adjustments if needed before applying to production.

3. Apply Migrations in Production

For production deployments:

npx prisma migrate deploy

This applies pending migrations without prompts or seeds.

CI/CD Integration: Add to your deployment pipeline:

# Example GitHub Actions step
- name: Run migrations
  run: npx prisma migrate deploy
  env:
    DATABASE_URL: ${{ secrets.DATABASE_URL }}

4. Reset Database (Development Only)

To reset database to clean state:

npx prisma migrate reset

This:

  • Drops database
  • Creates database
  • Applies all migrations
  • Runs seed script

Warning: This deletes all data. Only use in development.

Seeding Data

1. Create Seed Script

Create prisma/seed.ts using the template from assets/seed.ts. This script:

  • Uses Prisma Client to insert data
  • Creates initial users, settings, or reference data
  • Can be run manually or after migrations
  • Supports idempotent operations (safe to run multiple times)

2. Configure Seed in package.json

Add seed configuration to package.json:

{
  "prisma": {
    "seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
  }
}

Install ts-node for TypeScript execution:

npm install -D ts-node

3. Run Seed Manually

Execute seed script:

npx prisma db seed

Seed runs automatically after prisma migrate dev and prisma migrate reset.

4. Idempotent Seeding

Make seeds safe to run multiple times using upsert:

await prisma.user.upsert({
  where: { email: 'admin@example.com' },
  update: {}, // No updates if exists
  create: {
    email: 'admin@example.com',
    name: 'Admin User',
  },
});

Prisma Client Usage

1. Generate Client

After schema changes, regenerate Prisma Client:

npx prisma generate

This updates node_modules/@prisma/client with types matching your schema.

2. Use in Next.js Server Components

Create a Prisma client singleton using assets/prisma-client.ts:

import { prisma } from '@/lib/prisma';

export default async function UsersPage() {
  const users = await prisma.profile.findMany();

  return (
    <ul>
      {users.map((user) => (
        <li key={user.id}>{user.name}</li>
      ))}
    </ul>
  );
}

3. Use in Server Actions

'use server';

import { prisma } from '@/lib/prisma';
import { revalidatePath } from 'next/cache';

export async function createProfile(formData: FormData) {
  const name = formData.get('name') as string;

  await prisma.profile.create({
    data: {
      name,
      email: formData.get('email') as string,
    },
  });

  revalidatePath('/profiles');
}

CI/CD Integration

1. Add Schema Validation to CI

Create .github/workflows/schema-check.yml using the template from assets/github-workflows-schema-check.yml. This workflow:

  • Runs on pull requests
  • Validates schema syntax
  • Checks for migration drift
  • Ensures migrations are generated
  • Verifies Prisma Client generation

2. Migration Deployment

Add migration step to deployment workflow:

- name: Apply database migrations
  run: npx prisma migrate deploy
  env:
    DATABASE_URL: ${{ secrets.PROD_DATABASE_URL }}

3. Environment-Specific Databases

Use different database URLs for each environment:

# Development
DATABASE_URL="postgresql://localhost:5432/dev"

# Staging
DATABASE_URL="postgresql://staging-db.supabase.co:5432/postgres"

# Production
DATABASE_URL="postgresql://prod-db.supabase.co:5432/postgres"

Best Practices

Schema Design

  1. Use UUIDs for IDs: Better for distributed systems
  2. Add Timestamps: Track createdAt and updatedAt
  3. Define Indexes: Improve query performance on filtered fields
  4. Use Enums: Type-safe status/role fields
  5. Validate at DB Level: Use unique constraints and checks

Migration Management

  1. Review Before Applying: Always check generated SQL
  2. Name Descriptively: Use clear migration names
  3. Keep Atomic: One logical change per migration
  4. Test Locally First: Verify migrations work before production
  5. Never Modify Applied Migrations: Create new ones instead

Prisma Client

  1. Use Singleton Pattern: Prevent connection exhaustion
  2. Close in Serverless: Disconnect after operations
  3. Type Everything: Leverage Prisma's TypeScript types
  4. Use Select: Only fetch needed fields
  5. Batch Operations: Use createMany, updateMany for bulk ops

Troubleshooting

Migration fails with "relation already exists": Reset development database with npx prisma migrate reset. For production, manually fix conflicts.

Prisma Client out of sync: Run npx prisma generate after schema changes.

Connection pool exhausted: Use connection pooling via DIRECT_URL with pgBouncer.

Shadow database errors: Ensure shadow database URL is correct and accessible. For Supabase free tier, same DB can be used.

Type errors after schema changes: Restart TypeScript server in IDE after prisma generate.

Resources

scripts/

No executable scripts needed for this skill.

references/

  • prisma-best-practices.md - Comprehensive guide to Prisma patterns, performance optimization, and common pitfalls
  • supabase-integration.md - Specific considerations for using Prisma with Supabase, including RLS integration

assets/

  • example-schema.prisma - Complete schema example with common patterns (auth, timestamps, relations, indexes)
  • seed.ts - Idempotent seed script template for initial data
  • prisma-client.ts - Singleton Prisma Client for Next.js to prevent connection exhaustion
  • github-workflows-schema-check.yml - CI workflow for schema validation and migration checks

平台分布

Codex

36.58%
按下载量换算49

Claude

28.83%
按下载量换算39

Cursor

20.15%
按下载量换算27

Gemini CLI

9.88%
按下载量换算13

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills