From d53e40eea85727b2a3ee756d7d7abae91d27801a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ab=C3=ADlio=20Costa?= Date: Thu, 28 May 2026 16:03:43 +0100 Subject: [PATCH] Add skill instruction on not duplicating entity base class behavior (#172362) --- .claude/skills/ha-integration-knowledge/SKILL.md | 1 + .github/instructions/integrations.instructions.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.claude/skills/ha-integration-knowledge/SKILL.md b/.claude/skills/ha-integration-knowledge/SKILL.md index cd25d3127ef6..c7df10dacd54 100644 --- a/.claude/skills/ha-integration-knowledge/SKILL.md +++ b/.claude/skills/ha-integration-knowledge/SKILL.md @@ -24,6 +24,7 @@ The following platforms have extra guidelines: ## Entity platforms - Ensure `async_added_to_hass()` and `async_will_remove_from_hass()` have symmetrical behavior. For example, if a subscription is created in `async_added_to_hass()`, it should be unsubscribed in `async_will_remove_from_hass()`. Also, if something is torn down in `async_will_remove_from_hass()`, it should be set up in `async_added_to_hass()`. +- Entity base class (e.g. `SensorEntity`, `TrackerEntity`) provide a stable API for child classes to inherit from. Do not suggest redeclaring or duplicating attributes, properties, or methods the base class already provides, and do not add guards against the parent's behavior changing — rely on the base class instead. ## Integration Quality Scale diff --git a/.github/instructions/integrations.instructions.md b/.github/instructions/integrations.instructions.md index 4cbe4e0f18b9..420ca7d65b1a 100644 --- a/.github/instructions/integrations.instructions.md +++ b/.github/instructions/integrations.instructions.md @@ -27,6 +27,7 @@ The following platforms have extra guidelines: ## Entity platforms - Ensure `async_added_to_hass()` and `async_will_remove_from_hass()` have symmetrical behavior. For example, if a subscription is created in `async_added_to_hass()`, it should be unsubscribed in `async_will_remove_from_hass()`. Also, if something is torn down in `async_will_remove_from_hass()`, it should be set up in `async_added_to_hass()`. +- Entity base class (e.g. `SensorEntity`, `TrackerEntity`) provide a stable API for child classes to inherit from. Do not suggest redeclaring or duplicating attributes, properties, or methods the base class already provides, and do not add guards against the parent's behavior changing — rely on the base class instead. ## Integration Quality Scale