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 agentmods add rules/ckrl/ha-gitops/home-assistantgit clone --depth 1 https://github.com/ckrl/ha-gitopsWhat 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 | $0.00000 | $0.01627 |
| Opus 5 | $0.00000 | $0.00813 |
| Sonnet 5 | $0.00000 | $0.00325 |
| Haiku 4.5 | $0.00000 | $0.00163 |
Grade A, and why
home-assistant scanned grade A with 2 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 2d 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.
async def fetch(self) -> GitResult: ... Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Запрещены: `time.sleep`, `subprocess.run`, `requests`, `os.system`, чтение/запись файлов через `open()` без executor. How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Home Assistant Integration Rules
Применяются ко всему коду внутри custom_components/ha_gitops/.
Bootstrap
DOMAIN = "ha_gitops"— единственный источник вconst.py. Не дублировать литерал.- MVP: конфиг через Config Flow →
async_setup_entry(hass, entry)+async_unload_entry;manifest.json:config_flow: true. Топовыйasync_setup(hass, config)только возвращаетTrue(YAML-блок домена не используется). - Состояние интеграции — в
hass.data[DOMAIN][entry.entry_id](один config entry на инстанс HA):GitManagerиscan_interval. - Регистрация платформ:
await hass.config_entries.async_forward_entry_setups(entry, ("sensor", "button")). manifest.json— поля строго поdocs/architecture.md§5.2:domain,name,version,documentation,issue_tracker,requirements,dependencies,codeowners,iot_class: "cloud_polling",config_flow: true.
Async-контракт
- Все методы
GitManagerи всеasync_*коллбэки HA — async. - Любая блокирующая операция — не в event loop: git через GitPython внутри
asyncio.to_thread(см.docs/architecture.md§4.2); ssh-keygen и прочий subprocess —asyncio.create_subprocess_exec; тяжёлое file I/O —hass.async_add_executor_job. - Запрещены:
time.sleep,subprocess.run,requests,os.system, чтение/запись файлов черезopen()без executor. - Polling сенсора:
SCAN_INTERVAL = timedelta(seconds=...)берётся из конфига (scan_interval, дефолт 300). Сенсор реализуетasync_update, неupdate.
GitManager — публичный контракт (см. docs/architecture.md §8)
class GitManager:
async def initialize(self) -> None: ...
async def push(self) -> GitResult: ...
async def pull(self) -> GitResult: ...
async def fetch(self) -> GitResult: ...
async def commit(self, message: str | None = None) -> GitResult: ...
async def get_status(self) -> SyncStatus: ...
async def get_local_commit(self) -> CommitInfo: ...
async def get_remote_commit(self) -> CommitInfo: ...
async def get_changed_files(self) -> list[FileChange]: ...
async def generate_ssh_key(self) -> str: ...
async def test_connection(self) -> bool: ...
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.
- 2d ago First seen · 89 lines · 0 tokens per session scan A 15cfef29dd1e
home-assistant is a cursor rule published in the GitHub repository ckrl/ha-gitops (4 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,627 tokens. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
repository
Follow AGENTS.md and CONTRIBUTING.md before working in this repository.
cursorrules
Follow AGENTS.md and CONTRIBUTING.md before working in this repository.
backend-python
Cursor rule "backend-python" from coeusyk/inference-x, covering backend python rules, stack assumptions, code style, fastapi conventions and schema conventions.
api-tester
Expert API testing specialist focused on comprehensive API validation, performance testing, and quality assurance across all systems and third-party integrations.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.