| name | review-integration |
| description | Review a meter or charger integration PR or file against project patterns and rules |
| user-invocable | true |
| argument-hint | <PR number or file path> |
Review Integration
Reviews a meter or charger integration for pattern compliance, correctness, and completeness.
Step 1: Resolve Target
If PR number (e.g., 42):
- Run
gh pr diff $ARGUMENTS to get changed files
- Read all modified/added Python files in
meters/ or chargers/
If file path (e.g., custom_components/evse_load_balancer/meters/shelly_meter.py):
- Read the file directly
- Infer related files: test file, const.py changes, factory changes
Step 2: Determine Type
From file paths, determine if this is a meter or charger. Read the implementation file(s).
Step 3: Read Reference Files
Read for comparison:
custom_components/evse_load_balancer/const.py (check registration)
- Relevant factory
__init__.py (check registration)
custom_components/evse_load_balancer/config_flow.py (check filter list for chargers)
- One existing implementation of the same type for pattern comparison
- The base class (
meters/meter.py or chargers/charger.py)
Step 4: Run Checklist
Evaluate each item. Mark as PASS, FAIL, or WARN with specific file:line references.
Base Class Compliance
Entity Lookup
Error Handling
Naming & Style
Charger-Specific
Meter-Specific
Registration
Tests
Step 5: Automated Checks
ruff check <implementation_file>
pytest <test_file> -v 2>&1 || true
Step 6: Output Review
Format as:
## Integration Review: <Name> <Meter|Charger>
### Summary
<1-2 sentence assessment>
### Results
| Category | Status | Details |
|----------|--------|---------|
| Base Class | PASS/FAIL | ... |
| Entity Lookup | PASS/FAIL | ... |
| Error Handling | PASS/FAIL | ... |
| Naming & Style | PASS/FAIL | ... |
| Type-Specific | PASS/FAIL | ... |
| Registration | PASS/FAIL | ... |
| Tests | PASS/FAIL | ... |
### Issues
1. **[FAIL] <category>**: <description>
- File: <path>:<line>
- Fix: <specific suggestion>
### Suggestions
- <optional improvements, not blocking>
If issues are found, offer to fix them directly or describe the fixes needed for /create-integration to apply.