safe-change

Installation
SKILL.md

Safe Change

Never change something in place when other code depends on it. Add the new thing next to the old, move callers over, then remove the old. Each phase is its own PR and deploy, and each one is safe to roll back on its own.

Step 0: Know the callers

You need the full list of callers before you start: run impact-analysis if you haven't. If the code being changed has thin test coverage, run characterization-tests first so you'll notice if behavior shifts.

Step 1: Pick the pattern

Rename a model field (status → state)

  1. Expand: add state (nullable or with default). Write to both on save. Migration + backfill (django-migrations).
  2. Migrate readers: switch all reads (code, serializers, filters, admin, raw SQL, other repos) to state.
  3. Stop writing status. Make it nullable if it wasn't.
  4. Contract: remove the field from the model with SeparateDatabaseAndState (state only), deploy, then drop the column in a later migration.
Installs
1
GitHub Stars
1
First Seen
9 days ago