بنقرة واحدة
add-sensor
Scaffold a new sensor driver with tests and config
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Scaffold a new sensor driver with tests and config
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| 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/