lesson demos and exercises #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a comprehensive 10-lesson course teaching developers how to build AI agents using the Claude Agent SDK. Each lesson includes a demo (instructor walkthrough) and an exercise (hands-on practice).
Lesson 01: Model Selection
What It Teaches: How to choose between Haiku, Sonnet, and Opus based on task complexity and cost considerations. Smart model routing can reduce costs by 80%+.
Demo Scenario: A weather notification service processes thousands of alerts daily. Simple updates use fast, cheap Haiku while severe warnings require deeper Sonnet/Opus analysis.
Exercise Scenario: A support team handles thousands of tickets daily. Students learn to route simple questions to Haiku and complex issues to Sonnet/Opus based on complexity.
Lesson 02: Extended Thinking
What It Teaches: How to use extended thinking for complex multi-step analysis with transparent reasoning. Provides audit trails for high-stakes decisions.
Demo Scenario: An e-commerce platform experiences a sudden drop in checkout conversions. The ops team investigates root causes by correlating logs, changes, and user reports with auditable reasoning steps.
Exercise Scenario: A fintech company's fraud detection system flags transactions. Compliance officers need clear reasoning to approve/reject transactions, and regulators require audit trails for decisions.
Lesson 03: Agentic Architecture
What It Teaches: The fundamental differences between prompt-response systems and agentic systems. Covers autonomy, tool use, iteration, and orchestration patterns (sequential, parallel, hierarchical).
Demo Scenario: A company wants to automate customer research. Students design a multi-agent system that autonomously searches the web, analyzes findings, follows leads, and compiles reports.
Exercise Scenario: A SaaS company receives 5,000+ support tickets daily with enterprise SLA requirements. Students design a multi-agent architecture for triage, routing, knowledge base search, and human escalation.
Lesson 04: Claude Code Configuration
What It Teaches: How to configure Claude Code using .claude/CLAUDE.md files. Covers system prompts, model selection, allowed tools, and response formats.
Demo Scenario: Set up Claude Code as a code review assistant that identifies code smells, suggests best practices, and flags security vulnerabilities.
Exercise Scenario: Configure Claude Code as a documentation assistant that helps write clear code comments, README files, and API documentation with consistent formatting.
Lesson 05: Claude Agent SDK Basics
What It Teaches: Building the first agent using query() from the Claude Agent SDK. Covers the async iterator pattern, tool execution, and result handling.
Demo Scenario: A documentation team needs an automated summarizer that reads files, extracts key points, and produces structured summaries using the Read tool.
Exercise Scenario: A procurement team receives contracts in different formats. Build an agent that reads contracts, extracts key terms, and writes standardized output files using Read and Write tools.
Lesson 06: Custom Tools
What It Teaches: How to build custom MCP tools using createSdkMcpServer and tool() with Zod schemas. Tool naming follows mcp____ pattern.
Demo Scenario: A financial application needs agents to calculate taxes with proper decimal precision. Build a custom "calculate_tax" tool that handles currency formatting and rounding.
Exercise Scenario: An engineering team needs to validate API responses and check SLA compliance. Build a custom tool that validates schemas, measures latency, and detects breaking changes.
Lesson 07: Structured Outputs
What It Teaches: How to enforce structured outputs using Zod schemas and outputFormat. Guarantees type-safe, validated responses directly usable by applications.
Demo Scenario: A product review analyzer extracts sentiment, rating, key points, and purchase recommendations from review text with guaranteed consistent data structure.
Exercise Scenario: A team records meetings but struggles to extract actionable information. Build a system that automatically identifies action items, decisions, and participants with validated output.
Lesson 08: Claude Skills
What It Teaches: How to extend Claude with reusable expertise stored in .claude/skills/ directories. Use settingSources: ["project"] to load skills and the Skill tool to apply them.
Demo Scenario: Build an email etiquette reviewer that analyzes emails for tone, structure, clarity, and grammar using a custom SKILL.md file.
Exercise Scenario: Build a JavaScript code reviewer that checks for quality issues (var usage, console.log), bugs (loose equality, missing await), and security vulnerabilities (eval, innerHTML).
Lesson 09: MCP Integration
What It Teaches: How to integrate external MCP servers for standardized tool access. Covers GitHub MCP and ESLint MCP configuration and usage.
Demo Scenario: Build a GitHub file summarizer that uses the GitHub MCP server to fetch file contents from repositories and provide summaries.
Exercise Scenario: Build a code quality reviewer that uses the ESLint MCP server to analyze JavaScript files and provide detailed quality reports with issue categories and recommendations.
Lesson 10: Multi-Agent Orchestration
What It Teaches: How to coordinate multiple specialized subagents using the agents parameter in query(). The orchestrator uses Task in allowedTools to invoke subagents. Each subagent has its own description, prompt, tools, and model.
Demo Scenario: A research assistant coordinates three specialists: Researcher (gathers information via web search), Analyzer (finds patterns in data), and Summarizer (creates final reports). The orchestrator delegates tasks sequentially.
Exercise Scenario: A B2B SaaS sales team receives 200+ leads weekly. Build a sales qualifier that coordinates Company Researcher (gathers intelligence), Competitive Analyzer (compares solutions), and Qualification Scorer (assesses BANT criteria). Returns structured sales briefings with recommendations and talking points