Skill / SKILL.md

Loop To Machine

statelyai/skills

Convert existing agent code (a while-loop around a model, a tool loop, a tool-call scheduler, ad-hoc if/else control flow) into an XState v6 state machine with @statelyai/agent, and prove with a parity report that it behaves like the code it replaces. Use when asked to "turn this agent into a state machine", "port my loop to xstate", "make this a statechart", "refactor this agent into a machine", or "split environment and policy" for code that already runs.
2 views 56 repository stars 0 commentsUpdated Nov 28, 2026
Overview

Convert existing agent code (a while-loop around a model, a tool loop, a tool-call scheduler, ad-hoc if/else control flow) into an XState v6 state machine with @statelyai/agent, and prove with a parity report that it behaves like the code it replaces. Use when asked to "turn this agent into a state machine", "port my loop to xstate", "make this a statechart", "refactor this agent into a machine", or "split environment and policy" for code that already runs.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/statelyai/skills' skill-source

Use the complete skill-source/plugins/stately-agent/skills/loop-to-machine directory with your client’s skill installer.

  • plugins/stately-agent/skills/loop-to-machine

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory plugins/stately-agent/skills/loop-to-machine

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Needs source review
Checked at
Pending source check
Content SHA-256
63096865a3ebf0a377082fd75e58373b72de92e65ab0d0dea5929163986b5ab1
Format validation findings
  • Metadata requires string values.
Agent Skills specification
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills