Ha automation author
Skill nolte/claude-home-assistant/skills/ha-automation-author
Authors one Home Assistant automation-logic or command artifact as spec-conformant YAML (or a sandboxed .py) from a described intent — an automation, script, scene, generic template entity, or a rest_command / shell_command / python_script — conforming to the matching spec/ha-automation/<topic>. Picks the artifact type, enforces a deliberate mode, stable id/unique_id, unavailable-guarded templates, shell-injection and python-sandbox safety, redirects legacy trigger helpers to modern equivalents, validates offline, and returns a conformance report. Activate on "write an automation that…", "create a script for…", "add a scene/template sensor/rest_command for…", "schreibe eine Automation, die…", "erstelle ein Script für…". Do not activate for blueprints (ha-blueprint-scaffold), stateful helpers (ha-helper-scaffold), derived/statistical sensors (ha-derived-sensor-author), Python custom integrations (ha-integration-scaffold), or deploying to a live HA instance.From its SKILL.md
npx -y skills add nolte/claude-home-assistant --skill ha-automation-authorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.7 KB, as published. Nobody here has run it
HA Automation Author
Spec: spec/claude/ha-automation-author/en.md (EN canonical) / spec/claude/ha-automation-author/de.md (DE translation).
Why this is a skill, not an agent
- Human-visible authoring surface — the user describes an intent and reads back the generated YAML and the conformance report; a skill keeps that on the visible command surface, like the sibling
ha-blueprint-scaffold. - Mid-flow interactivity — artifact-type confirmation and the legacy-helper redirect are per-run dialogues the user must see and approve before generation.
- Orchestrator-leaning — it may later dispatch a generation agent (as
ha-blueprint-scaffolddispatchesha-blueprint-author); the skill-orchestrates default keeps the entry point in skill form. - Counter-dimension considered: the draft→validate→iterate loop could be an agent, but the type decision and the report belong in the user's working context; skill wins.
When this skill activates
Use this skill to author one non-blueprint automation-logic or command artifact from a described intent: an automation, script, scene, generic template entity, or a rest_command / shell_command / python_script.
When NOT to activate
- a parameterized, shareable blueprint →
ha-blueprint-scaffold/ha-blueprint-author - a stateful helper (
input_*,counter,timer,schedule) →ha-helper-scaffold - a derived/statistical helper sensor (
bayesian,derivative,filter,min_max,statistics,threshold,trend,history_stats,integration,utility_meter,group) →ha-derived-sensor-author - a Python custom integration →
ha-integration-scaffold - deploying/importing into a running HA instance → out of scope (generation only)
Hard rules
- One artifact, one type, one run. No multi-artifact batches.
- Intent is mandatory. Without a described intent there is no generation; everything else may fall back to a documented default, stated in the output.
- Read the topic spec first. Before generating, read the matching
ha-automation/<topic>spec; do not generate from memory. - Never generate a legacy trigger helper. If the intent targets
flux,device_sun_light_trigger, or a hand-builtplatform:trigger helper, propose the modern equivalent perspec/ha-automation/legacy-trigger-helpers/en.mdinstead. - Never overwrite an existing entity. Collision on
id/unique_id/object_idaborts with the identifier quoted. - Deliberate mode, stable identity, guarded templates.
automation/scriptcarry a consciously chosenmode(withmaxforparallel/queued); every entity gets a stableid/unique_idand an Englishalias(≤50 chars); every Jinja template guardsunavailable/unknown(has_value(),is_number(),float(default),availability). Names followspec/ha/naming-conventions/en.md. - Command-artifact safety.
shell_commandnever interpolates untrusted input unquoted (runs as root), no pipes/redirects in templates;python_scriptuses noimportand onlyhass/data/logger/output;rest_commandkeepsverify_ssl: trueunless justified and credentials out of the URL. - Verify HA internals against the official docs. Don't reproduce HA schemas/conventions from memory — consult Developer docs
developers.home-assistantandhome-assistant.io(seespec/ha/upstream-docs-verification/en.md).
Inputs
| Field | Required | Default | Notes |
|---|---|---|---|
intent | yes | — | What the artifact should do, in prose |
artifact_type | no | inferred from intent | automation / script / scene / template / rest_command / shell_command / python_script |
target_dir | no | working dir | Repo / HA config root |
target_file | no | per type | automations.yaml / scripts.yaml / scenes.yaml / configuration.yaml / python_scripts/<name>.py |
If the user is silent on an optional field, use the default but state it explicitly.
Pre-flight (in order — abort on first failure)
intentpresent and non-empty. If not, ask; do not generate.- Resolve
artifact_type(infer + confirm). Check it against the legacy-helper gate; on a legacy target, propose the modern alternative and stop. - Read the matching
ha-automation/<topic>spec. - The resolved target entity does not already exist (
id/unique_id/object_id). If it does, abort with the identifier quoted.
Workflow
1) Resolve and confirm
State the resolved artifact_type, target file path, and every assumed default in one paragraph. Wait for confirmation.
2) Generate
Write the artifact per the topic spec's MUST rules:
| Type | Key / location | Load-bearing rules |
|---|---|---|
automation | automation: in automations.yaml/packages/ | plural triggers/conditions/actions; stable id; English alias; deliberate mode(+max); event-driven trigger over polling |
script | script: in scripts.yaml/packages/ | sequence; public fields(+selectors) vs internal variables; deliberate mode |
scene | scene: in scenes.yaml/packages/ | attributes only in nested state:; activate via scene.turn_on |
template | template: block in configuration.yaml | modern block form; unique_id; state-based vs trigger-based chosen; unavailable-guarded |
rest_command | rest_command: | url (template ok); deliberate method; verify_ssl: true; creds via username/password |
shell_command | shell_command: | snake_case alias; literal command name; quote untrusted input; check returncode |
python_script | python_scripts/<name>.py | no import; hass/data/logger/output only; data.get(...); output dict |
3) Validate and report
Validate offline (YAML lint; ha core check where available; mentally render templates against unavailable/unknown sources). Emit a CONFORMANT / NEEDS-WORK report keyed to the topic spec's acceptance criteria, plus the written file path and assumed defaults. Do not echo the full artifact again unless asked.
4) No deploy
The skill never deploys to a live HA instance. Surface the report and stop.
Boundaries
- Blueprints →
ha-blueprint-scaffold/ha-blueprint-author - Stateful helpers →
ha-helper-scaffold - Derived/statistical sensors →
ha-derived-sensor-author - Custom integrations →
ha-integration-scaffold - Deploy to live HA → out of scope