{"kind":"Skill","metadata":{"namespace":"community","name":"arduino-azure-iot-edge-integration","version":"0.1.0"},"spec":{"description":"Design and implement Arduino integration with Azure IoT Hub and IoT Edge, including secure provisioning, resilient telemetry, command handling, and production guardrails.","files":{"SKILL.md":"---\nname: arduino-azure-iot-edge-integration\ndescription: 'Design and implement Arduino integration with Azure IoT Hub and IoT Edge, including secure provisioning, resilient telemetry, command handling, and production guardrails.'\n---\n\n# Arduino Azure IoT Edge Integration\n\nUse this skill when the user needs to connect Arduino-class devices to Azure IoT, especially in edge-heavy scenarios (gateways, intermittent networks, offline buffering, and local actuation).\n\n## When to use it\n\nUse this skill for requests such as:\n\n- \"I want to connect Arduino sensors to Azure\"\n- \"How do I send MQTT telemetry to IoT Hub?\"\n- \"I need an edge gateway for field devices\"\n- \"I want cloud-to-device commands and OTA configuration updates\"\n\n## Mandatory documentation review\n\nBefore recommending an IoT Edge topology or runtime behavior, review:\n\n- https://learn.microsoft.com/azure/iot-edge/\n\nIf documentation cannot be consulted, proceed with explicit assumptions and highlight them in a dedicated section.\n\n## Official Arduino references and best practices (required)\n\nBefore proposing firmware, wiring, or communication implementation details, consult official Arduino sources first:\n\n- https://www.arduino.cc/en/Guide\n- https://docs.arduino.cc/\n- https://docs.arduino.cc/language-reference/\n- references/arduino-official-best-practices.md\n\nWhen choosing between implementation alternatives, prioritize official Arduino guidance over community snippets unless there is a clear technical reason to deviate.\n\n## Objectives\n\n- Produce a secure end-to-end reference path from the Arduino device to cloud insights.\n- Handle unstable links (store-and-forward, retries, idempotency).\n- Define an actionable device and cloud backlog.\n\n## Integration patterns\n\n### Pattern A: Arduino direct to IoT Hub\n\nUse when connectivity is stable and cloud latency is acceptable.\n\n- Protocol: MQTT over TLS.\n- Identity: per-device credentials (SAS or X.509).\n- Telemetry payload: compact JSON with timestamp, device ID, metrics, and optional quality flags.\n\n### Pattern B: Arduino to local gateway, then IoT Edge\n\nUse when links are constrained, local control is required, or batching improves cost/reliability.\n\n- Arduino communicates with a local gateway (serial, BLE, local MQTT, RS-485, Modbus bridge).\n- The gateway publishes upstream through the IoT Edge runtime and routes data to IoT Hub.\n- Local modules can filter, aggregate, and trigger actions even during cloud outages.\n\n## Design flow\n\n### 1) Device contract\n\nDefine:\n\n- Sensor catalog and units.\n- Sampling frequency and expected throughput.\n- Message schema versioning strategy.\n- Desired/reported device twin properties to control runtime behavior.\n\n### 2) Security baseline\n\nRequire:\n\n- Unique identity per device.\n- No hardcoded secrets in source code or firmware artifacts.\n- Credential rotation strategy.\n- Signed firmware and a controlled update process when possible.\n\n### 3) Reliability and offline behavior\n\nPlan and document:\n\n- Backoff with jitter.\n- Local queue/buffer strategy with bounded size.\n- Duplicate suppression or downstream idempotent processing.\n- Fallback to last-known-good configuration.\n\n### 4) Cloud and edge routing\n\nDefine routes for:\n\n- Raw telemetry to cold storage.\n- Curated telemetry to hot analytics.\n- Alerts to operations channels.\n- Commands and configuration back to edge/device.\n\n### 5) Observability\n\nSpecify minimum operations telemetry:\n\n- Device heartbeat and firmware version.\n- Connectivity state transitions.\n- Message send success/error counters.\n- Gateway module health and restart reasons.\n\n## Reuse other skills\n\nWhen relevant, combine with:\n\n- `azure-smart-city-iot-solution-builder` for city-wide architecture and phased rollout.\n- `azure-resource-visualizer` for relationship diagrams.\n- `appinsights-instrumentation` for app and service telemetry patterns.\n\nAlso use `references/arduino-official-best-practices.md` as a quality baseline for firmware and hardware recommendations.\n\n## Required output\n\nAlways provide:\n\n1. Chosen connectivity pattern and rationale.\n2. Message contract (fields, units, sample payload).\n3. Security checklist for identity/credentials/updates.\n4. Reliability plan (retry, buffering, dedupe).\n5. Implementation backlog (firmware, gateway, cloud).\n\n## Output template\n\n1. Scenario and assumptions\n2. Recommended architecture\n3. Device and gateway contract\n4. Security and reliability controls\n5. Deployment plan and validation tests\n\n## Guidelines\n\n- Do not propose production deployments with shared credentials across devices.\n- Do not assume always-on connectivity in field deployments.\n- Do not omit command authorization and auditing in actuator scenarios.\n","references/arduino-iot-checklist.md":"# Arduino Azure IoT Checklist\n\nUse this checklist before finalizing architecture or implementation guidance.\n\n## 0) Official Arduino Baseline\n\n- Official references reviewed from \u003chttps://www.arduino.cc/en/Guide\u003e and \u003chttps://docs.arduino.cc/\u003e.\n- Language/API calls validated against \u003chttps://docs.arduino.cc/language-reference/\u003e.\n- Best practices reviewed from `references/arduino-official-best-practices.md`.\n\n## 1) Device Profile\n\n- MCU model and memory constraints documented.\n- Sensor list and sampling strategy defined.\n- Power model documented (mains, battery, sleep cycles).\n\n## 2) Connectivity\n\n- Selected transport documented (MQTT over TLS preferred).\n- Network failure behavior defined.\n- Local timestamp strategy defined if device lacks RTC sync.\n\n## 3) Security\n\n- Unique identity per device.\n- No secrets in source control.\n- Credential rotation plan documented.\n- Firmware update and rollback plan documented.\n\n## 4) Edge and Cloud Flow\n\n- Routing from edge to IoT Hub documented.\n- Offline buffering limits defined.\n- Duplicate handling strategy documented.\n- Alerting thresholds and destinations defined.\n\n## 5) Validation\n\n- Connectivity soak test scenario.\n- Packet loss and reconnection test.\n- Command authorization test.\n- Firmware version and health reporting verification.\n","references/arduino-official-best-practices.md":"# Arduino Official References and Best Practices\n\nUse these official Arduino resources before finalizing firmware or hardware guidance.\n\n## Official References\n\n- Arduino main guide: \u003chttps://www.arduino.cc/en/Guide\u003e\n- Arduino docs home: \u003chttps://docs.arduino.cc/\u003e\n- Getting started path: \u003chttps://docs.arduino.cc/learn/starting-guide/getting-started-arduino/\u003e\n- Arduino IDE usage: \u003chttps://docs.arduino.cc/learn/starting-guide/the-arduino-software-ide/\u003e\n- Arduino language reference: \u003chttps://docs.arduino.cc/language-reference/\u003e\n- Arduino programming reference overview: \u003chttps://docs.arduino.cc/learn/programming/reference/\u003e\n- Arduino memory guide: \u003chttps://docs.arduino.cc/learn/programming/memory-guide/\u003e\n- Arduino debugging fundamentals: \u003chttps://docs.arduino.cc/learn/microcontrollers/debugging/\u003e\n- Arduino low-power design guide: \u003chttps://docs.arduino.cc/learn/electronics/low-power/\u003e\n- Arduino communication protocols index: \u003chttps://docs.arduino.cc/learn/communication/\u003e\n- Arduino style guide for libraries: \u003chttps://docs.arduino.cc/learn/contributions/arduino-library-style-guide/\u003e\n\n## Firmware Best Practices\n\n- Keep the `loop()` non-blocking; avoid long `delay()` usage in production logic.\n- Use `millis()`-based scheduling for periodic tasks.\n- Budget SRAM explicitly and avoid dynamic allocation in hot paths.\n- Validate sensor ranges and provide safe defaults for invalid readings.\n- Add startup self-checks and periodic health heartbeat messages.\n- Version the payload schema and firmware version in every telemetry stream.\n- Implement retry with exponential backoff and jitter for network operations.\n- Store credentials outside source code and rotate them according to policy.\n\n## Hardware and Power Best Practices\n\n- Document voltage levels, pin mapping, and current limits per peripheral.\n- Design for brownout and power fluctuation scenarios.\n- Use watchdog and safe recovery behavior where available.\n- Plan low-power modes for battery deployments and validate wake cycles.\n\n## Integration Best Practices for Azure IoT\n\n- Prefer secure transports (MQTT over TLS) and per-device identity.\n- Define idempotent upstream processing for duplicate message scenarios.\n- Include device health metrics (uptime, reset reason, RSSI where applicable).\n- Validate offline buffering bounds to avoid uncontrolled memory growth.\n"},"import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/tree/541b7819d8c3545c6df122491af4fa1eae415779/skills/arduino-azure-iot-edge-integration"}},"content_hash":[243,142,178,232,36,74,7,71,169,191,8,74,103,13,122,193,146,19,157,186,217,100,64,96,183,90,203,72,120,174,174,216],"trust_level":"unsigned","yanked":false}
