Agent skill · Audited from source
Generate Migration
skill · getsentry/sentryNOASSERTION licenceAudited 29 Sep 2026 · source 42a3375c14f5
Is it safe? With care — CAUTION, grade B (89/100). We read this skill's source at commit 42a3375c14f5 and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 2 findings, 0 critical or high. What it does: Generate or review Django database migrations for Sentry. Use when creating or reviewing migrations and data migrations, adding/removing columns or tables, adding indexes, or resolving migration conflicts.
Cite
Cite this page
ModelsAtlas. “Generate Migration (getsentry/sentry)”. Retrieved 29 Sep 2026. https://modelsatlas.com/skills/getsentry/generate-migration
Trust audit
Audit 0.4.1 · source read 29 Sep 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 2 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (2)
MEDIUMInventory / provenanceinv.symlink · .claude/skills
.claude/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · api-docs/.node-version
api-docs/.node-version
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha 42a3375c14f5 · 29 Sep 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishergetsentry GitHub organizationOwner of the repository this skill is read from
- Source foldergetsentry/sentry/.agents/skills/generate-migrationThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdict42a3375c14f5A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Generate or review Django database migrations for Sentry. Use when creating or reviewing migrations and data migrations, adding/removing columns or tables, adding indexes, or resolving migration conflicts.
---
name: generate-migration
description: Generate or review Django database migrations for Sentry. Use when creating or reviewing migrations and data migrations, adding/removing columns or tables, adding indexes, or resolving migration conflicts.
---
# Generate Django Database Migrations
## Commands
Generate migrations automatically based on model changes:
```bash
sentry django makemigrations
```
For a specific app:
```bash
sentry django makemigrations <app_name>
```
Generate an empty migration (for data migrations or custom work):
```bash
sentry django makemigrations <app_name> --empty
```
## After Generating
1. If you added a new model, ensure it's imported in the app's `__init__.py`
2. Review the generated migration for correctness
3. Run `sentry django sqlmigrate <app_name> <migration_name>` to verify the SQL
4. Apply the migration locally with `sentry django migrate <app_name>` — Sentry's migration framework runs its safety checks on apply, so this catches unsafe ops (missing `is_post_deployment`, unsafe column changes, etc.) before CI does.
When editing a generated migration (e.g. swapping `DeleteModel` for `SafeDeleteModel`), **leave the auto-generated `is_post_deployment` comment block in place**. It documents a non-obvious flag with concrete guidance for future migration authors — useful context, not fluff. Only remove a comment if it's stale or contradicts the code.
### Don't test the ORM
Don't write tests that only exercise Django's ORM. Standard operations — create/update/delete, cascading deletes, unique-constraint enforcement — are provided by Django and Postgres and are assumed to work. Test _your_ logic (business rules, signal receivers, custom managers/validation), not the framework's.
### Do test data migrations and backfills
The exception to the above: a migration that **backfills or transforms data** is your logic, and it must have a test. Use the `TestMigrations` base class from `sentry.testutils.cases`; tests live in `tests/sentry/migrations/`.
Set `app`, `migrate_from` (the migration just before yours), and `migrate_to` (yours). Seed pre-migration rows in `setup_before_migration(self, apps)` using the **historical** model registry (`apps.get_model("sentry", "MyModel")`) — not a direct `from sentry.models...` import, since the current model may not match the schema at `migrate_from`. Then assert the post-migration state.
**Write exactly one `test_*` method.** `setUp` runs the full migrate-down → seed → migrate-up cycle on _every_ test method, so each extra method pays for another round trip with no added coverage. Cover multiple cases by seeding all of them in `setup_before_migration` and asserting each in the single test body.
```python
from sentry.testutils.cases import TestMigrations
class BackfillFooTest(TestMigrations):
app = "sentry"
migrate_from = "0123_before"
migrate_to = "0124_backfill_foo"
def setup_before_migration(self, apps):
Foo = apps.get_model("sentry", "Foo")
self.empty = Foo.objects.create(value=None)
self.already_set = Foo.objects.create(value="kept")
def test_backfill(self):
self.empty.refresh_from_db()
self.already_set.refresh_from_db()
assert self.empty.value == "expected"
assert self.already_set.value == "kept"
```
**`app` and `connection`**: `app` is the Django app label whose migration you're testing — `"sentry"` by default, but set it to e.g. `"workflow_engine"` when the migration lives in that app's `migrations/` directory. `connection` is the database alias, `"default"` by default; set it to whichever connection the model's table actually lives on. Both must match where the migration and its tables actually live, or the migrate up/down will run against the wrong database.
Run these tests locally with the `--migrations` and `--reuse-db` flags. On the first run, it will be necessary to use `--create-db` along with `--reuse-db` to get the database in a good state.
## Guidelines
### Historical Models and Save Hooks
`apps.get_model()` returns a historical model class without custom `save()` methods. Signals it emits use the historical class as sender, so receivers scoped to the live model, such as cache invalidation hooks, do not run.
When authoring or reviewing a data migration, inspect the live model's save hooks and explicitly perform required side effects. Keep using `apps.get_model()`; importing the live model is not a safe workaround.
### Adding Columns
- Use `db_default=<value>` instead of `default=<value>` for columns with defaults
- Nullable columns: use `null=True`
- Not null columns: must have `db_default` set
### Adding Indexes
For large tables, set `is_post_deployment = True` on the migration as index creation may exceed the 5s timeout.
### Deleting Columns
Deleting takes two migrations. Write both up front, but they must be **two separate PRs**, with phase 2 stacked on top off phase 1 so its migration depends on it. Say clearly that **phase 2 can't merge until phase 1 has deployed** — merging them together drops the column while old code is still running.
**Phase 1 — `MOVE_TO_PENDING`**
Run `makemigrations` twice, in this order. Once the field is off the model Django can't generate the `AlterField` anymore, so doing it the other way around means silently shipping without it.
1. With the field **still on the model**, edit it in place: `db_constraint=False` if it's an FK, `null=True` if it's not nullable and has no `db_default`. Run `makemigrations` to get the `AlterField`.
2. Remove the field and every code reference to it, then `makemigrations` again. Replace the generated `RemoveField` with `SafeRemoveField(..., deletion_action=DeletionAction.MOVE_TO_PENDING)` — this drops the Django state, not the column.
3. Hand-merge both into one migration. Example:
```python
operations = [
migrations.AlterField(
model_name="testmodel",
name="project",
field=sentry.db.models.fields.foreignkey.FlexiblExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 42a3375
git clone https://github.com/getsentry/sentry git -C sentry checkout 42a3375c14f5
The author documents no install command, so this uses the repository directly. Our verdict covers commit 42a3375c14f5 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- !CAUTION B 89 / 100
first audit · source
42a3375c14f5
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/getsentry/generate-migration/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All devops & cloud skills →getsentry/sentry
Instrument and discover analytics events in Sentry's frontend UI. Use when adding tracking to buttons, pages, modals, or custom interactions, when defining new analytics events, when searching for existing events, when…
getsentry/sentry
Reference and active migration guide for Sentry's cell architecture. Explains what cells and localities are and why they're different, how requests reach cells via Synapse API routing, ingestion routing, and the control…
getsentry/sentry
Guide for adding new actions to Sentry's Command+K palette. Use when implementing new cmdk actions, registering page-level or global actions, building async resource pickers, or adding contextual actions to a view.
getsentry/sentry
Guide for using Sentry's layout and text primitives. Use when implementing UI components, layouts, or typography. Enforces use of core components over styled components.
getsentry/sentry
Design Django ORM models for Sentry following architectural conventions for silos, replication, relocation, and foreign keys. Use when adding a new Django model, designing a model for a feature, deciding where data…
getsentry/sentry
Guide for creating forms using Sentry's new form system. Use when implementing forms, form fields, validation, or auto-save functionality.
Add this badge to your README
[](https://modelsatlas.com/skills/getsentry/generate-migration/)
<a href="https://modelsatlas.com/skills/getsentry/generate-migration/"><img src="https://modelsatlas.com/skills/getsentry/generate-migration/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about Generate Migration
What does the Generate Migration skill do?
Is Generate Migration safe to install?
What can Generate Migration access on my machine?
How current is this page?
Sources
- github.com/getsentry/sentry/tree/master/.agents/skills/generate- — the audited source at commit 42a3375c14f5 and every finding aboveObserved · 29 Sep 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Generate Migration skill do?
- Is Generate Migration safe to install?
- What can Generate Migration access on my machine?