Home Assistant Card Skill
Use this skill for Home Assistant custom card development. Custom cards are Web Components; any framework that defines custom elements can work. Lit and helper libraries are optional unless the repo already uses them.
This is separate from Python integrations, automations, scripts, helpers, and ordinary dashboard YAML. Use those skills unless the work changes a custom card package, registration, editor, or card usage contract.
Start With Current Docs
Fetch current Markdown from Home Assistant Contributors before changing card APIs. All upstream doc paths in this skill and its references are relative to this base URL:
texthttps://contributors.home-assistant.io/
Each page has a Markdown version at <page URL>index.md. Use frontend/llms.txt to find current frontend pages and marketplace/llms.txt for packaging and distribution. Start at llms.txt for other areas. Fetch only relevant pages; do not load llms-full.txt by default or copy Home Assistant docs into generated skill or repo files. For human-readable links, omit index.md.
Use references/frontend-docs.md as the docs routing index. Start with frontend/custom-ui/card/index.md for card APIs and frontend/custom-ui/card-editor/index.md for editors and picker registration.
Local Workflow
- Inspect local instructions first:
AGENTS.md, package scripts, README, HACS metadata, build config, source entrypoints, card/editor files, translations, and release notes. - Preserve the existing architecture and framework. Do not convert frameworks, add helper libraries, or add build tooling unless required.
- Read the relevant reference:
references/card-workflow.mdfor repo structure and validation,references/card-patterns.mdfor card API patterns,references/card-examples.mdfor card/editor examples, andreferences/frontend-docs.mdfor current docs. - Keep diffs surgical. Work with dirty worktrees; never revert unrelated edits.
- Prefer explicit config validation/defaulting in
setConfigor a local helper. AbuildConfighelper is a useful pattern, not a requirement. - Use Home Assistant frontend data and APIs deliberately:
hass.states,hass.localize,hass.callService, custom events, card sizing, editor APIs, and resource registration. - Handle unavailable or missing entities without crashing the whole dashboard.
- For card editors, dispatch
config-changedwith the full updated config and preserve existing editor UX. - Run repo-local validation, usually
npm test,npm run lint,npm run build, or equivalent scripts. For dependency changes in public repos, keep lockfiles and package-manager config free of private or machine-local registry URLs.
Scaffolding Guidance
When scaffolding a new card, copy the repo's preferred structure if one exists. Minimum shape is a JavaScript module that defines a custom element and is registered as a dashboard resource with type module. Add TypeScript, bundling, visual editors, translations, HACS metadata, screenshots, or release automation only when requested or already expected.
Review Checklist
Before finishing:
- Re-fetch the relevant current docs.
- Confirm the custom element name, dashboard
custom:type, and resource URL still match. - Check
setConfig, defaults, missing-entity handling, unavailable state, card sizing, editor updates, and card picker metadata. - Verify service calls use the intended domain, service, data, and target shape.
- Check translations, HACS metadata, generated bundle expectations, and public-registry hygiene if dependencies changed.
- Run local validation scripts and report any commands that could not be run.


