Files
claude-code-best-practice/implementation/claude-subagents-implementation.md
T
2026-02-28 20:00:34 +05:00

2.8 KiB

Sub-agents Implementation

Last Updated

← Back to Claude Code Best Practice Claude

Implemented

The weather agent is implemented in this repo as an example of the Command → Agent → Skills architecture pattern.


Weather Agent

File: .claude/agents/weather.md

---
name: weather
description: Use this agent PROACTIVELY when you need to fetch and transform
  weather data for Karachi, Pakistan. This agent fetches real-time temperature
  from wttr.in API and applies transformation rules from
  weather-orchestration/input.md, writing results to
  weather-orchestration/output.md.
tools: WebFetch, Read, Write
model: sonnet
color: green
memory: project
skills:
  - weather-fetcher
  - weather-transformer
---

# Weather Agent

You are a specialized weather agent that fetches and transforms weather data
for Karachi, Pakistan.

## Your Task

Execute the weather workflow by following the instructions from your preloaded
skills sequentially:

1. **First**: Follow the `weather-fetcher` skill instructions to fetch the
   current temperature
2. **Then**: Follow the `weather-transformer` skill instructions to apply
   transformations and write results
3. **Finally**: Update your agent memory with the reading details for
   historical tracking

...

The agent has two skills preloaded (weather-fetcher and weather-transformer) that provide step-by-step instructions for fetching from the wttr.in API and applying transformation rules.


How to Use

$ claude
> What is the weather in Karachi?

Orchestration Workflow

The weather agent is the Agent in the Command → Agent → Skills orchestration pattern. It receives the workflow from the /weather-orchestrator command and executes it using two preloaded skills (weather-fetcher, weather-transformer) within a single execution context.

Command Skill Agent Architecture Flow

Component Role This Repo
Command Entry point, user interaction /weather-orchestrator
Agent Orchestrates workflow with preloaded skills weather agent
Skills Domain knowledge injected at startup weather-fetcher, weather-transformer