agentleFS
45ck45ck/hci-review-skill/.agents/skills/state-model/SKILL.md

state-model

Skill19 starsChanged 5 days agoMITView on GitHub

Define the state machines and lifecycles for all key entities in the system -- states, transitions, invalid transitions, and user-visible cues per state.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use ultrathink. Work from the repo, routes, components, database schemas, API endpoints, and visible UI states.

    line 11
  2. Very specific:

    Write docs/hci/state-model.md unless the user asked for another path.

    line 14
  3. Distinctive:

    Create the directory if it does not exist.

    line 15
  4. Distinctive:

    Create Mermaid state diagrams for each entity.

    line 41
  5. Distinctive:

    all states as nodes

    line 42
  6. Distinctive:

    Create a coverage table:

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Define the state machines and lifecycles for this scope:

$ARGUMENTS

Use ultrathink. Work from the repo, routes, components, database schemas, API endpoints, and visible UI states. If details are missing, infer conservatively and mark assumptions.

Output

Write docs/hci/state-model.md unless the user asked for another path. Create the directory if it does not exist.

Required process

1) Identify stateful entities

Find every object in the system that has a lifecycle -- anything that changes state over time. Common examples: requests, tasks, users, sessions, approvals, documents, payments, invitations.

2) For each entity, define:

States

| State | Meaning | User-visible cue | Entry condition | Exit condition |

Allowed transitions

| From | To | Trigger | Who can trigger | Side effects |

Invalid transitions

| From | To | Why invalid | What happens if attempted |

Ambiguous or undefined states

Flag any state that is:

  • implied but never named
  • named differently in different places
  • missing a user-visible cue
  • reachable but with no defined exit

3) Diagrams

Create Mermaid state diagrams for each entity. Include:

  • all states as nodes
  • transitions as labeled edges
  • guard conditions where applicable
  • terminal states clearly marked

4) Cross-entity dependencies

Identify where one entity's state depends on another's. Document:

  • which entities are coupled
  • what happens when a parent entity changes state
  • cascading transitions
  • orphaned states (child entity stuck when parent moves)

5) UI state coverage

For each state, check:

  • Is there a distinct visual treatment?
  • Can the user tell what state they are in?
  • Can the user tell what actions are available in this state?
  • Is the transition feedback clear?

Create a coverage table: | Entity | State | Has visual cue | Has available actions | Has transition feedback | Gap |

Synthesis

End with:

  • entities with the most ambiguous state models
  • states that users cannot distinguish visually
  • transitions that happen silently without feedback
  • invalid transitions that the UI does not prevent
  • recommendations for simplifying overly complex lifecycles

Quality bar

  • Be specific. Reference actual database fields, API statuses, component props, or CSS classes where possible.
  • Distinguish between backend state and user-perceived state. Both matter.
  • A well-defined state model should make it impossible to ask "what state is this in?" while looking at the screen.

Deliverable style

  • Clear headings
  • Markdown tables
  • Mermaid diagrams where useful
  • Direct language
  • No filler

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.