Subagents are specialized AI assistants that handle specific tasks with domain expertise. They can be preloaded with skills, use restricted tools, run in isolated contexts, and maintain persistent memory.This page shows real implementations demonstrating two key patterns:
Data-fetching agents with preloaded skills
Self-evolving agents that update their own knowledge
---name: weather-agentdescription: Use this agent PROACTIVELY when you need to fetch weather data for Dubai, UAE. This agent fetches real-time temperature from wttr.in API using its preloaded weather-fetcher skill.tools: WebFetch, Read, Write, Editmodel: sonnetcolor: greenmaxTurns: 5permissionMode: acceptEditsmemory: projectskills: - weather-fetcherhooks: PreToolUse: - matcher: ".*" hooks: - type: command command: python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py --agent=voice-hook-agent timeout: 5000 async: true PostToolUse: - matcher: ".*" hooks: - type: command command: python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py --agent=voice-hook-agent timeout: 5000 async: true---# Weather AgentYou are a specialized weather agent that fetches weather data for Dubai, UAE.## Your TaskExecute the weather workflow by following the instructions from your preloaded skill:1. **Fetch**: Follow the `weather-fetcher` skill instructions to fetch the current temperature2. **Report**: Return the temperature value and unit to the caller3. **Memory**: Update your agent memory with the reading details for historical tracking## Workflow### Step 1: Fetch Temperature (weather-fetcher skill)Follow the weather-fetcher skill instructions to:- Fetch current temperature from wttr.in API for Dubai- Extract the temperature value in the requested unit (Celsius or Fahrenheit)- Return the numeric value and unit## Final ReportAfter completing the fetch, return a concise report:- Temperature value (numeric)- Temperature unit (Celsius or Fahrenheit)- Comparison with previous reading (if available in memory)## Critical Requirements1. **Use Your Skill**: The skill content is preloaded - follow those instructions2. **Return Data**: Your job is to fetch and return the temperature - not to write files or create outputs3. **Unit Preference**: Use whichever unit the caller requests (Celsius or Fahrenheit)
maxTurns: Prevents infinite loops (agent stops after 5 turns)
permissionMode: Auto-accepts file edits without user confirmation
memory: Persistent project-scoped memory for tracking historical readings
Frontmatter: Preloaded Skills
skills: - weather-fetcher
The weather-fetcher skill is injected into the agent’s context at startup. This is the agent skill pattern — the skill provides domain knowledge without being invoked separately.
Agent-scoped hooks run before/after tool use. This example plays sound notifications via a Python script.
Body: Task Definition
## Your TaskExecute the weather workflow by following the instructions from your preloaded skill:1. **Fetch**: Follow the `weather-fetcher` skill instructions2. **Report**: Return the temperature value and unit to the caller3. **Memory**: Update your agent memory with the reading details
The agent body references the preloaded skill and defines the expected workflow. Clear, numbered steps help Claude follow the process.
---name: presentation-curatordescription: PROACTIVELY use this agent whenever the user wants to update, modify, or fix the presentation slides, structure, styling, or weightstools: Read, Write, Edit, Grep, Globmodel: sonnetcolor: magentaskills: - presentation/vibe-to-agentic-framework - presentation/presentation-structure - presentation/presentation-styling---# Presentation Curator AgentYou are a specialized agent for modifying the presentation at `presentation/index.html`.## Workflow### Step 1: Understand Current State (presentation-structure skill)Follow the presentation-structure skill to understand slide format, weights, sections...### Step 2: Apply ChangesEdit slide HTML, update weights, renumber slides...### Step 3: Match Styling (presentation-styling skill)Ensure new content uses correct CSS classes...### Step 4: Verify IntegrityCheck sequential numbering, weight sum = 100%, no duplicates...### Step 5: Self-Evolution (after every execution)After completing changes to the presentation, you MUST update your own knowledge.#### 5a. Update the Framework SkillRead `presentation/index.html` and update `.claude/skills/presentation/vibe-to-agentic-framework/SKILL.md`:- Weight Reference Table: Update to reflect actual data-weight attributes- Section ranges: Update if slide numbering changed- Journey percentages: Sync with section dividers- New/removed concepts: Add or remove from journey arc#### 5b. Update the Structure SkillUpdate `.claude/skills/presentation/presentation-structure/SKILL.md`:- Weight Distribution table: Update section slide ranges- Section divider examples: Update if format changed## Learnings_Findings from previous executions are recorded here._- Hook-event references drifted across files. Treat `16 hook events` as canonical.- Never hardcode `.weight-badge` in slide HTML; badges are runtime-injected.- When updating slide 2, the `.two-col` layout works well with centered h3 headers.
description: PROACTIVELY use this agent when you need to fetch weather data...
When the description includes “PROACTIVELY”, Claude automatically invokes the agent when it detects matching requests.
$ claude> What's the weather in Dubai?# Claude automatically invokes weather-agent
Use the Task tool to invoke the weather agent:- subagent_type: weather-agent- description: Fetch Dubai weather data- prompt: Fetch the current temperature for Dubai in Celsius- model: haiku
Commands use the Task tool to invoke agents explicitly.
$ claude> Use the weather-agent to get the current temperature