بنقرة واحدة
git-conventions
Commit message format, PR conventions, branch rules, and pre-commit test gate for hass-diagral.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Commit message format, PR conventions, branch rules, and pre-commit test gate for hass-diagral.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Architecture, entity patterns, testing, and conventions for the hass-diagral Home Assistant custom integration.
Writing, updating, and structuring documentation pages for hass-diagral. Covers MDX format, frontmatter, docs.page components, docs.json navigation registration, and when to update docs after code changes.
Planning-track selection, epic/feature decomposition, readiness gates, and plan-delta rules.
Project-specific test setup for hass-diagral — directory structure, test tiers, devcontainer/docker environment detection, running pytest, and shared fixtures.
| name | git-conventions |
| description | Commit message format, PR conventions, branch rules, and pre-commit test gate for hass-diagral. |
| user-invocable | false |
Use this skill for any commit, PR creation, or pre-commit verification task in the hass-diagral project.
<type>[optional scope]: <gitmoji> <description>
[optional body — bullet points]
Tests: N passed, 0 failed, 0 errors
Tests: line: always required — run the test gate (§3) before committing| Type | Gitmoji | Use When |
|---|---|---|
feat | ✨ | New feature or entity |
fix | 🐛 | Bug fix |
docs | 📝 | Anything in docs/ or docs.json |
refactor | ♻️ | Code restructure, no feature/fix |
test | ✅ | Adding or updating tests |
chore | 🔧 | Deps, CI, build, maintenance |
Use the module filename without extension:
sensor, coordinator, alarm_control_panel, config_flowwebhook, diagnostics, entity, models, constdeps (dependency bumps), readme, entities (doc pages)feat(sensor): ✨ Add battery level sensor entity
- Added DiagralBatteryLevelSensor to sensor.py
- Added translation keys to en.json and fr.json
Tests: ✅ 42 passed, ❌ 0 failed, ⚠️ 0 errors
fix(coordinator): 🐛 Retain stale data when API returns empty response
Tests: ✅ 42 passed, ❌ 0 failed, ⚠️ 0 errors
test(sensor): ✅ Add test for anomaly count sensor
Tests: ✅ 43 passed, ❌ 0 failed, ⚠️ 0 errors
chore(deps): 🔧 Bump pydiagral to 1.7.0
Tests: ✅ 42 passed, ❌ 0 failed, ⚠️ 0 errors
The pre-commit gate applies only when custom_components/ has changed in the current commit.
Before running, check whether the staged or changed files include custom_components/:
git diff --name-only HEAD | grep -q "^custom_components/" && echo "tests required" || echo "tests not required"
If no file under custom_components/ is modified → skip the gate, use Tests: N/A (no custom_components change) in the commit body.
If any file under custom_components/ is modified → the gate is mandatory. No commit may be created until all tests pass at 100%.
Follow @skills/testing-hass-diagral/SKILL.md §3 for the canonical run commands (environment detection, devcontainer vs docker exec).
Quick summary:
# Detect environment
test -d /workspaces && echo "inside devcontainer" || echo "outside"
# Then run pytest tests/ -v (see testing-hass-diagral §3 for full commands)
Capture the output to extract the summary line.
Parse the last summary line from pytest output:
N passed, 0 failed, 0 errors
After gate passes (or is skipped), embed the test summary as the final line of the commit body:
feat(sensor): ✨ Add battery level sensor entity
- Added DiagralBatteryLevelSensor to sensor.py
- Added translation keys to en.json and fr.json
Tests: ✅ 42 passed, ❌ 0 failed, ⚠️ 0 errors
Format:
Tests: ✅ N passed, ❌ M failed, ⚠️ E errors — when gate ranTests: N/A (no custom_components change) — when gate was skippedSame format as the commit first line:
<type>[optional scope]: <gitmoji> <description>
## Summary
<One paragraph explaining the purpose and impact of the change.>
## Commits
- [`abc1234`](https://github.com/mguyard/hass-diagral/commit/abc1234) feat(sensor): ✨ Add battery level sensor — short explanation
- [`def5678`](https://github.com/mguyard/hass-diagral/commit/def5678) docs(entities): 📝 Document battery sensor
## Tests
pytest tests/ -v ✅ N passed, ❌ 0 failed, ⚠️ 0 errors
## Related Issues
Closes #<issue_number>
## Testsis mandatory. Run the pre-commit gate (§3) on the source branch before opening the PR. Fix all failures before opening.
| Branch | Role |
|---|---|
dev | Development — all PRs must target this branch |
main | Stable releases — merged only by semantic-release CI |
Never open a PR directly against main.
git log origin/dev..HEAD --oneline — list commits for the ## Commits sectiongit diff origin/dev --stat — verify scope of changesdev