home-assistant-card
Skill18 starsChanged 9 months agoMITView on GitHub
Use when creating, reviewing, debugging, or maintaining Home Assistant custom Lovelace cards or card editors, including custom elements, Web Components, hass data, setConfig, getCardSize/getGridOptions, getConfigElement/getConfigForm, window.customCards, resource registration, HACS card packages, entity display, service calls, translations, or frontend build validation.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-logSkill
- commitSkill
- home-assistant-integrationSkill
- interactive-debuggingSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill for Home Assistant custom card development.
- Very specific: line 20
Use rendered pages on developers.home-assistant.io only as secondary reading.
- Very specific: line 22
Use references/frontend-docs.md as the docs routing index.
- Very specific: line 28
Read the relevant reference: references/card-workflow.md for repo structure and validation, references/card-patterns.md for card API …
- Distinctive: line 29
Keep diffs surgical. Work with dirty worktrees.
- Very specific: line 30
Prefer explicit config validation/defaulting in setConfig or a local helper.
- Very specific: line 31
Use Home Assistant frontend data and APIs deliberately: hass.states, hass.localize, hass.callService, custom events, card sizing, editor …
- Very specific: line 34
Run repo-local validation, usually npm test, npm run lint, npm run build, or equivalent scripts.
- Very specific: line 46
Check setConfig, defaults, missing-entity handling, unavailable state, card sizing, editor updates, and card picker metadata.
- Distinctive: line 47
Verify service calls use the intended domain, service, data, and target shape.
- Distinctive: line 48
Check translations, HACS metadata, generated bundle expectations, and public-registry hygiene if dependencies changed.
- Distinctive: line 49
Run local validation scripts and report any commands that could not be run.
≈ “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.
Files
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 the Home Assistant developers docs repository before changing card APIs. All doc paths in this skill's 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. Fetch only relevant files, and do not copy Home Assistant docs into generated skill or repo files.
Use references/frontend-docs.md as the docs routing index. The most important source is frontend/custom-ui/custom-card.md.
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.
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
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.

