agentsclimarketplace

Embedded state machine libs

Skill easyzoom/aix-skills/skills/embedded-state-machine-libs

Use when integrating, designing, configuring, or debugging embedded StateMachine libraries, finite state machines, event transitions, or MCU state-driven workflowsFrom its SKILL.md

Install
npx -y skills add easyzoom/aix-skills --skill embedded-state-machine-libs

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 24 stars24 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.7 KB, 518 tokens by cl100k_base, as published. Nobody here has run it

Embedded State Machine Libs

Overview

Use this skill for embedded state machine libraries and hand-written finite state machines. The core is to make states, events, transitions, side effects, and invalid transitions explicit and verifiable.

When To Use

Use this skill when:

  • The user wants to add or debug a StateMachine library or event-driven MCU workflow.
  • The issue involves wrong transitions, stuck states, reentrancy, event loss, timeout handling, or unclear state ownership.
  • Firmware has modes such as idle, init, run, error, recovery, upgrade, sleep, or calibration.

Do not use this skill for RTOS scheduling issues unless the state machine is the primary abstraction.

First Questions

Ask for:

  • State machine library or custom implementation.
  • State list, event list, and current failing transition.
  • Whether transitions run in ISR, task, main loop, or callback context.
  • Whether timeouts, retries, or external interrupts drive events.
  • Expected behavior for invalid events.

Integration Checklist

  1. Define states and events. Names should reflect system meaning, not implementation steps.

  2. Separate transition from action. Make it clear what changes state and what side effects run because of the transition.

  3. Define invalid event behavior. Ignore, log, assert, error transition, or recovery must be explicit.

  4. Guard reentrancy. Avoid nested transitions unless the library explicitly supports them.

  5. Add observability. Log state transitions, current state, event source, and error transitions.

  6. Test transition table. Validate normal path, invalid events, timeout events, and recovery path.

Common Failures

  • Event emitted from ISR directly mutates state unsafely.
  • Timeout event races with success event.
  • State transition has hidden side effects that fail halfway.
  • Invalid events are silently ignored in safety-critical flows.
  • State names mirror functions instead of product behavior.

Verification

Before claiming state-machine behavior works:

  • State the state list, event list, transition rules, and invalid-event policy.
  • Confirm normal, timeout, error, and recovery transitions.
  • Confirm event source and reentrancy strategy.
  • Confirm transition logging or trace output exists for debugging.

Example

User:

设备升级状态机偶尔卡在 downloading。

Agent:

  1. Asks for states, events, timeout handling, and transition logs.
  2. Checks whether success/error/timeout events race.
  3. Verifies recovery transitions and invalid event behavior.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.