embedded-state-machine-libs
Skill36 starsChanged 5 months agoMITView on GitHub
Use when integrating, designing, configuring, or debugging embedded StateMachine libraries, finite state machines, event transitions, or MCU state-driven workflows
In this repository75 other files it gives its agents.
- 8051-mcu-debugSkill
- avem-integrationSkill
- battery-charger-fuel-gauge-integrationSkill
- ble-gatt-integrationSkill
- bootloader-debugSkill
- canbus-integrationSkill
- canopen-integrationSkill
- cellular-at-modem-integrationSkill
- cmbacktrace-integrationSkill
- cmsis-dsp-integrationSkill
- cortex-m-debugSkill
- cortex-r5-debugSkill
- crc-checksum-integrationSkill
- easylogger-integrationSkill
- embedded-app-example-libsSkill
- embedded-buffer-queue-libsSkill
- embedded-data-parsing-libsSkill
- embedded-debug-entrySkill
- embedded-fault-debugSkill
- embedded-framework-libsSkill
- embedded-input-libsSkill
- embedded-library-entrySkill
- embedded-linux-login-debugSkill
- embedded-peripheral-bringupSkill
- embedded-serial-log-debugSkill
- embedded-timing-libsSkill
- epd-integrationSkill
- esp-idf-integrationSkill
- fatfs-integrationSkill
- flashdb-integrationSkill
- freemodbus-integrationSkill
- freertos-kernel-debugSkill
- freertos-plus-tcp-integrationSkill
- gnss-gps-integrationSkill
- hardware-interface-debugSkill
- heatshrink-integrationSkill
- letter-shell-integrationSkill
- littlefs-integrationSkill
- low-power-debugSkill
- lvgl-integrationSkill
- lwip-integrationSkill
- mbedtls-integrationSkill
- mcuboot-integrationSkill
- mcu-flashing-debugSkill
- micro-ecc-integrationSkill
- miniz-integrationSkill
- mqtt-embedded-integrationSkill
- nanopb-integrationSkill
- nrf-connect-sdk-integrationSkill
- nr-micro-shell-integrationSkill
- openocd-jlink-stlink-debugSkill
- openthread-integrationSkill
- ota-update-integrationSkill
- plooc-integrationSkill
- power-management-integrationSkill
- qspi-xip-flash-debugSkill
- readme-writingSkill
- riscv-mcu-debugSkill
- rtos-debugSkill
- rt-thread-integrationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill for embedded state machine libraries and hand-written finite state machines.
- Distinctive: line 14
Use this skill when:
- Distinctive: line 20
Do not use this skill for RTOS scheduling issues unless the state machine is the primary abstraction.
- Distinctive: line 44
Avoid nested transitions unless the library explicitly supports them.
- Distinctive: line 62
Before claiming state-machine behavior works:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
- Define states and events. Names should reflect system meaning, not implementation steps.
- Separate transition from action. Make it clear what changes state and what side effects run because of the transition.
- Define invalid event behavior. Ignore, log, assert, error transition, or recovery must be explicit.
- Guard reentrancy. Avoid nested transitions unless the library explicitly supports them.
- Add observability. Log state transitions, current state, event source, and error transitions.
- 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:
- Asks for states, events, timeout handling, and transition logs.
- Checks whether success/error/timeout events race.
- Verifies recovery transitions and invalid event behavior.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

