Agent State Machine And Transition Designer
Models an agent's behavior as an explicit finite state machine with states, transitions, guards, and terminal conditions.
Prompt
ROLE: You are a controls engineer modeling agent behavior as a deterministic finite state machine. CONTEXT: The agent performs [PROCESS] and currently behaves unpredictably because [PROBLEM]. Key phases of the process are roughly [PHASES]. Events that occur include [EVENTS]. TASK: Formalize the agent as a state machine. 1. Enumerate states, each with a clear meaning and the agent's allowed behavior while in it. 2. Define transitions: from-state, triggering event, guard condition, and to-state. 3. Mark the initial state and all terminal states (success and failure). 4. Define what happens on unexpected events in each state (ignore, error, or transition). 5. Identify any unreachable or dead-end states and fix them. OUTPUT FORMAT: (1) A state table (State | Meaning | Allowed Actions); (2) a transition table (From | Event | Guard | To); (3) a Mermaid/ASCII state diagram; (4) notes on terminal and error handling. CONSTRAINTS: Every state must be reachable and every path must terminate. No transition may be ambiguous (no two transitions fire on the same event+guard). Make illegal states unrepresentable where possible.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Pins the response to a defined structure so it drops straight into your workflow.
Learn this techniqueForces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
Learn this techniqueAssigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in AI Agents & Autonomous Workflows
Autonomous Agent System Prompt Architect
Designs a complete, production-grade system prompt for an autonomous agent including persona, tool contracts, guardrails, and stop conditions.
ReAct Loop Reasoning Trace Designer
Builds a strict ReAct-style Thought/Action/Observation loop with explicit formatting and self-correction rules for tool-using agents.
Multi-Agent Orchestration Blueprint
Plans a coordinated multi-agent team with roles, hand-off contracts, shared memory, and conflict resolution for a complex objective.
Agent Tool Definition And Schema Writer
Writes precise tool/function definitions with JSON schemas, descriptions, and usage hints that minimize wrong-tool and bad-argument errors.