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.
git clone --depth 1 https://github.com/ckrl/ha-gitopsWrote 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/rules/ckrl/ha-gitops/testing)<a href="https://agentmods.dev/rules/ckrl/ha-gitops/testing"><img src="https://agentmods.dev/badge/rules/ckrl/ha-gitops/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.
<a href="https://agentmods.dev/rules/ckrl/ha-gitops/testing"><img src="https://agentmods.dev/badge/rules/ckrl/ha-gitops/testing.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.00000 | $0.01113 |
| Opus 5.5 | $0.00000 | $0.00445 |
| Sonnet 5.5 | $0.00000 | $0.00223 |
| Haiku 4.5 | $0.00000 | $0.00111 |
Grade A, and why
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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing Rules
Стек
- pytest + pytest-asyncio (
asyncio_mode = "auto"вpyproject.toml). - pytest-homeassistant-custom-component — фикстуры
hass,enable_custom_integrations,mock_config_entry. - Покрытие —
pytest-cov. Цель MVP: ≥ 80% поgit_manager.py, ≥ 60% поsensor.py/button.py.
Структура
- Файлы:
tests/test_<module>.py(по одному на модульcustom_components/ha_gitops/). tests/conftest.py— общие фикстуры:hass(из HA testing), временные директории, реальный bare git remote.- Один тест — одна проверка. Имена:
test_<unit>_<condition>_<expected>(например,test_push_no_changes_returns_clean).
Фикстуры
tmp_path— для конфиг-директории HA.bare_remote— фикстура с реальнымgit init --bareво временном каталоге; URL —file://{path}. Это позволяет тестироватьpush/pull/fetchбез сети и без моков subprocess.git_manager— собранныйGitManagerсtmp_pathкак config_dir иbare_remoteкакrepo_url. SSH-ключ дляfile://remote не нужен.- Для тестов SSH-логики (env, аргументы) — мокать
asyncio.create_subprocess_execчерезmonkeypatch/AsyncMock.
Что тестировать обязательно
git_manager.py:
initializeсоздаёт.git/,.gitignoreс блоком# ha-gitops:, не дублирует блок при повторном запуске._get_yaml_files()исключаетsecrets.yaml,secrets_backup.yaml,*.secrets.yaml, файлы из подпапок (только корень).- Panic guard: вручную staged
secrets.yaml→pushделает reset, не пушит, возвращает ERROR. pushбез изменений и без unpushed коммитов → no-op,SyncStatus.CLEAN, нет пустого коммита.pushс unpushed коммитом, но без staged изменений → выполняется толькоgit push.pullff-only: успех при behind, отказ +DIVERGEDпри diverged ветках.get_statusвозвращает корректныйSyncStatusдля всех 7 вариантов (clean,modified,ahead,behind,diverged,error,unknown)._build_commit_message: 1 файл / 2-3 файла / 4+ файла — формат subject из спеки §8.3, body содержит timestamp иCo-authored-by._build_ssh_envсодержитGIT_SSH_COMMANDс правильным путём ключа,IdentitiesOnly=yes, не пробрасывает~/.ssh.- Author/email подставляются через
-c user.name=... -c user.email=..., не через global config (проверяется через argv мока). - SSH-ключ при генерации получает права
0o600(проверятьPath.stat().st_mode & 0o777).
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 · 66 lines · 0 tokens per session scan A 6ac7991ea18e
testing is a cursor rule published in the GitHub repository ckrl/ha-gitops (6 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,113 tokens. 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-31.
testing compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| testingckrl/ha-gitops | Cursor rule | 6 | 7mo ago | MIT | A | 0 | Cursor |
| pytestsanjeed5/awesome-cursor-rules-mdc | Cursor rule | 3.6k | 9d ago | CC0-1.0 | A | 1,879 | Cursor |
| python-cursorrules-prompt-file-best-practicesPatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 374 | Cursor |
| python-general-coding-standardsholtwood/awesome-cursorrules-zh | Cursor rule | 244 | 1mo ago | MIT | A | 140 | Cursor |
| python-toolingkellerza/hass-addons | Cursor rule | 9 | 3d ago | Apache-2.0 | A | 0 | Cursor |
| pythonadonai-labs/agent-runway | Cursor rule | 2 | 6d ago | MIT | A | 0 | Cursor |
| pytestnedcodes-ok/cursorrules-collection | Cursor rule | 38 | 9mo ago | MIT | A | 529 | Cursor |