/hue-kit:hue-domainfrom hue-kit
Use when reading, analysing, authoring, or syncing Philips Hue scenes on a bridge via the hue-kit CLI. Do NOT use for non-Hue lighting or activating scenes.
Ships in hue-kit. 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.
Administering and authoring Philips Hue scenes on a bridge with the layered
(painter's-algorithm) scene model, via the hue-kit CLI. This domain owns the
model, the bridge fundamentals, the vocabulary, and the read/author/sync
operations -- everything needed to describe a home's scenes as editable YAML and
keep it in sync with the bridge, on ANY bridge.
The YAML contract below is the load-bearing surface; match user phrasing against
the keywords: clusters to route to a reference, capability, or tool.
domain_skill:
_schema_version: "1"
identity: >-
Administering and authoring Philips Hue scenes on a bridge with the layered
scene model, via the hue-kit CLI.
companions:
siblings: []
note: >-
No sibling domains in this plugin. Grew out of a home smart-home domain
(home-domain), but this skill is deliberately bridge-agnostic: it carries
only knowledge that applies to every Hue bridge, no one home's inventory,
IPs, zone names, or scene set. Distinct from any whole-home domain (network
/ non-Hue devices / automations) -- this is Hue scenes only.
scope:
covers:
- reading a bridge's scenes and solving the minimal meta-group vocabulary
- materialising the current bridge configuration to editable YAML
- authoring scene look/colour/brightness changes as YAML layer edits
- writing YAML scene definitions back to the bridge (definition-only)
- Hue CLIP v2 bridge fundamentals (connect, entity model, xy colour)
excludes:
- activating / triggering / turning scenes or lights on at runtime (this
edits DEFINITIONS, it does not actuate) -- but see hue-beyond-scenes for
the runtime FACTS (event stream, rate limits, group-command misses) a
caller needs even though this tool does not actuate
- implementing the Entertainment / DTLS streaming channel (documented in
hue-beyond-scenes as the only real-time path; not built here)
- sensors, rules, schedules, CLIP v1, cloud API, firmware / multi-bridge
- non-Hue lighting ecosystems (LIFX, Nanoleaf, etc.)
- whole-home administration beyond Hue scenes (network, other devices)
- one specific home's inventory / credentials / named scenes
orientation:
summary: >-
Work in this domain is documentation-first and verification-led: the bridge
is the source of truth for current scene definitions, so read it (hue-kit
report / validate) before recommending or writing a change. The core loop
is edit-YAML -> validate -> apply: a scene is a default of OFF plus an
ordered stack of layers, each painting one meta-group a colour+brightness,
topmost layer wins. Colour is xy-authoritative. Scene edits change
DEFINITIONS only (visible on next activation, nothing actuates live), so
they are safe against a live home -- but a redefinition that changes a
scene's LOOK is a human-judgement call to surface, not decide. Start with
hue-bridge-basics if the bridge connection or entity model is unclear;
scene-layers is the full model + verb spec.
vocabulary:
- term: meta-group
definition: >-
A named light-subset in the registry (scene-groups.yaml), defined as a
union of bridge zones (or explicit lights). The layered vocabulary is a
small set of these -- within one group of the certified minimum.
- term: layer
definition: >-
One entry in a scene's stack = (meta-group, colour + brightness).
Layers are ordered bottom -> top; the topmost layer covering a light
wins.
- term: layer stack
definition: >-
A scene's ordered list of layers over a default of OFF. A lower layer's
group may be a SUPERSET the higher layers overpaint.
- term: certified minimum
definition: >-
The solver's proven smallest family size that can express every scene
as a layer stack. Computed and reported as the baseline; the emitted
family may be one group larger when the larger family has lower
inter-group overlap (maps more cleanly onto real rooms).
- term: xy-authoritative
definition: >-
A bulb's real colour is its CIE xy point in its gamut; the # hsl(...)
annotation is derived and readable-only. To shift a hue, edit the xy.
- term: definition vs actuation
definition: >-
Editing a scene changes its stored definition (what it will apply);
nothing lights up until the scene is next activated. This domain edits
definitions and never actuates.
behavioral_guardrails:
- >-
Investigate before answering: read the live bridge (hue-kit report /
validate) before recommending or writing a change; do not reason from
memory of how the scenes "should" look.
- >-
Only `hue-kit apply --yes` writes to the bridge. Everything else is
read-only. Always dry-run (`hue-kit apply`) and show the diff first.
- >-
Flag look changes. Redefining a scene is cheap and reversible; whether
the new look is good is the user's call -- surface it, do not decide it.
- >-
After a change, validate the YAML and show the resulting bridge diff
before applying it.
- >-
Bridge-agnostic only: never bake one home's IPs, keys, zone names, or
scene set into this skill's docs. Connection details come from the user's
environment (HUE_BRIDGE_IP / HUE_APP_KEY / HUE_KEY_FILE).
- >-
Never write to the bridge through the read-only primitives library
(scene-meta-groups.py); writes go through `hue-kit apply` (backup + PUT +
verify).
- >-
Do not ask the user to name the meta-groups, and do not propose names for
them. The placeholders (G1, G2, ...) are a working default, not a defect
to clear before proceeding -- nothing downstream needs them renamed. A
good name for "29 lights minus kitchen and the baths" is a judgement
about how a home is actually lived in; it comes from the user unprompted,
weeks later, not from a light-count table presented at setup. Tabulating
the groups and asking "what should these be called?" hands the user a
question the data cannot answer, and a suggested name is worse: it is a
guess about their home dressed as a recommendation, and it sticks.
index:
references:
- id: hue-bridge-basics
path: references/hue-bridge-basics.md
keywords: [bridge, connect, ip, discovery, application key, link button,
clip v2, api, https, self-signed, entity model, light, room,
zone, grouped_light, scene, xy, mirek, brightness, definition
vs actuation, credential]
summary: >-
General CLIP v2 fundamentals for any bridge -- connecting (IP, app key,
TLS), the resource model (light/room/zone/grouped_light/scene), why
scenes are definitions not live state, and xy-authoritative colour.
- id: scene-layers
path: references/scene-layers.md
keywords: [layered model, painter's algorithm, meta-group, layer, layer
stack, certified minimum, solver, scene-groups.yaml,
scene-designs.yaml, export, validate, apply, template names,
authoring workflow, xy, ct, bri]
summary: >-
The layered scene model + the scene-layers.py solver/sync behind the
CLI verbs -- the two config files, the report/export/validate/apply
operations, the authoring workflow, and template-name maintenance.
- id: hue-beyond-scenes
path: references/hue-beyond-scenes.md
keywords: [event stream, eventstream, sse, server-sent events, keepalive,
tcp keepalive, dead peer, silently deaf, scene activated,
status static dynamic_palette, rate limit, 10 requests per
second, throughput, entertainment, entertainment_configuration,
dtls, udp 2100, real-time, sync, music sync, video sync,
zigbee group miss, group command dropped, mesh congestion,
rename light, metadata name, mirek to xy, kang approximation,
colour conversion]
summary: >-
Bridge facts just OUTSIDE the scene-definition surface: the event
stream and its missing-keepalive trap (a dropped socket leaves a client
silently deaf), the ~10 req/s bridge-wide REST cap and why real-time
light driving needs the Entertainment DTLS channel instead, Zigbee
group commands silently missing a bulb, the light-rename endpoint, and
the mirek -> xy (Kang) conversion. Read when a task touches runtime
behaviour rather than scene authoring.
capabilities:
- id: start
keywords: [default, bare invocation, no arguments, get started, set up,
first run, show me my lights, my scenes, has anything changed,
open the report, what do my lights look like]
description: >-
THE DEFAULT ENTRY POINT -- run this for a bare invocation, or any opening
request that does not already name a specific operation. Detects which of
the eight verdict states applies (see default_flow) and reports a
machine-readable `hue-kit-verdict:` line. Read-only except on first run.
operation: hue-kit start [--no-open] [--accept]
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (Sync)
- id: discover
keywords: [find bridge, discovery, bridge ip, no ip, locate bridge,
meethue, which bridge, network scan]
description: >-
Find Hue bridges: the cloud service (discovery.meethue.com) with an
automatic local-mDNS fallback when it is down or rate-limited (HTTP 429,
reported to the user), then cache the IP. There is NO default bridge --
verbs auto-discover a single bridge, or the user sets HUE_BRIDGE_IP.
operation: hue-kit discover
tool: scripts/hue_kit_cli.py
reference_section: hue-bridge-basics.md (Connecting)
- id: pair
keywords: [pair, application key, app key, authenticate, link button,
credential, first run, no key, generateclientkey]
description: >-
Mint an application key: press the bridge link button, POST
generateclientkey, store the key 0600 on POSIX (user-scoped on
Windows, which has no POSIX mode bits). The app-authentication step --
required once per bridge; the key cannot be auto-detected.
AGENT FLOW (you run it; the user only presses the button): confirm
readiness via AskUserQuestion ("Ready to pair the bridge? Confirm and
you will have ~30 seconds to press the button." / "I'm ready to pair" /
"I'm not ready to pair"), then start `hue-kit pair` IN THE BACKGROUND
(no flags -- it goes non-interactive on its own when not run from a
terminal), CONFIRM the process is still alive, and only THEN tell the
user to press the round button on top of the bridge -- the command
blocks up to 30s polling, so the instruction must not wait on it, but a
command that died instantly must not be announced as ready either.
`--no-wait` is redundant here since stdin is not a tty when launched
this way; bare `hue-kit pair` keeps the interactive press-Enter prompt
for humans in a terminal.
operation: hue-kit pair [--no-wait] [--force]
tool: scripts/hue_kit_cli.py
reference_section: hue-bridge-basics.md (Connecting)
- id: report
keywords: [read scenes, analyse, solve, minimal groups, meta-groups,
report, layer stacks, what scenes]
description: >-
Read the live bridge, solve a near-minimal meta-group vocabulary, and print
each scene as a layer stack with bake verification. Read-only; start here.
operation: hue-kit report
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (The tool -- solver)
- id: groups
keywords: [starter registry, group vocabulary, placeholder names, rename
groups, scene-groups.yaml]
description: >-
Write a starter scene-groups.yaml with placeholder group names for the
user to rename to something meaningful. Refuses to overwrite an
existing registry unless `--force` is given; do not pass `--force` on
the user's behalf.
operation: hue-kit groups [PATH] [--force]
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (Sync)
- id: export
keywords: [bridge to yaml, materialise design, current configuration,
scene-designs.yaml, capture]
description: >-
Materialise scene-designs.yaml from the live bridge colours + the
registry; verifies the family expresses and bakes every scene first.
operation: hue-kit export
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (Sync)
- id: validate
keywords: [diff, compare, validate, discrepancies, yaml vs bridge, drift]
description: Diff the YAML design against the live bridge, per light. Read-only.
operation: hue-kit validate
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (Sync)
- id: apply
keywords: [write to bridge, bake, apply, set scenes, yaml to bridge, --yes,
dry-run, backup]
description: >-
Write the YAML layer stacks back to the bridge. Dry-run unless --yes;
backs each scene up, writes only beyond-tolerance lights, verifies by
re-read.
operation: hue-kit apply [--yes] [--scene NAME]
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (Sync)
- id: init
keywords: [example, scaffold, copy examples, overwrite with your own,
starter files]
description: >-
Copy the shipped example scene-groups.yaml and scene-designs.yaml into
DIR (defaulting to the plugin data directory) for the user to overwrite
with their own. This creates YAML only; it does not create HTML.
operation: hue-kit init [DIR]
tool: scripts/hue_kit_cli.py
reference_section: scene-layers.md (The two config files)
default_flow:
trigger: >-
A bare invocation, or any opening request that does not already name a
specific operation ("show me my lights", "what are my scenes"). Do NOT
open with `report` -- that prints solver internals at a user who asked to
see their lights. Run `hue-kit start` and branch on its verdict.
command: hue-kit start
note: >-
The state detection is the script's job, not yours: it decides among the
eight verdicts below and prints `hue-kit-verdict: <state>` as its last
line. Branch on that line; do not re-derive the state by inspecting
files.
verdicts:
- verdict: first-run
meaning: Neither working file existed; it built the registry + design,
built the registry + design. Requires BOTH
absent -- one present yields `incomplete`.
do: >-
Tell the user what was set up and stop.
Mention in ONE line that the group names are placeholders they can
rename in scene-groups.yaml whenever they like. Do NOT ask them to name
the groups now, and do NOT propose names or tabulate the groups to help
them decide -- see the naming guardrail in behavioral_guardrails.
- verdict: incomplete
meaning: >-
Exactly one of scene-groups.yaml / scene-designs.yaml exists, so this
is neither a first run nor an established workdir. Nothing was
written, and no export ran.
do: >-
Relay the diagnostic, which names the missing file. The missing one
cannot be rebuilt safely on its own: a regenerated registry carries
placeholder group names the existing design does not reference, and a
regenerated design discards colour edits the user has not applied. If
the DESIGN is missing, `hue-kit export` rebuilds it from the registry.
If the REGISTRY is missing, the user restores it, or deletes the
design to start over from the bridge and accepts placeholder names.
Do not suggest --force, and do not delete anything for them.
- verdict: accepted
meaning: >-
`--accept` re-baselined the bridge's current shape as the reference.
No YAML was touched.
do: Tell the user the shape was accepted as the new baseline; nothing
else changed, no further action needed.
- verdict: clean
meaning: The bridge matches the local design.
do: >-
Ask (AskUserQuestion) whether they want to change a scene.
- verdict: changed
meaning: >-
`validate-design` ran cleanly and found a real discrepancy (colour or
brightness), or the shape fingerprint shows a light/zone/scene was
added, removed, or renamed -- both named in the output. Nothing was
written.
do: >-
Surface WHAT differs, then ask which direction to sync -- the two are
destructive in opposite directions and only the user knows which side
is the real work. Pull (`hue-kit export`, bridge -> YAML) discards
local edits; push (`hue-kit apply`, YAML -> bridge) overwrites the
bridge, so dry-run it first and only then `--yes`. For a reviewed shape
change they do not want mirrored locally, `hue-kit start --accept`
re-baselines without touching the YAML.
- verdict: validate-failed
meaning: >-
The bridge diff did NOT finish comparing -- a malformed registry, an
unmatched scene filter, or another scene-layers error. Distinct from
`changed`: this means the comparison itself failed, not that it ran
and found a difference.
do: Show the diagnostic printed above the verdict line, and fix the
underlying problem (e.g. a registry typo) before retrying. Do not
treat this as drift to sync.
- verdict: bridge-unreachable
meaning: The bridge could not be read.
do: Route to discover / pair; do not fall through to other verbs.
- verdict: setup-failed
meaning: A first-run step (building the registry, the design, or the
report) failed.
do: Show the diagnostic printed above the verdict line; do not retry
blindly. If it looks like a connectivity problem, route to discover /
pair.
tools:
- name: hue-kit
command: hue-kit [--dir PATH] <discover|pair|start|report|groups|export|validate|apply|init>
description: >-
The verb CLI over the layered scene tool. NOTE `--dir` is a top-level
option and must precede the VERB (argparse rejects it after). Invocation:
`bin/hue-kit` (`bin/hue-kit.cmd` on Windows) is on the Bash tool's PATH
while this plugin is enabled, so `hue-kit <verb>` works directly. The
PATH entry is injected by Claude Code per session and is keyed to the
installed version, so a bare `hue-kit` resolves in a Claude Code session
with this plugin enabled; elsewhere run the shim by its path in the
plugin's install directory. The CLI re-execs under the plugin's
bootstrap-provisioned venv either way. Working files (scene-groups.yaml / scene-designs.yaml)
default to the plugin data dir
(~/.claude/plugins/data/plugins-kit/hue-kit), regardless of cwd.
- name: scene-layers.py
command: '"${BOOTSTRAP_PYTHON:?requires bootstrap >= 0.120.0}" "${CLAUDE_PLUGIN_ROOT}/scripts/scene-layers.py" [--export-designs|--validate-design|--apply ...]'
description: >-
Re-execs under the plugin venv when launched directly.
The layered solver + bi-directional sync the CLI wraps. Read-only against
the bridge except --apply --yes. See references/scene-layers.md.
- name: scene-meta-groups.py
command: (imported, not run directly)
description: >-
READ-ONLY primitives library (bridge I/O, colour math)
that scene-layers.py imports. Never run directly; never write through it.
asset_dependencies:
- path: ../../examples/scene-groups.yaml
consumer: scripts/hue_kit_cli.py (init)
purpose: shipped example meta-group registry copied by `hue-kit init`
- path: ../../examples/scene-designs.yaml
consumer: scripts/hue_kit_cli.py (init)
purpose: shipped example layered design copied by `hue-kit init`
- path: ../../scripts/scene-layers.py
consumer: scripts/hue_kit_cli.py
purpose: the solver/sync tool the CLI execs with translated flags
- path: ../../scripts/bootstrap_guard.py
consumer: scripts/hue_kit_cli.py
purpose: vendored guard that re-execs the CLI under the plugin venv
hue-kit start and branch
on its hue-kit-verdict: line (see default_flow above). This covers both
first-time setup and the has-anything-changed check; do not hand-run the
report -> groups -> export chain, and do not open with
report, which prints solver internals at someone who asked to see a picture.validate -> apply.group: reference in scene-designs.yaml, then
validate (a pure rename must show 0 discrepancies).
Nothing is written to the bridge; group names are a local vocabulary.Do NOT use to turn scenes/lights on or off at runtime (this edits definitions), for non-Hue ecosystems, or for whole-home administration beyond Hue scenes.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kitaekatt/plugins-kit --plugin hue-kit