원클릭으로
orm-models
Creating Eloquent-style models, queries, relationships, casts, factories, and API resources in Rudder
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Creating Eloquent-style models, queries, relationships, casts, factories, and API resources in Rudder
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Setting up authentication with guards, sessions, registration, password reset, gates/policies, and vendor views in Rudder
Building MCP servers with tools, resources, prompts, decorators, and HTTP/stdio transports in Rudder
Creating controller-returned views with route overrides, multi-framework support, and the html tagged template in Rudder
Building AI agents with tools, streaming, conversation memory, approval flows, and middleware in Rudder
Defining server and client tools with Zod schemas, approval gates, streaming yields, and modelOutput for Rudder AI agents
Setting up authentication with guards, sessions, registration, password reset, gates/policies, and vendor views in Rudder
| name | orm-models |
| description | Creating Eloquent-style models, queries, relationships, casts, factories, and API resources in Rudder |
| license | MIT |
| appliesTo | ["@rudderjs/orm","@rudderjs/orm-prisma"] |
| trigger | creating or editing a `Model` class under `app/Models/`, writing queries / relationships, defining casts / accessors / factories, or building `JsonResource` API resources |
| skip | a route handler that only reads a model — controller-views is enough |
| metadata | {"author":"rudderjs"} |
Load when you're creating or editing a Model class under app/Models/, writing queries, defining casts / accessors / factories, or building JsonResource API resources. For depth, open the rule file matching your task.
| Task | Open |
|---|---|
Define a model — static table, fillable, hidden, casts, soft deletes, decorators, custom casts | rules/defining-models.md |
Query the database — find / where / paginate, eager loading, scopes, soft-delete filters | rules/querying.md |
CRUD + observers — create / update / delete, observer lifecycle, atomic counters | rules/crud-and-observers.md |
Test data — ModelFactory, sequence, states, .make() vs .create() | rules/factories.md |
API output — JsonResource, ResourceCollection, when / whenLoaded / mergeWhen | rules/resources.md |
ModelRegistry.set(adapter) plugs in the DB driver. @rudderjs/orm has no runtime DB dependency.find/first/all/where(...).get()/paginate) returns Model instances, not plain records. Use Model.hydrate(record) to wrap external data (cached JSON, fixtures).static fillable (allowlist) / static guarded (denylist; ['*'] locks all) drop keys outside policy on create / update / fill. instance.forceFill bypasses.Model.create/update/delete fire lifecycle events. query().create() bypasses them. increment / decrement deliberately do not fire — pure data-plane operations.'string', 'integer', 'float', 'boolean', 'date', 'datetime', 'json', 'array', 'collection', 'encrypted', 'encrypted:array', 'encrypted:object'. Encrypted casts need @rudderjs/crypt.See playground/app/Models/User.ts for a working model and playground/routes/console.ts for factory-based seeding.