/ha-lovelace-taste:ha-lovelace-tastefrom ha-lovelace-taste
Builds Home Assistant Lovelace custom cards, editors, badges, and dialogs that match native HA UI using design tokens, card API, and conventions for themes, accessibility, and languages.
Ships in ha-lovelace-taste. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A good custom card is one a user can't tell apart from a core card. Home Assistant users switch between light and dark themes, custom themes, languages, 12 and 24 hour clocks, masonry and sections dashboards, phones and wall tablets. A card that hard-codes a color, a font or a pixel width breaks on some of these, and users notice at once. So the rule behind everything below: take every visual decision from Home Assistant itself, and add your own design only on top of its tokens.
Read the reference files when you get to that part of the work:
references/design-tokens.md - the tokens with their light and dark defaults, and ready-made
CSS for the native patterns (tile header, badges, alerts, features, segmented control, select
rows, charts, dialogs and bottom sheets)references/card-api.md - card and editor skeletons, re-rendering, registration that survives
the frontend's registry swap, hass helpers, events, distribution through HACS or the
integration itselfreferences/verification.md - the mock hass demo page, scenarios from real data, the
regression check between versions, README images in both themes, the release checklistreferences/hacs.md - publishing in the HACS default store: hacs.json, validation actions,
the README as HACS shows it, the brand icon, the pull request, what reviewers ask for, and
the README after the mergetranslation_key, states, attributes, units, device class, which ones are disabled by default
or unavailable. An export of the entities of one device, taken in a few states (off, ready,
running, finished), is worth more than any description. If the integration has more than one
version or fork, collect data from each: keys, state casing and option order often differ.ha-alert, more-info dialogs, card features.
Reuse their sizes, typography and behavior.var().hass, actions through standard
services, more-info on tap, a visual editor with ha-form, entities found from the device.Full list and copy-ready CSS in references/design-tokens.md. The parts that matter most:
ha-card own the surface. Wrap the card in <ha-card>: it already applies the theme's
background, border, radius and shadow (--ha-card-background, --ha-card-border-*,
--ha-card-border-radius, --ha-card-box-shadow). Don't paint your own card background.--primary-text-color, --secondary-text-color, --disabled-text-color, and
--text-primary-color for text on an accent fill. Never #000, #fff or rgba(0,0,0,.6).--ha-font-family-body, --ha-font-size-xs/s/m/l/xl/2xl/3xl,
--ha-font-weight-normal/medium/bold, --ha-line-height-condensed/normal. The tile card's name
is size m (14px) at medium weight, its secondary line size s (12px) in the secondary color.--ha-space-1 to --ha-space-20 (steps of 4px) and
--ha-border-radius-sm/md/lg/xl/2xl/3xl/pill, instead of your own numbers.var(--{name}-color) (red, pink, purple, deep-purple, indigo,
blue, light-blue, cyan, teal, green, light-green, lime, yellow, amber, orange, deep-orange,
brown, grey, blue-grey...), the semantic ones (--info-color, --warning-color,
--error-color, --success-color) and the state ones (--state-icon-color,
--state-inactive-color). Let the user pick the card color with the ui_color selector and
turn names into var(--{name}-color).::before with opacity: 0.2 for tile icons and buttons, 0.12 for alerts);
color-mix(in srgb, var(--accent) 20%, transparent) does the same where a layer doesn't fit.
Both are right in light and dark, because they show whatever is behind them.--disabled-color at 0.2 opacity, 42px high, like card features.--ha-tile-icon-border-radius, --ha-card-features-border-radius,
--ha-badge-border-radius, --ha-dialog-border-radius and --ha-dialog-surface-background
in the matching pattern, so a theme that restyles core cards restyles yours too.<ha-icon icon="mdi:..."> sized with --mdc-icon-size. Check that every icon name
exists in the MDI version Home Assistant ships (a missing name renders as an empty square).var(--ha-font-size-m, 14px): older Home Assistant versions and
some themes don't define the newer tokens.Design on top, not instead: a custom dial, a hob map or a usage chart is fine, as long as its strokes, fills, text and states come from the same tokens. Check it with a dark theme and with a custom theme that changes the primary color.
Every card must look right in the light theme and in the dark theme from the first draft, not as a fix later. Users switch themes by hand, by schedule or with the sun, and a card that only works in one of them is broken for half of them.
prefers-color-scheme inside a card: the user can run a dark Home Assistant on a light OS. Read
colors from the theme tokens; if logic really needs to know, use hass.themes.darkMode.var().color-mix(..., transparent), never by mixing with white or
black: the tint then sits on the light or dark card background and keeps its meaning in both.--disabled-color goes from
#bdbdbd to #464646, --energy-grid-return-color changes too. Colors computed in
JavaScript (chart shades read with getComputedStyle) must be recomputed when hass.themes
changes.--text-primary-color or white, and the fill must be strong enough for it in both themes:
set a minimum opacity rather than letting a pale fill carry white or dark text.rgba(0, 0, 0, 0.28) and similar); they read in
both themes. Borders use --divider-color or the card border tokens.currentColor or the same tokens in fill and stroke, never
literal colors.<picture> with
<source media="(prefers-color-scheme: dark)">, because GitHub follows the reader's theme.hass-more-info event): users expect to reach
the entity, its history and its settings from anywhere on a card.switch.toggle, select.select_option, number.set_value,
button.press), so actions show in the logbook and can be reproduced in automations.hass.formatEntityState(stateObj) for states and units;
Intl formatters that follow hass.locale.number_format (decimal separator chosen by the
user, not by the language), hass.locale.time_format (12, 24, language, system) and
hass.locale.time_zone. Don't format numbers or dates by hand.hass is replaced on every state change in the
instance. Redraw only when the card's own entities, the registry, the language or the theme
changed, and then patch the DOM rather than replacing it, so open selects, focus and
animations survive.hass-notification event) in the user's language.unavailable and unknown as such, hide features whose
entities never report a value, and don't treat an entity left behind by an old version
(restored: true in its attributes) as the real one.Don't ask users to type entity ids. Let them pick the device in the editor (device selector
filtered by integration and model), then read hass.entities (the entity registry) and keep the
entities of that device, recognized by their translation_key. Renamed entities keep working,
and the card works in every language. When versions of the integration name a key differently,
keep a small alias table; when an old and a new entity share a key, prefer the one that has a
state.
Follow the user's language (hass.locale.language, then hass.language), with English for
anything else. Ship your own strings for what the integration doesn't translate (program names,
options), named like the vendor's own app in that language, and keep them in one table that can be
exported for translators. Program and option ids from different appliances can collide: scope
names by appliance type when the same id means different things.
getGridOptions() for sections dashboards (for example
{ columns: 12, min_columns: 6 }) and getCardSize() for masonry.container-type: inline-size on the card) instead of viewport media
queries: the same card can be a third of a desktop or a full phone width.role="button", tabindex="0", Enter and Space on anything clickable;
aria-pressed on toggles; aria-label on icon-only buttons; a :focus-visible ring in the
accent color.<dialog> styled like Home Assistant's (580px wide, 24px radius), that
becomes a bottom sheet on phones (core switches below 870px wide or 500px tall) with room for
the safe area.prefers-reduced-motion: reduce, as core
does.Treat every card that already ships as a contract: adding a card or a feature must not change the
others. Before proposing a commit, render every card, in every state and language, with the
published version and with the new one, and explain every difference (see
references/verification.md). Data from real users, including the other version of the
integration, belongs in that check. Shared code (base classes, string tables, alias tables,
helpers) is where accidental changes come from: give new behavior a hook that does nothing by
default, so the output of the other cards stays identical byte for byte.
Lessons from real appliances that a mock won't show:
0.0166666666666667 h, which is 60.0000001 seconds.
Round before comparing with thresholds.min120 comes before min30: sort stepped values by their number.Run and run): normalize before comparing.unavailable forever because the appliance lists the feature but
never reports it.translation_key (zones, cavities): tell them apart by the number
in the entity id or friendly name.VERSION constant and a console banner with it.window.customElements for a
polyfilled registry while it boots; an element defined before that is unknown to the
dashboard ("Custom element doesn't exist"). Wait for home-assistant (or hc-main) to be
defined, then define the card and editor if not defined yet. Push the card into
window.customCards once, with preview: true, so it shows in the card picker.hacs.json with the file name), or the card served
by its own integration (static path plus add_extra_js_url, with a ?v= that changes with the
file), so users install one thing. Details in references/card-api.md.icon="..." lets a quote inject markup into the dashboard.hacs/default, and patience. Reviewers read
the code: escaping, blocking I/O on the event loop, admin-only actions, nothing private under
/config/www, no personal data in names, a license that is yours to give. After the merge the
README leads with the HACS search. Everything in references/hacs.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
home-assistant, lovelace, custom-cards, hacs, design-system, web-components
npx claudepluginhub fabioscarparo/home-assistant-lovelace-taste-skill --plugin ha-lovelace-tasteOther plugins' skills for the same job