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.
npx agentmods add skills/hermeticormus/libreembed-claude-code/bare-metal-patternsnpx skills add HermeticOrmus/LibreEmbed-Claude-Code --skill bare-metal-patternsgit clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-CodeWrote 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.
[](https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/bare-metal-patterns)<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/bare-metal-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/bare-metal-patterns.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02138 |
| Opus 5 | $0.00000 | $0.01069 |
| Sonnet 5 | $0.00000 | $0.00428 |
| Haiku 4.5 | $0.00000 | $0.00214 |
Grade A, and why
bare-metal-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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.
bare-metal-patterns
Knowledge Base
Production bare-metal C patterns for ARM Cortex-M. All code uses arm-none-eabi-gcc, C11.
Pattern 1: Register Bit Manipulation Macros
Consistent, readable register access without HAL dependency.
/* Generic bit manipulation — safe for any 32-bit register */
#define REG_SET_BIT(reg, bit) ((reg) |= (1U << (bit)))
#define REG_CLR_BIT(reg, bit) ((reg) &= ~(1U << (bit)))
#define REG_TST_BIT(reg, bit) (((reg) >> (bit)) & 1U)
/* Set a multi-bit field: mask off old value, OR in new value */
#define REG_SET_FIELD(reg, mask, shift, val) \
((reg) = ((reg) & ~(mask)) | (((val) << (shift)) & (mask)))
/* Example: set USART1 baud rate divisor in BRR register */
/* BRR = fCK / baud (oversampling by 16) */
#define USART_BRR_SET(uart, fck, baud) \
((uart)->BRR = (uint32_t)((fck) / (baud)))
USART_BRR_SET(USART1, 84000000UL, 115200UL); /* STM32F4 APB2 @ 84MHz */
Pattern 2: GPIO Configuration (Register Level)
Full GPIO setup for STM32F4 without HAL:
/* PA5 = LED (push-pull output), PA0 = button (input, pull-up) */
void gpio_init(void)
{
/* 1. Enable GPIOA clock */
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
(void)RCC->AHB1ENR; /* Bus latency flush: read back after write */
/* 2. PA5: General purpose output, push-pull, high speed */
GPIOA->MODER = (GPIOA->MODER & ~(3U << 10)) | (1U << 10); /* MODER5 = 01 */
GPIOA->OTYPER &= ~(1U << 5); /* Push-pull */
GPIOA->OSPEEDR|= (3U << 10); /* Very high speed */
GPIOA->PUPDR = (GPIOA->PUPDR & ~(3U << 10)); /* No pull */
/* 3. PA0: Input, pull-up */
GPIOA->MODER = (GPIOA->MODER & ~(3U << 0)); /* MODER0 = 00: input */
GPIOA->PUPDR = (GPIOA->PUPDR & ~(3U << 0)) | (1U << 0); /* Pull-up */
}
static inline void led_on(void) { GPIOA->BSRR = (1U << 5); }
static inline void led_off(void) { GPIOA->BSRR = (1U << (5+16)); }
static inline void led_toggle(void) { GPIOA->ODR ^= (1U << 5); }
static inline int btn_read(void) { return (int)((GPIOA->IDR >> 0) & 1U); }
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.
- 5d ago First seen · 235 lines · 0 tokens per session scan A 89692ae8788c
bare-metal-patterns is a skill published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (44 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,138 tokens. 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.
Other skills, from other repositories
expert-rmt5
ESP-IDF v5.x RMT5 API expert for LED protocols, encoders, and multi-channel control. Use when working with RMT peripheral programming, LED strip control, or migrating from RMT4 to RMT5.
iot-skills
Use when developing with Raspberry Pi Pico (RP2040) for GPIO, I2C, Wi-Fi, MQTT, or sensor integration using MicroPython. Index of 1 skill: KE3036 Keyes Pico learning kit.
mspm0-skill
Tool-neutral CLI agent rules for TI MSPM0 development with SysConfig, DriverLib, CCS, Keil/uVision, CMake/GCC/OpenOCD, and supported board references. Use when an agent needs to inspect or modify MSPM0 projects, validate SysConfig output, package examples, or work on NUEDC embedded firmware.
hardware-iot-bus
Low-level I2C and SPI bus peripheral control for embedded Linux boards (Orange Pi, Raspberry Pi, RISC-V).
aether-iot-query
Use this skill when the user asks about a live AetherEdge runtime: channels, points, real-time values, history, alarms, rules, models, instances, routing, SHM health, service health, or system status. Use aether CLI commands to answer — do NOT inspect source code, local database files, or config YAMLs to answer…
aether-iot
Build, integrate, diagnose, or generate applications for the AetherEdge AI-native edge kernel. Use for AetherEdge onboarding, SDK compositions, device and topology clients, read-only operations UIs, MCP integration, Domain Packs, or governed IoT commands where live-state authority and physical-device safety must be…