← ClaudeAtlas

code-strandslisted

Best practices for the AWS Strands Agents SDK — structuring prompts, multi-agent patterns, structured I/O, and splitting monolithic agents into specialists. Use when designing or refactoring Strands-based agent systems.
tstapler/dotfiles · ★ 8 · DevOps & Infrastructure · score 59
Install: claude install-skill tstapler/dotfiles
# Strands Agents SDK Best Practices > For prompt design for Strands system prompts and tool descriptions, apply the `meta-prompt-engineering` skill. ## Core Philosophy Strands is **model-driven**: agents decide what to do, tools define what's possible. Keep system prompts focused on a single domain of expertise. Fat prompts become brittle; specialists compose cleanly. ## `@tool` Decorator — How It Works Strands builds the LLM tool spec from your function signature automatically: ```python from strands import tool @tool def analyze_incident(incident_key: str, severity: str, days_back: int = 30) -> str: """Analyze a BTS incident and return classification recommendations. Args: incident_key: Jira ticket ID (e.g. BTS-12345) severity: P1, P2, P3, or P4 days_back: Days back for comparison window """ ... ``` - **First docstring paragraph** → tool description shown to the LLM (make it precise — this is the routing signal) - **`Args:` section** → per-parameter descriptions in the tool spec - **Type annotations** → JSON Schema types - **Default values** → optional parameters Override name/description or provide a full custom schema (e.g. for enums): ```python @tool(name="get_weather", description="Retrieves weather forecast") def weather_forecast(...): ... @tool(inputSchema={"json": {"type": "object", "properties": {"shape": {"type": "string", "enum": ["circle", "rectangle"]}}, "required": ["shape"]}}) def calculate_area(shape: str):