USB-Meter / AGENTS.md
Newer Older
32 lines | 1.953kb
Bogdan Timofte authored 2 weeks ago
1
# Agent Guide
2

            
3
This project has dedicated specifications to keep implementation work aligned and to prevent agent drift.
4

            
5
Before changing code, read the documentation that matches the touched area:
6

            
7
- `Documentation/API Reference/README.md`
8
  Entry point for entity, operation, invariant, and test expectations.
9
- `Documentation/API Reference/UI_ALIGNMENT.md`
10
  UI-to-spec mapping and known alignment gaps.
11
- `Documentation/Project Structure and Naming.md`
12
  Folder, naming, and view-organization rules.
13
- `Documentation/Research Resources/README.md`
14
  Vendor manuals, protocol notes, and reverse-engineering material.
15

            
16
## Working Rules
17

            
18
- Treat `MUST` items in `Documentation/API Reference/` as required behavior.
19
- Treat `SHOULD` items as expected behavior; regressions need a reason and documentation update.
20
- If code and documentation disagree, do not silently choose one. Update the implementation, update the spec, or call out the conflict.
21
- Keep feature work scoped to the relevant model, view, or operation described in the docs.
22
- When adding behavior, update the matching API Reference page if the behavior changes an invariant, public API, storage shape, sync behavior, or user-visible workflow.
23
- Prefer existing project patterns over new abstractions unless the docs or surrounding code clearly support the change.
24

            
25
## Quick Routing
26

            
27
- Meter Bluetooth, connection, measurements: `Documentation/API Reference/Meter.md`, `BluetoothDiscovery.md`, `Operations.md`
28
- Charge sessions and charged devices: `ChargedDevice.md`, `ChargingMonitoring.md`, `ChargeCurveIsolation.md`, `ChargeCurveStorage.md`
29
- Capacity and consumption logic: `CapacityMeasurement.md`, `ConsumptionMeasurement.md`, `IdleConsumptionMeasurement.md`
30
- Powerbank behavior: `Powerbank.md`
31
- CloudKit and cross-device data integrity: `CloudKitSync.md`, `Charge Session Integrity and Conflict Healing.md`
32
- UI changes: `UI_ALIGNMENT.md` and the relevant operation/entity page