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 skills add AmethystLuna/embedded-workbench --skill state-machine-designgit clone --depth 1 https://github.com/AmethystLuna/embedded-workbenchWrote 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/amethystluna/embedded-workbench/state-machine-design)<a href="https://agentmods.dev/skills/amethystluna/embedded-workbench/state-machine-design"><img src="https://agentmods.dev/badge/skills/amethystluna/embedded-workbench/state-machine-design/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.
<a href="https://agentmods.dev/skills/amethystluna/embedded-workbench/state-machine-design"><img src="https://agentmods.dev/badge/skills/amethystluna/embedded-workbench/state-machine-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.1 | $0.00054 | $0.01994 |
| Opus 5.5 | $0.00022 | $0.00798 |
| Sonnet 5.5 | $0.00011 | $0.00399 |
| Haiku 4.5 | $0.00005 | $0.00199 |
Grade A, and why
state-machine-design 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 1mo 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 — 193 lines — stays where its author put it; the contents beside it link to each section on GitHub.
State Machine Design
For a design that has to be decided rather than reviewed:
dsh-model-everythingverifies the machine itself —model_verifyexplores every interleaving for unreachable states, deadlock, a timeout that can never fire, and a lock held across an await;model_compose_verifydecides two mechanisms interacting, including a lost update on a shared location. Load itsmodel-everythingskill when the plugin is installed. This skill stays the implementation guide: the C code, the flags, the timeouts.
Core Rules
- Fix the state model, not the symptom. Every in-progress or pending flag must have explicit success, failure, timeout, and reset exits.
- Timeout logic must be gated on real pending work. Idle states must not trigger retry, recovery, or error transitions.
- Do not trust a low-level send return value as proof of delivery when an application-layer ACK exists. Use the protocol's completion signal.
- When adding retries, also define attempt timestamps, backoff rules, and cleanup paths so the state machine cannot lock up silently.
- If pause, stop, or reconnect can interrupt the normal flow, add an explicit recovery or re-drive branch instead of assuming the old path will naturally resume.
Transition Gates
- When a state transition depends on multiple preconditions, verify every one explicitly at the transition gate. Do not rely on implicit assumptions (e.g., "the timer expired, therefore everything must be healthy"). A single unchecked precondition is the most common source of silent state corruption.
- If a target state's preconditions can become false while already in that state, define a reverse transition back to the source state. One-way state latches without fallback paths will eventually leak incorrect state to downstream consumers.
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.
- 1mo ago Changed · +2 lines 8e4b8fba19fa
- 3mo ago First seen · 191 lines · 54 tokens per session scan A c349d2f9f330
state-machine-design is a skill published in the GitHub repository AmethystLuna/embedded-workbench (36 stars, last pushed 2d ago), licensed MIT. It adds 54 tokens to every session and 1,994 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-31.
state-machine-design compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| state-machine-designAmethystLuna/embedded-workbench | Skill | 36 | 2d ago | MIT | A | 54 | Claude Code |
| gke-ai-troubleshooting-tpu-dynamic-slices-monitoringgoogle/skills | Skill | 25k | today | Apache-2.0 | A | 107 | Claude Code, Codex |
| gke-ai-troubleshooting-tpu-vbar-oomgoogle/skills | Skill | 25k | today | Apache-2.0 | A | 125 | Claude Code, Codex |
| doca-flowNVIDIA/skills | Skill | 4.2k | 2d ago | Apache-2.0 | A | 224 | Claude Code |
| competition-firmware-layoutzhaoxuya520/reverse-skill | Skill | 45k | 16d ago | MIT | A | 110 | Codex |
| diagnose-driver-installNVIDIA/deepops | Skill | 1.5k | 3d ago | BSD-3-Clause | A | 47 | Claude Code, Codex |
| diagnose-backend-bugQoderAI/better-harness | Skill | 2.5k | 19d ago | MIT | A | 87 | Claude Code, Codex |