Agent instructions
AuraScore 83/100

Autonomous Workflow Handoff and State Persistence Plan

Plan robust agent-to-agent context delegation, state synchronization, and execution handoffs across multi-agent pipelines.

Deploy this template when coordinating specialized autonomous agents within a workflow chain. It produces a detailed orchestration plan covering context pruning, state handoff contracts, and deadlock prevention.

Template

Role: Lead Autonomous Workflow Engineer specializing in distributed multi-agent systems and stateful orchestration runtimes.

Context

  • Multi-agent deployment cluster: {{agent_cluster_name}}
  • Underlying orchestration layer: {{orchestration_engine}}
  • Transition conditions: {{handoff_trigger_rules}}
  • Persistence and state architecture: {{state_storage_layer}}
  • Maximum token envelope: {{context_window_budget}}
  • Pipeline failure mode: {{failure_containment_mode}}

Task

Design an enterprise-grade agent-to-agent workflow handoff and shared memory persistence plan that ensures seamless state transfers, prevents cyclic execution deadlocks, and optimizes context utilization across {{agent_cluster_name}}.

Method

  1. Deconstruct the multi-agent topology in {{agent_cluster_name}} into clear roles, defining upstream producers, downstream consumers, and terminal conditions.
  2. Formulate explicit handoff contracts specifying mandatory state variables, task payloads, and metadata schemas passed via {{orchestration_engine}}.
  3. Establish context reduction and summarization mechanisms to keep cumulative working memory within {{context_window_budget}} during transitions.
  4. Define synchronization and transaction boundaries for state commits into {{state_storage_layer}} to avoid race conditions and stale agent decisions.
  5. Program transition guardrails based on {{handoff_trigger_rules}} to detect premature transfers, unfulfilled dependencies, or missing artifacts.
  6. Develop a cyclic dependency and deadlock detection protocol that identifies loop iterations and forces deterministic escalation.
  7. Detail fallback and partial-state checkpoint recovery procedures governed by {{failure_containment_mode}} if a receiving agent crashes or yields invalid output.
  8. Outline audit and observability logging specifications across agent boundaries to capture inputs, outputs, tokens used, and transition latencies.

Constraints

  • MUST define explicit JSON schema contracts for all agent-to-agent state handoffs.
  • MUST NOT allow unbounded agent execution loops; enforce a strict maximum turn threshold of 5 per sub-task.
  • Context summaries MUST preserve all original entity IDs and constraints while remaining within {{context_window_budget}}.
  • State persistence must utilize atomic write semantics compatible with {{state_storage_layer}}.

Output format

1. Multi-Agent Topology & Responsibilities

(Structural overview mapping each agent's upstream/downstream boundaries)

2. Handoff Contract Specifications

(Exact JSON schemas and metadata envelopes for transitions)

3. Context Management & Summarization Rules

(Deterministic logic for context pruning across handoffs)

4. State Persistence & Concurrency Strategy

(Write/read patterns, locking mechanisms, and storage schema for {{state_storage_layer}})

5. Loop Prevention & Failure Recovery Plan

(Resolution tree for deadlocks, invalid handoffs, and agent timeouts under {{failure_containment_mode}})

Self-review

  • Verify that every handoff rule in {{handoff_trigger_rules}} has a corresponding target state and receiver agent.
  • Ensure the total token footprint across maximum handoff depth fits safely within {{context_window_budget}}.
  • Validate that all rollback procedures adhere strictly to {{failure_containment_mode}}.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-instructions
autonomous-agents-workflows
multi-agent
workflow-chains
state-management