Skip to content
Back to skills

State Prototype

ASecurity

Builds a throwaway single-file HTML demo of a proposed state model, driven by an explicit transition table, with free-play buttons and scenario tabs a person can click through. Use when asked to prototype, sanity-check, or feel out a state machine, lifecycle, or status design before implementing it. Do NOT use to explain an existing mechanism (use mechanism-viz), to check every interleaving (use tla-model), to chart a checked model (use statechart), or for a static diagram (use show-me).

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 9, 2026
ai-agentsexpressgit

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add wilbeibi/wilbeibi-skills --skill state-prototype --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of State Prototype?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for State Prototype
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wilbeibi-state-prototype/badge)](https://www.skillsdirectory.com/skills/wilbeibi-state-prototype)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: state-prototype
description: Builds a throwaway single-file HTML demo of a proposed state model, driven by an explicit transition table, with free-play buttons and scenario tabs a person can click through. Use when asked to prototype, sanity-check, or feel out a state machine, lifecycle, or status design before implementing it. Do NOT use to explain an existing mechanism (use mechanism-viz), to check every interleaving (use tla-model), to chart a checked model (use statechart), or for a static diagram (use show-me).
---

# state-prototype

A prototype is throwaway code that answers one question about a state model. The part worth keeping is its transition table.

## Steps

1. **State the question (REQUIRED).** Write one paragraph at the top of the page: the state model, and the one decision the demo must settle. Example: "Can a closed writer's journal reach the next writer with its old merge base?" If the question is not settled yet, run the grill-me skill first. Done when the question names one decision.
2. **Write the model as an explicit transition table** in one pure `<script>` block, with no DOM access:
   ```js
   const TRANSITIONS = [
     // from, event, to, owner: the one writer of this transition, guard
     { from: "open", event: "finish", to: "closed", owner: "runner receipt",
       guard: (s) => s.unsettled === 0 },
   ];
   function step(state, event) { /* matching row -> next state, else { refused: reason } */ }
   function reads(result) { /* one sentence: what this state, or this refusal, settles about the question */ }
   ```
   Every mutable field in the state belongs to a row, and every row names one owner. An event with no legal row is refused visibly, never ignored. Done when every state has an exit or is marked terminal.
3. **Build the page.** Use one self-contained HTML file with no framework, bundler, or server. From top to bottom:
   - The title and the question.
   - The current state as labelled fields, with the last change highlighted.
   - One sentence under the fields, `reads(step(...))`, saying what this state or this refusal settles about the question.
   - One button per event, always enabled, that shows a refusal when there is one.
   - Scenario tabs. Each resets to a known start and steps through its ordered buttons. The sentence updates on every click, including a refusal.
4. **Pick scenarios from the failure cases.** Cover the happy path, a failed awaited attempt, an ambiguous timeout, a crash between two steps, a late or duplicate executor, two writers at once, and a delete mid-flight. Drop a case the model cannot express, and say so on the page. Done when each scenario ends on a state the user can judge right or wrong, and the sentence under the fields changed with that state.
5. **Hand over and capture the answer.** Write the file to the OS temp directory and give its path. Never write it into the repository. When the question is settled, record the verdict and the final transition table in the design doc, issue, or code. When the table lands in code, test it table-driven, one case per row and per refused event (test-writing). Keep the HTML only if the user asks.

## Rules

- Label buttons and fields in domain words. Use code identifiers only when the reader wrote the code.
- The sentence is `reads` of what `step` just returned, including a refusal. A sentence written by hand beside the fields drifts from the table.
- Keep state in memory unless persistence is the question.
- Write no tests and no generalisation: one prototype answers one question.
- A click-through shows one ordering. When the answer depends on timing between concurrent actors, take the question to tla-model.

## Notes

- Ported from the logic branch of [mattpocock/skills](https://github.com/mattpocock/skills) `prototype` (MIT). Adapted: the explicit transition table with owners, failure-case scenarios, and temp-directory output.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.