一键导入
recipe-orchestrated-workflow
Full recipe for a 3-agent pipeline (researcher → writer → reviewer) coordinated by a lead orchestrator agent using withAgentTool().
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Full recipe for a 3-agent pipeline (researcher → writer → reviewer) coordinated by a lead orchestrator agent using withAgentTool().
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Agentic harness diagnostic + improvement loop. Probes the framework with real model runs, uses the rax-diagnose CLI to root-cause failures from structured trace data, ships ONE coordinated architectural fix, verifies via before/after diff, commits with empirical evidence. Use at the start of any harness improvement session — replaces ad-hoc grep + log-spelunking with a deterministic feedback loop.
Use when the architecture may have drifted from documentation, packages have grown complex, dead code or disabled systems are suspected, or before planning a major refactor — scoped to the reactive-agents-ts 22-package monorepo.
Reactive Agents framework architecture — layer stack, dependency graph, build order, and package structure. Use when planning work, understanding package relationships, or determining build dependencies.
Use when analyzing the Reactive Agents codebase for architectural improvements, abstraction opportunities, composability gaps, or Effect-TS engineering quality — before proposing refactors, during design reviews, or when codebase complexity is growing.
LLMService API contract — the correct signatures for complete(), stream(), embed(), and response types. Use when calling LLMService from any layer, writing reasoning strategies, or building LLM-dependent features.
LLM provider streaming patterns and per-provider quirks. Use when adding a new provider, implementing adapter hooks, or debugging streaming tool call behavior in packages/llm-provider.
| name | recipe-orchestrated-workflow |
| description | Full recipe for a 3-agent pipeline (researcher → writer → reviewer) coordinated by a lead orchestrator agent using withAgentTool(). |
| compatibility | Reactive Agents TypeScript projects using @reactive-agents/* |
| metadata | {"author":"reactive-agents","version":"2.0","tier":"recipe"} |
A 3-agent pipeline where a lead orchestrator delegates to a researcher (web search + synthesis), a writer (document creation), and a reviewer (quality check). The lead coordinates the workflow, passes results between agents, and handles revision cycles.
multi-agent-orchestration — withAgentTool(), withDynamicSubAgents(), withRemoteAgent()reasoning-strategy-selection — plan-execute-reflect for the lead agentmemory-patterns — shared checkpoint state between agentscost-budget-enforcement — per-session budgets per sub-agentimport { ReactiveAgents } from "@reactive-agents/runtime";
const orchestrator = await ReactiveAgents.create()
.withName("lead-orchestrator")
.withProvider("anthropic")
.withReasoning({
defaultStrategy: "plan-execute-reflect",
maxIterations: 30,
})
.withAgentTool("researcher", {
name: "Research Specialist",
description: "Searches the web for information on a topic and returns key findings with source URLs",
maxIterations: 15,
tools: ["web-search", "http-get", "checkpoint"],
})
.withAgentTool("writer", {
name: "Content Writer",
description: "Writes a well-structured document given research findings. Returns a markdown document.",
maxIterations: 12,
tools: ["file-write", "checkpoint"],
})
.withAgentTool("reviewer", {
name: "Quality Reviewer",
description: "Reviews a document for factual accuracy, completeness, and clarity. Returns pass/fail with specific feedback.",
maxIterations: 8,
tools: ["file-read", "checkpoint"],
})
.withTools({
allowedTools: ["researcher", "writer", "reviewer", "checkpoint", "final-answer"],
})
.withCostTracking({ perSession: 5.0 })
.withObservability({ verbosity: "normal" })
.withSystemPrompt(`
You coordinate a content production pipeline. Follow this workflow:
1. Call researcher("Research [topic] thoroughly. Find 3-5 authoritative sources.")
2. Checkpoint the research findings.
3. Call writer("Write a comprehensive article about [topic]. Use these findings: [research output]")
4. Call reviewer("Review this document at [file path]. Check: factual accuracy, completeness, clear structure.")
5. If reviewer approves: return final-answer with the document path.
6. If reviewer requests changes: call writer again with the feedback.
7. Maximum 2 revision cycles before returning the best version.
`)
.build();
// Run the full pipeline
const result = await orchestrator.run(
"Create a comprehensive guide on React Server Components and when to use them"
);
console.log(result.output);
console.log(`Total pipeline cost: $${result.cost?.total.toFixed(4)}`);
await orchestrator.dispose();
.withAgentTool("researcher", {
name: "Research Specialist",
description: "...",
provider: "anthropic",
model: "claude-haiku-4-5-20251001", // cheaper for research
maxIterations: 15,
tools: ["web-search", "http-get"],
})
.withAgentTool("writer", {
name: "Content Writer",
description: "...",
// no model override — inherits orchestrator's model (Sonnet/Opus for quality writing)
maxIterations: 12,
tools: ["file-write"],
})
// Instead of pre-defined agents, enable the orchestrator to spawn agents as needed:
.withDynamicSubAgents({ maxIterations: 10 })
// The orchestrator can create specialized agents based on the task at hand.
// Use when the set of required specializations isn't known in advance.
// If researcher and writer run as separate services:
.withRemoteAgent("researcher", "http://researcher-service:8001")
.withRemoteAgent("writer", "http://writer-service:8002")
// Each remote agent must expose a .withA2A() interface (see a2a-agent-networking skill)
// For tasks that don't depend on each other, instruct the orchestrator to batch them:
.withSystemPrompt(`
When multiple independent research topics are needed, call the researcher
multiple times. Each call runs a separate research task.
Synthesize all findings before calling the writer.
`)
// Note: sub-agent calls are sequential by default in the kernel.
// True parallelism requires withDynamicSubAgents() with concurrent dispatching logic.
const result = await orchestrator.run("Create an article about...");
// result.output — path to the written document, or summary of pipeline execution
// result.cost — combined cost of orchestrator + all sub-agents
// result.steps — full trace including sub-agent invocations and results
maxIterations on sub-agents applies per invocation — a researcher called 3 times can use up to 3 × maxIterations totalwithCostTracking budgets that account for the full pipeline