원클릭으로
prisma-data-model
Use when changing Prisma schema, migrations, constraints, or data model invariants.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when changing Prisma schema, migrations, constraints, or data model invariants.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when adding, changing, extracting, or reusing client components, including Storybook stories and controls.
Use when adding or changing forms in apps/client.
Use when changing GitHub OAuth, session cookies, SessionGuard, logout, or authenticated API request identity.
Use when adding or changing routes in apps/client.
Use when adding or changing client state, React Query data flow, immutable context values, or Zustand stores.
Use when styling apps/client with Tailwind CSS v4.
| name | prisma-data-model |
| description | Use when changing Prisma schema, migrations, constraints, or data model invariants. |
Generated from ai/registry.json. Do not edit manually.
Canonical skill: ../../../ai/skills/prisma-data-model.md.
Referenced context:
../../../ai/rules/prisma-data-model-rules.md../../../ai/architecture/data-model.md../../../ai/architecture/tenant-access.md../../../ai/glossary/domain-terms.mdThis file is compiled from canonical AI knowledge files. Edit canonical files under ai, then run npm run ai:sync.
ai/skills/prisma-data-model.mdUse this skill when changing Prisma schema, migrations, database constraints, tenant relationships, or data-model documentation.
Change the relational model without breaking tenant reachability, SDK-visible invariants, migration history, or data-model documentation.
ai/rules/prisma-data-model-rules.mdai/architecture/data-model.mdai/architecture/tenant-access.mdai/glossary/domain-terms.mddocs/DATA_MODEL.mddocs/TECHNICAL_DECISIONS.mdnpm --workspace @capture-flag/api run db:generate after Prisma schema changes.npm --workspace @capture-flag/api run build after generated client or model changes.ai/rules/prisma-data-model-rules.mdRules for schema, migrations, constraints, and data model invariants.
snake_case through Prisma @@map and @map.@db.Uuid and database-generated IDs.createdAt and updatedAt to mutable entities unless there is a concrete reason not to.docs/DATA_MODEL.md consistent.key = default.config + environment.enabled field; the served boolean value is the state.ai/architecture/data-model.mdThe data model supports a SaaS feature flag and remote config product.
Organization
Project
Config
Feature Flags
Environment
config + environment.deletedAt, revokedAt, and acceptedAt preserve historical state when product behavior needs it.Schema or migration changes that alter relationships, constraints, or invariants must update docs/DATA_MODEL.md.
ai/architecture/tenant-access.mdCapture Flag is multi-tenant from the first MVP slice. Tenant boundaries are enforced in API services.
Organization
Project
Config
Environment
SDK Key
Segment
Feature Flag
Feature Flag Environment Value
Config Environment State
Audit Log
Every operational entity must be reachable from an organization, directly or through a project.
AccessService centralizes private API access checks.
requireOrganizationMember(userId, organizationId) verifies organization membership.requireOrganizationRole(userId, organizationId, roles) verifies allowed organization roles.requireProjectAccess(userId, projectId) verifies project read access.requireProjectRole(userId, projectId, projectRoles, organizationRoles) verifies project write access.Organization owner and admin roles can satisfy project access even without explicit project membership.
Organization member and viewer roles do not satisfy project access on their own. They need an explicit project membership for project reads, and a matching project role for project writes.
owner/admin manage organization members, organization roles, and projects, but only owners can create, change, or remove owners.project_admin manages project members, configs, environments, SDK keys, segments, and flags for that project.developer manages flags only, not project members, configs, environments, SDK keys, or segments.viewer is read-only.request.user.id to the service.AccessService with the resolved organization or project.ai/glossary/domain-terms.mdCore Capture Flag domain language.
Authenticated platform identity. Users are global and can belong to multiple organizations.
External provider account linked to a user, such as GitHub.
Opaque client session stored in an HTTP-only cookie. The database stores only the token hash.
Primary tenant. Organizations own projects and organization memberships.
User membership and role inside an organization.
Product, application, or system inside an organization. Projects group configs, environments, SDK keys, members, flags, and segments.
User membership and role scoped to one project.
Named set of flags/settings consumed by SDKs as public Config JSON.
Runtime environment such as development, staging, or production.
Reusable targeting group scoped to a config. SDKs evaluate segment membership locally from Evaluation Context data.
Immutable record of important domain changes used for investigation and compliance.