ai-agent-architectures
Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework…
от j4flmao★ 47 звёзд на GitHub
Установить ai-agent-architectures в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
AI Agent Architectures
Purpose
Design a single LLM agent end to end: the control loop, the tool surface, memory, planning strategy, guardrails, and how it is evaluated. This parent skill makes the top-level decisions and hands detail to its children: core-architectures (loop mechanics), tool-calling-principles (tool contracts), memory-systems (state and recall), and multi-agent-topology (when one agent is not enough).
Agent Protocol
Trigger
"build an agent", "agent architecture", "autonomous agent", "agent design review", "agent framework choice", "agent system prompt".
Input Context
- Task domain, success criteria, and expected task length (steps, minutes).
- Tools/APIs available and their side effects.
- Model/provider constraints, latency and cost budget.
- Data the agent must remember across turns or sessions.
- Risk profile: what is the worst action the agent could take?
Output Artifact
Architecture brief: component table, loop diagram (Mermaid sequence), tool list with schemas, memory plan, guardrails, eval plan.
Response Format
Loop: {react|plan-execute|workflow} Model: {tier} Max steps: {n}
Tools ({count}; split past ~10-15 or on eval evidence): {name: side-effect level}
Memory: working={strategy} | long-term={store} | episodic={yes/no}
Guardrails: {input, output, action approvals}
Eval: {dataset, metric, pass threshold}
Children to consult: {skill paths}
Completion Criteria
- Each component (loop, tools, memory, planning, guardrails, eval) has an explicit decision.
- Small, cohesive toolset per agent; split only when evals show tool or domain confusion (repo heuristic: ~10-15 tools).
- Destructive tools have human approval or dry-run.
- Eval dataset exists before prompt iteration starts.
Component Map
| Component | Decision | Default | Child skill |
|---|---|---|---|
| Control loop | ReAct vs plan-and-execute vs fixed workflow | Fixed workflow if steps known | core-architectures, ../agentic-workflows |
| Tools | Granularity, schemas, error contract | Few coarse tools with strict schemas | tool-calling-principles |
| Working memory | What stays in context | System prompt + plan + recent turns | memory-systems |
| Long-term memory | Retrieval store, write policy | Explicit "remember" writes, hybrid retrieval | memory-systems |
| Planning | Explicit plan object or implicit | Explicit plan for > ~5 steps | references/planning-strategies.md |
| Guardrails | Input/output filters, approvals | Approval on irreversible actions | ../../harness-engineering/sandbox-execution |
| Observability | Traces, cost | One span per LLM/tool call | ../../harness-engineering/agent-observability |
Minimal Agent Loop (Anthropic Messages API)
from __future__ import annotations
import json
import os
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
MODEL = os.environ["AGENT_MODEL"] # pin the model id in config, not in code
MAX_STEPS = 12
TOOLS = [{
"name": "search_orders",
"description": "Look up orders by customer email. Read-only. Returns at most 20 orders.",
"input_schema": {
"type": "object",
"properties": {"email": {"type": "string", "format": "email"}},
"required": ["email"],
},
}]
def run_tool(name: str, args: dict) -> str:
if name == "search_orders":
return json.dumps(search_orders(args["email"])) # your implementation
raise ValueError(f"unknown tool {name}")
def run_agent(user_msg: str) -> str:
messages = [{"role": "user", "content": user_msg}]
for _ in range(MAX_STEPS):
resp = client.messages.create(
model=MODEL, max_tokens=2048, system=SYSTEM_PROMPT, tools=TOOLS, messages=messages
)
messages.append({"role": "assistant", "content": resp.content})
if resp.stop_reason != "tool_use":
return "".join(b.text for b in resp.content if b.type == "text")
results = []
for block in resp.content:
if block.type != "tool_use":
continue
try:
out, is_error = run_tool(block.name, block.input), False
except Exception as exc: # report to the model so it can recover
out, is_error = f"{type(exc).__name__}: {exc}", True
results.append({"type": "tool_result", "tool_use_id": block.id,
"content": out, "is_error": is_error})
messages.append({"role": "user", "content": results})
raise RuntimeError(f"agent exceeded {MAX_STEPS} steps without finishing")
The OpenAI-style equivalent uses tools=[{"type": "function", "function": {...}}] and returns tool_calls on the assistant message; answers go back as role: "tool" messages with tool_call_id.
System Prompt Skeleton
Role and goal: one paragraph, the outcome not the persona.
Constraints: what must never happen; which actions need confirmation.
Tools: when to use each (descrip
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- core-architectures/SKILL.md
- core-architectures/references/react-pattern.md
- core-architectures/references/reflexion.md
- memory-systems/SKILL.md
- memory-systems/references/context-summarization.md
- memory-systems/references/semantic-memory.md
- multi-agent-topology/SKILL.md
- references/planning-strategies.md
- tool-calling-principles/SKILL.md
- tool-calling-principles/references/model-context-protocol.md
FAQ
Что делает скилл ai-agent-architectures?
Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).
Как установить скилл ai-agent-architectures?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ai-agent-architectures запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…