Critical rules for developing the ha-legacy-gsm-sms Home Assistant addon - surgical file editing between addon variants, preserving test configurations, and multi-component feature implementation checklist.
Critical development guidelines for the ha-legacy-gsm-sms Home Assistant addon repository. This skill ensures proper handling of multiple addon variants, preserves custom test configurations, and enforces complete feature implementation across all required files.
This repository contains multiple addon variants with **intentional differences**:
When syncing features or fixes between addon variants, you MUST make **surgical, line-by-line edits** to preserve custom settings. Copying entire files will overwrite intentional configuration differences.
1. **Read the target file first** using file reading tools or `git show HEAD:path`
2. **Identify what needs to change** - only those specific lines
3. **Make surgical edits** - change only what's necessary
4. **Verify with diff** - check that only intended changes were made
The test addon has these **intentional differences** that must be preserved:
Contains custom debug logging with `๐ DEBUG:` prefixes. Do NOT overwrite with production version.
These values have been tuned for this project and differ from upstream:
When adding a new SMS feature, it must be implemented in ALL these places:
**Don't mark a task as complete until all four are updated.**
When adding a new feature to both production and test addons:
1. Implement in production addon first (`addon-gsm-gateway/`)
2. For Python files (`mqtt_publisher.py`, `run.py`): These CAN be synced (except `support.py`)
3. For `config.yaml`: Make **individual line edits** - never copy the whole file
4. Always verify test addon customizations are preserved after changes
Both should be bumped together when features are added.
Phone numbers can contain: `+`, digits, spaces, `-`, `(`, `)`, `,`
The `+` character can appear **anywhere** (not just at the start) because multiple international numbers are comma-separated: `+1234567890,+0987654321`
**Correct regex:** `^[\+\d\s\-\(\),]*$`
**Wrong regex:** `^\+?[\d\s\-\(\),]*$` (only allows + at start)
Before marking a task as complete:
1. Run Python syntax check on all modified `.py` files
2. Test the logic with edge cases (multiple values, empty values, special characters)
3. Verify with `git diff` that only intended changes were made
4. Check that both production AND test addons are updated (if applicable)
5. Confirm documentation matches the implementation
If unsure whether a file has custom settings or special handling:
This project is based on [PavelVe/hassio-addons](https://github.com/PavelVe/hassio-addons). When syncing upstream features, always credit the source in CHANGELOG.md.
**โ WRONG - Copying entire file:**
```bash
cp addon-gsm-gateway/config.yaml addon-test-current/config.yaml
```
**โ CORRECT - Surgical edit:**
```bash
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/ha-legacy-gsm-sms-development-rules/raw