Install any skill in seconds. Free to start, no credit card required.
Get Started Free →django-models
Design Django ORM models for Sentry following architectural conventions for silos, replication, relocation, and foreign keys.
Passed 11 of 23 test cases with the skill, and 5 of 23 without it.
6 fixed5 passed either way12 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
The instructions your model reads when the skill loads.
This skill captures the architectural decisions that go into a Sentry model. It does not cover Django syntax, import order, or migration generation — for those:
generate-migration skill after the model is designed.hybrid-cloud-outboxes skill.hybrid-cloud-rpc skill.Before writing any fields, decide all four. They are coupled — getting one wrong forces a follow-up migration to fix the others.
Cell silo (@cell_silo_model) is the default. Use control silo (@control_silo_model) only when the data is shared across organizations or has to be strongly consistent with other control-silo resources (auth, integration installs, API tokens, slug reservations).
The wrong way to think about it: "this is a user-facing thing, so control." The right way: "what is the smallest silo where this can correctly live, and is that silo the same as everything that mutates it together?" If a cell never reads it, it does not belong in the cell.
If yes, the model must inherit from ReplicatedCellModel (cell-side) or ReplicatedControlModel (control-side) and set category: ClassVar[OutboxCategory] = OutboxCategory.MY_THING. The base Model class is for data that genuinely never crosses the silo boundary.
Replication is part of the design, not a thing you bolt on later. If you have to ask "should other silo X be able to look this up by ID without an RPC?" — that is a replication decision, and it changes the base class. When in doubt, defer to the hybrid-cloud-outboxes skill before finalizing the model.
Every concrete model must set __relocation_scope__ — the runtime check at src/sentry/db/models/base.py raises if missing. The choice is almost always one of:
| Scope | When |
|---|---|
RelocationScope.Organization | Customer data tied to an org that should travel with the org during a relocation. Includes most projects, settings, members, dashboards, alerts. |
RelocationScope.Excluded | Transient data, telemetry, caches, system-internal state, anything in the getsentry app, or data not meaningful in another instance. |
A set of scopes with a get_relocation_scope() override exists but is rare; reach for it only when relocation behavior is per-instance conditional. Excluded cannot be part of a set.
If you are not sure: most new models that store a customer's working state are Organization; most new models that exist for Sentry's operations (queues, caches, attempts, jobs, feature flags consumed at runtime) are Excluded.
The FK type is an architectural statement, not a style choice:
test cases passed, vs 5 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.