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 aka-kika/akakika-skills --skill agent-state-machinegit clone --depth 1 https://github.com/aka-kika/akakika-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/aka-kika/akakika-skills/agent-state-machine)<a href="https://agentmods.dev/skills/aka-kika/akakika-skills/agent-state-machine"><img src="https://agentmods.dev/badge/skills/aka-kika/akakika-skills/agent-state-machine/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/aka-kika/akakika-skills/agent-state-machine"><img src="https://agentmods.dev/badge/skills/aka-kika/akakika-skills/agent-state-machine.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.00046 | $0.01603 |
| Opus 5 | $0.00023 | $0.00801 |
| Sonnet 5 | $0.00009 | $0.00321 |
| Haiku 4.5 | $0.00005 | $0.00160 |
Grade A, and why
agent-state-machine 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 12d 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 — 303 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent State Machine
Model every agent / task / run with one shared state machine: a fixed set of states, only the transitions that are legal between them, and a recovery path out of every failure or wait. This kills the most common agent-UX bug — random status strings invented per screen.
When to use
- Active runs, task queues, AI generation, local model jobs
- Agent progress, notifications, error recovery
- Retry / stop / cancel behavior and "needs review" states
Core rule
Agent UX needs clear states, legal transitions, and recovery paths. Do not invent random labels per screen.
State vocabulary
Draft
Queued
Starting
Thinking
Running
Waiting
Blocked
Paused
Cancelling
Cancelled
Failed
Completed
Needs Review
Archived
State meanings
Draft Created but not ready to run
Queued Ready and waiting
Starting Preparing environment/model/files
Thinking Planning/reasoning before action
Running Executing work
Waiting Waiting for external service/user/system
Blocked Cannot continue without user action
Paused Temporarily stopped, can resume
Cancelling Stop requested, cleanup in progress
Cancelled Stopped by user/system
Failed Ended with error
Completed Finished successfully
Needs Review User should inspect result
Archived Hidden from active workflow
Legal transitions
Draft → Queued
Queued → Starting
Starting → Thinking
Thinking → Running
Running → Waiting
Waiting → Running
Running → Needs Review
Running → Completed
Running → Failed
Running → Blocked
Running → Cancelling
Cancelling → Cancelled
Failed → Queued
Blocked → Queued
Needs Review → Archived
Completed → Archived
Paused → Running
Avoid impossible transitions unless explicitly handled.
Reference implementation
Swift shown below, but the pattern is language-agnostic — one enum, one validator.
enum AgentRunState: String, Codable, CaseIterable, Hashable {
case draft
case queued
case starting
case thinking
case running
case waiting
case blocked
case paused
case cancelling
case cancelled
case failed
case completed
case needsReview
case archived
var title: String {
switch self {
case .draft: "Draft"
case .queued: "Queued"
case .starting: "Starting"
case .thinking: "Thinking"
case .running: "Running"
case .waiting: "Waiting"
case .blocked: "Blocked"
case .paused: "Paused"
case .cancelling: "Cancelling"
case .cancelled: "Cancelled"
case .failed: "Failed"
case .completed: "Completed"
case .needsReview: "Needs Review"
case .archived: "Archived"
}
}
var symbol: String {
switch self {
case .draft: "doc"
case .queued: "list.bullet.rectangle"
case .starting: "play.circle"
case .thinking: "brain"
case .running: "bolt.circle"
case .waiting: "clock"
case .blocked: "xmark.octagon"
case .paused: "pause.circle"
case .cancelling: "xmark.circle"
case .cancelled: "xmark.circle"
case .failed: "exclamationmark.triangle"
case .completed: "checkmark.circle"
case .needsReview: "checkmark.seal"
case .archived: "archivebox"
}
}
}
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.
- 12d ago First seen · 303 lines · 46 tokens per session scan A a32053706dc9
agent-state-machine is a skill published in the GitHub repository aka-kika/akakika-skills (10 stars, last pushed 2d ago), licensed MIT. It adds 46 tokens to every session and 1,603 once invoked, about $0.0002 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-31.
Other skills, from other repositories
apple-design
Cross-platform UI/UX design reviewer grounded in Apple's Human Interface Guidelines (122 pages pulled from developer.apple.com, including 57 component pages) plus a design-craft lens for distinctive, non-templated work. Use it to audit, review, critique, or improve any mobile app (iOS, Flutter, React Native) or…
data-charts-tako
Search and visualize the world's data - get charts, insights, and embeddable knowledge cards for finance, economics, demographics, sports, and more.
monorepo-management
Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient, scalable multi-package repositories with optimized builds and dependency management. Use when setting up monorepos, optimizing builds, or managing shared dependencies.
browse-and-evaluate
Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.
render-airdrop-carousel
Assemble a viral iOS "AirDrop" notification-carousel video ad (≈6–8s, 9:16) from a brand line plus 6–16 real product photos — a native AirDrop share-sheet card ("Brand would like to share a · Decline / Accept") springs up and its preview window CYCLES through the products, landing on a range/lineup payoff with an…
render-3d-product-showcase
Assemble a premium 3D product-showcase ad from a config — four beat clips (an orbiting hero rotation, a macro push-in, a physics reveal, a typographic close) normalized to the brand-color canvas, hard-concatenated in order, closed on a deterministic Playwright brand end card, and mixed under one instrumental bed at…