.claude/skills/prismadb/SKILL.md
Configure and use Prisma 7 ORM with PostgreSQL driver adapters in the FTC Metrics project. Use when setting up database schemas, running migrations, troubleshooting Prisma configuration, or working with the packages/db package.
npx skillsauth add ftc8569/ftcmetrics prismadbInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Prisma 7 introduces breaking changes from v6. The main change is that database connection configuration has moved from schema.prisma to prisma.config.ts.
bun add @prisma/client @prisma/adapter-pg pg dotenv
bun add -d prisma @types/pg
Create prisma.config.ts in your Prisma package root (where prisma/ folder is):
import { config } from "dotenv";
import { defineConfig } from "prisma/config";
import path from "path";
// Load .env from appropriate location
config({ path: path.resolve(__dirname, "../../.env") });
export default defineConfig({
earlyAccess: true,
schema: "./prisma/schema.prisma",
datasource: {
url: process.env.DATABASE_URL!,
},
migrate: {
adapter: async () => {
const { Pool } = await import("pg");
const { PrismaPg } = await import("@prisma/adapter-pg");
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
return new PrismaPg(pool);
},
},
});
Remove url from datasource block:
datasource db {
provider = "postgresql"
}
generator client {
provider = "prisma-client-js"
}
// Your models here...
import { config } from "dotenv";
import path from "path";
// Load .env from workspace root
config({ path: path.resolve(__dirname, "../../../.env") });
import { Pool } from "pg";
import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "@prisma/client";
// Create connection pool
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const adapter = new PrismaPg(pool);
// Prevent multiple instances during development
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};
export const prisma = globalForPrisma.prisma ?? new PrismaClient({ adapter });
if (process.env.NODE_ENV !== "production") {
globalForPrisma.prisma = prisma;
}
export * from "@prisma/client";
| Prisma 6 | Prisma 7 |
|----------|----------|
| url = env("DATABASE_URL") in schema.prisma | datasource.url in prisma.config.ts |
| new PrismaClient() | new PrismaClient({ adapter }) |
| Built-in database driver | Explicit driver adapter required |
| --schema flag for CLI | Config file auto-detected |
# Generate Prisma client
prisma generate
# Push schema to database (no migration)
prisma db push
# Create migration
prisma migrate dev --name <name>
# Open Prisma Studio
prisma studio
url is no longer supported"Remove url = env("DATABASE_URL") from your schema.prisma datasource block and add it to prisma.config.ts instead.
Ensure your prisma.config.ts has the datasource.url property set and that the .env file is being loaded correctly.
When using workspaces, ensure the dotenv path resolves to the correct .env location:
config({ path: path.resolve(__dirname, "../../.env") }); // Adjust depth as needed
development
Configure TypeScript in a Bun/npm workspaces monorepo with shared base config, package-specific overrides, path aliases, and cross-package type sharing. Use when setting up tsconfig files, configuring path aliases, resolving module errors, or sharing types between packages.
development
Tailwind CSS styling for FTC Metrics with official FIRST colors and component patterns. Use when styling React components, creating responsive layouts, or implementing dark mode.
development
Configure and integrate Soketi WebSocket server with FTC Metrics for real-time updates. Use when setting up WebSocket connections, broadcasting scouting data changes, implementing presence channels for team collaboration, or debugging real-time features.
development
Create, structure, and optimize skills for the FTC Metrics project. Use when creating a new skill, improving an existing skill, or needing guidance on skill design patterns, triggers, frontmatter, and progressive disclosure.