用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/trycompai/comp --skill prisma命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Run all audit checks (RBAC, hooks, design system, tests) and verify build
Check code for the most common, high-risk security vulnerabilities (broken access control, tenant isolation, injection, secrets, SSRF, auth/session, unsafe file handling, mass assignment) before it ships. Use after editing any API controller, guard, or auth code (apps/api/src/auth/**), a Prisma schema/query, a file-upload/webhook handler, or before committing/pushing security-sensitive changes.
How to reuse ANY integration check's results in a feature via the universal CheckResultsService (apps/api integration-platform). Use whenever a feature needs data produced by an integration check — "show 2FA status on People", "surface AWS S3 findings in X", "reuse a check's results", "per-user/per-resource results from a connected integration", "which integrations feed task T". Read this BEFORE writing your own IntegrationCheckResult / CheckRunRepository query — don't hand-roll it.
基于 SOC 职业分类
正在显示 SKILL.md
| name | prisma |
| description | Prisma schema conventions and migration workflow |
Source Cursor rule: .cursor/rules/prisma.mdc.
Original file scope: **/*.prisma.
Original Cursor alwaysApply: false.
Schema changes happen in packages/db, then regenerate types in each app.
# Schema files are in packages/db/prisma/schema/
packages/db/prisma/schema/
├── schema.prisma # Main schema with datasource
├── user.prisma # User models
├── task.prisma # Task models
└── ...
# Run from packages/db
cd packages/db
bunx prisma migrate dev --name your_migration_name
# Each app needs to regenerate Prisma client types
bun run -F apps/app db:generate
bun run -F apps/api db:generate
bun run -F apps/portal db:generate
# Or from root (if configured)
bun run prisma:generate
# 1. Make schema changes in packages/db
# 2. Create migration
cd packages/db && bunx prisma migrate dev --name add_user_role
# 3. Regenerate types in ALL apps that use the db
bun run -F apps/app db:generate
bun run -F apps/api db:generate
bun run -F apps/portal db:generate
# Don't edit schema in app directories
apps/app/prisma/schema.prisma # ❌ Wrong location
# Don't forget to regenerate types
bunx prisma migrate dev # ✅ Created migration
# ... forgot to run db:generate in apps # ❌ Types out of sync
Always use prefixed CUIDs for IDs using generate_prefixed_cuid.
model User {
id String @id @default(dbgenerated("generate_prefixed_cuid('usr'::text)"))
// ... other fields
}
model Task {
id String @id @default(dbgenerated("generate_prefixed_cuid('tsk'::text)"))
// ... other fields
}
model Organization {
id String @id @default(dbgenerated("generate_prefixed_cuid('org'::text)"))
// ... other fields
}
// Don't use UUID
model User {
id String @id @default(uuid())
}
// Don't use auto-increment
model User {
id Int @id @default(autoincrement())
}
// Don't forget ::text cast
model User {
id String @id @default(dbgenerated("generate_prefixed_cuid('usr')")) // ❌ Missing ::text
}
| Entity | Prefix | Example ID |
|---|---|---|
| User | usr | usr_BJRIZLgRPuWt8MvMjkSY82f1 |
| Organization | org | org_cK9xMnPqRs2tUvWx3yZa4b5c |
| Task | tsk | tsk_dE6fGhIj7kLmNoP8qRsT9uVw |
| Control | ctl | ctl_xY0zAaBb1cDdEe2fFgGh3iIj |
| Policy | pol | pol_kK4lLmMn5oOpPq6rRsSt7uUv |
::text in the function calldbgenerated()usr_ vs org_)After schema changes:
packages/db/prisma/schema/bunx prisma migrate devapps/app with db:generateapps/api with db:generateapps/portal with db:generate