firmware-update-patterns

firmware-update-patterns is a skill for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 45 tokens per session (1,542 once invoked), scanned A, original, MIT.

A reference guide to updating microcontroller firmware remotely, commonly called FOTA, or firmware over the air.

In plain words
What is it for?
Use it when building bootloader checks, firmware image headers, MQTT-based update progress, and reliable remote-update flows.
Why use it?
It helps make updates safer by checking firmware images and tracking update progress so interrupted updates are less likely to leave devices unusable.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the firmware-update plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it when building bootloader checks, firmware image headers, MQTT-based update progress, and reliable remote-update flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hermeticormus/libreembed-claude-code/firmware-update-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HermeticOrmus/LibreEmbed-Claude-Code --skill firmware-update-patterns
Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code.

Or install firmware-update, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for firmware-update-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/firmware-update-patterns/github.svg)](https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/firmware-update-patterns)
Your own site
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/firmware-update-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/firmware-update-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for firmware-update-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/firmware-update-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/firmware-update-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,542 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.01542
Opus 5.5 $0.00018 $0.00617
Sonnet 5.5 $0.00009 $0.00308
Haiku 4.5 $0.00005 $0.00154

Measured 2mo ago against content hash d12100d639a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

firmware-update-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/firmware-update/skills/firmware-update-patterns/SKILL.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.

firmware-update-patterns

Knowledge Base

FOTA patterns for MCU firmware updates with reliability guarantees.


Pattern 1: mcuboot Image Header Construction

/* Build tool (Python/imgtool) writes this header before the firmware binary */
/* MCU application starts at header_base + header_size (default 0x20 = 32 bytes) */

#define MCUBOOT_MAGIC  0x96f3b83dUL

typedef struct __attribute__((packed)) {
    uint32_t magic;        /* 0x96f3b83d */
    uint32_t load_addr;    /* 0: XIP from flash */
    uint16_t hdr_size;     /* 32 bytes */
    uint16_t protect_tlv;  /* 0 */
    uint32_t img_size;     /* Firmware body bytes */
    uint32_t flags;        /* IMAGE_F_* flags */
    uint8_t  img_ver[8];   /* major, minor, revision[2], build_num[4] */
    uint32_t _pad;
} mcuboot_header_t;        /* Exactly 32 bytes */

/* Verify on bootloader side: */
bool mcuboot_verify_header(const void *slot_base)
{
    const mcuboot_header_t *hdr = slot_base;
    return hdr->magic == MCUBOOT_MAGIC
        && hdr->hdr_size == 32U
        && hdr->img_size > 0U
        && hdr->img_size < MAX_IMAGE_SIZE;
}

Pattern 2: FOTA Progress Tracking via MQTT

# Python host-side: publish firmware chunks, track progress
import paho.mqtt.client as mqtt
import struct, hashlib

CHUNK_SIZE = 1024
TOPIC_CMD  = "device/{id}/ota/cmd"
TOPIC_DATA = "device/{id}/ota/data"
TOPIC_ACK  = "device/{id}/ota/ack"

def send_firmware(client, device_id, fw_bytes):
    total = len(fw_bytes)
    sha256 = hashlib.sha256(fw_bytes).hexdigest()

    # Start command
    client.publish(TOPIC_CMD.format(id=device_id),
        f'{{"cmd":"start","size":{total},"sha256":"{sha256}"}}')

    # Send chunks
    for i, offset in enumerate(range(0, total, CHUNK_SIZE)):
        chunk = fw_bytes[offset:offset+CHUNK_SIZE]
        hdr = struct.pack(">IHH", offset, len(chunk), i)
        client.publish(TOPIC_DATA.format(id=device_id), hdr + chunk)

    # Finish
    client.publish(TOPIC_CMD.format(id=device_id), '{"cmd":"apply"}')

Read the full file on GitHub · 198 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +5 lines · +45 tokens per session d12100d639a9
  2. 3mo ago First seen · 193 lines · 0 tokens per session scan A 68a6beb94885

Subscribe to this mod's changes

firmware-update-patterns is a skill published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 1,542 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

firmware-update-patterns compared with skills from other repositories

firmware-update-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
firmware-update-patternsHermeticOrmus/LibreEmbed-Claude-CodeSkill501mo agoMITA45Claude Code
volt-otatonone-ai/tononeSkill842d agoMITA70Claude Code
volt-firmwaretonone-ai/tononeSkill842d agoMITA76Claude Code
volt-powertonone-ai/tononeSkill842d agoMITA65Claude Code
volt-drivertonone-ai/tononeSkill842d agoMITA63Claude Code
volt-recontonone-ai/tononeSkill842d agoMITA52Claude Code
iot-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A59Claude Code