Choose the right LLM workflow or agent architecture (prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer, autonomous loop) when designing an AI pipeline, agent, bot or automation, or when splitting a large task across subagents.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Agent Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/alptugince-agent-patterns)
---
name: agent-patterns
description: Choose the right LLM workflow or agent architecture (prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer, autonomous loop) when designing an AI pipeline, agent, bot or automation, or when splitting a large task across subagents.
---
# Agent patterns
Start with the simplest thing that works. Add structure only when it measurably improves results.
## Decision guide
| Situation | Pattern |
|---|---|
| One call with good context and tools is enough | Augmented LLM (single call, structured output, tools, retrieval) |
| Fixed sequence of steps, each consuming the previous output | Prompt chaining, with programmatic gates between steps |
| Inputs fall into distinct categories that need different handling | Routing: a classifier with structured output picks the branch |
| Independent subtasks, or several perspectives on one task | Parallelization: sectioning (split) or voting (same task, several runs, aggregate) |
| Subtasks unknown until the input is analysed | Orchestrator-workers: a planner emits a structured list of subtasks, workers run them, a synthesizer merges |
| Clear quality criteria and iteration helps | Evaluator-optimizer: generator → grader with structured feedback → regenerate until it passes or a limit is hit |
| Open-ended task, unpredictable number and order of steps | Agent: tool calls in a loop with environment feedback until done |
## Build rules
- Structured outputs (JSON schema / typed models) at every decision point; routing and grading on free text is fragile.
- Every loop has a hard limit (iterations, tokens, time) and a defined failure result.
- Tools: few, well named, with clear descriptions, examples and errors that tell the model how to recover. Return concise, relevant tool results.
- Ground truth from the environment beats self-assessment: tests, compilers, schema validators and real execution make the best evaluators.
- Put human approval before irreversible or external actions (sending, publishing, paying, deleting, merging).
- Keep state explicit (a typed state object or files) so runs can be paused, inspected, resumed and replayed.
- Log every call, tool call and decision; those transcripts feed `memory-dream` and `skill-eval`.
## In Claude Code
- Orchestrator-workers and parallelization map to subagents: the main session plans and spawns subagents with a precise brief each (inputs, output format, what not to touch), then synthesizes.
- Evaluator-optimizer maps to a generator session plus the `reviewer` or `verifier` subagent, or to the project gate via the Stop hook.
- Routing maps to skills: good skill descriptions are the router.
## Verify the design
Before building the full system, run the chosen pattern on 3-5 real inputs and compare against the simpler alternative one row up in the table. Keep the extra structure only if it wins.