mqtt-uns-feeder
Guide for adding MQTT/UNS transport to data feeders.
Install
mkdir -p .claude/skills/mqtt-uns-feeder && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10174" && unzip -o skill.zip -d .claude/skills/mqtt-uns-feeder && rm skill.zipInstalls to .claude/skills/mqtt-uns-feeder
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when adding MQTT/Unified-Namespace transport to a feeder in this repo — either alongside an existing Kafka feeder (transport split) or for a brand-new source where MQTT is the primary fit. Covers UNS topic-tree design, xRegistry MQTT messagegroup pattern, paho-mqtt v5 binary-mode CloudEvent emission, Entra JWT enhanced auth for Event Grid namespace brokers, two-app folder layout sharing a core acquisition module, Dockerfile.mqtt + dedicated pyproject, two MQTT ARM templates (BYO broker + Event Grid namespace), the read-only test-client registration helper, MQTT Docker E2E, and the four-button portal/README update. NOTE: AMQP 1.0 transport is MANDATORY alongside MQTT — see `.github/skills/amqp-feeder/SKILL.md` and the 'Mandatory AMQP Companion' section below.Key capabilities
- →Design UNS topic trees
- →Configure MQTT messagegroups
- →Emit CloudEvents
- →Design ARM templates
How it works
Standardizes the addition of MQTT transport to feeders, covering topic-tree design and CloudEvent emission.
Inputs & outputs
When to use mqtt-uns-feeder
- →Add MQTT feeder support
- →Design UNS topic hierarchy
- →Configure CloudEvent emission
About this skill
MQTT / Unified Namespace Feeder
This skill describes how to add MQTT transport to a feeder so that its events are published into a Unified Namespace topic tree carrying binary-mode MQTT 5.0 CloudEvents with JSON payloads. The pegelonline source is the reference implementation — read its files alongside this document.
The skill applies in two shapes:
- Transport split — an existing source already ships a Kafka feeder and you are adding an MQTT sibling (the pegelonline pattern).
- MQTT-first — a brand-new source whose data shape is so well-suited to LKV-on-retained-topics that Kafka may not even be added later.
Either way, the runtime never publishes to both transports from the same process. There are always two independent containers, two independent pyproject.toml files, two independent images, and two independent ARM templates.
When to Use
- Add MQTT/UNS publication to an existing Kafka source.
- Greenfield source where the upstream data is naturally a hierarchical catalog of stable identifiers (stations, vessels, zones, sensors) each emitting periodic measurements.
- Refactor a feeder so the acquisition logic is shared between Kafka and MQTT apps.
When not to Use
- High-volume firehose telemetry without stable per-object identity (raw lightning strokes, raw AIS sentences, raw firehoses): UNS LKV semantics do not fit.
- Sources whose payloads exceed MQTT broker per-message limits.
- Sources that need consumer-side replay/seek to historical offsets. MQTT retained slots only hold the last value per topic.
Mandatory Expert Reviews
Three subagents must review the MQTT design before generation runs:
| Aspect | Reviewer | What to ask |
|---|---|---|
| Topic tree | UNS Catalog Architect if available; otherwise consult the xRegistry Expert who knows the UNS-on-xRegistry mapping. | Validate the hierarchy depth, segment naming, wildcard fitness, retained vs non-retained per event type, QoS, single-vs-multi-topic-per-object decisions. |
| xRegistry MQTT contract | xRegistry Expert | Validate the MQTT/5.0 endpoint, the dedicated <source>.mqtt messagegroup with basemessageurl references back into the transport-neutral group, and the protocoloptions.properties (topic / qos / retain). |
| Schemas | JSON Structure Expert | Re-confirm that JsonStructure schemas (shared with Kafka) still cover every field; add no MQTT-specific schema drift. |
Do not skip these reviews. Even when the same human contract author also wrote the Kafka contract, MQTT-specific decisions (retained slots, wildcards, key/topic alignment) require an independent expert pass.
Mandatory Pre-merge Documentation Gate
A feeder PR is NOT mergeable until every one of the following docs mentions MQTT in a meaningful way. Both reviewers (xRegistry + UNS) and the implementing agent must verify this BEFORE opening the PR. Reject or fix any PR that fails the gate.
| File | Required MQTT content |
|---|---|
<source>/README.md | A "Transports" (or equivalently named) section that names the MQTT app, explains the Kafka vs MQTT choice for this source, and lists all four deployment templates (Kafka container, Kafka + Event Hubs, MQTT container, MQTT + Event Grid namespace). |
<source>/CONTAINER.md | An MQTT section with env-var table (broker host, port, TLS, auth mode, topic prefix, retain default, QoS default) and the two MQTT Deploy-to-Azure badges. |
<source>/EVENTS.md | The MQTT messagegroup with the literal topic patterns (e.g. air-quality/be/issep/...) per message type. Must be regenerated from the updated xreg, not hand-edited. |
Root README.md | The source's row appends the MQTT image link and the two MQTT deploy badges. |
ghpages/app.js and ghpages/catalog.json | mqtt: true set on the source entry so the portal renders the MQTT deploy buttons. |
Each of these MUST be touched in the same PR as the MQTT feeder code. PRs that ship code without docs are bug-causing and have happened repeatedly — do not allow it.
Reviewer checklist (paste into PR description or review comment):
-
<source>/README.mdmentions MQTT and the four deploy templates -
<source>/CONTAINER.mdhas MQTT env-var table + two MQTT badges -
<source>/EVENTS.mdshows the MQTT messagegroup + topic patterns - Root
README.mdrow has MQTT image + two MQTT badges -
ghpages/app.jsandghpages/catalog.jsonsetmqtt: true
If any box is unchecked, the PR is incomplete — either fix in branch or re-open as a "doc backfill" PR before declaring the feeder done.
Mandatory AMQP Companion
Every MQTT feeder PR in this repo MUST also ship an AMQP 1.0 sibling feeder in the same PR. This is non-negotiable. The three transports (Kafka, MQTT, AMQP) form the standard trio for every source.
Rationale: MQTT is right for UNS-style consumers (low-latency, retained LKV, pub/sub fan-out). AMQP 1.0 is right for queue-oriented enterprise consumers (Azure Service Bus, ActiveMQ Artemis, Qpid Dispatch, RabbitMQ AMQP 1.0 plugin) where work-distribution semantics or transactional delivery matter. Shipping one without the other leaves half the consumer population unserved and creates ongoing per-source retrofit debt — which we are no longer willing to take on.
Authoritative contract: .github/skills/amqp-feeder/SKILL.md. Read it
in full alongside this document. Pegelonline is the reference
implementation for both transports.
| Required AMQP artifact | Where |
|---|---|
<source>.amqp messagegroup + AMQP endpoint(s) in xreg | <source>/xreg/<source>.xreg.json |
AMQP CBS target generated via xrcg --azure_cbs_target | <source>_amqp_producer/... (generated) |
<source>_amqp/ app folder sharing the core acquisition module | sibling of <source>_kafka/ and <source>_mqtt/ |
Dockerfile.amqp | <source>/Dockerfile.amqp |
Test<Source>AmqpDockerFlow class | tests/docker_e2e/test_docker_amqp_flow.py |
AMQP rows in matrix.json (build + flow) | tests/docker_e2e/matrix.json |
| ARM template for Service Bus (CBS / Entra ID) | <source>/azure-template-amqp.json |
AMQP section in CONTAINER.md with env-var table + Deploy badges | <source>/CONTAINER.md |
AMQP messagegroup + address templates in EVENTS.md | <source>/EVENTS.md |
Root README.md row: AMQP image link + AMQP deploy badges | README.md |
amqp: true on the portal entry | ghpages/app.js + ghpages/catalog.json |
<source>/README.md Transports section lists Kafka + MQTT + AMQP | <source>/README.md |
The AMQP messagegroup MUST share the schemas (single
schemagroups.<source>.jstruct block) and use the SAME identity tuple
as the Kafka subject/key and the MQTT topic. AMQP address templates
match the topic placeholders one-for-one.
Reviewer checklist (paste into PR description or review comment):
- xreg has
<source>.amqpmessagegroup with AMQP endpoint(s) (generic SASL PLAIN + Azure Service Bus CBS) - xrcg regenerated with
--azure_cbs_targetand the generated<source>_amqp_produceris committed -
<source>_amqp/app folder exists, shares core acquisition module with Kafka/MQTT apps -
Dockerfile.amqpbuilds; OCI labels set correctly -
Test<Source>AmqpDockerFlowclass exists intest_docker_amqp_flow.py -
matrix.jsonhas the AMQPbuildrow AND the AMQPflowrow - CI shows the AMQP flow job actually executing and passing
-
azure-template-amqp.jsonpresent and referenced from CONTAINER.md - CONTAINER.md, EVENTS.md, source README, root README, portal entries all mention AMQP
- AMQP identity placeholders match Kafka subject/key and MQTT topic exactly
A PR that adds MQTT without AMQP is not mergeable — open it as Kafka+MQTT+AMQP from day one. If you discover mid-implementation that AMQP is impossible for this source (e.g. upstream payloads cannot be addressed under any sensible AMQP address template), document the reason in the PR body and request explicit user approval to ship MQTT-only as an exception.
Mandatory Pre-merge Test Gate
A feeder PR is NOT mergeable until both of the following exist in the same PR as the feeder code. This has been violated repeatedly; do not allow it.
| Required | Where |
|---|---|
Test<Source>MqttDockerFlow class | tests/docker_e2e/test_docker_mqtt_flow.py |
Matrix build entries (one per image: <source> Kafka and <source>-mqtt) | tests/docker_e2e/matrix.json build array |
Matrix flow entry with "test_file": "test_docker_mqtt_flow.py" | tests/docker_e2e/matrix.json flow array |
The Docker E2E test must boot eclipse-mosquitto:2 alongside the
<source>_mqtt image and assert everything described in the Docker
E2E section below (retained refs, telemetry, topic match, binary-mode
CE properties, schema validation).
Reviewer checklist (paste into PR description or review comment):
-
Test<Source>MqttDockerFlowclass exists intest_docker_mqtt_flow.py -
matrix.jsonbuildhas the<source>-mqttimage entry -
matrix.jsonflowhas a row with"test_file": "test_docker_mqtt_flow.py"pointing at the new class - CI run on the PR shows the new MQTT flow job actually executing and passing (not skipped by path filter)
A "fast-shipping" feeder PR that omits the test is a regression, not a feature. Reject it.
Inputs
- source id (e.g.
pegelonline) - list of event types and their identity tuple (e.g.
Stationkeyed onwater_shortname/station_id,CurrentMeasurementkeyed on the same) - decision: which events are retained (LKV) and which are not
- the UNS domain prefix the source belongs to
(e.g.
hydro/de/wsv/pegelonline/...) - whether a Kafka feeder already exists in the folder
Non-Negotiables
- One process, one transport. Never emit MQTT and Kafka from the same Python process or container.
- The MQTT and K
Content truncated.
When not to use it
- →High-volume firehose telemetry
- →Non-UNS environments
Prerequisites
Limitations
- →Not for high-volume firehose telemetry
- →Requires expert review
How it compares
It mandates a specific expert review and documentation gate for MQTT transport addition.
Compared to similar skills
mqtt-uns-feeder side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| mqtt-uns-feeder (this skill) | 0 | 2mo | No flags | Advanced |
| telegram-bot-builder | 106 | 6mo | Review | Intermediate |
| machine-learning-ops-ml-pipeline | 4 | 4mo | No flags | Advanced |
| reddit-api | 3 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
telegram-bot-builder
davila7
Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.
machine-learning-ops-ml-pipeline
sickn33
Design and implement a complete ML pipeline for: $ARGUMENTS
reddit-api
alinaqi
Reddit API with PRAW (Python) and Snoowrap (Node.js)
uv
mitsuhiko
Use `uv` instead of pip/python/venv. Run scripts with `uv run script.py`, add deps with `uv add`, use inline script metadata for standalone scripts.
hugging-face-tool-builder
patchy631
Use this skill when the user wants to build tool/scripts or achieve a task where using data from the Hugging Face API would help. This is especially useful when chaining or combining API calls or the task will be repeated/automated. This Skill creates a reusable script to fetch, enrich or process data.
vastai-core-workflow-b
jeremylongshore
Execute Vast.ai secondary workflow: Core Workflow B. Use when implementing secondary use case, or complementing primary workflow. Trigger with phrases like "vastai secondary workflow", "secondary task with vastai".