Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Defines Sentry Django ORM model architecture choices: silo placement, replication base classes, relocation scope, and foreign key types.
22% 48%+26 ptsof test cases passed
Passed 11 of 23 test cases with the skill, and 5 of 23 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
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:
Next to this one in the catalogue, plus more from the same author.