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.
npx skills add L3DigitalNet/Claude-Code-Plugins --skill ha-async-patternsgit clone --depth 1 https://github.com/L3DigitalNet/Claude-Code-PluginsWrote 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.
[](https://agentmods.dev/skills/l3digitalnet/claude-code-plugins/ha-async-patterns)<a href="https://agentmods.dev/skills/l3digitalnet/claude-code-plugins/ha-async-patterns"><img src="https://agentmods.dev/badge/skills/l3digitalnet/claude-code-plugins/ha-async-patterns/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.
<a href="https://agentmods.dev/skills/l3digitalnet/claude-code-plugins/ha-async-patterns"><img src="https://agentmods.dev/badge/skills/l3digitalnet/claude-code-plugins/ha-async-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00050 | $0.00900 |
| Opus 5.5 | $0.00020 | $0.00360 |
| Sonnet 5.5 | $0.00010 | $0.00180 |
| Haiku 4.5 | $0.00005 | $0.00090 |
Grade A, and why
ha-async-patterns scanned grade A with 1 finding 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 3mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
response = requests.get(f"http://{self._host}/api", timeout=10) How it starts
The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Async Python Patterns in Home Assistant
Home Assistant runs on a single-threaded asyncio event loop. All I/O must be non-blocking. Blocking the loop freezes automations, the UI, and entity updates.
Pattern 1: Async Libraries (Preferred)
import aiohttp
async def async_get_data(self) -> dict:
async with aiohttp.ClientSession() as session:
async with session.get(f"http://{self._host}/api") as response:
response.raise_for_status()
return await response.json()
Pattern 2: Wrapping Sync Libraries
When no async library exists:
import requests
async def async_get_data(self) -> dict:
return await self.hass.async_add_executor_job(self._sync_get_data)
def _sync_get_data(self) -> dict:
response = requests.get(f"http://{self._host}/api", timeout=10)
response.raise_for_status()
return response.json()
With arguments:
# Positional args after callable (forwarded positionally — async_add_executor_job
# cannot pass keyword args, so options like timeout/headers need functools.partial)
result = await hass.async_add_executor_job(requests.get, url)
# Keyword args with functools.partial
from functools import partial
result = await hass.async_add_executor_job(
partial(requests.get, url, timeout=10, headers=headers)
)
Pattern 3: Callbacks vs Coroutines
from homeassistant.core import callback
# @callback = sync, runs on event loop, NO I/O allowed
@callback
def _handle_coordinator_update(self) -> None:
self._attr_native_value = self.coordinator.data.get("value")
self.async_write_ha_state()
# async = coroutine, CAN do I/O
async def async_turn_on(self, **kwargs) -> None:
await self.coordinator.client.async_set_state(True)
await self.coordinator.async_request_refresh()
Pattern 4: Timeouts
import asyncio
from homeassistant.helpers.update_coordinator import UpdateFailed
async def async_get_data(self) -> dict:
try:
async with asyncio.timeout(10):
return await self.client.async_get_data()
except TimeoutError:
raise UpdateFailed("Request timed out")
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.
- 3mo ago First seen · 147 lines · 50 tokens per session scan A 6b3b2589ea7f
ha-async-patterns is a skill published in the GitHub repository L3DigitalNet/Claude-Code-Plugins (8 stars, last pushed 3mo ago), licensed MIT. It adds 50 tokens to every session and 900 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
ha-async-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ha-async-patternsL3DigitalNet/Claude-Code-Plugins | Skill | 8 | 3mo ago | MIT | A | 50 | Claude Code |
| fastapi-patternsaffaan-m/ECC | Skill | 316k | 2d ago | MIT | A | 35 | Claude Code, Kiro |
| stripe-projectse2b-dev/E2B | Skill | 15k | today | Apache-2.0 | A | 51 | Claude Code, Codex |
| azure-messaging-webpubsubservice-pymicrosoft/skills | Skill | 3.3k | today | MIT | A | 64 | Claude Code |
| azure-mgmt-botservice-pymicrosoft/skills | Skill | 3.3k | today | MIT | A | 59 | Claude Code |
| azure-appconfiguration-pybenjaminasterA/antigravity-awesome-skills | Skill | 527 | today | MIT | A | 0 | Claude Code, Codex |
| azure-messaging-webpubsubservice-pybenjaminasterA/antigravity-awesome-skills | Skill | 527 | today | MIT | A | 0 | Claude Code, Codex |