3.2 KiB
Implémentation des commandes
| ← Retour à Claude Code Best Practice |
La commande weather orchestrator est implémentée dans ce repo comme point d'entrée du pattern d'architecture Command → Agent → Skill, démontrant comment les commandes orchestrent des workflows multi-étapes.
Weather Orchestrator
Fichier : .claude/commands/weather-orchestrator.md
---
description: Fetch weather data for Dubai and create an SVG weather card
model: haiku
---
# Weather Orchestrator Command
Fetch the current temperature for Dubai, UAE and create a visual SVG weather card.
## Workflow
### Step 1: Ask User Preference
Use the AskUserQuestion tool to ask the user whether they want the temperature
in Celsius or Fahrenheit.
### Step 2: Fetch Weather Data
Use the Agent tool to invoke the weather agent:
- subagent_type: weather-agent
- prompt: Fetch the current temperature for Dubai, UAE in [unit]...
### Step 3: Create SVG Weather Card
Use the Skill tool to invoke the weather-svg-creator skill:
- skill: weather-svg-creator
...
La commande orchestre l'ensemble du workflow : elle demande à l'utilisateur sa préférence d'unité de température, invoque le weather-agent via l'outil Agent, puis invoque le skill weather-svg-creator via l'outil Skill.
$ claude
> /weather-orchestrator
Demande à Claude d'en créer une pour toi — il génère le fichier markdown avec frontmatter YAML et corps dans .claude/commands/<name>.md
Le weather orchestrator est la Command dans le pattern d'orchestration Command → Agent → Skill. Il sert de point d'entrée — gérant l'interaction utilisateur (préférence d'unité de température), déléguant la récupération des données au weather-agent, et invoquant le skill weather-svg-creator pour la sortie visuelle.
| Composant | Rôle | Dans ce repo |
|---|---|---|
| Command | Point d'entrée, interaction utilisateur | /weather-orchestrator |
| Agent | Récupère les données avec un skill préchargé (skill d'agent) | weather-agent avec weather-fetcher |
| Skill | Crée la sortie indépendamment (skill) | weather-svg-creator |