Recommend a design pattern for intent
card_builder_design_for_intentConvert a free-text card request into a concrete Home Assistant design pattern by scoring curated patterns and returning the best match plus alternatives.
Instructions
Score curated design patterns against a free-text intent and recommend the top match.
Scores each entry in DESIGN_PATTERNS by domain match (weight 5) and
intent-keyword overlap (weight 1.5 per hit against intent.lower()),
then returns the top scorer plus up to three runners-up; makes no
call to Home Assistant.
Use when: turning a user's free-text card request into a concrete
pattern/template recommendation.
Not for: the full pattern body — call
card_builder_get_design_pattern(name) on the recommendation; the
underlying design rules — call card_builder_design_principles.
Returns: {intent, domain, entity_id, recommendation, score, label, description, ux_notes, recommended_template, anti_patterns, next_steps, alternatives}, or {..., "recommendation": None, "note": ...} when nothing scores above zero.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | No | HA entity domain to weight the match toward, e.g. 'sensor'. Omit to infer from entity_id or match on keywords alone. | |
| intent | Yes | Free-text description of what the card should do, e.g. 'show battery level'. | |
| entity_id | No | Full entity id, e.g. 'sensor.battery'; used to infer domain when domain is omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||