Planning and Worker Flow
Tiered orchestration for questions that are too broad for a single call.
Install
One-line install
npx attrition-sh pack install planning-and-worker-flow
AGENTS.md snippet (Claude Code / Cursor)
# Planning and Worker Flow # See: /packs/planning-and-worker-flow
Raw Markdown
Machine-readable body for agent ingestion or copy/paste.
Telemetry
Not yet measuredSummary
A multi-step harness pattern that uses a narrow planning pass, typed worker calls, and a constrained synthesis pass instead of letting one prompt attempt everything at once.
Fit and expected payoff
When this pack earns its extra structure, when to skip it, and what it should improve.
Use when
Situations where this pack earns its extra structure.
- The user asks a broad or multi-entity question.
- You need cross-tool synthesis with traceable intermediate outputs.
- A single-shot answer tends to overgeneralize or hallucinate missing evidence.
Avoid when
Keeps the pack from becoming a default hammer.
- A deterministic query or a single issue packet already contains everything needed.
- The overhead of planning exceeds the complexity of the task.
What it improves
Expected outcomes if implemented well.
- Broad questions are decomposed into smaller evidence-gathering steps.
- Worker outputs stay typed and auditable before synthesis.
- The final answer is grounded in a bounded set of prior results instead of hidden chain-of-thought.
Minimal instructions
Smallest useful starting point.
Use a three-phase harness: 1. Plan the smallest useful set of steps. 2. Execute workers with typed outputs and explicit dependencies. 3. Synthesize only from validated worker results. Do not let the model answer broad questions directly when multiple tools or scopes are involved.
Full instructions
Complete natural-language instruction set.
You are implementing a harness for questions that exceed a safe single-call boundary. Phase 1: Plan - decide which tools or internal workers are required - keep the plan narrow - include dependencies and step purpose Phase 2: Execute - run steps by tier - allow parallel workers only when outputs are independent - persist success, failure, duration, and result summary Phase 3: Synthesize - read only validated worker outputs - cite the evidence sources or record IDs used - do not invent facts not present in worker results Favor typed worker outputs over freeform intermediate prose.
Evaluation checklist
These checks should pass before you consider the pattern production-ready.
- Was planning narrower than the original question?
- Did each worker have a clear scope and output contract?
- Did synthesis only use worker results and cited evidence?
- Could the run recover or re-plan if a worker failed?
Common failure modes
Every check below traces back to a specific production failure. Read as: "I would think about X because in production Y can happen."
- Mid
Planner creates too many steps with no dependency discipline.
- Trigger
- (legacy — trigger not separated)
- Prevention
- (legacy — no explicit prevention)
- Mid
Workers return unstructured prose that is hard to validate.
- Trigger
- (legacy — trigger not separated)
- Prevention
- (legacy — no explicit prevention)
- Mid
Synthesis ignores worker results and drifts back into generic model prose.
- Trigger
- (legacy — trigger not separated)
- Prevention
- (legacy — no explicit prevention)
Official docs and implementation references
Anthropic: Building effective agents
Canonical workflow patterns such as prompt chaining, routing, parallelization, and evaluator loops.
https://www.anthropic.com/research/building-effective-agentsLangGraph overview
Reference for controlled multi-step and multi-agent orchestration.
https://docs.langchain.com/oss/python/langgraphLangGraph product page
High-level framing for reliable agent orchestration.
https://www.langchain.com/langgraph