power-mgmt-patterns

power-mgmt-patterns is a skill for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 50 tokens per session (1,590 once invoked), scanned A, original, MIT.

A reference guide to reducing power use in battery-powered embedded devices by putting hardware into low-power modes safely.

In plain words
What is it for?
Use it when designing sleep and wake-up routines, disabling peripherals, configuring GPIO pins, and restoring clocks after wake-up.
Why use it?
It helps prevent lost data, unfinished transfers, and incorrect hardware state when a device sleeps or wakes.

Skill for Claude Code

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

Part of the power-management plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it when designing sleep and wake-up routines, disabling peripherals, configuring GPIO pins, and restoring clocks after wake-up.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hermeticormus/libreembed-claude-code/power-mgmt-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 power-mgmt-patterns
Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code.

Or install power-management, 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 power-mgmt-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/power-mgmt-patterns/github.svg)](https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/power-mgmt-patterns)
Your own site
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/power-mgmt-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/power-mgmt-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 power-mgmt-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/power-mgmt-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/power-mgmt-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,590 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.00050 $0.01590
Opus 5.5 $0.00020 $0.00636
Sonnet 5.5 $0.00010 $0.00318
Haiku 4.5 $0.00005 $0.00159

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

Security

Grade A, and why

power-mgmt-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/power-management/skills/power-mgmt-patterns/SKILL.md · 188 lines

How it starts

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

power-mgmt-patterns

Knowledge Base

Power management patterns for battery-operated embedded systems.


Pattern 1: Sleep Entry Checklist

Before entering Stop/Standby mode, complete these steps in order:

void prepare_for_stop2(void)
{
    /* 1. Complete all pending DMA transfers */
    HAL_DMA_Abort(&hdma_spi1_tx);

    /* 2. Flush UART TX buffer */
    while (!LL_USART_IsActiveFlag_TC(USART2)) {}

    /* 3. Disable peripheral clocks */
    __HAL_RCC_SPI1_CLK_DISABLE();
    __HAL_RCC_USART2_CLK_DISABLE();
    __HAL_RCC_ADC1_CLK_DISABLE();

    /* 4. Configure unused GPIOs as analog (lowest leakage) */
    GPIO_InitTypeDef gpio = {
        .Mode = GPIO_MODE_ANALOG, .Pull = GPIO_NOPULL,
        .Pin  = GPIO_PIN_2 | GPIO_PIN_3   /* Unused pins on GPIOB */
    };
    HAL_GPIO_Init(GPIOB, &gpio);

    /* 5. Configure wake-up: EXTI0 (PA0) falling edge */
    HAL_EXTI_GetHandle(&hexti0, EXTI_LINE_0);
    /* EXTI already configured; just ensure it's enabled */

    /* 6. Enter Stop 2 */
    HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

    /* 7. After wake: restore clocks */
    SystemClock_Config();
    MX_USART2_UART_Init();
    MX_SPI1_Init();
}

Pattern 2: RTC Alarm Wake-Up

Wake MCU at a specific time or after an interval using the RTC alarm.

void rtc_set_wakeup_interval(uint32_t seconds)
{
    HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);

    /* RTCCLK = LSE 32.768kHz, prescaler = 16 → 2048Hz */
    /* WUTR reload value = seconds * 2048 */
    HAL_RTCEx_SetWakeUpTimer_IT(&hrtc,
        seconds * 2048U - 1U,
        RTC_WAKEUPCLOCK_RTCCLK_DIV16);
}

void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
    /* Woke from RTC: take sensor reading */
    schedule_sensor_read();
}

/* Usage: wake every 60 seconds */
void setup_periodic_wakeup(void)
{
    rtc_set_wakeup_interval(60U);
    prepare_for_stop2();
}

Pattern 3: GPIO Leakage Prevention

Floating GPIO inputs near the logic threshold (VCC/2) draw up to 1mA per pin.

Read the full file on GitHub · 188 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 · +50 tokens per session 516a959e11dc
  2. 3mo ago First seen · 183 lines · 0 tokens per session scan A 4cbe8356d95a

Subscribe to this mod's changes

power-mgmt-patterns is a skill published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 1mo ago), licensed MIT. It adds 50 tokens to every session and 1,590 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

power-mgmt-patterns compared with skills from other repositories

power-mgmt-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
power-mgmt-patternsHermeticOrmus/LibreEmbed-Claude-CodeSkill501mo agoMITA50Claude 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