> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Agent Skills

> Create and download PowerPoint, Excel, Word, and PDF files with Claude Agent Skills.

Pass a Skill configuration to `Claude`, then download generated files from Anthropic's Files API.

## Code

```python skills.py theme={null}
from pathlib import Path
from typing import Any, Dict, List, Optional

from agno.agent import Agent
from agno.models.anthropic import Claude
from anthropic import Anthropic


def extract_generated_file_ids(
    provider_data: Optional[Dict[str, Any]],
) -> List[str]:
    provider_data = provider_data or {}
    file_ids = []

    for file_id in provider_data.get("file_ids", []):
        if isinstance(file_id, str) and file_id not in file_ids:
            file_ids.append(file_id)

    def collect(value: Any) -> None:
        if isinstance(value, dict):
            if value.get("type") in {
                "code_execution_output",
                "bash_code_execution_output",
            }:
                file_id = value.get("file_id")
                if isinstance(file_id, str) and file_id not in file_ids:
                    file_ids.append(file_id)
            for nested_value in value.values():
                collect(nested_value)
        elif isinstance(value, list):
            for nested_value in value:
                collect(nested_value)

    collect(provider_data.get("server_tool_blocks", []))
    return file_ids


def download_generated_files(file_ids: List[str]) -> None:
    client = Anthropic()

    for file_id in file_ids:
        metadata = client.beta.files.retrieve_metadata(file_id=file_id)
        output_path = Path(metadata.filename).name
        client.beta.files.download(file_id=file_id).write_to_file(output_path)
        print(f"Downloaded {output_path}")


agent = Agent(
    model=Claude(
        id="claude-sonnet-4-6",
        skills=[{"type": "anthropic", "skill_id": "pptx", "version": "latest"}],
    ),
    instructions="Create concise, well-structured presentations.",
)

if __name__ == "__main__":
    run = agent.run("Create a three-slide presentation about renewable energy.")
    file_ids = extract_generated_file_ids(run.model_provider_data)

    if not file_ids:
        raise RuntimeError("Claude did not return a generated file.")

    download_generated_files(file_ids)
```

Agno 2.7.2 adds the Skills container, the `code_execution_20250825` server tool, and the `code-execution-2025-08-25` and `skills-2025-10-02` beta values when `skills` is set. Anthropic now treats that code execution version as generally available, but still accepts its legacy beta value. Agno copies IDs from Bash execution results to `model_provider_data["file_ids"]` and preserves Python execution results in `model_provider_data["server_tool_blocks"]`. `extract_generated_file_ids()` handles both result shapes. Anthropic's Python SDK adds the Files API beta header when you call `client.beta.files`.

## Pre-Built Skills

| Skill ID | Capability                                                       |
| -------- | ---------------------------------------------------------------- |
| `pptx`   | Create and edit presentations and analyze presentation content   |
| `xlsx`   | Create and analyze spreadsheets and generate reports with charts |
| `docx`   | Create and edit Word documents and format text                   |
| `pdf`    | Generate formatted PDF documents and reports                     |

Use up to eight Skills in one Messages API request. Each configuration takes `type`, `skill_id`, and an optional `version`. Use `type="custom"` with the `skill_*` ID for a Skill uploaded to your Anthropic workspace.

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[anthropic]"
    ```
  </Step>

  <Step title="Export your Anthropic API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export ANTHROPIC_API_KEY="your_anthropic_api_key_here"
      ```

      ```powershell Windows theme={null}
      $Env:ANTHROPIC_API_KEY="your_anthropic_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the agent">
    Save the code above as `skills.py`, then run:

    ```bash theme={null}
    python skills.py
    ```
  </Step>
</Steps>

## Constraints

* Skills run in an isolated Anthropic container without network access or runtime package installation.
* Generated files remain in Anthropic's environment until you download them. The Files API permits downloads only for files generated by Skills or code execution.
* Anthropic can return `pause_turn` for a long-running Skill. Agno 2.7.2 drops that stop reason. Keep this one-shot example to short generation tasks, and use Anthropic's native SDK when the operation requires pause continuation.
* The Files API is beta. Skills and the Files API are available through the Claude API, Claude Platform on AWS, and Microsoft Foundry deployments hosted by Anthropic. They are unavailable through Amazon Bedrock and Google Cloud Vertex AI.
* Skill-generated `.pptx`, `.xlsx`, `.docx`, and `.pdf` files are outputs. Office binary inputs require a code-execution container upload or conversion to text or PDF instead of a Messages API `document` block.

## Developer Resources

* [Anthropic provider overview](/models/providers/native/anthropic/overview)
* [Anthropic Agent Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)
* [Use Agent Skills with the API](https://platform.claude.com/docs/en/build-with-claude/skills-guide)
* [Anthropic Files API](https://platform.claude.com/docs/en/build-with-claude/files)
