CommunityWriting & Editinggithub.com

TongyiDai/xinjin-huochuan

薪尽火传 · Agent Relay — a verifiable work-handoff protocol for AI agents. Pass state, artifacts, ownership, and acceptance criteria across Codex, TRAE, Claude, Cursor, and more.

What is xinjin-huochuan?

Agent Relay is a structured handoff protocol designed for multi-agent workflows. It enables one AI agent to pass ongoing work—including state, artifacts, ownership, and acceptance criteria—to another agent seamlessly, without losing context. The protocol supports popular agent platforms such as Codex, TRAE, Claude, Cursor, and others, making it highly portable across development environments. Its core workflow involves a set of well-defined actions (e.g., offer, accept, complete, verify) that ensure each handoff is verifiable and traceable. By relying on a dedicated Relay Context rather than scanning entire directories or using raw conversation logs, Agent Relay avoids unnecessary overhead and maintains focus on the specific artifacts and criteria that matter. This approach is especially useful for complex, multi-step tasks where different agents specialize in different phases, such as implementation, testing, and review.

Works with✓Claude Code✓Codex CLI✓Cursor
npx skills add TongyiDai/xinjin-huochuan

Installed? Explore more Writing & Editing skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

薪尽火传 · Agent Relay

Switch agents without losing context. Memory Hub is the internal storage layer; Relay is the product layer.

Mandatory First Step

After triggering this Skill, first read the Relay Context. Do not scan the project directory, Skill files, or Home directory first:

  1. Prefer calling the MCP tool relay_context with the current project path and current Agent name.
  2. If MCP is not available, run agent-relay context --agent <name> --project "$PWD".
  3. Only after the Context points to specific artifacts should you open those artifacts for on-site verification.

Do not replace the Relay Context with find /, full directory scans, or raw session logs.

Action Selection

User IntentAction
"Continue", "Go on", "See what other agents did"context or resume --no-mark, check inbox
"Hand off to Codex/Claude/TRAE"offer
Take the baton and start workingaccept
Long-running task still in progressheartbeat
Completed with evidencecomplete
Handoff party confirms completionverify
Cannot continuefail or reject
Cancel the relaycancel
General stage recordingcapture

Use the agent-relay command; the old memory-hub is only a compatibility entry point.

Taking the Baton

  1. Read the current project and the queue of pending handoffs.
  2. Open the real artifacts referenced by the handing-off agent.
  3. If artifacts are missing or have changed, do not accept the baton directly; first explain the discrepancy.
  4. Once confirmed actionable, accept.
  5. Do not ask the user to repeat background that is already recorded in the Hub.
agent-relay context --agent codex --project "$PWD"
agent-relay inbox --agent codex --project "$PWD"
agent-relay accept \
  --relay relay-xxxx \
  --agent codex \
  --summary "Input artifacts verified, starting to take the baton"

In a read-only sandbox, first run:

agent-relay resume --agent codex --project "$PWD" --no-mark

Handing Off

A handoff must include clear acceptance criteria. Provide real artifact paths or verifiable sources; do not just write "done."

agent-relay offer \
  --project "$PWD" \
  --from-agent trae \
  --to-agent codex \
  --summary "Implementation complete, handing off to Codex for edge-case validation" \
  --acceptance "All tests pass" \
  --acceptance "No sensitive information present" \
  --artifact "/path/to/implementation" \
  --source-ref "test: integration suite passed" \
  --priority high

By default, an offer expires if not accepted within 7 days; the default lease after acceptance is 1 hour. For long-running tasks, periodically renew the lease:

agent-relay heartbeat \
  --relay relay-xxxx \
  --agent codex \
  --summary "Edge-case testing in progress"

Completion and Verification

Upon completion, the accepting agent must provide evidence:

agent-relay complete \
  --relay relay-xxxx \
  --agent codex \
  --summary "Edge-case verification completed" \
  --artifact "/path/to/test-results.json"

The verifying agent confirms each criterion and checks the artifacts:

agent-relay verify \
  --relay relay-xxxx \
  --agent trae \
  --summary "Artifacts and acceptance criteria both confirmed" \
  --accept-all-criteria

completed is not yet closed loop; only verified counts as a completed baton leg.

Recording Boundaries

  • Do not save entire chat logs, passwords, tokens, API keys, or unfiltered private data.
  • Do not write guesses as facts; do not modify past events — append corrective records.
  • Do not write Relay entries for single-agent, single-turn, or tasks with no future value.
  • Relay does not replace Git, business version control, or file locks for simultaneous multi-user editing.
  • Real-environment verification takes precedence over memory content.

See references/protocol.md for the full state machine, dependency chain, artifact fingerprints, conflict resolution, and privacy rules.

Related Skills