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/mintuz/skills/xstatenpx skills add mintuz/skills --skill xstategit clone --depth 1 https://github.com/mintuz/skillsWrote 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/mintuz/skills/xstate)<a href="https://agentmods.dev/skills/mintuz/skills/xstate"><img src="https://agentmods.dev/badge/skills/mintuz/skills/xstate.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.00118 | $0.01443 |
| Opus 5 | $0.00059 | $0.00722 |
| Sonnet 5 | $0.00024 | $0.00289 |
| Haiku 4.5 | $0.00012 | $0.00144 |
Grade A, and why
xstate 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 today.
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 — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
XState
Treat a statechart as an executable ownership model for time, concurrency, and resource lifetimes.
Recognise a hand-rolled statechart
Each of the following is a lifecycle already being modelled by hand:
- a
useStateflag for work in flight:isSubmitting,isLoading,pending; - a
.then,.catch, orawaitblock that sets two or more pieces of state in sequence; - a re-entry guard such as
if (submitting) return; - a line that clears an error or a stale result before a retry;
- a
useEffectthat starts asynchronous work and needs an ignore flag in its cleanup; - two booleans that must never both be true, such as
isLoadingwitherror; - a
setTimeoutorsetIntervalfor retry, debounce, or polling that something must clear; - a
pointerdown,dragstart, or gesture handler that binds listeners to the document and must unbind them; - handling for a response that arrives after cancel, replacement, or unmount.
Any one of them is the entry point to step 1, however small the request, and whether or not the file imports xstate. When the code already exists, name each defect it has today and the wrong behaviour a user would see, before you propose the machine that removes it.
For a visualisation-only request, inspect the current machine source and go to step 6 instead.
1. Establish the temporal boundary
Inventory the mounted journey, external authority, live resources, concurrent concerns, retry and cancellation policy, and every source of stale or duplicate work. Inspect existing actors and runtime integrations, and confirm the installed XState major version; the XState 4 and 5 APIs differ.
Use XState only where ordering, concurrency, retries, cancellation, stale results, or resource lifetimes make the behaviour temporal. Two tests find that lifetime; classify by what they show, not by what the state renders.
First, an external answer — a network response, a timer, another actor, the platform — makes state temporal whatever it looks like on screen. A disabled button or a spinner is the presentation of temporal state, not presentation state.
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- today Changed d736796308d0
- 4d ago First seen · 79 lines · 118 tokens per session scan A 3c485a2ceb3e
xstate is a skill published in the GitHub repository mintuz/skills (29 stars, last pushed yesterday), licensed MIT. It adds 118 tokens to every session and 1,443 once invoked, about $0.0006 per session on Opus 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.
Other skills, from other repositories
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
agentsop-conventions-pinning
SOP for writing, loading, and evolving a project-level convention file (CONVENTIONS.md / CLAUDE.md / .cursor/rules / .clinerules / AGENTS.md) so that a coder-agent reliably respects your codebase's style choices every session. Tool-agnostic; covers the four load mechanics (read-only attachment, ancestor-walk…
agentsop-llm-artifact-versioning
Enhancement overlay — version the WHOLE deployable LLM-app artifact as one bundle: prompts + compiled programs + model snapshot pins + retrieval config + eval-set version, versioned together so a deploy is reproducible and rollback is atomic. Activate when preparing to deploy an LLM app, when asking "what exactly is…
agentsop-output-format-by-model
Pick an LM output format per (task x consumer x model) rather than by reflex: different formats carry different cognitive load (e.g. code-in-JSON makes the same model write worse code than plain-text+diff, while asking for prose when you need a typed object fails the other way). Use when designing or debugging an LM's…
agentsop-code-execution-decision
Decision rubric for when an LM agent should write-and-run code (Program-of-Thought / code interpreter) versus reason in natural language: classify each step as deterministic- computable (emit + execute code, feed the result back) vs judgment (stay in prose). Use when designing or debugging an agent step that does…
agentsop-dify
SOP for building LLM applications on Dify — visual workflow + chatflow + agent + RAG knowledge base + plugin marketplace + observability, self-hostable. Use when shipping LLM apps fast with a "no-code to pro-code" gradient, especially when non-engineers need to co-author the flow.