library(artclaude)
# List pre-built skills
claude_skill_list(type = "prebuilt")
# skill_id name type
# 1 pptx PowerPoint prebuilt
# 2 xlsx Excel prebuilt
# 3 docx Word prebuilt
# 4 pdf PDF prebuiltOverview
Agent Skills are pre-packaged capabilities that extend Claude’s abilities for specialized tasks. This vignette covers:
- Pre-built skills: PowerPoint, Excel, Word, PDF
- Local skills: Load from filesystem
- Uploaded skills: Persist on Anthropic servers
- Custom skills: Create your own
Pre-Built Skills
Anthropic provides 4 pre-built skills for document processing:
PowerPoint Skill
Create and modify PowerPoint presentations:
chat <- claude_new(
skills = list(claude_skill("pptx")),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Create a presentation about R package development with 5 slides:
1. Title slide
2. Why R packages
3. Package structure
4. Documentation with roxygen2
5. Testing with testthat")Excel Skill
Create and modify Excel spreadsheets:
chat <- claude_new(
skills = list(claude_skill("xlsx")),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Create an Excel file with:
- Sheet 1: Monthly sales data for 2024
- Sheet 2: Pivot table summarizing by quarter
- Sheet 3: Chart showing trend")Word Skill
Create and modify Word documents:
chat <- claude_new(
skills = list(claude_skill("docx")),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Create a Word document: Technical Specification for API v2.0
Include: Overview, Endpoints, Authentication, Rate Limits, Examples")PDF Skill
Extract and process PDF content:
chat <- claude_new(
skills = list(claude_skill("pdf")),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
# Upload PDF via Files API
file <- claude_file_upload("annual_report.pdf")
chat$chat(
claude_file_content(file$id),
"Extract all financial tables from this PDF"
)Local Skills
Creating a Skill
Skills follow the agentskills.io specification:
my_skill/
+-- SKILL.md # Required: YAML frontmatter + instructions
+-- templates/ # Optional: template files
+-- scripts/ # Optional: helper scripts
SKILL.md format:
---
name: greeting
description: Greet users professionally
---
Always greet users with "Welcome to Artalytics!" followed by
a brief introduction to the platform's capabilities.Using Local Skills
library(artclaude)
# Create skill directory
skill_dir <- tempfile("skill_")
fs::dir_create(skill_dir)
writeLines(c(
"---",
"name: greeting",
"description: Greet users professionally",
"---",
"",
"Always greet users with 'Welcome to Artalytics!'",
"followed by a brief introduction."
), fs::path(skill_dir, "SKILL.md"))
# Load and use
chat <- claude_new(
skills = list(claude_skill_local(skill_dir)),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Please greet me")Skills with Resources
Add template files and scripts:
skill_dir <- "~/skills/report_generator"
fs::dir_create(fs::path(skill_dir, "templates"))
# Main skill file
writeLines(c(
"---",
"name: report_generator",
"description: Generate formatted reports",
"---",
"",
"Use the template in templates/report.md to create reports.",
"Follow the structure and formatting guidelines."
), fs::path(skill_dir, "SKILL.md"))
# Template file
writeLines(c(
"# {title}",
"",
"## Executive Summary",
"{summary}",
"",
"## Findings",
"{findings}"
), fs::path(skill_dir, "templates", "report.md"))
# Use skill
chat <- claude_new(
skills = list(claude_skill_local(skill_dir)),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Create a report about Q4 sales using the template")Uploaded Skills
Upload for Persistent Use
Upload skills to Anthropic’s servers:
# Create skill
skill_dir <- tempfile("skill_")
fs::dir_create(skill_dir)
writeLines(c(
"---",
"name: code_reviewer",
"description: Review R code for best practices",
"---",
"",
"Review R code for:",
"- Proper use of data.table",
"- Native pipe usage",
"- Package qualification (pkg::function)",
"- Documentation completeness"
), fs::path(skill_dir, "SKILL.md"))
# Upload
result <- claude_skill_upload(skill_dir)
result$skill_id # "skill_abc123..."
# Use in future sessions
chat <- claude_new(
skills = list(claude_skill(result$skill_id)),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Review this function: get_data <- function() { ... }")Listing Skills
# List all skills
all_skills <- claude_skill_list(type = "all")
# List only pre-built
prebuilt <- claude_skill_list(type = "prebuilt")
# List only uploaded
uploaded <- claude_skill_list(type = "uploaded")Skill Design Best Practices
Clear Instructions
# Good: Specific, actionable
"When analyzing code:
1. Check for data.table usage
2. Verify pipe is native |>
3. Ensure external calls use pkg::function()
4. Confirm roxygen docs are complete"
# Not ideal: Vague
"Review code for quality"Contextual Information
Provide context that helps Claude succeed:
---
name: art_evaluator
description: Evaluate artwork descriptions
---
You are an art expert specializing in Impressionist and Post-Impressionist
movements. When evaluating artwork descriptions:
1. Verify historical accuracy
2. Check artist attribution
3. Assess style classification
4. Validate date ranges
5. Review medium/technique descriptions
Reference established art history sources and note any discrepancies.Resource Organization
artwork_skill/
+-- SKILL.md
+-- templates/
| +-- evaluation_template.md
| +-- report_template.md
+-- reference/
| +-- impressionist_artists.csv
| +-- movement_timeline.json
Use Cases
Domain-Specific Agent
# Art curation assistant
art_skill <- claude_skill_local("~/skills/art_curator")
chat <- claude_new(
skills = list(art_skill),
tools = list(claude_code_exec(), claude_web_search()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Curate a collection of Impressionist works from 1870-1890")Workflow Automation
# Document processing pipeline
skills <- list(
claude_skill("pdf"),
claude_skill("xlsx"),
claude_skill("pptx")
)
chat <- claude_new(
skills = skills,
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Extract data from report.pdf, create Excel summary, generate PowerPoint")Limits
- Maximum 8 skills per request
- Skills require code execution tool
- Skills require appropriate beta headers
API Reference
Skills Guide: https://platform.claude.com/docs/en/build-with-claude/skills-guide
Related Functions
-
claude_skill(): Reference skill by ID -
claude_skill_local(): Load from local directory -
claude_skill_upload(): Upload to API -
claude_skill_list(): List available skills -
claude_new(): Create chat with skills
