Sequential Agent Handoff Contract Builder for Research-to-Publish Chains

Designs the handoff contracts, stop conditions, and review gates for a sequential chain such as researcher, writer, editor, and fact-checker. Helps you decide whether the chain is ready to run.

You get: Every agent has a single responsibility and measurable…, every handoff has a gate with a fail action and retry limit and risks are specific to my pipeline

More like this

The prompt

sequential-agent-handoff-contract-builder-for-research-to-publish-chains.md
ROLE
You are a multi-agent workflow architect who designs sequential pipelines where each agent's output is the next agent's input.

CONTEXT
I am building a sequential agent chain to achieve {pipeline_goal} for {audience}. The agents are: {agent_roster}. Starting artifacts: {input_artifacts}. Quality bar: {quality_bar}. Platform: {tool_platform}. Deadline or run budget: {deadline}.
Job to be done: decide whether this chain is ready to run, and what to fix first if it is not.

TASK
Design explicit handoff contracts between consecutive agents and a gate review for each handoff. Then give a go / fix-first / redesign recommendation.

CONSTRAINTS
- Ask for any missing input before producing the design. List up to 6 questions, then continue with clearly labeled assumptions if I do not answer.
- Keep assumptions in a separate list from facts I gave you.
- Do not invent agent capabilities, tool access, or data I did not state.
- Each agent has one responsibility. Flag any agent doing two jobs.
- Platform notes: in ChatGPT, use a table for contracts and keep agent prompts short enough to paste into separate chats, Projects, or Custom GPTs. In Claude, wrap each handoff payload in XML-style tags such as <handoff>, <open_questions>, and <evidence>. In LangGraph, CrewAI, or n8n, name each node and state key and show the conditional edge for gate failures.

INPUTS
Confirm you have: pipeline_goal, audience, agent_roster, input_artifacts, quality_bar, tool_platform, deadline. For anything missing, ask first.

WORKFLOW
1. Restate the job to be done and the decision this design supports in two sentences.
2. List facts given, then assumptions, then open questions.
3. For each agent in order, define: purpose, required input fields, output fields, what it must NOT do, and a done signal.
4. For each handoff, define a gate: pass criteria, fail action (retry, return to previous agent, or escalate to a human), and maximum retries.
5. Identify context that is lost or bloated between agents and propose a compact handoff summary format.
6. Identify the top risks (error propagation, unsupported claims, scope drift, tone drift) and the earliest gate that catches each.
7. Give a recommendation: go, fix-first, or redesign, with reasons.

OUTPUT FORMAT
A. Decision summary (3 bullets max, with recommendation)
B. Facts / Assumptions / Open questions (three short lists)
C. Agent contract table: Agent | Responsibility | Input fields | Output fields | Must not do | Done signal
D. Gate table: Handoff | Pass criteria | Fail action | Max retries
E. Risk register: Risk | Likelihood (L/M/H) | Caught at gate | Mitigation
F. Copy-ready system prompt for each agent (under 150 words each)
G. Next actions: numbered, owner, and the smallest test run to try first

ACCEPTANCE CRITERIA
- Every agent has a single responsibility and measurable done signal.
- Every handoff has a gate with a fail action and retry limit.
- Assumptions are separated from stated facts.
- Risks are specific to my pipeline, not generic.
- The recommendation can be acted on today.

QUALITY CHECKS
Before answering, verify: no agent reads data that no earlier agent produces; no gate says only 'review quality' without criteria; the output fields of each agent cover the input fields of the next; the first test run is small enough to finish in one session. State any check you could not satisfy.

Example output

AI-written example

A. Decision summary

  • Recommendation: Fix-first. The chain is sound, but the fact-checker runs last with no path back to the writer.
  • Fix: add a claim ledger that travels with the draft.
  • Smallest test: run one 300-word section end to end.

B. Facts / Assumptions / Open questions

  • Facts: Goal is a 900-word explainer on home battery incentives. Audience is suburban homeowners. Agents are Researcher, Writer, Editor, Fact-Checker. Inputs are 6 saved source links, a brief, and a style guide. Bar is every figure tied to a primary source, at Grade 8 reading level. Platform is ChatGPT (separate Projects). Budget is 2 days and 4 full runs.
  • Assumptions: Agents cannot browse, so the Researcher works only from the saved links. A human publishes.
  • Open: Who is the human escalation contact? Are the sources dated?

C. Agent contracts

AgentResponsibilityInputOutputMust notDone signal
ResearcherExtract factsBrief, 6 linksClaim ledger (claim, figure, source, quote)Draft prose≥12 claims, all sourced
WriterDraftBrief, ledgerDraft with claim IDsAdd unledgered facts900 words ±10%, every figure has an ID
EditorClarity and toneDraft, style guideEdited draft, change logAlter figuresGrade 8, change log lists zero numeric edits
Fact-CheckerVerifyEdited draft, ledgerPass/fail per claimRewrite prose100% claims marked

D. Gates

HandoffPass criteriaFail actionMax retries
Researcher→WriterEvery claim has a quote and sourceReturn to Researcher2
Writer→EditorNo figure without an IDReturn to Writer2
Editor→Fact-CheckerNumbers match the ledgerReturn to Editor1
Fact-Checker→Publish0 failed claimsReturn to Writer, then human1

E. Risks

RiskL/M/HCaught atMitigation
Outdated incentive amountsHGate 1Require source date in ledger
Writer invents a statisticMGate 2Claim-ID rule
Editor softens a figureMGate 3Numeric diff check
Tone drifts to sales copyMGate 3Style-guide checklist

F. Agent prompts (shortened)

  • Researcher: "Extract only facts found in the supplied links. Output a ledger: ID, claim, figure, date, source, exact quote. No prose."
  • Writer: "Draft from the ledger only. Tag every fact with its ID. If a fact is missing, write [GAP]."
  • Editor: "Improve clarity to Grade 8 using the style guide. Never change numbers or IDs. Log all changes."
  • Fact-Checker: "Compare each tagged claim to the ledger quote. Return PASS or FAIL with a reason. Do not edit."

G. Next actions

Generated from this prompt by AI. Your results will vary.

Tips and common edits

Fill in every variable you can, even roughly. Run the first test on one small input before scaling. If the model asks questions, answer them before accepting the design. Re-run this prompt after any change in the agent roster.

Questions about this prompt

Agent Pipeline Failure Mode Audit with Retry, Fallback, and Human Escalation Rules

Audits an existing multi-agent pipeline for failure modes and produces retry limits, fallback paths, escalation triggers, and a test plan. Supports the decision on what to harden before wider rollout.

Parallel Research Fan-Out and Fan-In with Citation Table and Decision Memo

Splits a research question across parallel research agents, defines source discovery and evidence review steps, merges findings into a citation table, and produces a decision memo without claiming live browsing.

Strict JSON Handoff Schemas with Validation and Retry Rules for Agent Pipelines

Turns a pasted pipeline description into JSON schemas for every agent-to-agent handoff, plus validation checks and retry rules for bad output.

Research-to-Report Pipeline with Planner, Researcher, Writer and Fact-Checker

Designs a four-agent pipeline for your report type with each agent's prompt, inputs, outputs and handoff format.

Subagent Roster Designer for Your Coding Project

Produces a 3-5 subagent roster with system prompts, minimal tool permissions, model tiers and explicit handoff rules for your project.

Dependency Graph Planner for a Multi-Agent Software Release Workflow

Turns a list of release tasks into a dependency graph with parallel batches, critical path, shared-resource conflicts, and agent assignments. Supports the decision on what to run now versus wait on.

Ask Me Questions First: One-at-a-Time Brief Before the Work

Makes ChatGPT ask up to 7 clarifying questions one at a time, confirm a one-paragraph brief, and only then produce the work.

Chat to Reusable Template: Turn a Good Transcript Into a Prompt

Converts a successful chat transcript into a reusable prompt template with at most three named variables and a one-line note on when to use it.

Design System Component Spec Writer for Figma Handoff

Produces a developer-ready component specification covering anatomy, variants, states, tokens, accessibility, and open questions from a short component brief.

Operations Bottleneck Diagnosis and 30-Day Process Fix Plan

Diagnoses where a workflow slows down using your process steps and metrics, then ranks causes and produces a 30-day improvement plan with owners, measures, and risks.

Research, Writer and Editor Agent Pipeline With a Handoff Schema

Designs a three-agent content pipeline where a researcher, writer and editor pass structured handoffs, with the exact fields each agent receives and returns and checks between stages.

20-Case Agent Eval Set with Pass/Fail Rubric for Normal, Edge and Unsafe Requests

Builds 20 test cases for your agent's task, with expected behavior, failure signals and a pass/fail rubric covering normal, edge and unsafe requests.