AI Agent Prompts

Agent State Machine Mapper

Convert a loosely described agent workflow into explicit states, transitions, guards, retries, timeouts, and terminal outcomes.

FreeClaudeChatGPT
Best for

Engineers turning agent prototypes into durable workflows that can resume safely, handle asynchronous events, and avoid duplicate side effects.

Suitable LLM groups
FrontierReasoning
Download Prompt.md
Prompt
You are an AI workflow engineer who specializes in deterministic state management around probabilistic agent behavior.

Inputs:
1. Agent goal and workflow narrative: {{workflow_narrative}}
2. Events, tools, approvals, and external systems: {{events_and_dependencies}}
3. Business rules and prohibited transitions: {{business_rules}}
4. Retry, timeout, cancellation, and recovery expectations: {{recovery_requirements}}
5. Persistence, orchestration, and audit constraints: {{technical_constraints}}

Do the following:
1. Identify stable states, transient processing states, waiting states, and terminal outcomes; distinguish state from data attributes and UI labels.
2. Define every transition with its triggering event, guard conditions, side effects, idempotency behavior, owner, and audit record.
3. Add explicit paths for validation failure, tool outage, partial success, human rejection, timeout, cancellation, duplicate events, and resumed execution.
4. Detect unreachable states, ambiguous ownership, unsafe loops, missing terminal states, and transitions that allow the agent to bypass authorization or verification.
5. Produce a state table, Mermaid-compatible state diagram text, transition contract examples, invariants, and test cases covering happy paths and recovery paths.

How to use

  1. Describe events and external side effects separately.
  2. List every approval and prohibited transition.
  3. Specify retry, timeout, and cancellation behavior.
  4. Validate the map against event replay and duplicate delivery.

Example input

Workflow: A contract-intake agent receives an uploaded agreement, validates required fields, extracts terms, requests legal review for risky clauses, collects business approval, and stores the signed record. Events: file upload, extraction result, reviewer decision, approval webhook, and document-system confirmation. Rules: no business approval before legal clearance when risk is high; storage only after both approvals. Recovery: tools retry twice, reviews expire after five business days, and users may cancel before storage. Technical constraints: durable workflow engine, event replay, and seven-year audit retention.

Example output

The map defines Received, Validating, ExtractionPending, ReviewRequired, AwaitingLegal, AwaitingBusiness, ReadyToStore, Storing, Completed, Rejected, Cancelled, and ManualRecovery states. Every external write uses a contract ID plus operation key for idempotency. High-risk contracts cannot enter AwaitingBusiness without legal approval. Expired reviews move to ManualRecovery rather than silently restarting. Duplicate webhooks are acknowledged without repeating side effects, and cancellation is blocked once immutable storage is confirmed.

Customization tips

  • Use states for durable conditions, not every internal step.
  • Add guard conditions for authorization and verification.
  • Give external writes idempotency keys.
  • Define terminal outcomes for rejection, cancellation, and recovery.

Tags

#agent-state-machine#workflow-orchestration#durable-execution#idempotency#recovery-design

FAQ

What is this prompt for?
It turns an agent workflow into an explicit state machine that supports durable execution, auditability, and safe recovery.
How should I customize it?
Provide the workflow narrative, events, side effects, business guards, approval rules, timeouts, and orchestration constraints.
Are there any limitations?
The result still requires implementation-specific concurrency analysis, load testing, and validation against the guarantees of your workflow engine.
How is it different from a basic prompt?
It distinguishes durable states from attributes and specifies guarded transitions, idempotency, ownership, recovery paths, invariants, and unreachable-state checks.
Free

Agent Handoff Contract Designer

Define reliable handoffs between agents or from agents to people, with clear payloads, acceptance rules, ownership, and recovery paths.

ClaudeChatGPT
#agent-handoff#multi-agent-systems#workflow-contract
Free

Agent Evaluation Benchmark Builder

Create a representative benchmark that tests an AI agent's task success, tool use, safety, recovery, and efficiency before release.

ClaudeChatGPT
#agent-evaluation#benchmark-design#regression-testing
Free

Agent Task Decomposition Planner

Breaks a broad goal into a structured set of sub-tasks an AI agent can execute step by step, with clear success criteria and handoff points for human review.

ClaudeChatGPT
#ai-agents#task-planning#agent-architecture

Related Skills

API & Integration BuildingFree

Webhook Contract and Replay Safety Architect

Design reliable webhook integrations with signatures, schemas, idempotency, ordering, retries, replay protection, and reconciliation.

ClaudeChatGPT
#webhook design#idempotency#event replay
Agent Systems & LLM WorkflowsFree

Agent Tool Failure and Recovery Orchestrator

Design agent recovery for unavailable tools, bad responses, timeouts, partial actions, duplicates, permission errors, and human escalation.

ClaudeChatGPT
#agent recovery#tool failure#LLM orchestration
Agent Systems & LLM WorkflowsFree

Multi Agent Collaboration Orchestrator

Design multi-agent workflows with roles, task decomposition, shared state, handoffs, verification, budgets, conflict handling, and human control.

ClaudeChatGPT
#multi-agent systems#agent orchestration#AI workflows
Related articles coming soon — visit the Learn hub.