Claude Platform Docs
Messages스킬

API에서 Agent Skills 시작하기

Agent Skills를 사용하여 Claude API로 10분 이내에 문서를 생성하는 방법을 알아보세요.

이 튜토리얼에서는 Agent Skills를 사용하여 PowerPoint 프레젠테이션을 만드는 방법을 보여줍니다. Skills를 활성화하고, 요청을 보내고, 생성된 파일에 접근하는 방법을 배우게 됩니다.

사전 요구 사항

Agent Skills 개요

사전 구축된 Agent Skills는 문서 생성, 데이터 분석, 파일 처리와 같은 작업을 위한 전문 지식으로 Claude의 기능을 확장합니다. Anthropic은 API에서 다음과 같은 사전 구축된 Agent Skills를 제공합니다:

  • PowerPoint (pptx): 프레젠테이션 생성 및 편집
  • Excel (xlsx): 스프레드시트 생성 및 분석
  • Word (docx): 문서 생성 및 편집
  • PDF (pdf): PDF 문서 생성

1단계: 사용 가능한 Skills 나열하기

먼저 어떤 Skills를 사용할 수 있는지 확인합니다. Skills API를 사용하여 Anthropic이 관리하는 모든 Skills를 나열하세요. 각 언어 탭은 하나의 연속된 스크립트에서 발췌한 것이며, import 및 클라이언트 설정은 맨 위에 있습니다:

# Anthropic 관리 스킬 목록 조회
ant skills list --source anthropic

다음과 같은 Skills가 표시됩니다: pptx, xlsx, docx, pdf.

이 API는 각 Skill의 메타데이터, 즉 이름과 설명을 반환합니다. Claude는 시작 시 이 메타데이터를 로드하여 어떤 Skills를 사용할 수 있는지 판단합니다. 이것이 progressive disclosure(점진적 공개)의 첫 번째 단계로, Claude가 아직 전체 지침을 로드하지 않은 채 Skills를 발견하는 단계입니다.

2단계: 프레젠테이션 만들기

PowerPoint Skill을 사용하여 재생 에너지에 관한 프레젠테이션을 만듭니다. Messages API의 container 파라미터를 사용하여 Skills를 지정하세요:

# PowerPoint Skill로 메시지 생성
response = client.messages.create(
    model="claude-opus-5",
    max_tokens=16000,
    container={
        "skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]
    },
    messages=[
        {
            "role": "user",
            "content": "Create a presentation about renewable energy with 5 slides",
        }
    ],
    tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)

print(f"stop_reason={response.stop_reason}, blocks={len(response.content)}")

요청에는 다음과 같은 부분이 포함됩니다:

  • model: 코드 실행 도구를 지원하는 모델
  • container.skills: Claude가 사용할 수 있는 Skills를 지정
  • type: "anthropic": Anthropic이 관리하는 Skill임을 나타냄
  • skill_id: "pptx": PowerPoint Skill 식별자
  • version: "latest": 가장 최근에 게시된 버전으로 설정된 Skill 버전
  • tools: 코드 실행 활성화(Skills에 필수)

이 요청을 보내면 Claude는 자동으로 작업을 관련 Skill과 매칭합니다. 프레젠테이션을 요청했으므로 Claude는 PowerPoint Skill이 관련 있다고 판단하고 전체 지침을 로드합니다. 이것이 점진적 공개의 두 번째 단계입니다. 그런 다음 Claude는 Skill의 코드를 실행하여 프레젠테이션을 생성합니다.

3단계: 생성된 파일 다운로드하기

프레젠테이션은 코드 실행 컨테이너에서 생성되어 파일로 저장되었습니다. 2단계의 response에는 파일 ID가 포함된 파일 참조가 들어 있습니다. 파일 ID를 추출하고 Files API로 파일을 다운로드하세요. 예제에서는 시스템 임시 디렉터리에 저장합니다:

# 파일 ID를 추출합니다. 코드 실행 도구는 Skill의 코드를
# Bash 하위 도구로 실행하며, 생성된 파일은 bash_code_execution_tool_result 블록 내의
# bash_code_execution_output 항목으로 나타납니다.
file_id = None
for block in response.content:
    if block.type == "bash_code_execution_tool_result":
        if block.content.type == "bash_code_execution_result":
            for output in block.content.content:
                file_id = output.file_id

if file_id:
    # 파일을 다운로드하여 저장합니다
    output_path = Path(tempfile.gettempdir()) / "renewable_energy.pptx"
    file_content = client.files.download(file_id=file_id)
    file_content.write_to_file(output_path)
    print(f"Presentation saved to {output_path}")

더 많은 예제 시도하기

다음 변형을 시도해 보세요:

스프레드시트 만들기

response = client.messages.create(
    model="claude-opus-5",
    max_tokens=16000,
    container={
        "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
    },
    messages=[
        {
            "role": "user",
            "content": "Create a quarterly sales tracking spreadsheet with sample data",
        }
    ],
    tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)

Word 문서 만들기

response = client.messages.create(
    model="claude-opus-5",
    max_tokens=16000,
    container={
        "skills": [{"type": "anthropic", "skill_id": "docx", "version": "latest"}]
    },
    messages=[
        {
            "role": "user",
            "content": "Write a 2-page report on the benefits of renewable energy",
        }
    ],
    tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)

PDF 생성하기

response = client.messages.create(
    model="claude-opus-5",
    max_tokens=16000,
    container={
        "skills": [{"type": "anthropic", "skill_id": "pdf", "version": "latest"}]
    },
    messages=[
        {
            "role": "user",
            "content": "Generate a PDF invoice template",
        }
    ],
    tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
)

다음 단계

Claude가 발견하고 성공적으로 사용할 수 있는 효과적인 Skills를 작성하는 방법을 알아보세요.

Agent Skills를 사용하여 API를 통해 Claude의 기능을 확장하는 방법을 알아보세요.

전문 작업을 위한 자체 Skills를 업로드하세요.

Claude Code의 Skills에 대해 알아보세요.

예제 Skills와 구현 패턴을 살펴보세요.

Was this page helpful?