iot-protocols
Use when the user asks about MQTT 5, QoS, retained messages, last will, CoAP, LwM2M, BLE GATT, LoRaWAN, Matter, Thread or device provisioning. Produces…
от j4flmao★ 47 звёзд на GitHub
Установить iot-protocols в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
IoT Protocols
Purpose
Constrained devices run on batteries, lossy radios and tiny RAM. This skill picks the protocol stack that fits the link and power budget, designs MQTT topics/QoS or CoAP resources correctly, and secures and provisions devices so a fleet can be managed for years.
Agent Protocol
Trigger
"MQTT", "CoAP", "LwM2M", "IoT protocol", "QoS", "retained message", "last will", "MQTT 5", "BLE GATT", "LoRaWAN", "Matter", "Thread", "device provisioning".
Input Context
- Device class (MCU RAM/flash, battery or mains), link (Wi-Fi, Ethernet, cellular LTE-M/NB-IoT, BLE, 802.15.4/Thread, LoRaWAN)
- Message rates and sizes, latency needs, command/downlink needs
- Cloud/broker (Mosquitto, EMQX, HiveMQ, AWS IoT Core, Azure IoT Hub) and security requirements
Output Artifact
Protocol choice, topic/resource design, QoS and session settings, client code. No file unless requested.
Response Format
Link: {radio/network}
Protocol: {MQTT 3.1.1 | MQTT 5 | CoAP | LwM2M | BLE GATT | LoRaWAN}
Design: {topics/resources and payload format}
Delivery: {QoS / confirmable, retries, session expiry}
Security: {TLS/DTLS, cert/PSK, provisioning}
Offline: {buffering and reconnect strategy}
1. Choosing the Stack
| Situation | Choice | Why |
|---|---|---|
| IP device, always-on-ish, cloud telemetry + commands | MQTT over TLS (TCP 8883) | Broker fan-out, persistent sessions, huge ecosystem |
| Very constrained IP device, UDP/6LoWPAN, sleepy nodes | CoAP (RFC 7252) over DTLS or OSCORE | 4-byte header, UDP, REST semantics, Observe |
| Fleet management (firmware update, config, standard objects) | LwM2M (OMA) over CoAP | Standard object model, FOTA, bootstrap |
| Phone/gateway companion, short range | BLE GATT | Low power, phone native |
| Smart-home interoperability | Matter (over Wi-Fi/Thread/Ethernet) | Multi-vendor ecosystem |
| Long range, few bytes per hour | LoRaWAN | km range, duty-cycle and payload limits |
| Non-IP sensor nets to a gateway | MQTT-SN, Zigbee, proprietary | gateway translates to MQTT |
2. MQTT Essentials
- Pub/sub through a broker; clients connect over TCP (1883 plain, 8883 TLS) or WebSocket.
- QoS per message, between each client and the broker (not end to end):
- QoS 0 at most once — no ack.
- QoS 1 at least once — PUBLISH/PUBACK; duplicates possible → consumers must be idempotent.
- QoS 2 exactly once between two hops — PUBLISH/PUBREC/PUBREL/PUBCOMP; more round trips and state. Rarely worth it; prefer QoS 1 + idempotent handling.
- Retained message: broker keeps the last message on a topic and delivers it to new subscribers (device state, config). Clear by publishing an empty retained payload.
- Last Will and Testament: broker publishes it if the client disconnects ungracefully — pair with a retained
onlinestatus for presence. - Persistent session (
cleanSession=falsein 3.1.1 /Clean Start=false+ Session Expiry in 5) queues QoS 1/2 messages while the client is offline. - Keep-alive: choose with the NAT/cellular idle timeout in mind (often 60–300 s); too short drains batteries.
MQTT 5 additions worth using
Reason codes on acks, session and message expiry intervals, user properties (metadata without payload changes), topic aliases (save bytes), request/response (Response Topic + Correlation Data), shared subscriptions ($share/<group>/<topic>) for load-balanced backend consumers, flow control (Receive Maximum).
Topic design
{tenant}/{deviceType}/{deviceId}/telemetry device -> cloud, QoS 0/1
{tenant}/{deviceType}/{deviceId}/state retained, device -> cloud
{tenant}/{deviceType}/{deviceId}/cmd/{name} cloud -> device, QoS 1
{tenant}/{deviceType}/{deviceId}/cmd/{name}/res device -> cloud, correlation id
- Put the device ID in the topic and enforce per-device ACLs on the broker (a device may publish/subscribe only under its own ID).
- No leading
/, no wildcards in published topics; subscribers use+(one level) and#(multi-level, last). - Version payloads (
"v": 2) and keep them compact (CBOR or Protobuf on constrained links, JSON when bandwidth allows).
3. CoAP Essentials
- UDP request/response with methods GET/POST/PUT/DELETE and response codes (2.05 Content, 4.04 Not Found ...).
- Message types: Confirmable (CON, retransmitted with exponential back-off until ACK), Non-confirmable (NON), ACK, RST.
- Observe (RFC 7641): client registers on a resource and gets notifications on change — the CoAP analogue of subscribe.
- Block-wise transfer (RFC 7959) for payloads larger than a datagram (firmware images).
- Security: DTLS 1.2/1.3 (PSK, raw public keys or certificates) or OSCORE (RFC 8613) for end-to-end protection through proxies.
- Discovery via
/.well-known/core(CoRE Link Format).
4. Security and Provisioning
- TLS 1.2+ (prefer 1.3) with server certificate validation on the device — pin the CA, not the leaf, so certificates can rotate.
- Unique per
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл iot-protocols?
Use when the user asks about MQTT 5, QoS, retained messages, last will, CoAP, LwM2M, BLE GATT, LoRaWAN, Matter, Thread or device provisioning. Produces device-to-cloud protocol choice, topic design and TLS/DTLS security. Not for cloud stream processing (use data-streaming) or firmware drivers (use c-cpp-patterns).
Как установить скилл iot-protocols?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл iot-protocols запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…