hacs.integration_blueprint: Skill for Claude Code

.agents/skills/ha-testing/SKILL.md

ha-testing is a skill for Claude Code, Codex from jpawlowski/hacs.integration_blueprint. It costs 194 tokens per session (2,137 once invoked), scanned A, original, MIT.

A set of instructions for writing and repairing automated tests for a Home Assistant custom integration. The tests use pytest, a Python testing tool, and a Home Assistant test package to load an integration and check its real states.

In plain words
What is it for?
It helps add tests for configuration flows and other integration behavior, fix failing tests, update snapshots, and assess coverage limits such as hardware or timing constraints.
Why use it?
It guides test structure, shared fixtures, markers, mocks, registry checks, and decisions about when a behavior change or bug fix needs a regression test.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is jpawlowski/hacs.integration_blueprint's own configuration. It tells Claude Code and Codex how to work on hacs.integration_blueprint itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything hacs.integration_blueprint configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jpawlowski/hacs.integration_blueprint. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jpawlowski/hacs.integration_blueprint/main/.agents/skills/ha-testing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jpawlowski/hacs.integration_blueprint

Made for: Claude Code, Codex.

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-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/jpawlowski/hacs.integration_blueprint/ha-testing/github.svg)](https://agentmods.dev/skills/jpawlowski/hacs.integration_blueprint/ha-testing)
Your own site
<a href="https://agentmods.dev/skills/jpawlowski/hacs.integration_blueprint/ha-testing"><img src="https://agentmods.dev/badge/skills/jpawlowski/hacs.integration_blueprint/ha-testing/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-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/jpawlowski/hacs.integration_blueprint/ha-testing"><img src="https://agentmods.dev/badge/skills/jpawlowski/hacs.integration_blueprint/ha-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 194 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,137 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00194 $0.02137
Opus 5 $0.00097 $0.01069
Sonnet 5 $0.00039 $0.00427
Haiku 4.5 $0.00019 $0.00214

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

Security

Grade A, and why

ha-testing 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 10d 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.

.agents/skills/ha-testing/SKILL.md · 229 lines

How it starts

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

Testing

Home Assistant tests are integration tests by nature: you load a real config entry into a real hass instance and assert on hass.states — not on Python objects.

Read blueprint.tests.instructions.md first — it holds the rules: directory mirroring, pytest markers, which fixtures to define, the core-interface rule, registry assertions, what to mock and what never to mock, the full command list, and the do/don't list. This skill is the scaffolding and the judgement calls.

When a test is required

  • Behavioural change, bug fix, or regression → add a proportionate test.
  • Documentation-only, formatting-only, or anything that cannot affect runtime → no test needed.
  • If a test is impractical (needs real hardware, non-deterministic timing), say so explicitly and describe the residual risk. Do not silently skip it, and never claim coverage that does not exist.

Bootstrap: tests/conftest.py

The suite currently has no conftest.py. Custom integrations are not loaded by default in tests, so the first thing any new test file needs is this — create it once:

"""Shared fixtures for <domain> tests."""

from collections.abc import Generator
from unittest.mock import AsyncMock, patch

import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry

from custom_components.<domain>.const import DOMAIN
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant


@pytest.fixture(autouse=True)
def auto_enable_custom_integrations(enable_custom_integrations: None) -> None:
    """Load the custom integration in every test."""


@pytest.fixture
def mock_config_entry() -> MockConfigEntry:
    """Return a config entry for the integration."""
    return MockConfigEntry(
        domain=DOMAIN,
        title="Example Device",
        data={CONF_USERNAME: "test-user", CONF_PASSWORD: "test-password"},
        unique_id="test-unique-id",
    )


@pytest.fixture
def mock_api_client() -> Generator[AsyncMock]:
    """Patch the API client with a mock that returns fixture data."""
    with patch(
        "custom_components.<domain>.{ClassPrefix}ApiClient",
        autospec=True,
    ) as client_class:
        client = client_class.return_value
        client.async_get_data.return_value = {"model": "Blueprint", "title": "ok"}
        yield client


@pytest.fixture
async def init_integration(
    hass: HomeAssistant,
    mock_config_entry: MockConfigEntry,
    mock_api_client: AsyncMock,
) -> MockConfigEntry:
    """Set up the integration and return the loaded entry."""
    mock_config_entry.add_to_hass(hass)
    assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
    await hass.async_block_till_done()
    return mock_config_entry

Read the full file on GitHub · 229 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. 10d ago First seen · 229 lines · 194 tokens per session scan A 56af1c6e7b80

Subscribe to this mod's changes

ha-testing is a skill published in the GitHub repository jpawlowski/hacs.integration_blueprint (49 stars, last pushed 2d ago), licensed MIT. It adds 194 tokens to every session and 2,137 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-30.