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/generalgit 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.01013 | $0.01013 |
| Opus 5 | $0.00507 | $0.00507 |
| Sonnet 5 | $0.00203 | $0.00203 |
| Haiku 4.5 | $0.00101 | $0.00101 |
Grade A, and why
general 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 yesterday.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Использовать `async def` + `await` для всех git/IO операций; никаких `subprocess.run`/`os.system` в продакшен-коде. How it starts
The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.
General Rules
Important
- Проект — кастомная Home Assistant integration
ha_gitops, распространяется через HACS. - Источник истины по архитектуре и требованиям —
docs/architecture.md(в репо, нумерация разделов стабильна). Все правила, docstrings, тесты ссылаются на параграфы оттуда. При расхождении кода иarchitecture.md— документ выигрывает; правки в документ — отдельным шагом, не вместе с кодом. - Никаких ссылок на ресурсы вне репо (KB-пути, личные заметки, Notion и т. п.) ни в коде, ни в правилах, ни в комментариях. Репо самодостаточен.
- DOMAIN компонента:
ha_gitops. Менять нельзя — ломает существующие конфиги. - Все ответы и обсуждения — на русском; код, идентификаторы, commit messages, UI-строки и логи — на английском.
Core Stack (do NOT switch unless explicitly asked)
- Python 3.11+ (соответствует HA 2024.1+).
- Home Assistant Core API (
homeassistant.*) — entity-модель, config flow, services. - asyncio — все I/O-операции неблокирующие; git-операции через GitPython в
asyncio.to_thread;ssh-keygen—asyncio.create_subprocess_exec. - GitPython + git на
PATH— бэкенд с v0.1.8 (manifest.json:GitPython), публичный APIGitManagerбез изменений. - pytest +
pytest-homeassistant-custom-component— тесты. - uv (Astral) — управление venv и зависимостями. Версия Python пинится через
.python-version, lockfile —uv.lock. Команды:uv sync --extra dev,uv run pytest,uv add --dev <pkg>. НЕ использоватьpip installнапрямую и не вводить параллельныйPipfile/poetry.lock. - HACS — дистрибуция (manifest.json + hacs.json).
Запрещено вводить без обсуждения: dulwich, pygit2, paramiko, FastAPI/Flask, ORM, БД, Node.js-инструменты.
DO
- Использовать
async def+awaitдля всех git/IO операций; никакихsubprocess.run/os.systemв продакшен-коде. - Логировать через
logging.getLogger(__name__); имя логгера —custom_components.ha_gitops.<module>. - Идемпотентность: повторный
pushбез изменений = no-op (без пустого коммита). Повторныйinitializeне падает. - Любая git-ошибка →
SyncStatus.ERRORв сенсоре +persistent_notificationс человекочитаемым текстом, HA не падает. - Все пути —
pathlib.Path, неstr. Конфиг-директория HA —hass.config.path(...). - Type hints на всех публичных функциях.
from __future__ import annotationsв каждом модуле.
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.
- yesterday First seen · 46 lines · 1,013 tokens per session scan A fc2baeeb8653
general is a cursor rule published in the GitHub repository ckrl/ha-gitops (4 stars, last pushed 3mo ago), licensed MIT. It adds 1,013 tokens to every session, about $0.0051 per session on Opus 5. A static security scan graded it A with 1 finding (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.