agentleFS
denysdovhandenysdovhan/agents/skills/home-assistant-integration/SKILL.md

home-assistant-integration

Skill18 starsChanged 9 months agoMITView on GitHub

Use this skill when creating, scaffolding, reviewing, or maintaining Python Home Assistant custom integrations, including work on custom_components, manifests, config flows, options flows, config entries, platforms/entities, DataUpdateCoordinator, integration automation triggers, diagnostics, repairs, discovery/networking, authentication, HACS-ready repositories, or Home Assistant integration quality scale compliance.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for Home Assistant custom integration development.

    line 8
  2. Very specific:

    Use rendered pages on developers.home-assistant.io only as secondary reading.

    line 18
  3. Distinctive:

    Keep API/client code Home Assistant agnostic where the repo already separates it from integration code.

    line 34
  4. Distinctive:

    Use config entries and UI setup by default for real integrations.

    line 35
  5. Distinctive:

    Keep entities cheap: no I/O in entity properties.

    line 36
  6. Very specific:

    Use ConfigEntry.runtime_data for runtime objects when adding or reshaping integration state.

    line 37
  7. Very specific:

    Add tests for changed behavior.

    line 39
  8. Distinctive:

    When behavior is unclear, add narrow debug logging or ask for logs instead of guessing.

    line 40
  9. Distinctive:

    When scaffolding a new integration from an existing user repo, copy structure and tooling style, then remove business logic that does not …

    line 44
  10. Very specific:

    Add files such as config_flow.py, platform modules, coordinator.py, entity.py, diagnostics.py, repairs.py, translations, tests, and brand …

    line 54
  11. Distinctive:

    Default to Bronze. Higher levels are cumulative and should only be added when the user asks or explicitly accepts the extra scope.

    line 58
  12. Distinctive:

    Verify the requested quality level, defaulting to Bronze.

    line 67
  13. Distinctive:

    Run component and platform review checklists relevant to changed files.

    line 68
  14. Distinctive:

    Run local validation scripts from the repo instructions.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Home Assistant Integration Skill

Use this skill for Home Assistant custom integration development. This is separate from Home Assistant automation, helper, script, and Lovelace work.

Start With Current Docs

Fetch the latest markdown from the Home Assistant developers docs repository before coding. All doc paths in this skill and its references are relative to this base URL — prepend it when fetching:

https://raw.githubusercontent.com/home-assistant/developers.home-assistant/master/docs/

Use rendered pages on developers.home-assistant.io only as secondary reading. Do not copy Home Assistant docs into generated skill or repo files. Fetch only the files relevant to the task.

The reference files in this skill are the routing indexes to the doc paths; do not rely on remembered Home Assistant APIs. Always consult the relevant reference, then fetch the current markdown files it points to, before editing matching files:

ReferenceUse when
references/architecture.mdEditing generic integration architecture, lifecycle, setup, manifest, config entries, data fetching, events, diagnostics, auth, networking, docs, tests, or translations
references/core-integration-files.mdEditing core integration files such as __init__.py, manifest.json, config_flow.py, coordinator.py, diagnostics.py, repairs.py, services, translations, tests, or docs
references/entities-and-domains.mdEditing platform/entity files such as sensor.py, binary_sensor.py, calendar.py, weather.py, or deciding which platform domain fits a feature
references/automation-triggers.mdAdding or maintaining new integration-provided automation triggers in trigger.py and triggers.yaml
references/quality-rules.mdChecking Bronze/Silver/Gold/Platinum quality scale rules or reviewing an integration against Home Assistant quality requirements

Local Workflow

  1. Inspect local instructions first: AGENTS.md, scripts, pyproject.toml, workflows, README files, and existing custom_components/<domain> files.
  2. Preserve repo conventions. Prefer existing user Home Assistant repo patterns: uv tooling, scripts/lint, scripts/test, typed runtime data, DataUpdateCoordinator, config flows, diagnostics, translations, and minimal diffs.
  3. Keep API/client code Home Assistant agnostic where the repo already separates it from integration code.
  4. Use config entries and UI setup by default for real integrations. Use YAML only when the user explicitly asks or the existing repo still requires it.
  5. Keep entities cheap: no I/O in entity properties; update cached values through setup, coordinator refreshes, or event callbacks.
  6. Use ConfigEntry.runtime_data for runtime objects when adding or reshaping integration state.
  7. Handle setup failures with the Home Assistant exceptions that match the failure: retryable setup failures, auth failures, and permanent invalid configuration should not be conflated.
  8. Add tests for changed behavior. Run the repo scripts requested by local instructions, usually scripts/lint after Python changes and scripts/test before finishing.
  9. When behavior is unclear, add narrow debug logging or ask for logs instead of guessing.

Scaffolding Guidance

When scaffolding a new integration from an existing user repo, copy structure and tooling style, then remove business logic that does not belong to the new integration. Keep only the integration basics needed for setup, manifest validity, importability, testability, and future feature work.

Minimum shape for a custom integration is usually:

custom_components/<domain>/
  __init__.py
  manifest.json

Add files such as config_flow.py, platform modules, coordinator.py, entity.py, diagnostics.py, repairs.py, translations, tests, and brand assets only when required by the requested scope or the selected quality target. Use references/core-integration-files.md before adding or editing these files.

Quality Scale

Default to Bronze. Higher levels are cumulative and should only be added when the user asks or explicitly accepts the extra scope. Bronze means all Bronze rules apply; Silver includes Bronze; Gold includes Silver and Bronze; Platinum includes all lower levels.

Before finishing ordinary integration work, read references/quality-rules.md, confirm the current rule list from core/integration-quality-scale/_includes/tiers.json, fetch the latest markdown for each relevant rule, and verify every Bronze rule against the current code. If the user asks for Silver, Gold, or Platinum, make the additional rule set part of the implementation scope before coding.

Review Checklist

Before finishing:

  1. Re-fetch relevant docs and quality rule files.
  2. Verify the requested quality level, defaulting to Bronze.
  3. Run component and platform review checklists relevant to changed files.
  4. Confirm config entry setup, unload, runtime data, entity IDs, translations, diagnostics, and tests match the selected scope.
  5. Run local validation scripts from the repo instructions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.