원클릭으로
hsem-code-quality
Activate before every commit and PR to run the full HSEM quality gate pipeline — lint, typing, quality checks, and tests.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Activate before every commit and PR to run the full HSEM quality gate pipeline — lint, typing, quality checks, and tests.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Activate at the start of any code change to ensure canonical helpers and patterns are used instead of re-implementing them inline.
Activate after every code change to verify all documentation files that describe the changed behaviour are updated and consistent with the implementation.
Activate when making changes that touch Home Assistant integration surfaces — config flows, entities, translations, services, device info, async patterns, or platform setup.
Activate when writing or reviewing Home Assistant integration code to ensure Bronze and Silver quality tier standards — HA constants, entity patterns, coordinator usage, config flow, and async correctness.
Activate when adding, modifying, or using any Huawei Solar inverter/battery sensor entity in HSEM. Follow the full wiring protocol from const.py through coordinator.py.
Activate when making any change to the HSEM planner layer — engine, cost function, SoC simulation, candidate generation, slot population, MILP optimizer, or safety gates.
| name | hsem-code-quality |
| description | Activate before every commit and PR to run the full HSEM quality gate pipeline — lint, typing, quality checks, and tests. |
Activate this skill before every commit and before opening any PR.
Run these in order. If any fails, fix the issues before proceeding.
tox -e lint)tox -e lint
Runs: isort → black → ruff format → ruff check
This auto-formats and checks for style violations. Fix any remaining lint errors.
tox -e typing)tox -e typing
Runs: mypy type checking. Must pass with 0 errors.
Rules:
disable_error_code is empty in pyproject.toml — never add new suppressions# type: ignore without a comment justifying whytox -e quality)tox -e quality
Runs: pyright + vulture static checks. Must pass with 0 errors.
tox -e py314)tox -e py314
Runs: pytest with coverage on Python 3.14.
For faster iteration during development:
pytest tests/ # all tests
pytest tests/test_module.py # specific file
pytest tests/test_module.py::test_fn # specific test
Hard limit: 30 KB per file in planner/ and utils/. Check before PR:
wc -c custom_components/hsem/planner/*.py
wc -c custom_components/hsem/utils/*.py
If a file exceeds 30 KB, split it before adding more features.
pre-commit run --all-files
abs(x) > 1e-9), pytest.approx() in tests| None, not Optional[...]@override: every method that overrides a base class methodhomeassistant.* → custom_components.hsem.*%-formatting for loggingopen(file, encoding='utf-8') in text modepathlib over os.pathgit --no-optional-locks status
Only intended changes should appear. If any of the four gates fail, fix them before committing. Do not submit a PR with formatting, linting, typing, or test failures.