python-tooling

python-tooling is a cursor rule for Cursor from kellerza/hass-addons. It costs 0 tokens per session (435 once invoked), scanned A, original, Apache-2.0.

Python development rules for a Home Assistant add-on, using Python 3.13, uv for environments, Ruff for code checks, and pytest for tests. Home Assistant is software for controlling and integrating smart-home devices.

In plain words
What is it for?
They guide Python package layout, asynchronous code, shared Home Assistant API use, dependency changes, linting, formatting, and test execution.
Why use it?
They standardize how the project is run, formatted, checked, and tested, reducing incompatible code and repeated API implementations.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit They guide Python package layout, asynchronous code, shared Home Assistant API use, dependency changes, linting, formatting, and test execution.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/kellerza/hass-addons/python-tooling
Install

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.

Clone the repo
git clone --depth 1 https://github.com/kellerza/hass-addons

Made for: Cursor.

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 python-tooling

README.md
[![agentmods](https://agentmods.dev/badge/rules/kellerza/hass-addons/python-tooling/github.svg)](https://agentmods.dev/rules/kellerza/hass-addons/python-tooling)
Your own site
<a href="https://agentmods.dev/rules/kellerza/hass-addons/python-tooling"><img src="https://agentmods.dev/badge/rules/kellerza/hass-addons/python-tooling/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.

agentmods 80×15 button for python-tooling

Your own site · 80×15
<a href="https://agentmods.dev/rules/kellerza/hass-addons/python-tooling"><img src="https://agentmods.dev/badge/rules/kellerza/hass-addons/python-tooling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 435 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.00000 $0.00435
Opus 5.5 $0.00000 $0.00174
Sonnet 5.5 $0.00000 $0.00087
Haiku 4.5 $0.00000 $0.00044

Measured 12d ago against content hash b6631c1afc13, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-tooling 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 12d 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.

.cursor/rules/python-tooling.mdc · 26 lines

What it actually says

Python conventions (src/)

  • Python 3.13 only (requires-python = ">=3.13,<3.14"). Use 3.13 syntax freely; no backport shims.
  • uv manages the env and runs code/tests. Run modules with uv run -m <package> (e.g. uv run -m ha_addon_control_group) and tests with uv run pytest. Don't add deps by hand-editing uv.lock; add to pyproject.toml and let uv resolve.
  • Layout: pythonpath = src. Packages are ha_addon, ha_addon_control_group, ha_addon_esp, ha_addon_qsusb64 (see tool.uv.build-backend.module-name). Shared HA REST/ websocket helpers live in src/ha_addon/ha_api/ — reuse them, don't re-implement an HA client.
  • Lint/format: ruff with a broad select (A,ASYNC,B,D,E,F,G,I,PGH,PIE,PL,PTH,PYI,RUF,UP,W). Notable: D (docstrings) is on, PTH means prefer pathlib over os.path, line-ending is lf. max-args = 7. Run uv run ruff check and uv run ruff format before finishing.
  • Async: code is async-first (aiohttp, anyio); pytest runs with asyncio_mode = auto, so async def test_* needs no marker.
  • Tests live in src/tests/<addon>/ and run with coverage. Per the ponytail rule, non-trivial logic gets one small test here.
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. 12d ago First seen · 26 lines · 0 tokens per session scan A b6631c1afc13

Subscribe to this mod's changes

python-tooling is a cursor rule published in the GitHub repository kellerza/hass-addons (9 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 435 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-10-02.