基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/wrtnlabs/autobe --skill fix-db命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | fix-db |
| description | Fix Prisma schema compilation errors |
| allowed-tools | Read, Edit, Write, Bash, Grep, Glob |
Fix Prisma schema compilation errors according to code conventions.
NEVER use:
enum types (use String with TypeScript union types instead)Fix compilation errors in Prisma schema files to ensure npm run build:prisma passes.
┌─────────────────────────────────────┐
│ Step 1: Run Build │
│ npm run build:prisma │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 2: Parse Errors │
│ - Syntax errors │
│ - Relation errors │
│ - Type errors │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 3: Fix by Convention │
│ Apply code conventions │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 4: Re-run Build │
│ Loop until 0 errors │
└─────────────────────────────────────┘
npm run build:prisma 2>&1
Capture all error output.
Common error types:
Error parsing attribute: Syntax error in decoratorError validating field: Invalid field typeError validating relation: Missing or invalid relation// Standard
id String @id @db.Uuid
created_at DateTime @db.Timestamptz
updated_at DateTime @db.Timestamptz
deleted_at DateTime? @db.Timestamptz
{parent}_id String @db.Uuid
{parent} {prefix}_{parents} @relation(fields: [{parent}_id], references: [id], onDelete: Cascade)
// DO NOT use Prisma enum
status String // "active" | "inactive" defined in TypeScript
// WRONG - Never do this
// enum Status { ACTIVE INACTIVE }
parent_id String? @db.Uuid
parent {Model}? @relation("recursive", fields: [parent_id], references: [id], onDelete: Cascade)
children {Model}[] @relation("recursive")
@@index([{parent}_id, status])
@@index([name(ops: raw("gin_trgm_ops"))], type: Gin)
npm run build:prisma
Repeat Steps 2-4 until no errors.
| Error Pattern | Fix |
|---|---|
| Missing relation | Add @relation with fields and references |
| Invalid type | Use correct Prisma types (String, Int, DateTime, etc.) |
| Duplicate model | Remove duplicate or rename |
| Missing @@map | Add table name mapping |
| Enum error | Replace with String type |
npm run build:prisma completes with no errors