| name | ha-code-quality |
| description | Standards and commands for linting, code formatting, typing validation (Ruff, MyPy, Codespell, ESLint, Pre-commit/Prek, Tox), and adherence to Home Assistant Python 3.14 standards in Keymaster. |
Code Quality & Standards Guide for Keymaster
This skill guides linting, formatting, and static typing enforcement across the
repository.
Automated Quality Suite (Tox)
Run the full CI lint environment:
tox -e lint
This runs Ruff linting, Ruff formatting check, MyPy across the entire repo
(mypy .), and Codespell.
Individual Quality Tools
Configuration is defined in pyproject.toml.
Ruff Formatting & Linting
ruff check .
ruff check --fix .
ruff format .
Type Checking (MyPy)
mypy .
Spell Checking (Codespell)
codespell custom_components/keymaster tests
TypeScript / Frontend Linting
yarn lint
yarn lint:fix
Pre-commit / Prek Hooks
Run pre-commit checks locally before committing:
prek run --all-files
pre-commit run --all-files
Guidelines
- Python Target: Configured for Python 3.14 (
target-version = "py314").
Use modern typing syntax (e.g. list[str], X | Y,
from __future__ import annotations).
- Line Length: Strictly adhere to the 100-character line limit configured
in
pyproject.toml.
- Async Hygiene: Use
async_create_task or HA core async helpers; avoid
blocking synchronous calls in the event loop.
- Docstrings & Comments: Preserve existing docstrings and write clear
docstrings for new public methods and classes.