ai-agentic-workflows
Use when the user asks about an agentic workflow, prompt chaining, router, orchestrator-workers, evaluator-optimizer, ReAct, plan-and-execute or a LangGraph…
от j4flmao★ 47 звёзд на GitHub
Установить ai-agentic-workflows в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Agentic Workflows
Purpose
Choose and implement the simplest control flow that solves the task reliably. Most production "agents" are workflows: predefined code paths that call an LLM at specific steps. Reserve open-ended autonomous loops for tasks whose number of steps cannot be known in advance, and always bound them with step limits, budgets, and checkpoints.
Agent Protocol
Trigger
"agentic workflow", "agent loop", "ReAct", "plan-and-execute", "planner/executor", "reflection", "evaluator-optimizer", "prompt chaining", "routing", "orchestrator-workers", "LangGraph".
Input Context
- The task, its success criterion, and whether the step sequence is known up front.
- Available tools and which ones mutate state (writes, payments, deploys).
- Latency and cost budget per run; acceptable failure rate.
- Framework constraints (plain SDK, LangGraph, other).
Output Artifact
A workflow design: pattern choice with rationale, state schema, node/step list, loop bounds, HITL points, and eval plan. Code only if requested.
Response Format
Pattern: {chain|router|parallel|orchestrator-workers|evaluator-optimizer|autonomous}
Why not simpler: {one line}
State: {typed fields}
Steps: {step -> step (condition)}
Bounds: max_steps={n}, max_cost={usd}, timeout={s}
Human checkpoints: {before which actions}
Eval: {dataset + metric}
Completion Criteria
- Simplest viable pattern chosen and justified.
- Every loop has a hard iteration cap and a budget.
- State-mutating tools gated by approval or dry-run.
- Typed state schema, not raw message history only.
- Offline eval set defined before tuning prompts.
Pattern Decision Tree
Is the sequence of steps known in advance?
├── Yes → Is it a single fixed sequence?
│ ├── Yes → Prompt chain (step N output feeds step N+1, with code checks between)
│ └── No, input type decides the path → Router (classify, then dedicated prompt/tool)
├── Partly: subtasks are independent → Parallelization (sectioning or voting), then aggregate
├── Subtasks only known after reading the input → Orchestrator-workers
├── Quality improves with critique and clear criteria exist → Evaluator-optimizer loop
└── Open-ended, many steps, environment feedback needed → Autonomous agent (ReAct-style loop)
| Pattern | Latency | Cost | Predictability | Typical use |
|---|---|---|---|---|
| Prompt chain | Sum of steps | Low | High | Draft → translate → format |
| Router | 1 extra call | Low | High | Support ticket triage |
| Parallel (voting) | Max of branches | N× | High | Moderation with majority vote |
| Orchestrator-workers | Variable | Medium | Medium | Multi-file code change |
| Evaluator-optimizer | k × (gen + eval) | Medium | Medium | Translation, constrained writing |
| Autonomous agent | Unbounded unless capped | High | Low | Coding agents, research |
Core Loops
ReAct
Interleave reasoning and tool use: the model decides an action, the harness executes it, the observation is appended, repeat until the model returns a final answer. With native tool calling, "Thought/Action/Observation" text parsing is unnecessary: the API returns structured tool-call blocks.
Plan-and-Execute
A planner produces an explicit step list; an executor runs each step (often a small ReAct loop); a re-planner revises the remaining plan after each step. Better on long tasks because the plan is persisted state, not something the model must remember. Re-planning is mandatory: a static plan breaks on the first surprise.
Evaluator-Optimizer (Reflection)
Generator produces output; evaluator scores it against explicit criteria and returns actionable feedback; loop until pass or cap. Reflection without an external signal (tests, schema validation, retrieval check) often just rephrases the same mistake, so prefer evaluators grounded in execution results.
Implementation (LangGraph)
from __future__ import annotations
from typing import Literal, TypedDict
from langgraph.checkpoint.memory import MemorySaver
from langgraph.graph import END, START, StateGraph
class State(TypedDict):
task: str
draft: str
feedback: str
passed: bool
attempts: int
MAX_ATTEMPTS = 3
def generate(state: State) -> dict:
draft = call_llm(f"Task: {state['task']}\nPrevious feedback: {state['feedback']}")
return {"draft": draft, "attempts": state["attempts"] + 1}
def evaluate(state: State) -> dict:
errors = run_checks(state["draft"]) # deterministic checks first: tests, schema, linters
return {"passed": not errors, "feedback": "\n".join(errors)}
def route(state: State) -> Literal["generate", "publish", "give_up"]:
if state["passed"]:
return "publish"
return "give_up" if state["attempts"] >= MAX_ATTEMPTS else "generate"
builder = StateGraph(State)
builder.add_node("generate", generate)
builder.add_node("evaluate", evaluate)
builder.add_node("publish", publish) # state-mutating: guarded by interrupt below
builder.ad
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/generative-ui.md
- references/meta-prompting.md
- references/prompt-optimization.md
FAQ
Что делает скилл ai-agentic-workflows?
Use when the user asks about an agentic workflow, prompt chaining, router, orchestrator-workers, evaluator-optimizer, ReAct, plan-and-execute or a LangGraph workflow with human checkpoints. Produces the simplest workflow pattern with typed state, loop bounds and approval points. Not for multi-agent runtimes (use ai-multi-agent-systems) or single-loop mechanics (use ai-agent-core-loop).
Как установить скилл ai-agentic-workflows?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ai-agentic-workflows запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…