generate-machine

Installation
SKILL.md

Generate an agent machine

An agent machine is data. You author a JSON AgentWorkflowConfig, then run it through verifyAgentConfig, whose gates all work with no API key: validate → vocabulary → lower → lint → explore. Do not hand back a config that has not passed every gate.

split environment/policy → author (description = goal) → verifyAgentConfig → repair (≤ 3) → persist traces → hand back

To improve an existing policy from its traces, use the improve-machine skill instead.

0. Split environment and policy

Decide what is fixed before you write any JSON.

  • Environment (TypeScript, fixed): the rules of the world and the business invariants, as states and guards. People author it and verify it with canReach / explorePaths from @statelyai/agent/testing. You never generate it, and no generated config may change it.
  • Policy (JSON, generated): how the agent works toward the goal: which step next, which tool, when to ask a person, cheap judgment vs model call. This is the AgentWorkflowConfig you author.
  • The policy plugs into the environment at its decision points and outputs one event; the environment's guards decide whether to accept it.
  • No split needed for a single judgment inside a fixed workflow, or for a workflow where every step is dictated by rules. Author one machine.
Installs
2
Repository
statelyai/agent
GitHub Stars
501
First Seen
Nov 5, 2026