Sandbox
@keyuchen21/agentic-engineering-handbook

Agentic engineering roadmap for MCP, harnesses, and evals

Agentic Engineering Handbook is a structured learning path for people building with AI agents. It connects core ideas like tool use, memory, MCP, skills, harnesses, and evals with curated readings and small build exercises. The repository is meant to teach how agent systems work and how to evaluate them, not to provide a drop-in agent product. The main content lives in the README and the `tutorials/agent-loop` lessons with example code.

187 stars16 forksPythonUpdated 1mo ago
How We Build Effective Agents: Barry Zhang, Anthropic
AI Engineer534k views • 1 year ago

Videos about this repo

Who it's for

Builders who want a guided path from basic agent loops to production agent systems.

What it delivers

You can learn the pieces of agentic engineering in order and turn that into better agent workflows and evaluations.

What it does

Phase-based learning roadmap

Walks through agent loops, foundations, MCP and tools, memory and skills, harnesses, coding workflows, and evals.

Build exercises

Each phase includes a concrete exercise, such as building a ticket triage agent, an MCP server, or a mini coding harness.

Applied practice tracks

Adds focused tracks for coding agents, deep research, MCP operations, security, code review, and production operations.

Curated reading table

Lists priority-ranked articles and docs with topic labels and key ideas for deeper study.

Agent loop tutorials

Includes `tutorials/agent-loop` lessons and Python examples that show how an agent loop grows from bash commands to skills and subagents.

README

Agentic Engineering Handbook

The definitive OpenAI, Anthropic, Google, MCP, Harness, Evals, and Production Agent Systems learning roadmap.

License: MIT Last Updated

If this repository helps you, consider giving it a ⭐


Why This Repository?

The AI industry has entered the Agentic Era. Building production-grade AI systems now requires mastering agents, tool use, MCP, memory, long-running workflows, coding agents, agent harnesses, evals, and safety — but the knowledge is scattered across OpenAI blogs, Anthropic engineering posts, SDK docs, cookbooks, and research papers.

This repository consolidates 179 curated resources into one structured learning roadmap.

The goal: Become a world-class Agentic Engineer.


How To Use This Handbook

Pick the path that matches your starting point:

  • New to agents: follow the Learning Roadmap from Phase 0 to Phase 6. Treat each Read First, Then Read, and Build Exercise as a checklist.
  • Already building LLM apps: start at Phase 2 or Phase 3, then fill gaps in agent loop, tool calling, evals, and production engineering.
  • Trying to build projects: use the phase-level Build Exercise prompts, then branch into Applied Practice Tracks for coding agents, security, code review, or SRE.
  • Looking for references: jump to the Full Reading Table. Read P0 first, use P1 for implementation detail, and keep P2 as optional background.

Learning Roadmap

Phase 0 — Agent Loop From Scratch

If you treat Claude Code as a coding CLI, many capabilities can feel like magic: it reads files, runs commands, edits code, delegates work, and stays oriented during complex tasks.

From an engineering perspective, the core is much simpler:

model + tools + one loop.

Understanding that loop makes the rest of the system easier to reason about:

  • When the agent should plan first, and when it should act immediately
  • Why an explicit todo list reduces drift in longer tasks
  • Why subagents improve exploration while protecting the main context
  • How skills, MCP, and hooks each add capability around the same core loop

These pages are based on the upstream English Markdown tutorials from shareAI-lab/mini-claude-code, with added Study Notes and inline source code for this handbook.

StepPageCode
v0Bash is All You Needv0_bash_agent.py
v1Model as Agentv1_basic_agent.py
v2Structured Planningv2_todo_agent.py
v3Subagent Mechanismv3_subagent.py
v4Skills Mechanismv4_skills_agent.py

Supporting files are included in the same folder: requirements.txt, .env.example, v0_bash_agent_mini.py, and skills/.

Next reference: minion.py is a compact, single-file coding agent worth reading after this lab. It shows how an OpenAI-compatible agent loop grows to include tool calls, sessions, resume, approvals, memory, and context compaction.


Phase 1 — Agent Foundations

Build shared vocabulary for workflow vs agent, tool loop, handoff, guardrails.

Key Mental Models

Should I build an agent? (4-question checklist from Barry Zhang's talk - Anthropic)

QuestionIf No → WorkflowIf Yes → Agent
Is the task complex enough?Decision tree is fully mappableAmbiguous problem space
Is the task valuable enough?<$0.10 per run>$1 per run, cost doesn't matter
Are all core capabilities doable?Weak links break the chainModel handles every step well
Is error cost low & detectable?High cost + hard to detect → human-in-the-loopErrors caught by tests/CI

Think like the agent. Most failures come from designing with a human perspective. Put yourself inside the agent's context window: you only see ~10K–20K tokens (system prompt + tool descriptions + recent observations). Ask: does the agent have enough information to act correctly at each step?

→ Source: How We Build Effective Agents

Read First

#TitleVendor
1System PromptsAnthropic
2Prompt guidanceOpenAI
3Function CallingOpenAI
4Tool use overviewAnthropic
5Function calling - Gemini APIGoogle
6Building effective agentsAnthropic
7New tools for building agentsOpenAI
8Agents SDK overviewOpenAI

Then Read

TitleVendor
How We Build Effective Agents: Barry Zhang, AnthropicAnthropic
Phistory — Claude Code & Codex CLI System Prompt Diff HistoryCommunity
Coding Agents 101: The Art of Actually Getting Things DoneCognition
OpenAI Agents SDK examplesOpenAI
Structured Outputs for Multi-Agent SystemsOpenAI

Build Exercise

Build a customer service/ticket triage agent: router → specialist → evaluator, with all outputs constrained by structured schemas.


Phase 2 — MCP & Tool Ecosystem

Understand MCP server/client, remote vs local, tool loading, approval, connector boundaries.

Read First

#TitleVendor
1Introducing the Model Context ProtocolAnthropic
2MCP and ConnectorsOpenAI
3Building MCP servers for ChatGPT Apps and API integrationsOpenAI

Then Read

TitleVendor
Code execution with MCP: Building more efficient agentsAnthropic
Writing effective tools for AI agents - with AI agentsAnthropic
Model Context Protocol - CodexOpenAI
Build a Remote MCP serverCloudflare
Introducing the MCP RegistryMCP
OpenAI Docs MCPOpenAI
Build your ChatGPT UIOpenAI

Build Exercise

Build a read-only repo/docs MCP server, then create an eval to verify the agent correctly cites documentation.


Phase 3 — Context, Memory & Skills

Learn to control context window, short/long-term memory, skills/plugins, CLAUDE.md/AGENTS.md.

Read First

#TitleVendor
1Agent Skills SpecificationAgent Skills
2Effective context engineering for AI agentsAnthropic
3The new rules of context engineering for Claude 5 generation modelsAnthropic
4How the Open Knowledge Format can improve data sharingGoogle Cloud
5How Long Contexts FailDrew Breunig
6Context RotChroma
7Progressive disclosureClaude-Mem
8Equipping agents for the real world with Agent SkillsAnthropic
9Agent SkillsAnthropic
10SkillsOpenAI
11Building Reliable Agents with Memory and CompactionOpenAI

Then Read

TitleVendor
Custom instructions with AGENTS.md - CodexOpenAI
Best practices for Claude CodeAnthropic
Agent Skills - CodexOpenAI
Skills in OpenAI APIOpenAI

Build Exercise

Implement the same task as a Skill/Plugin, then measure accuracy and token cost across three variants: no skill, long prompt, and skill-based.


Phase 4 — Harness & Long-Running Agents

Master agent runtime: event stream, thread, tool execution, state, sandbox, approval, recovery.

Read First

#TitleVendor
1Unrolling the Codex agent loopOpenAI
2Unlocking the Codex harness: how we built the App ServerOpenAI
3Agent Harness Engineering: A SurveyAcademic
4Effective harnesses for long-running agentsAnthropic
5Orchestrate subagents at scale with dynamic workflowsAnthropic
6Deep AgentsLangChain

Then Read

TitleVendor
Deep researchOpenAI
Open Deep ResearchLangChain
The next evolution of the Agents SDKOpenAI
A harness for every task: dynamic workflows in Claude CodeAnthropic
Using PLANS.md for multi-hour problem solvingOpenAI
Build long-running AI agents that pause, resume, and never lose context with ADKGoogle
Harness design for long-running application developmentAnthropic
Scaling Managed Agents: Decoupling the brain from the handsAnthropic

Build Exercise

Build a mini coding harness: plan file, shell tool, apply patch, test gate, event log, and resume capability.


Phase 5 — Coding & Workspace Agents

Compare Codex vs Claude Code product/SDK forms; learn multi-agent, IDE, workspace collaboration.

Read First

#TitleVendor
1AGENTS.mdAgentic AI Foundation
2Introducing CodexOpenAI
3Best practices for Claude CodeAnthropic
4How Claude Code works in large codebasesAnthropic
5Enabling Claude Code to work more autonomouslyAnthropic

Then Read

TitleVendor
Introducing the Codex appOpenAI
Introducing workspace agents in ChatGPTOpenAI
Apple's Xcode now supports Claude Agent SDKAnthropic
Building Consistent Workflows with Codex CLI & Agents SDKOpenAI
Best practices for Claude CodeAnthropic
The spec is dead, long live the spec!Ravi on Product
How Anthropic teams use Claude CodeAnthropic
Multi-stack Web App BuildsCommunity

Build Exercise

Run both OpenAI/Codex and Claude Code style workflows on the same repo: issue → plan → patch → tests → PR summary.


Phase 6 — Evals, Safety & Production

Build pre/post-launch eval loop, trace loop, safety boundaries, permissions, regression monitoring.

Read First

#TitleVendor
1Demystifying evals for AI agentsAnthropic
2The six generations of AI agents and how to eval themBraintrust
3Agent observability powers agent evaluationLangChain
4Agent Evaluation Readiness ChecklistLangChain
5Build an Agent Improvement Loop with Traces, Evals, and CodexOpenAI
6Macro Evals for Agentic SystemsOpenAI
7Testing Agent Skills Systematically with EvalsOpenAI

Then Read

TitleVendor
How we build evals for Deep AgentsLangChain
Deep Research BenchFutureSearch
How to Evaluate Tool-Calling AgentsArize
AI agent evaluation: How to test, debug, and improve agents in productionArize
A Survey on Agent-as-a-JudgeAcademic
Running Codex safely at OpenAIOpenAI
How we contain Claude across productsAnthropic
Evals API Use-case - MCP EvaluationOpenAI
Measuring AI agent autonomy in practiceAnthropic

Build Exercise

Build a smoke/macro eval suite for your agent: task success rate, tool misuse, prompt injection resistance, latency, cost, and human approval count.


Applied Practice Tracks

Use these tracks after the core roadmap when you want to practice agentic engineering in real engineering workflows.

TrackStart HereWhy It Matters
Agentic coding workflowCoding Agents 101, How Claude Code works in large codebases, How Anthropic teams use Claude CodeTurns agent theory into day-to-day engineering habits: prompting, checkpoints, verification, parallel work, and team rollout.
Spec-driven buildingThe spec is dead, long live the spec!, Multi-stack Web App BuildsTreats specs, prompts, and assignments as executable source material for agents.
Context failure modesHow Long Contexts Fail, Context Rot, Progressive disclosureHelps diagnose context poisoning, distraction, confusion, context degradation, and retrieval overload.
Evals and observabilityDemystifying evals for AI agents, Agent observability powers agent evaluation, Agent Evaluation Readiness ChecklistBuilds the feedback loop for traces, datasets, graders, offline/online evals, and regression gates.
Deep research agentsDeep research, Open Deep Research, Alibaba-NLP/DeepResearchPractices long-running research agents: planning, search, MCP, citations, report synthesis, and benchmark-driven improvement.
MCP operationsBuild a Remote MCP server, Introducing the MCP RegistryShows how MCP moves from local prototypes to authenticated, discoverable, production-grade tool ecosystems.
Agent securityOWASP Top Ten, SAST vs. DAST vs. RASP, Copilot Remote Code Execution via Prompt InjectionGrounds agent security in classic AppSec plus new prompt-injection and tool-permission failure modes.
Code review systemsHow to Review Code Effectively, AI-Assisted Assessment of Coding Practices in Modern Code Review, AI Code Review Implementation Best PracticesConnects human review quality with AI-assisted review, automated comments, and review policy design.
Production and SRE agentsML and LLM system design, Introduction to Site Reliability Engineering, Observability Basics You Should KnowExtends agents beyond coding into incidents, observability, root-cause analysis, on-call, and production operations.

Full Reading Table

Priority guide: P0 = must-read (architectural/conceptual), P1 = highly useful (implementation detail), P2 = optional context (background/releases).

PriorityTitleVendorTopicKey IdeaDate
P0OpenAI for Developers in 2025OpenAIAgents; MCP; PlatformAnnual overview: systematic walkthrough of Responses API, Agents SDK, AgentKit, Codex, MCP, Apps SDK, and AGENTS.md.2025-12-30
P0New tools for building agentsOpenAIAgents; Responses API; ToolsKey starting point for OpenAI's agent platform: Responses API, built-in web/file/computer tools, Agents SDK, tracing/observability.2025-03-11
P0Introducing AgentKitOpenAIAgents; Evals; AgentKitAgentKit, expanded evals, agent RFT: the official agent toolchain from prototype to production.2025-10-06
P0Prompt guidanceOpenAIPrompting; Models; Agent UXOfficial model-specific prompting guidance for outcome-first prompts, reasoning effort, preambles, and validation rules in tool-heavy workflows.Current docs
P0System PromptsAnthropicSystem prompts; Claude; BehaviorClaude web/mobile system prompt release notes; useful for studying production prompting patterns and behavioral scaffolding.Current docs
P0Agents SDK overviewOpenAIAgents; SDKOfficial SDK entry point: concepts and boundaries of agent, tool, handoff, guardrail, and tracing.Current docs
P0Introducing the Model Context ProtocolAnthropicMCP; StandardsThe origin article for MCP: an open standard connecting AI assistants to data, tools, and systems.2024-11-25
P0Building effective agentsAnthropicAgents; Patterns; FrameworksEssential agent primer: workflow vs agent, prompt/tool/retrieval, orchestrator-worker, evaluator-optimizer patterns.2024-12-19
P0Coding Agents 101: The Art of Actually Getting Things DoneCognitionCoding agents; Workflows; PracticeProduct-agnostic guide to prompting, delegation, verification, environment setup, security, and cost management for coding agents.2025-06
P0minion.pySentdexAgent loop; Coding agents; Reference implementationCompact single-file coding agent showing OpenAI-compatible model calls, tool-call parsing, sessions, resume, approvals, memory, and context compaction in runnable Python.Current repo
P0AGENTS.mdAgentic AI FoundationCodin

Files in the repo

Repository payload4 top-level entries
  • tutorials
  • .gitignore
  • LICENSE
  • README.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tutorials & guides

shareAI-lab/
learn-claude-code

Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1

77k
luongnv89/
claude-howto
luongnv89/claude-howtoTutorials & Guides

A visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.

41k
agentskills/
agentskills
agentskills/agentskillsTutorials & Guides

Specification and documentation for Agent Skills

25k