소스 정보
- 저장소
- tools-only/X-Skills
- 최근 소스 활동
- 2026년 2월 9일 04:36
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tools-only/X-Skills --skill prisma-schema-gen명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | prisma-schema-gen |
| description | Generate Prisma schema from natural language descriptions |
| shortcut | psg |
| category | database |
| difficulty | beginner |
| estimated_time | 3-5 minutes |
Generates complete Prisma schema files from natural language descriptions, including models, relationships, indexes, and validation.
Generated Schema:
Output: Complete schema.prisma file ready for migration
Time: 3-5 minutes
# Generate schema from description
/prisma-schema-gen "Blog with users, posts, and comments"
# Shortcut
/psg "E-commerce with products, orders, and customers"
# Specify database
/psg "Task management app" --database postgresql
# With specific relationships
/psg "Social network with users, posts, likes, and follows"
Input:
/psg "Blog platform with users, posts, comments, and tags"
Generated schema.prisma:
// This is your Prisma schema file
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
email String @unique
name String
password String
bio String?
avatar String?
posts Post[]
comments Comment[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
@@map("users")
}
model Post {
id String @id @default(uuid())
title String
slug String @unique
content String @db.Text
excerpt String?
published Boolean @default(false)
publishedAt DateTime?
viewCount Int @default(0)
authorId String
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
comments Comment[]
tags PostTag[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([authorId])
@@index([slug])
@@index([published, publishedAt])
@@map("posts")
}
model Comment {
id String @id @default(uuid())
content String @db.Text
postId String
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
authorId String
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([postId])
@@index([authorId])
@@map("comments")
}
model Tag {
id String @id @default(uuid())
name String @unique
slug String @unique
posts PostTag[]
@@index([slug])
@@map("tags")
}
// Junction table for many-to-many
model PostTag {
id String @id @default(uuid())
postId String
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
tagId String
tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
@@unique([postId, tagId])
@@index([postId])
@@index([tagId])
@@map("post_tags")
}
# After generating schema, run:
npx prisma migrate dev --name init
# This creates:
# - migrations/
# └── 20250110000000_init/
# └── migration.sql
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
// Create user
async function createUser() {
const user = await prisma.user.create({
data: {
email: '[email protected]',
name: 'John Doe',
password: 'hashed_password_here'
}
})
return user
}
// Create post with tags
async function createPost() {
const post = await prisma.post.create({
data: {
title: 'Getting Started with Prisma',
slug: 'getting-started-with-prisma',
content: 'Full blog post content...',
published: true,
publishedAt: new Date(),
authorId: 'user-uuid-here',
tags: {
create: [
{
tag: {
connectOrCreate: {
: { : },
: { : , : }
}
}
}
]
}
},
: {
: ,
: {
: {
:
}
}
}
})
post
}
() {
posts = prisma..({
: {
:
},
: {
: {
: {
: ,
: ,
:
}
},
: {
: {
:
}
},
: {
: {
:
}
}
},
: {
:
},
:
})
posts
}
() {
comment = prisma..({
: {
: ,
: ,
:
},
: {
: {
: {
: ,
:
}
}
}
})
comment
}
() {
posts = prisma..({
: {
: [
{ : { : query, : } },
{ : { : query, : } }
],
:
},
: {
:
}
})
posts
}
() {
post = prisma..({
: { slug },
: {
: ,
: {
: {
: {
: {
: ,
:
}
}
},
: {
:
}
},
: {
: {
:
}
}
}
})
(!post) {
()
}
prisma..({
: { : post. },
: { : { : } }
})
post
}
() {
posts = prisma..({
: {
: ,
: {
: {
: {
: tagSlug
}
}
}
},
: {
: ,
: {
: {
:
}
}
},
: {
:
}
})
posts
}
model Customer {
id String @id @default(uuid())
email String @unique
name String
phone String?
orders Order[]
cart Cart?
}
model Product {
id String @id @default(uuid())
name String
description String?
price Decimal @db.Decimal(10, 2)
stock Int @default(0)
orderItems OrderItem[]
cartItems CartItem[]
}
model Order {
id String @id @default(uuid())
customerId String
customer Customer @relation(fields: [customerId], references: [id])
items OrderItem[]
total Decimal @db.Decimal(10, 2)
status String // 'pending', 'paid', 'shipped', 'delivered'
createdAt DateTime @default(now())
}
model OrderItem {
id String @id @default(uuid())
orderId String
order Order @relation(fields: [orderId], references: [id])
productId String
product Product @relation(fields: [productId], references: [id])
quantity Int
price Decimal @db.Decimal(10, 2)
}
model User {
id String @id @default(uuid())
username String @unique
email String @unique
posts Post[]
likes Like[]
following Follow[] @relation("Following")
followers Follow[] @relation("Followers")
}
model Post {
id String @id @default(uuid())
content String
authorId String
author User @relation(fields: [authorId], references: [id])
likes Like[]
createdAt DateTime @default(now())
}
model Like {
id String @id @default(uuid())
userId String
user User @relation(fields: [userId], references: [id])
postId String
post Post @relation(fields: [postId], references: [id])
@@unique([userId, postId])
}
model Follow {
id String @id @default(uuid())
followerId String
followingId String
follower User @relation("Following", fields: [followerId], references: [id])
following User @relation("Followers", fields: [followingId], references: [id])
@@unique([followerId, followingId])
}
model Organization {
id String @id @default(uuid())
name String
slug String @unique
members Member[]
projects Project[]
}
model User {
id String @id @default(uuid())
email String @unique
memberships Member[]
}
model Member {
id String @id @default(uuid())
userId String
user User @relation(fields: [userId], references: [id])
orgId String
org Organization @relation(fields: [orgId], references: [id])
role String // 'owner', 'admin', 'member'
@@unique([userId, orgId])
}
model Project {
id String @id @default(uuid())
name String
orgId String
org Organization @relation(fields: [orgId], references: [id])
tasks Task[]
}
model Task {
id String @id @default(uuid())
title String
completed Boolean @default(false)
projectId String
project Project @relation(fields: [projectId], references: [id])
}
PostgreSQL:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
// PostgreSQL-specific types
model Example {
jsonData Json
textData String @db.Text
amount Decimal @db.Decimal(10, 2)
}
MySQL:
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
SQLite (Development):
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
MongoDB:
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String @unique
}
1. Install Prisma:
npm install @prisma/client
npm install -D prisma
2. Initialize Prisma:
npx prisma init
3. Use generated schema:
prisma/schema.prisma with generated contentDATABASE_URL in .env4. Create migration:
npx prisma migrate dev --name init
5. Generate Prisma Client:
npx prisma generate
6. Use in code:
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
/sql-query-builder - Generate SQL queriesGenerate schemas fast. Migrate safely. Query confidently. ️