← ClaudeAtlas

ha-config-entry-migratelisted

Adds or extend async_migrate_entry in an existing Home Assistant Custom Integration to migrate stored config entries across a schema change — bump ConfigFlow.VERSION (breaking) or MINOR_VERSION (backward-compatible), transform entry.data / entry.options (rename, move, default, split keys) via hass.config_entries.async_update_entry, reject a newer-than-current entry by returning False, and add a migration test. Non-destructive to unrelated keys; never drops data silently. Activate on phrasings like "migrate the config entry to the new schema", "I renamed a config key and need a migration", "bump the config entry version", "migriere den Config-Entry auf das neue Schema", "füge eine async_migrate_entry hinzu". Do not activate for greenfield scaffolding (ha-integration-scaffold), setup-time config-flow patterns (ha-config-flow-augment), adding a new option (ha-options-flow-augment), or deploying to a live HA instance.
nolte/claude-home-assistant · ★ 1 · AI & Automation · score 71
Install: claude install-skill nolte/claude-home-assistant
# HA Config Entry Migrate Spec: `spec/claude/ha-config-entry-migrate/en.md` (EN canonical) / `spec/claude/ha-config-entry-migrate/de.md` (DE translation). This skill owns the config-entry **migration** path — `async_migrate_entry` plus the `VERSION` / `MINOR_VERSION` bump — that no other skill covers. It sits between `ha-config-flow-augment` (which explicitly excludes destructive refactors) and the initial scaffold, and is the maintenance move an integration needs whenever its stored `entry.data` / `entry.options` shape changes. ## Why this is a skill, not an agent - **Human-visible augmentation surface** — the user describes the schema change and reads back the `async_migrate_entry` body, the version bump, and the migration test; a skill keeps this on the visible command surface, like the sibling `ha-config-flow-augment`. - **Mid-flow interactivity** — whether the change is breaking (major `VERSION`) or backward-compatible (minor `MINOR_VERSION`), and the exact key transforms, are per-run dialogues the user confirms before generation. - **Bounded, inline generation** — one migration function plus the version bump and a test fits inline; no isolated agent context is needed. - Counter-dimension considered: the draft→validate loop could be an agent, but the breaking-vs-minor decision and the report belong in the user's working context; skill wins. ## When this skill activates Use this skill when an existing integration's stored config-entry shape changed — a renamed key,