ha-media-source-add

ha-media-source-add is a skill for Claude Code from nolte/claude-home-assistant. It costs 193 tokens per session (1,906 once invoked), scanned A, original, MIT.

A workflow for adding a media source to an existing Home Assistant custom integration. A media source is a browsable provider that exposes media libraries and lets Home Assistant find playable items.

In plain words
What is it for?
It is for creating the integration's media-source module, defining browseable folders or levels, assigning media types, and exposing media identifiers for playback.
Why use it?
It turns a media hierarchy into the structure Home Assistant expects and checks the result against the relevant integration rules. It also helps decide whether the feature should be a media source or a media-player device.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-home-assistant plugin — 45 skills, 11 agents shipped together

Good fit It is for creating the integration's media-source module, defining browseable folders or levels, assigning media types, and exposing media identifiers for playback.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nolte/claude-home-assistant/ha-media-source-add
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nolte/claude-home-assistant --skill ha-media-source-add
Clone the repo
git clone --depth 1 https://github.com/nolte/claude-home-assistant

Made for: Claude Code.

Or install claude-home-assistant, the plugin that ships this one along with the rest of its 45 skills, 11 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ha-media-source-add

README.md
[![agentmods](https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-media-source-add/github.svg)](https://agentmods.dev/skills/nolte/claude-home-assistant/ha-media-source-add)
Your own site
<a href="https://agentmods.dev/skills/nolte/claude-home-assistant/ha-media-source-add"><img src="https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-media-source-add/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ha-media-source-add

Your own site · 80×15
<a href="https://agentmods.dev/skills/nolte/claude-home-assistant/ha-media-source-add"><img src="https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-media-source-add.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 193 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,906 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00193 $0.01906
Opus 5 $0.00097 $0.00953
Sonnet 5 $0.00039 $0.00381
Haiku 4.5 $0.00019 $0.00191

Measured 11d ago against content hash e6cb3c7c7f40, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ha-media-source-add scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ha-media-source-add/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

HA Media Source Add

Spec: spec/claude/ha-media-source-add/en.md (EN canonical) / spec/claude/ha-media-source-add/de.md (DE translation).

Why this is a skill, not an agent

  • Human-visible augmentation surface — the user describes a media hierarchy and reads back media_source.py, the browse tree shape, and the conformance report; a skill keeps this on the visible command surface, like the sibling augment skills (ha-config-flow-augment, ha-coordinator-add, ha-repairs-add).
  • Mid-flow interactivity — the media-source-vs-media-player-entity decision and the per-level MediaClass/identifier shape are per-run dialogues the user approves before generation.
  • Bounded, inline generation — one media_source.py module with two methods fits inline; no isolated agent context is needed.
  • Counter-dimension considered: the draft→validate loop could be an agent, but the source-vs-entity decision and the hierarchy shaping belong in the user's working context; skill wins.

When this skill activates

Use this skill to add a media source provider to an existing integration — a media_source.py that exposes a browsable, playable media library to the Home Assistant media browser.

When NOT to activate

  • a media_player entity that consumes media sources (the async_browse_media(hass, ...) call path) → ha/entity-platforms-media / ha/entity-architecture
  • translation mechanics for Unresolvable/BrowseErrorha/translations
  • thumbnail proxy / streaming /api/... routes → out of scope
  • greenfield integration scaffolding → ha-integration-scaffold
  • deploying/importing into a running HA instance → out of scope

Hard rules

  1. One media source, one run. No multi-source batches.
  2. Read spec/ha/media-source/en.md first. Do not generate from memory.
  3. No manifest change for discovery. HA discovers media_source.py automatically via the integration platform mechanism — never add a manifest entry for discovery.
  4. Top-level contract. media_source.py exports the top-level async function async_get_media_source(hass) -> MediaSource returning an instance of the MediaSource subclass, which is bound to the domain via super().__init__(DOMAIN).
  5. Two mandatory methods. Implement async_browse_media(item) (returns a BrowseMediaSource tree — root node on empty item.identifier, children otherwise; raise BrowseError when the structure cannot be retrieved) and async_resolve_media(item) (returns a PlayMedia(url, mime_type) with a correct mime_type; raise Unresolvable when the item cannot be resolved).
  6. Node attributes. Every BrowseMediaSource node carries an appropriate MediaClass and correctly set can_play/can_expand flags (can_play for playable items, can_expand for items browsable deeper); root items set identifier=None.
  7. URI construction. Use generate_media_source_id(DOMAIN, identifier) to construct media-source:// URIs; encode the path in the identifier for deep hierarchies.
  8. Translatable errors. Raise Unresolvable/BrowseError with translation_domain/translation_key/translation_placeholders when the message is to be translatable (see spec/ha/translations/en.md).
  9. Name per spec/ha/naming-conventions/en.md and verify HA internals against the official docs (see spec/ha/upstream-docs-verification/en.md).

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 107 lines · 193 tokens per session scan A e6cb3c7c7f40

Subscribe to this mod's changes

ha-media-source-add is a skill published in the GitHub repository nolte/claude-home-assistant (1 stars, last pushed 1mo ago), licensed MIT. It adds 193 tokens to every session and 1,906 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.