퀵스타트
Claude Agent Skills와 API로 문서를 만듭니다.
Agent Skills를 사용해 Claude API로 10분 안에 문서를 만드는 방법을 배웁니다.
이 튜토리얼에서는 Agent Skills를 사용해 PowerPoint 프레젠테이션을 만듭니다. Skills를 활성화하는 방법, 간단한 요청을 보내는 방법, 생성된 파일에 접근하는 방법을 배웁니다.
전제 조건
- Anthropic API 키
- Python 3.7 이상 또는 curl 설치
- API 요청에 대한 기본 이해
Agent Skills란?
사전 구축 Agent Skills는 문서 작성, 데이터 분석, 파일 처리 같은 작업을 위한 전문 지식으로 Claude의 능력을 확장합니다. Anthropic은 API에서 다음 사전 구축 Agent Skills를 제공합니다.
- PowerPoint (pptx): 프레젠테이션 생성 및 편집
- Excel (xlsx): 스프레드시트 생성 및 분석
- Word (docx): 문서 생성 및 편집
- PDF (pdf): PDF 문서 생성
Note
커스텀 Skills를 만들고 싶나요? 도메인별 전문성을 담은 직접 만든 Skills 예시는 Agent Skills Cookbook을 참조하세요.
1단계: 사용 가능한 Skills 나열하기
먼저 어떤 Skills를 사용할 수 있는지 확인합니다. Skills API로 Anthropic이 관리하는 모든 Skills를 나열합니다.
import anthropic
client = anthropic.Anthropic()
# Anthropic이 관리하는 Skills 나열
skills = client.beta.skills.list(
source="anthropic",
betas=["skills-2025-10-02"]
)
for skill in skills.data:
print(f"{skill.id}: {skill.display_title}")import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic();
// Anthropic이 관리하는 Skills 나열
const skills = await client.beta.skills.list({
source: 'anthropic',
betas: ['skills-2025-10-02']
});
for (const skill of skills.data) {
console.log(`${skill.id}: ${skill.display_title}`);
}curl "https://api.anthropic.com/v1/skills?source=anthropic" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02"다음 Skills가 표시됩니다: pptx, xlsx, docx, pdf.
이 API는 각 Skill의 메타데이터, 즉 이름과 설명을 반환합니다. Claude는 시작 시 이 메타데이터를 로드해 어떤 Skills를 사용할 수 있는지 압니다. 이것이 점진적 공개의 첫 번째 수준입니다. Claude는 아직 전체 지침을 로드하지 않고, 어떤 Skills가 있는지만 발견합니다.
2단계: 프레젠테이션 만들기
이제 PowerPoint Skill을 사용해 재생 에너지에 관한 프레젠테이션을 만듭니다. Messages API의 container 파라미터로 Skills를 지정합니다.
import anthropic
client = anthropic.Anthropic()
# PowerPoint Skill을 사용해 메시지 생성
response = client.beta.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=4096,
betas=["code-execution-2025-08-25", "skills-2025-10-02"],
container={
"skills": [
{
"type": "anthropic",
"skill_id": "pptx",
"version": "latest"
}
]
},
messages=[{
"role": "user",
"content": "재생 에너지에 대한 5장짜리 프레젠테이션을 만들어 주세요"
}],
tools=[{
"type": "code_execution_20250825",
"name": "code_execution"
}]
)
print(response.content)import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic();
// PowerPoint Skill을 사용해 메시지 생성
const response = await client.beta.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 4096,
betas: ['code-execution-2025-08-25', 'skills-2025-10-02'],
container: {
skills: [
{
type: 'anthropic',
skill_id: 'pptx',
version: 'latest'
}
]
},
messages: [{
role: 'user',
content: '재생 에너지에 대한 5장짜리 프레젠테이션을 만들어 주세요'
}],
tools: [{
type: 'code_execution_20250825',
name: 'code_execution'
}]
});
console.log(response.content);curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 4096,
"container": {
"skills": [
{
"type": "anthropic",
"skill_id": "pptx",
"version": "latest"
}
]
},
"messages": [{
"role": "user",
"content": "재생 에너지에 대한 5장짜리 프레젠테이션을 만들어 주세요"
}],
"tools": [{
"type": "code_execution_20250825",
"name": "code_execution"
}]
}'각 부분이 하는 일을 살펴보겠습니다.
container.skills: Claude가 사용할 수 있는 Skills를 지정합니다type: "anthropic": Anthropic이 관리하는 Skill임을 나타냅니다skill_id: "pptx": PowerPoint Skill 식별자입니다version: "latest": Skill 버전을 가장 최근에 게시된 버전으로 설정합니다tools: 코드 실행을 활성화합니다. Skills에 필요합니다- Beta headers:
code-execution-2025-08-25와skills-2025-10-02
이 요청을 보내면 Claude는 작업과 관련 있는 Skill을 자동으로 찾아냅니다. 프레젠테이션을 요청했으므로 Claude는 PowerPoint Skill이 관련 있다고 판단하고 전체 지침을 로드합니다. 이것이 점진적 공개의 두 번째 수준입니다. 그런 다음 Claude는 Skill의 코드를 실행해 프레젠테이션을 만듭니다.
3단계: 생성된 파일 다운로드하기
프레젠테이션은 코드 실행 컨테이너 안에서 생성되어 파일로 저장됩니다. 응답에는 파일 ID가 포함된 파일 참조가 들어 있습니다. 파일 ID를 추출하고 Files API로 다운로드합니다.
# 응답에서 파일 ID 추출
file_id = None
for block in response.content:
if block.type == 'tool_use' and block.name == 'code_execution':
# 파일 ID는 도구 결과 안에 있음
for result_block in block.content:
if hasattr(result_block, 'file_id'):
file_id = result_block.file_id
break
if file_id:
# 파일 다운로드
file_content = client.beta.files.download(
file_id=file_id,
betas=["files-api-2025-04-14"]
)
# 디스크에 저장
with open("renewable_energy.pptx", "wb") as f:
file_content.write_to_file(f.name)
print(f"프레젠테이션이 renewable_energy.pptx에 저장되었습니다")// 응답에서 파일 ID 추출
let fileId: string | null = null;
for (const block of response.content) {
if (block.type === 'tool_use' && block.name === 'code_execution') {
// 파일 ID는 도구 결과 안에 있음
for (const resultBlock of block.content) {
if ('file_id' in resultBlock) {
fileId = resultBlock.file_id;
break;
}
}
}
}
if (fileId) {
// 파일 다운로드
const fileContent = await client.beta.files.download(fileId, {
betas: ['files-api-2025-04-14']
});
// 디스크에 저장
const fs = require('fs');
fs.writeFileSync('renewable_energy.pptx', Buffer.from(await fileContent.arrayBuffer()));
console.log('프레젠테이션이 renewable_energy.pptx에 저장되었습니다');
}# 응답에서 file_id 추출 (jq 사용)
FILE_ID=$(echo "$RESPONSE" | jq -r '.content[] | select(.type=="tool_use" and .name=="code_execution") | .content[] | select(.file_id) | .file_id')
# 파일 다운로드
curl "https://api.anthropic.com/v1/files/$FILE_ID/content" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: files-api-2025-04-14" \
--output renewable_energy.pptx
echo "프레젠테이션이 renewable_energy.pptx에 저장되었습니다"Note
생성된 파일을 다루는 전체 세부 정보는 코드 실행 도구 문서를 참조하세요.
더 많은 예제 시도하기
Skills로 첫 문서를 만들었으니 다음 변형도 시도해 보세요.
스프레드시트 만들기
response = client.beta.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=4096,
betas=["code-execution-2025-08-25", "skills-2025-10-02"],
container={
"skills": [
{
"type": "anthropic",
"skill_id": "xlsx",
"version": "latest"
}
]
},
messages=[{
"role": "user",
"content": "샘플 데이터가 포함된 분기별 매출 추적 스프레드시트를 만들어 주세요"
}],
tools=[{
"type": "code_execution_20250825",
"name": "code_execution"
}]
)const response = await client.beta.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 4096,
betas: ['code-execution-2025-08-25', 'skills-2025-10-02'],
container: {
skills: [
{
type: 'anthropic',
skill_id: 'xlsx',
version: 'latest'
}
]
},
messages: [{
role: 'user',
content: '샘플 데이터가 포함된 분기별 매출 추적 스프레드시트를 만들어 주세요'
}],
tools: [{
type: 'code_execution_20250825',
name: 'code_execution'
}]
});curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 4096,
"container": {
"skills": [
{
"type": "anthropic",
"skill_id": "xlsx",
"version": "latest"
}
]
},
"messages": [{
"role": "user",
"content": "샘플 데이터가 포함된 분기별 매출 추적 스프레드시트를 만들어 주세요"
}],
"tools": [{
"type": "code_execution_20250825",
"name": "code_execution"
}]
}'Word 문서 만들기
response = client.beta.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=4096,
betas=["code-execution-2025-08-25", "skills-2025-10-02"],
container={
"skills": [
{
"type": "anthropic",
"skill_id": "docx",
"version": "latest"
}
]
},
messages=[{
"role": "user",
"content": "재생 에너지의 이점에 대한 2쪽짜리 보고서를 작성해 주세요"
}],
tools=[{
"type": "code_execution_20250825",
"name": "code_execution"
}]
)const response = await client.beta.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 4096,
betas: ['code-execution-2025-08-25', 'skills-2025-10-02'],
container: {
skills: [
{
type: 'anthropic',
skill_id: 'docx',
version: 'latest'
}
]
},
messages: [{
role: 'user',
content: '재생 에너지의 이점에 대한 2쪽짜리 보고서를 작성해 주세요'
}],
tools: [{
type: 'code_execution_20250825',
name: 'code_execution'
}]
});curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 4096,
"container": {
"skills": [
{
"type": "anthropic",
"skill_id": "docx",
"version": "latest"
}
]
},
"messages": [{
"role": "user",
"content": "재생 에너지의 이점에 대한 2쪽짜리 보고서를 작성해 주세요"
}],
"tools": [{
"type": "code_execution_20250825",
"name": "code_execution"
}]
}'PDF 생성하기
response = client.beta.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=4096,
betas=["code-execution-2025-08-25", "skills-2025-10-02"],
container={
"skills": [
{
"type": "anthropic",
"skill_id": "pdf",
"version": "latest"
}
]
},
messages=[{
"role": "user",
"content": "PDF 인보이스 템플릿을 생성해 주세요"
}],
tools=[{
"type": "code_execution_20250825",
"name": "code_execution"
}]
)const response = await client.beta.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 4096,
betas: ['code-execution-2025-08-25', 'skills-2025-10-02'],
container: {
skills: [
{
type: 'anthropic',
skill_id: 'pdf',
version: 'latest'
}
]
},
messages: [{
role: 'user',
content: 'PDF 인보이스 템플릿을 생성해 주세요'
}],
tools: [{
type: 'code_execution_20250825',
name: 'code_execution'
}]
});curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 4096,
"container": {
"skills": [
{
"type": "anthropic",
"skill_id": "pdf",
"version": "latest"
}
]
},
"messages": [{
"role": "user",
"content": "PDF 인보이스 템플릿을 생성해 주세요"
}],
"tools": [{
"type": "code_execution_20250825",
"name": "code_execution"
}]
}'다음 단계
사전 구축 Agent Skills를 사용해 보았으므로 다음을 할 수 있습니다.
클로데스킬스 문서