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 makifbaysal/tasktrooper --skill game-state-machines-and-aigit clone --depth 1 https://github.com/makifbaysal/tasktrooperWrote 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/makifbaysal/tasktrooper/game-state-machines-and-ai)<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/game-state-machines-and-ai"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/game-state-machines-and-ai/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/makifbaysal/tasktrooper/game-state-machines-and-ai"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/game-state-machines-and-ai.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00053 | $0.01589 |
| Opus 5.5 | $0.00021 | $0.00636 |
| Sonnet 5.5 | $0.00011 | $0.00318 |
| Haiku 4.5 | $0.00005 | $0.00159 |
Grade A, and why
game-state-machines-and-ai 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 4d 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 — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Game State Machines and AI
Overview
Character controllers, enemies, menus and match flow are all state machines whether or not the code admits it. When they are written as a pile of booleans (isJumping, isAttacking, isStunned), illegal combinations become reachable and every new state touches every branch. Make the states and the legal transitions explicit, and test the table.
Core principle: One current state, an explicit list of (state, event) → next state, and enter/exit hooks. Anything not in the table cannot happen.
Flags vs a table
// ❌ flag soup: can be jumping AND stunned AND attacking; every rule checks every flag
if (input.attack && !this.isStunned && !this.isDead && (!this.isJumping || this.canAirAttack)) { ... }
// ✅ explicit states and transitions
type State = "idle" | "run" | "jump" | "attack" | "stunned" | "dead";
type Event = "move" | "stop" | "jump" | "land" | "attack" | "attackEnd" | "hit" | "recover" | "die";
const transitions: Record<State, Partial<Record<Event, State>>> = {
idle: { move: "run", jump: "jump", attack: "attack", hit: "stunned", die: "dead" },
run: { stop: "idle", jump: "jump", attack: "attack", hit: "stunned", die: "dead" },
jump: { land: "idle", hit: "stunned", die: "dead" },
attack: { attackEnd: "idle", hit: "stunned", die: "dead" },
stunned: { recover: "idle", die: "dead" },
dead: {},
};
export class Fsm {
constructor(public state: State, private hooks: Hooks) {}
send(e: Event): boolean {
const next = transitions[this.state][e];
if (!next) return false;
this.hooks.exit?.(this.state); this.state = next; this.hooks.enter?.(next);
return true;
}
}
The same shape in C# is an enum plus a Dictionary<(State, Event), State> built once; in GDScript a Dictionary of dictionaries or one node per state (godot-gdscript-patterns); in Unreal a UENUM with a switch, or StateTree for larger designs.
Testing the table
it.each([
["idle", "jump", "jump"], ["jump", "attack", "jump"], // no air attack in this design
["stunned", "move", "stunned"], ["dead", "recover", "dead"],
["attack", "hit", "stunned"],
])("%s + %s → %s", (from, ev, to) => {
const fsm = new Fsm(from as State, {});
fsm.send(ev as Event);
expect(fsm.state).toBe(to);
});
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.
- 4d ago First seen · 118 lines · 53 tokens per session scan A 935bb7ffc61b
game-state-machines-and-ai is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 53 tokens to every session and 1,589 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-10-09.
Other skills, from other repositories
i4h-workflow-train-rl
Use when training, evaluating, or exporting Workflow policies with online RSL-RL or RLinf, including RL checkpoint and Workflow handoff.
openclaw-plugin
You are an autonomous agent in a persistent world. Your character is in SOUL.md. World rules are in WORLD.md.
pokemon-player
Play Pokemon games autonomously via headless emulation. Starts a game server, reads structured game state from RAM, makes strategic decisions, and sends button inputs — all from the terminal.
pokemon-player
Play Pokemon via headless emulator + RAM reads.
ramp
Fetch and follow Ramp's published agent playbooks inside Paperclip, with mandatory approval gates for spend, incorporation, cards, account setup, and other financial actions.
github-pr-workflow
Prepare a GitHub pull request from a feature branch — branch hygiene, commit shape, title/body, verification notes, screenshots for UI work, and replies to review comments.