agentsclimarketplace

Ha backup platform add

Skill nolte/claude-home-assistant/skills/ha-backup-platform-add

Augments an existing Home Assistant Custom Integration with one backup-platform surface — pre/post backup hooks or a backup agent — conforming to spec/ha/backup-platform. For hooks it generates backup.py with async_pre_backup/async_post_backup that symmetrically pause and resume stateful operations around a backup; for an agent it generates the agent listing and listener wiring plus a BackupAgent subclass implementing the full upload/download/list/get/delete contract with the mandated error handling; exact signatures live in the body and spec. Disambiguates hooks-vs-agent by integration type before generating. Activate on "add backup hooks", "make my integration backup-aware", "provide a backup agent", or equivalent German requests. Do not activate for greenfield scaffolding (ha-integration-scaffold), the sibling diagnostics module (ha-diagnostics-augment), encryption/retention/restore orchestration (owned by the backup manager), or deploying to a live HA instance.From its SKILL.md

Install
npx -y skills add nolte/claude-home-assistant --skill ha-backup-platform-add

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.8 KB, as published. Nobody here has run it

HA Backup Platform Add

Spec: spec/claude/ha-backup-platform-add/en.md (EN canonical) / spec/claude/ha-backup-platform-add/de.md (DE translation).

Why this is a skill, not an agent

  • Human-visible augmentation surface — the user describes the integration type and reads back the backup.py module and the conformance report; a skill keeps this on the visible command surface, like the sibling augment skills (ha-config-flow-augment, ha-coordinator-add, ha-repairs-add, ha-device-automation-add).
  • Mid-flow interactivity — the hooks-vs-agent disambiguation is a per-run dialogue the user approves before generation.
  • Bounded, inline generation — one platform module (the two hook functions, or the agent class plus its registration) fits inline; no isolated agent context is needed.
  • Counter-dimension considered: the draft→validate loop could be an agent, but the surface decision belongs in the user's working context; skill wins.

When this skill activates

Use this skill to add one backup-platform surface — pre/post backup hooks (for DB-writing or stateful integrations) or a backup agent (for storage-providing integrations) — to an existing integration via its backup.py platform module.

When NOT to activate

  • greenfield integration scaffolding → ha-integration-scaffold
  • the sibling diagnostics platform module → ha-diagnostics-augment
  • backup encryption, retention, scheduling, or restore orchestration → owned by the backup manager / HA core, out of scope
  • deploying/importing into a running HA instance → out of scope

Hard rules

  1. One surface, one run. Either pre/post hooks or a backup agent — no combined batch.
  2. Read spec/ha/backup-platform/en.md first. Do not generate from memory.
  3. Disambiguate the surface. Stateful / DB-writing integration → pre/post hooks; storage-providing (cloud-storage) integration → backup agent. When both apply, have the user pick the one this run augments.
  4. Hooks contract. async_pre_backup(hass: HomeAssistant) -> None and async_post_backup(hass: HomeAssistant) -> None are top-level async functions; whatever async_pre_backup pauses, async_post_backup resumes.
  5. Agent registration. async_get_backup_agents(hass) returns list[BackupAgent] and must return [] when no loaded config entry exists for the domain (hass.config_entries.async_loaded_entries(DOMAIN)). async_register_backup_agents_listener(hass, *, listener, **kwargs) is a @callback returning an unregister function; notify listeners during async_setup_entry.
  6. Agent contract. The BackupAgent subclass (from homeassistant.components.backup) sets domain/name/unique_id and implements async_upload_backup, async_download_backup, async_list_backups, async_get_backup, and async_delete_backup — the full abstract interface.
  7. Error semantics. Errors raise BackupAgentError (or a subclass) — no other exception leaves the agent; a missing backup raises BackupNotFound in async_download_backup/async_delete_backup/async_get_backup. Call the on_progress callback periodically in async_upload_backup.
  8. No backup-manager territory. Never implement encryption, retention, scheduling, or restore orchestration; those belong to the backup manager or the core.
  9. Name per spec/ha/naming-conventions/en.md and verify HA internals against the official docs (see spec/ha/upstream-docs-verification/en.md).

Inputs

FieldRequiredDefaultNotes
target_diryes—repo root; custom_components/<domain>/manifest.json must exist
needyes—the integration type / backup need, in prose
surfacenoinferred + confirmedhooks / agent
name / unique_idnoderivedagent identity (agent surface only)
storage / paused operationsnoasked when neededstorage binding (agent) or operations to pause (hooks)

If the user is silent on an optional field, use the default but state it explicitly.

Pre-flight (in order — abort on first failure)

  1. target_dir/custom_components/<domain>/manifest.json exists; read domain.
  2. Resolve surface (infer + confirm). Disambiguate hooks vs. agent by integration type; when both apply, have the user pick the one for this run.
  3. Read ha/backup-platform.
  4. The targeted exports are not already declared in backup.py. If they are, abort.

Workflow

1) Resolve and confirm

State domain, the resolved surface, and (for an agent) the name/unique_id and storage binding in one paragraph. Wait for confirmation.

2) Generate

SurfaceModule exports
hooksasync_pre_backup(hass) + async_post_backup(hass) (top-level async, symmetric pause/resume)
agentasync_get_backup_agents(hass) (empty list without a loaded config entry) + async_register_backup_agents_listener (@callback) + a BackupAgent subclass (domain/name/unique_id, upload/download/list/get/delete, BackupAgentError/BackupNotFound)

Write to custom_components/<domain>/backup.py. Mention the python3 -m script.scaffold backup template as a quick start; the skill itself generates offline.

3) Validate and report

Validate offline (backup.py present; for hooks both top-level functions exported; for an agent async_get_backup_agents + the listener @callback exported, the empty-list-without-entry guard present, the BackupAgent subclass sets the identity and implements the five methods, errors raise BackupAgentError/BackupNotFound). Emit a CONFORMANT / NEEDS-WORK report keyed to ha/backup-platform acceptance criteria, plus the changed file paths and the chosen surface.

4) No deploy

The skill never deploys to a live HA instance. Surface the report and stop.

Boundaries

  • Greenfield scaffold → ha-integration-scaffold
  • Sibling diagnostics module → ha-diagnostics-augment
  • Encryption / retention / scheduling / restore → backup manager / HA core, out of scope
  • Deploy to live HA → out of scope

Keep looking

Skills are one crate of 608,666. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.