with one click
add-sensor
Scaffold a new sensor driver with tests and config
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Scaffold a new sensor driver with tests and config
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | add-sensor |
| description | Scaffold a new sensor driver with tests and config |
| argument-hint | [sensor-name] [bus-type: i2c|spi|uart] |
| allowed-tools | Read, Edit, Write, Grep, Glob, Bash |
| user-invocable | true |
Scaffold a complete new sensor driver for the Tricorder platform.
Arguments: $ARGUMENTS should be <sensor-name> <bus-type> (e.g., bmp390 i2c)
Read the canonical example for the bus type:
src/sensors/bme680.pysrc/sensors/ads1263.pysrc/sensors/tfmini_s.pyRead the base class at src/sensors/base.py for BaseSensor, SensorReading, SensorFactory.
Create the driver at src/sensors/<sensor-name>.py:
BaseSensorDEFAULT_REGISTERS and DEFAULT_CONFIDENCE class constants__init__ pulling all hardware params from config dict_do_initialize() with chip ID verification and register setup_do_read() returning a SensorReadingSensorFactory.register("<sensor-name>", <ClassName>) at module bottomAdd mock fixture to tests/conftest.py:
Create tests at tests/unit/test_<sensor-name>.py:
SensorInitializationErrorAdd config to config/base.yaml under the appropriate bus section (i2c_devices, spi_devices, or uart_devices).
Run the full test suite to verify:
PYTHONPATH=src python -m pytest tests/ --cov=src --cov-fail-under=85 -v
Run lint to verify:
ruff check src/ tests/