haggle: Agent for Claude Code

.claude/agents/ha-integration-architect.md

ha-integration-architect is an agent for Claude Code from NaanyaBiz/haggle. It costs 71 tokens per session (633 once invoked), scanned A, original, Apache-2.0.

A coding agent for building and reviewing Home Assistant custom integrations, which connect Home Assistant to external devices or services. It focuses on current Home Assistant patterns for setup, configuration, data updates, sensors, and entity platforms.

In plain words
What is it for?
Use it when changing a custom integration's setup flow, reauthentication, data coordinator, sensors, entity classes, or platform wiring.
Why use it?
Home Assistant integrations have specific lifecycle and typing rules that are easy to get wrong. This agent checks those rules and helps avoid regressions against Home Assistant quality requirements.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is NaanyaBiz/haggle's own configuration. It tells Claude Code how to work on haggle 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 haggle configures →

Reuse

Borrowing it

Nothing to install: this file belongs to NaanyaBiz/haggle. 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/NaanyaBiz/haggle/main/.claude/agents/ha-integration-architect.md
Clone the repo
git clone --depth 1 https://github.com/NaanyaBiz/haggle

Made for: Claude Code.

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-integration-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/naanyabiz/haggle/ha-integration-architect.svg)](https://agentmods.dev/agents/naanyabiz/haggle/ha-integration-architect)
Your own site
<a href="https://agentmods.dev/agents/naanyabiz/haggle/ha-integration-architect"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/ha-integration-architect.svg" alt="Measured on agentmods" height="20"></a>
Per session 71 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 633 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.00071 $0.00633
Opus 5 $0.00036 $0.00316
Sonnet 5 $0.00014 $0.00127
Haiku 4.5 $0.00007 $0.00063

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

Security

Grade A, and why

ha-integration-architect 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 3d 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.

.claude/agents/ha-integration-architect.md · 44 lines

How it starts

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

You are an expert in Home Assistant custom integration development (2025.x+).

Your scope

Review and advise on:

  • custom_components/haggle/__init__.pyasync_setup_entry, runtime_data, async_forward_entry_setups
  • custom_components/haggle/config_flow.py — ConfigFlow, reauth, reconfigure flows
  • custom_components/haggle/coordinator.py — DataUpdateCoordinator, _async_setup, _async_update_data
  • custom_components/haggle/sensor.py — entity classes, CoordinatorEntity, SensorEntityDescription
  • Any new entity platform files

Mandatory HA 2025.x patterns you enforce

  1. runtime_data: All per-entry state on entry.runtime_data (typed dataclass). Never hass.data[DOMAIN][entry_id].
  2. ConfigEntry typing: Use type HaggleConfigEntry = ConfigEntry[HaggleRuntimeData]. Pass the alias everywhere.
  3. _async_setup: One-time setup (e.g. verify connectivity) goes here, not in _async_update_data.
  4. async_config_entry_first_refresh: Call this in async_setup_entry, catch ConfigEntryNotReady for transient errors.
  5. Reauth flow: Raise ConfigEntryAuthFailed from the coordinator; HA auto-triggers reauth. Don't handle auth errors in async_setup_entry.
  6. async_forward_entry_setups (plural): Not the deprecated async_forward_entry_setup.
  7. import_statistics: For historical interval data, use recorder.statistics.async_import_statistics() with StatisticData objects. Attribute consumption to the interval's actual timestamp, not "now". This is critical for the Energy dashboard.
  8. DeviceInfo: Use DeviceInfo(...) typed-dict constructor, not a raw dict. Use DeviceEntryType.SERVICE for cloud APIs.
  9. Entity naming: _attr_has_entity_name = True, translation_key= on SensorEntityDescription. Don't hardcode name=.

What you do NOT touch

  • AGL API calls (that's agl-api-explorer)
  • NEM12 / kWh parsing semantics (that's energy-domain-expert)
  • Test code (that's ha-test-writer)

Response format

Short and direct. Flag violations with the specific pattern name (e.g. "runtime_data violation"). Suggest the corrected code snippet. Don't re-explain HA basics unless asked.

Read the full file on GitHub · 44 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. 3d ago First seen · 44 lines · 0 tokens per session scan A deb40af93a50

Subscribe to this mod's changes

ha-integration-architect is an agent published in the GitHub repository NaanyaBiz/haggle (13 stars, last pushed 5d ago), licensed Apache-2.0. It adds 71 tokens to every session and 633 once invoked, about $0.0004 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-09-04.

Related

Other agents, from other repositories

edge-python-specialist

Implement Python code for the edge service including picamera2, WebSocket, GPIO, and systemd.

atretyak1985/swarmery · 26 tokens

bubbaloop-node-author

Use when the user wants to create, scaffold, validate, or refactor a bubbaloop node (sensor/actuator/processor/gateway). Knows the node contract (manifest queryable, command queryable, heartbeat), bubbaloop-sdk patterns for Rust and Python, registration + install flow, and how to test end-to-end via the MCP plugin or…

kornia/bubbaloop · 86 tokens

realtime-dev

Real-time - Socket.io, WebSocket, Pusher, MQTT/ESP32, WebRTC: room, stato server-authoritative, riconnessioni. Usalo per feature real-time e IoT.

thomascasali/claude-kb-workflow · 46 tokens

iot-protocol-engineer

IoT protocol specialist who matches problem characteristics to protocol choice (MQTT, CoAP, LwM2M, BLE, LoRaWAN, Thread, Zigbee), then designs the protocol layer correctly. Use PROACTIVELY when choosing or designing IoT connectivity.

HermeticOrmus/LibreEmbed-Claude-Code · 61 tokens

ha-esphome-config-reviewer

Produces one bundled, read-only device-level review of an ESPHome device configuration: config-pattern conformance, credential and API/OTA hardening, schema currency against the official ESPHome docs, Home-Assistant-driven binding correctness, display rendering discipline, display design conformance (palette roles…

nolte/claude-home-assistant · 223 tokens

ha-esphome-fleet-reviewer

Produces one bundled, read-only repository-level review of an ESPHome fleet: directory layout, package architecture and concern cuts, the substitution and defaults interface each package exposes, deviation handling through !extend / !remove versus near-duplicate packages, fleet-wide credential blast radius…

nolte/claude-home-assistant · 200 tokens