HA NOVA Review
Scope
Read-only quality review for automations, scripts, helpers, storage scenes, and storage dashboards:
- Config quality checks (safety, reliability, performance, style)
- Notification checks follow
../ha-nova/mobile-notification-composition.md: objective schema, capability, safety, or privacy violations are findings; optional style differences are suggestions; recurring-workflow intent advice is low-severity usability advice, never a correctness finding - Collision scan (other automations targeting same entities)
- Conflict analysis (real conflicts vs safe patterns)
- Explorative questions for complex automation/script behavior
- Suggestion synthesis that separates open questions from confident recommendations
- Quick-Fix: if an acute state problem is detected, offer a single corrective service call
- Bulk review: aggregate the same checks across a deterministic multi-target workset
Read-only analysis. Exception: after explicit user confirmation, one Quick-Fix service call may be executed to correct an acute state problem detected during review.
- No
POST,PUT,PATCH, orDELETEconfig writes through the relay. - If the user wants to change an automation or script, hand off to
ha-nova:write. - If the user wants to change a helper, hand off to
ha-nova:helper. - The Quick-Fix service call in Step 4 is the only write exception in this skill.
- Bulk review is stricter: no Quick-Fix, no service calls, no write exception.
Bootstrap (once per session)
Read and follow ../ha-nova/session-bootstrap.md.
Relay Contract
Relay CLI: ha-nova relay
ha-nova relay ws --data-file <payload-file>— canonical WebSocket pathha-nova relay core --method <METHOD> --path <PATH> --body-file <payload-file>— canonical REST pathha-nova relay ... --jq-file <filter-file>— canonical complex filter pathha-nova relay ... --out <result-file>— canonical large-output path
Target Resolution
If user provides an exact automation/script entity_id (e.g., automation.main_lights), skip search and go directly to config read.
Storage scenes resolve like automations (registry unique_id → GET /api/config/scene/config/<id>; name-based requests search the scene. domain in the compact registry exactly like the automation keyword search). The Editability Guard from ha-nova:scene applies. A scene without registry unique_id is YAML-backed: run SC checks only when that scene's exact YAML is already in context; otherwise STOP and ask for the pasted scene YAML — never emit an empty or inferred review. Storage dashboards resolve by url_path (lovelace/dashboards/list → lovelace/config), and D-02/D-05 additionally read lovelace/resources. Apply the SC/D families from ../review/checks-extended.md; cross-item HX rules run in aggregate/bulk mode OR whenever their required registry/state context is already loaded. A dashboard D-01/D-06 pass normally loads that context, so apply HX-05 to visible card actions without expanding the workset. Flow adaptation for these targets: a SCENE replaces the Step-2 collision scan with a consumer scan (search/related on the scene entity — who activates it) and skips conflict analysis; a DASHBOARD skips Steps 2–4 entirely (no collision surface, no Quick-Fix) — its review is the D config-quality pass plus suggestion synthesis. Output for both: keep the Report shape but include ONLY the sections that ran (findings, consumers for scenes, suggestions, next step) — never render empty collision/conflict/Quick-Fix sections for checks that were intentionally skipped.
For helpers, resolve the family first:
- storage-based family: entity_id domain is one of
input_boolean,input_number,input_text,input_select,input_datetime,input_button,counter,timer,schedule - supported config-entry family: domain is one of
utility_meter,derivative,integration,min_max,threshold,tod,statistics,group,history_stats,template - config-entry helper review remains minimal, but target resolution must still normalize to a real
entry_id
Asked only about broken or missing references: ../ha-nova/bulk-patterns.md → Dead-Reference Sweep before any shortlist or Static Pass; its report is the answer.
If the target config is not already in the thread context, resolve it yourself:
- If the user asks for a bulk audit by
prefix,domain,area, orlabel, build a shortlist first using../ha-nova/bulk-patterns.md.
- use
config/entity_registry/list_for_displayfor directprefix/domainresolution, except a whole automation/script domain (below) - escalate to
config/entity_registry/listandconfig/area_registry/listonly when richer area/label evidence is required - for room/area phrasing, resolve the area and use
search/relatedwithitem_type:"area"before any registry-first fallback - treat area-related results as a keyed object (
automation,script,entity,device, ...), not as a flat array - use the canonical area projection by target family:
- automation review ->
.data.automation - script review ->
.data.script - helper-in-area is not a first-class bulk selector contract
.data.entityis only a fallback seed for automation/script derivation when the target-family arrays are absent- use direct registry
area_idonly as supplemental evidence when it is actually populated - dedupe the shortlist on canonical
entity_id, then sort deterministically and persist the matched shortlist - "all my automations":
ha-nova find --domain automation --limit 200 --include-disabled(scripts:ha-nova find --domain script --limit 200 --include-disabled) is the shortlist — it also lists YAML items without a registry row; itstotalis the matched count - an automation/script bulk audit first reads
../ha-nova/bulk-patterns.md→ Static Pass and runs it over EVERY matched target - derive the current review set:
- exact single target -> current review set = that one target
- more than one resolved target -> current review set = the Static Pass's flagged targets (helpers: all resolved targets) in deterministic order, trimmed to the first 5 only when more than 5 are flagged
- carry the exact matched, statically checked, and current review-set counts into Bulk Mode Gate
- beyond the Static Pass, do not resolve unique_ids, read configs, read states, or run collision scans for targets outside the current review set
- a narrow collision explanation may inspect one extra target outside the matched remainder when needed to classify a cluster; keep that read explicit, read-only, outside the audited-item count, and clearly marked as related/collision evidence in the transcript
- once the shortlist or workset is saved, keep that file immutable; use dedicated filenames for later registry, config, and collision outputs
- if the user intentionally requested a bulk selector, do not ask a clarifying question just because multiple matches remain
- Search by name using entity registry (compact fields:
ei=entity_id,en=name/alias):
Skip this step when step 1 already produced a resolved current review set.
Create <payload-file> with {"type":"config/entity_registry/list_for_display"}.
Then run:
```text
ha-nova relay ws --data-file <payload-file> --jq-file <filter-file>
```
Write <filter-file> with:
```jq
.data.entities[] | select(.ei | startswith("automation.")) | "\(.ei) | \(.en // "unnamed")"
```
Filter the resulting text with the client's native search/filter tool, not shell-specific pipelines.
For scripts: select(.ei | startswith("script.")).
For helpers: (.ei | split(".")[0]) as $domain | select(["input_boolean","input_number","input_text","input_select","input_datetime","input_button","counter","timer","schedule"] | index($domain)).
- If the helper might be from the config-entry family, also read:
```text
ha-nova relay ws --data-file <payload-file> --out <entries-file>
ha-nova relay ws --data-file <payload-file> --out <registry-file>
```
with:
{"type":"config_entries/get"}{"type":"config/entity_registry/list"}
Resolve the target by one of:
- exact
entry_id - config-entry
titlewithin the supported helper domains - linked
entity_idby matching entity-registryconfig_entry_id
Build the canonical metadata item:
entry_iddomaintitlestatelinked_entities[]
- If multiple matches remain outside an intentional bulk-selector flow: present top candidates (max 5) and ask one clarifying question. Never guess.
- For automation/script targets, resolve
unique_id(config key) — the entity_id slug and config key differ for UI-created items (seerelay-api.md→ ID Types):
Create <payload-file> with the final config/entity_registry/get request in one write step, then run:
```text
ha-nova relay ws --data-file <payload-file> --out <registry-file>
ha-nova relay jq -r --file <registry-file> '.data.unique_id'
```
The jq filter quoting above is a POSIX example. On Windows/PowerShell pass the same filter with native argument quoting.
Use that saved-result + -r form for the scalar. Do not create a separate jq file for .data.unique_id, do not strip quotes with shell substitutions afterward, and do not write placeholder payload templates that are rewritten later with perl -0pi, sed -i, or similar commands.
For scripts: use "entity_id":"script.<slug>".
Skip this step for config-entry helpers — entry_id is already the canonical identity.
- Read the target:
```text
# Automation:
ha-nova relay core --method GET --path /api/config/automation/config/<unique_id> --jq-file <config-filter-file> --out <target-file>
# Script:
ha-nova relay core --method GET --path /api/config/script/config/<unique_id> --jq-file <config-filter-file> --out <target-file>
# Helper (storage-based family, WS list + filter):
ha-nova relay ws --data-file <payload-file> --jq-file <helper-filter-file> --out <target-file>
```
Preferred: copy ../ha-nova/config-body-filter.jq to <config-filter-file> and use that copied file directly.
If the canonical file is unavailable (flat-copy installs), recreate it with exactly:
```jq
if .ok then .data.body else error("relay error: \(.error.message // "unknown")") end
```
When writing this jq file, paste that jq program body exactly as shown. Do not add extra shell-escape backslashes around the jq interpolation or run a probe variant first.
POSIX shell example only:
```sh
cat <<'EOF' > "$config_filter_file"
if .ok then .data.body else error("relay error: \(.error.message // "unknown")") end
EOF
```
On Windows/PowerShell, use the native file-writing equivalent or copy the canonical file while preserving the exact jq file body. The jq file body must contain exactly that one jq expression and nothing else. Do not add extra single quotes inside the error string. If you print the file for confirmation, do not compare it against a shell-escaped string, do not store the jq program in a shell variable, and do not wrap it in an if [ "$line" != ... ] guard. If the printed contents differ, overwrite the same config_filter_file with the exact canonical line before the first config read; do not create probe variants or alternate filenames, and do not patch the file afterward with in-place rewrite commands.
Write <helper-filter-file> with:
```jq
if .ok then [.data[] | select(.name | test("<search_term>";"i"))] else error("relay error: \(.error.message // "unknown")") end
```
For config-entry helpers, persist the canonical metadata item from step 3 to <target-file> instead of attempting {type}/list.
Then read the file with the native file-reading tool for complete, untruncated access.
- After reading the config for an automation or script, extract the primary controlled entity from the config actions (the first significant entity_id being controlled, e.g.,
light.main_light,climate.main_zone— NOT the automation/script entity itself). Read its current state (for Quick-Fix detection at end of review):
```text
ha-nova relay core --method GET --path /api/states/<controlled_entity_id> --jq-file <state-filter-file> --out <state-file>
```
Write <state-filter-file> with:
```jq
if .ok then .data.body else empty end
```
Skip this step when the current review set contains more than one target.
If no controlled entity found in actions, or state read fails: continue review — Quick-Fix will be skipped.
For standalone config-entry helper review, skip this step entirely. There is no config body with actions to analyze for a primary controlled entity.
If config is already in the thread context (e.g., user pasted YAML):
- If entity_id is known for an automation or script: skip Target Resolution entirely, go straight to Config Quality Review (Step 1). But still read the primary controlled entity's state (step 7 above) for Quick-Fix detection when the current review set contains exactly one target — this step is independent of Target Resolution.
- If the target already in context is a config-entry helper metadata item: skip Target Resolution entirely and go straight to the config-entry helper review lane in Step 1. Do not attempt primary-controlled-entity state reads or Quick-Fix detection from that path.
- If entity_id is unknown: run Target Resolution search (above) to find entity_id. If not found, proceed with Config Quality Review only. Note in output: "Not found, so overlaps were not checked."
Do NOT invoke ha-nova:entity-discovery or ha-nova:read — handle everything within this review flow.
Bulk Mode Gate
After target resolution:
- resolved targets
== 1: stay in normal single-target review mode - resolved targets
> 1: enter aggregate multi-target review mode automatically
Multi-target rules:
- multi-target deep review starts only after the current review set is trimmed (the Static Pass precedes it)
- Quick-Fix is single-target only; skip Step 4 and its prerequisite state-read step whenever the current review set contains more than one target
Bulk mode rules:
- use
../ha-nova/bulk-patterns.mdfor selector semantics, stable ordering, and workset limits - deep-audit only the current workset (max 5 targets); the Static Pass already checked every matched automation/script
- stop after that one workset; do not start a second batch in the same standalone request
- related-item, trace, and live evidence only per target inside the current workset; no prefetch for the remaining targets
- Step 1 ran in the Static Pass (helpers: run it per item); run Step 2 / Step 3 per workset item
- dedupe official-doc verification by pattern across the workset; do not refetch the same doc page per item
- cap related-config deep reads across the whole workset, not per item
- aggregate findings by repeated pattern, but preserve affected item lists
- skip Steps 4-6 entirely; bulk mode does not offer Quick-Fix, exploratory questions, or single-target suggestion synthesis
- persist collision candidate sets to files when needed; do not embed JSON arrays in shell variables for later command generation
- when multiple Relay probes are needed inside one temp directory, keep shared temp files serial or use dedicated payload filenames per probe
- write each Relay payload file as the final JSON body for that request; do not create placeholder templates and patch them later
- if more flagged targets remain after the current workset, report
matched N / statically checked S / deep-audited M / remaining Rand wait for an explicit follow-up request before continuing
Flow
Pre-Analysis Reference
Before analyzing, consult these sources:
Official HA docs (fetch selectively based on config content — do NOT fetch all for every review):
- Trigger issues → https://www.home-assistant.io/docs/automation/trigger/
- Mode issues → https://www.home-assistant.io/docs/automation/modes/
- Action/script issues → https://www.home-assistant.io/docs/scripts/
- Templates present (
{{/{%) → https://www.home-assistant.io/docs/configuration/templating/ (functions, filters, constants, and documented semantic hazards; fetch once per review — the checks in../review/checks.mdstay local and offline). No web access or a failed fetch: continue with the local checks and say in the output that template function validity was not verified against the official reference. - Schema questions → https://www.home-assistant.io/docs/automation/yaml/
Only fetch pages relevant to the triggers, actions, and templates found in the config. Cross-check against documented gotchas and constraints — this catches issues beyond the hardcoded checks below.
Verify-before-flag rule: the canonical sequence lives in
../review/checks.md → Verify Before Flagging, because the post-write
phases load that file without this one. Resolve every finding against a source
before reporting it, and flag it when the source confirms the CLAIM you are
making — semantics or risk for behavioral checks, schema invalidity only for
schema-shaped ones.
Do NOT flag valid HA builtins or documented behavior as errors — but "valid"
alone never clears a behavioral finding: much of the catalog describes config
Home Assistant accepts and that still misbehaves.
Step 1: Config Quality Review
Analyze config against the review catalog plus any additional issues found in the official docs. Report only violations found.
Traverse all variables: mappings in the config, not just the top-level block. Include root variables: on the automation/script plus local variables: actions inside choose, if / then / else, default, repeat, and nested sequence blocks.
Rule Catalog
- Load
../review/checks.mdbefore evaluating findings. Read../review/checks-extended.mdas checks.md says: a check's evidence boundary before flagging or escalating that check, and the family section before reviewing a scene, dashboard, YAML sensor, or bulk/cross-item set. ../review/SKILL.mdis the stable review entrypoint;../review/checks.mdplus../review/checks-extended.mdare the full rule catalog.
Apply the catalog:
- Load
../review/checks.mdand follow its## Applicationsection — the family-by-domain matrix, the per-check evidence boundaries (R-17..R-25, M-05), and the live-helper evidence rules live there. - Codes stay internal (checks.md → Output Guardrail): never show them in user-facing output — describe findings in plain language instead.
Step 2: Collision Scan
Find other automations/scripts that control the same entities.
For updates, this same scan is also run pre-write as an advisory impact preview (see ha-nova:write Phase 2 Step 3c, Pre-Write Impact, and the ha-nova:helper update flows). The post-write run here stays mandatory and authoritative against the persisted config.
Branch by target family:
- automation/script/storage-based helper: use action-derived target entities as before
- config-entry helper metadata item: use
linked_entities[]from the canonical metadata item; do not attempt action extraction
- Build the candidate entity list:
- automation/script: extract all target entity_ids from config actions (the entities being controlled); area, floor, or label targets anywhere get their own
search/related(item_type: area|floor|label);excludenarrows only at run time - helper (storage-based family): use the helper entity_id
- helper (config-entry family): use up to 3
linked_entities[]from the canonical metadata item
- For the top 3 most significant candidate entities, run
search/related:
```text
ha-nova relay ws --data-file <payload-file> --jq-file <filter-file>
```
<filter-file> is the canonical ../ha-nova/search-related-consumers.jq (recreate per ../ha-nova/relay-api.md → Parsing rule on flat-copy installs).
- Collect related automations/scripts (exclude current target).
- Read configs of related items (max 5 for a single standalone target; keep a tighter shared budget across a bulk workset; post-write scans inside
write/helperdeliberately use a tighter budget of max 3 related configs). Resolveunique_idfirst for automation/script targets (see Target Resolution step 5), then:
```text
# Automation:
ha-nova relay core --method GET --path /api/config/automation/config/<unique_id> --jq-file <config-filter-file> --out <related-file>
# Script:
ha-nova relay core --method GET --path /api/config/script/config/<unique_id> --jq-file <config-filter-file> --out <related-file>
```
- If no related items found, report "no conflicts for <scanned devices>" in the Conflicts section and skip Step 3. On a filter error, report the collision scan as inconclusive — never as "no conflicts".
Trace Evidence (automation/script reviews only)
Trace ANALYSIS belongs to ha-nova:diagnose: a runtime complaint ("didn't
fire", "wrong behavior last night") is a concrete incident and routes there,
not here. Stay in this skill only when the user asked for an automation or
script review and traces are supporting evidence for a config finding — never
as the answer to a failure question.
In that case:
- Prefer the normalized CLI helper fields from
ha-nova trace latest <automation_or_script_entity_id> --json,ha-nova trace list <automation_or_script_entity_id> --json, andha-nova trace get <automation_or_script_entity_id> <run_id> --json; they are enough for run selection, result status, timestamp, item binding, and most review findings. - Inspect raw trace internals only when step-level evidence is required. Raw trace nodes can be arrays of event records; type-check before reading
path,result,changed_variables, orerror, and avoid large jq projections as the standard path. - Cross-reference trace findings with config quality findings from Step 1
- Verify
item_idin every trace matches the target'sunique_idbefore attributing results (Evidence below). - Include trace-based findings in the Findings section with a descriptive title (e.g.,
🔴 Condition blocked — condition was never met in last 3 runs). Localize at runtime per../ha-nova/output-rules.md.
Step 3: Conflict Analysis
For each related automation/script, apply the 3-step conflict test:
Step 3a — Action Polarity:
- Same action on same entity → not a conflict (possibly redundant, note only)
- Opposite actions (on/off, open/close, different values) → proceed to 3b
Step 3b — Trigger Temporal Relationship:
- Mutually exclusive triggers (sunrise/sunset, non-overlapping time windows) → no conflict, skip
- Sequential triggers (event start → event end/timeout) → complementary pair, skip
- Concurrent triggers (can fire in same time window) → proceed to 3c
Step 3c — Guard Conditions:
- Mutually exclusive conditions (e.g.,
sleep_mode: onvsoff) → no conflict, skip - No mutual exclusion → real conflict risk, report
Use the known safe/problem patterns from ../review/checks.md when deciding whether a related automation pair is truly benign or a real conflict.
Step 4: Quick-Fix Detection (single-target only)
Skip this step entirely in bulk mode.
After completing Steps 1-3, check if the current entity state (from the earlier <state-file> read) shows an acute, fixable problem.
Qualifies as Quick-Fix:
- Entity state contradicts automation intent under current conditions (e.g., light
onwhen automation should have turned itoff, climate mode wrong) - Entity is in error/degraded state that a service call can reset (e.g.,
unavailablecover that needscover.stop_cover) - Helper value is desynchronized from what automation logic expects (e.g.,
input_selectstuck on wrong option)
Does NOT qualify:
- State is simply "not what user wants" without clear automation-intent evidence — that's a service-call request, not a review finding
- Fix requires config change (that's a Suggestions item)
- Multiple equally valid corrections exist (ambiguous — note in Questions to consider instead)
- State read failed or entity unavailable — skip, note in Instant Help section: localized equivalent of "Skipped: current state unavailable."
- The corrective call would grant physical access or is physically irreversible — unlocking or opening a lock, disarming an alarm panel, opening a garage/gate/entry-door cover by
device_class, or running a scene, script, or automation that reaches one. Every corrective call — ordinary device control or a trigger-source write such as resetting a desynchronizedinput_select— must RUN the indirect-actuation gate first:ha-nova plan call <domain.service> <entity_id> [--set k=v]…(read-only; the CLI runs the gate per../ha-nova/indirect-actuation.md— ordinary device control still carries its CONSUMER scan). What disqualifies it is the gate's VERDICT, not having consulted the gate: anordinaryorpreviewplan stays Quick-Fixable, while atypedplan — or a scan that could not enumerate the consumers — sends it out of Quick-Fix. Never Quick-Fix those: name the fix and offer to run it as a separate service call, which carries the typed high-consequence gate this step does not.
If qualified:
- Show current state vs expected state
- Show exact service call that would fix it
- Ask for natural confirmation bound to this exact service-call preview (same tier as
ha-nova:service-call; relay the plan'ssay; Safety below).
On confirmation:
Execute the planned call once, verified by the CLI:
ha-nova apply --plan <id>
Relay the result's say (../ha-nova/output-rules.md → Verb Results); exit 2 means the state changed since the plan — show the new plan and ask again; never retry after exit 6 or 7.
Step 5: Explorative Questions (standalone automation/script only)
Skip this step in bulk mode and for helper reviews.
Run this step only when at least one complexity gate matches:
- state-machine pattern: explicit state tracking plus threshold comparisons on the same signal across different branches
- loop-capable control flow:
repeat:present, orchoose:with 3+ branches - periodic trigger (
time_pattern) combined with actuator control such asswitch,light,cover,climate, orvalve
Ask only non-binding "what happens if...?" questions that go beyond the fixed checklist:
- boundary values and exact equality
- cycles and anti-cycling gaps
- sustained conditions that stay true for hours
- time extremes such as HA restart mid-cycle
- branch interplay and helper/variable overwrites
- failure and recovery when one step in a sequence fails
queued/parallelbehavior under rapid repeat triggers
Rules:
- return max 3 prompts
- no severity emojis
- no internal check codes
- do not restate an existing formal finding unless there is remaining uncertainty that the finding alone does not cover
- if no complexity gate matches, keep the Questions to consider section and mark it as the localized equivalent of "No follow-up questions right now."
Step 6: Suggestion Synthesis (standalone single-target only)
Skip this step in bulk mode.
Derive candidate suggestions only from verified evidence already present in the current review context:
- matched findings from Step 1
- verified conflicts from Step 3
- current config structure
- already loaded related-config evidence
- alias/description text, pasted comments, or explicit history already present in the thread
Do not invent intent or removal justification from appearance alone.
Design-intent gate for remove/simplify ideas:
- treat existing logic as deliberate until proven otherwise
- removal/simplification is allowed only when the current context justifies the purpose of that logic and shows it is obsolete, contradictory, or unnecessarily complex
- if the purpose cannot be established, downgrade the idea into Questions to consider instead of presenting it as a confident suggestion
After the gate, rank confident suggestions by intervention depth:
- Fix existing
- Simplify existing
- Extend existing
- Add new
Rules:
- dedupe overlapping ideas
- cap the Suggestions section at 4 items
- when the same verified problem supports both a smaller direct fix and a larger optional monitoring/fallback addition, include both as confident suggestions and keep the smaller fix first
- do not place a new watchdog, monitor, or helper above a smaller root-cause fix
- do not suggest large refactors when a smaller change can eliminate the current verified problem
- if no confident recommendation remains after gating, output the localized equivalent of "No confident suggestions."
Output Format
Apply ../ha-nova/output-rules.md: plain words, HA names verbatim; unless asked or names clash, no ids, "entity", modes, Relay/HA URLs, snapshots, raw JSON.
Review output is sectioned, not card-framed; only a Section 8 quick-fix proposal renders as the service-call Preview Card (output-cards.md → Cards) when it proposes a call.
Exception: if a maintainer-provided release-validation or machine-check prompt explicitly pins exact section titles or machine markers, follow that override exactly so automated validation can compare the fixed headings. This exception does not allow internal check codes in normal user-facing prose.
Standard mode
For resolved automation/script/helper targets == 1, keep this 8-section output in the same order every time (scene/dashboard targets omit skipped sections per Target Resolution):
Section 1 — Review target:
- item type (automation / script / helper) and name
Section 2 — Findings:
- numbered list or "no issues found"
- each finding uses:
🔴|🟠|🟡 Short descriptive titleWhy: ...Fix: ...- 🔴 = high/critical, 🟠 = medium, 🟡 = low/info
- title must describe WHAT the issue is in one short phrase, NOT an internal code
- if clean: localized equivalent of "No issues found in this review."
Section 3 — Collision check:
- list the checked entity names
- short result: how many related automations/scripts found
- if no related items were found: localized equivalent of "No related items found."
Section 4 — Conflicts:
- numbered conflicts or localized equivalent of "No conflicts found."
- each: the other item's name, what this automation does vs what the other does, risk description
- 🔴 = real conflict, 🟠 = potential, 🟡 = info (safe pattern)
Section 5 — Questions to consider:
- non-binding questions and edge-case prompts only
- use this section for exploratory prompts and intent-uncertain remove/simplify follow-ups
- no severity emojis
- or localized equivalent of "No follow-up questions right now."
Section 6 — Suggestions:
- confident improvement ideas only
- each item follows the Suggestion Block item shape (output-cards.md): short title + what it does + why it helps; the section header stays plain — review output is sectioned, not card-framed
- rank by intervention depth: Fix existing → Simplify existing → Extend existing → Add new
- do not place intent-uncertain removals/simplifications here
- or localized equivalent of "No confident suggestions."
Section 7 — Summary:
- one-paragraph natural language summary
- mention total findings count and highest severity emoji
- if clean: localized equivalent of "No issues found in this review."
Section 8 — Instant help:
- if no acute state problem: localized equivalent of "No quick fix suggested."
- if state read failed: localized equivalent of "Skipped: current state unavailable."
- if fixable problem detected: current state, expected state, proposed service call, confirmation prompt
Aggregate multi-target mode
For resolved targets > 1, return exactly these 6 sections:
Section 1 — Scope:
- filter used
- matched, statically checked, and deep-audited counts
- remaining count when applicable
Section 2 — Summary:
- one-paragraph aggregate summary
- count findings by highest severity
- say how many items were clean
Section 3 — High-Risk Findings:
- deduped 🔴 findings grouped by pattern
- each finding lists the affected targets
Section 4 — Repeated Patterns:
- recurring 🟠 / 🟡 findings grouped by pattern
- each pattern lists the affected targets
Section 5 — Items Checked:
- compact per-item table: target, overall status, top finding; clean items collapse into one count line
Section 6 — Collisions by Cluster:
- group conflicts by shared controlled entity or linked helper
- separate true conflicts from safe/redundant clusters
- if clean: localized "no conflicts"
Evidence
Each finding's data belongs to the reviewed item (matching entity_id, unique_id, or item_id, never a name alone), is complete (say when a read was truncated or failed), and is current. Unverified findings say so ("this likely means …", "could not verify …"), never in a verified tone.
Safety
- Safety Core: before any write, apply
../ha-nova/safety-core.md; not yet in this conversation → read it first; unreadable or incomplete → stop and write nothing.
- Drafts follow
../ha-nova/smallest-solution.md: the complete requested outcome in the simplest safe design, nothing speculative.
- The Quick-Fix service call requires confirmation bound to its exact preview; bulk mode disables it entirely.
Guardrails
- Quick-Fix: max 1 service call per review, only after explicit user confirmation, only simple state corrections (no config mutations)
- Never guess entity IDs
- Limit collision scan to top 3 target entities, max 5 related configs for a single standalone target
- For a bulk workset, trim before deep reads (the Static Pass precedes trimming) and keep a shared related-config budget
- Never build a config snapshot for the full matched set during bulk review
- Batch reviews: the Static Pass covers every matched automation/script; bulk workset max 5 targets for deep checks — more flagged → the first 5 in deterministic order, then offer to continue.