What Claude Skills are and why you need them
Claude Skills are modular instruction packages that teach Claude to perform specific tasks at a professional level. Each Skill is a folder containing a SKILL.md file with YAML metadata and Markdown instructions. Anthropic introduced this format in October 2025 and published it as an open standard in December 2025.
The key idea: instead of one giant system prompt, Claude only loads the instructions it needs. At the start of a session, it sees only the Skill names and descriptions (~100 tokens per Skill). When a task matches a specific Skill — the full instructions get loaded. This saves tokens and improves quality.
| Built-in Skill | What it does | Output format |
|---|---|---|
| Generates PDF reports with proper formatting | ||
| docx | Creates Word documents with styles and structure | .docx |
| pptx | Builds presentations with slides and design | .pptx |
| xlsx | Generates spreadsheets with formulas and formatting | .xlsx |
| frontend-design | Creates web components and UI | .html/.jsx |
| data-analysis | Analyzes data and builds charts | .html/.png |
Plug any of these Skills into an n8n workflow, and you get automatic document generation via a web form with automatic upload to Google Drive.
Projects store context in one place for one user. Skills are portable and modular: you build a Skill once, and it works everywhere — in Claude.ai, Claude Code, via API, and even in third-party tools (Cursor, Codex). Plus, you can share Skills with your team or the community.
Workflow architecture: from prompt to file
Trigger
File Type
API + Skill
Extract ID
Download
Drive
How it works:
- Form Trigger — a web form where the user enters a prompt and picks the document type (PDF/DOCX/PPTX/XLSX)
- Switch — routes the request to the corresponding node with the right system prompt and skill_id
- Anthropic API — HTTP Request to Messages API with Code Execution and the chosen Skill
- Code Node — recursively searches for the file_id in the response (nested structure)
- Files API — downloads the generated file by file_id
- Google Drive — automatically saves the file to the specified folder
Set up the Anthropic API in n8n
Claude Skills work through the Anthropic Messages API with Code Execution enabled. The built-in "Anthropic" node in n8n doesn't support Skills — so we use HTTP Request instead.
In n8n, go to Settings → Credentials and create a new credential of type HTTP Header Auth:
Name: x-api-key
Value: sk-ant-api03-your-key-here
In every HTTP Request to Anthropic, include the required headers:
anthropic-version: 2023-06-01
anthropic-beta: code-execution-2025-05-14
Content-Type: application/json
Without the anthropic-beta: code-execution-2025-05-14 header, Skills won't work. Code Execution is a beta feature that lets Claude run Python code in an isolated container to generate files. Check the current beta version in the Anthropic documentation.
Form Trigger + Switch: routing by document type
Add a Form Trigger node with two fields:
Field 1:
Type: Text (multiline)
Label: "Describe the document you want to create"
Field 2:
Type: Dropdown
Label: "File type"
Options:
- PPTX (Presentation)
- PDF (Report)
- DOCX (Document)
- XLSX (Spreadsheet)
After the Form Trigger, add a Switch node that routes the request based on the "File type" value:
Rule 1: {{ $json.file_type }} contains "PPTX"
→ Output 1 (Presentation node)
Rule 2: {{ $json.file_type }} contains "PDF"
→ Output 2 (PDF node)
Rule 3: {{ $json.file_type }} contains "DOCX"
→ Output 3 (Document node)
Rule 4: {{ $json.file_type }} contains "XLSX"
→ Output 4 (Spreadsheet node)
Each Output leads to a separate HTTP Request node with its own system prompt, optimized for that specific format. This is a key detail: prompts for presentations, reports, and spreadsheets are significantly different.
Connect Claude with Skills and Code Execution
Each branch of Switch leads to an HTTP Request node that calls the Anthropic Messages API. Here's an example body for PDF generation:
{
"model": "claude-sonnet-4-20250514",
"max_tokens": 16000,
"tools": [{
"type": "code_execution",
"name": "code_execution"
}],
"system": "You are a professional document designer.
Create PDF reports with clear structure,
typography, and visual hierarchy.
Use Python libraries for generation.",
"messages": [{
"role": "user",
"content": {{ $json.prompt }}
}]
}
For PPTX, the system prompt will be different — focused on slides, visual design, and presentation structure. For XLSX — on formulas, cell formatting, and charts.
When you pass code_execution in tools, Claude gets access to an isolated Python container. It writes code (using python-pptx, reportlab, openpyxl, etc.), runs it, and the result — a ready file — is stored in Anthropic's Files API with a unique file_id. That's the file_id we extract in the next step.
If you want to use a specific custom skill, add a "skills" field with an array of skill_id values to the request body. For built-in Skills (pdf, docx, pptx, xlsx), this isn't required — Claude automatically picks the right Skill from the task context.
Extract the file and upload it to Google Drive
The Anthropic API response is an array of content blocks of different types: text, code_execution, tool_use, tool_result. The file_id can be deeply nested. So we need a recursive search via a Code Node:
function findFileId(obj) {
if (!obj || typeof obj !== 'object') return null;
// Look for the file_id field
if (obj.file_id) return obj.file_id;
// Recursively walk nested objects
for (const key of Object.keys(obj)) {
const result = findFileId(obj[key]);
if (result) return result;
}
// Walk arrays too
if (Array.isArray(obj)) {
for (const item of obj) {
const result = findFileId(item);
if (result) return result;
}
}
return null;
}
const response = items[0].json;
const fileId = findFileId(response);
if (!fileId) throw new Error('File ID not found');
return [{ json: { file_id: fileId } }];
Next, add an HTTP Request to download the file from the Anthropic Files API:
Method: GET
URL: https://api.anthropic.com/v1/files/{{ $json.file_id }}/content
Headers:
x-api-key: {{ $credentials.anthropicApi.apiKey }}
anthropic-version: 2023-06-01
anthropic-beta: files-api-2025-04-14
Response: File (binary)
The last step is the Google Drive node (Create File), which uploads the binary file to the specified folder:
Operation: Upload
File Name: {{ $json.file_name || "document" }}.pdf
Parent Folder: Your Google Drive folder ID
Input Data: Binary (from the previous node)
Create an OAuth2 credential for Google Drive in n8n: Settings → Credentials → Google Drive OAuth2. You'll need a Google Cloud project with the Drive API enabled and a configured OAuth consent screen. Redirect URI: https://your-n8n.com/rest/oauth2-credential/callback.
Creating custom Skills
Built-in Skills are just the start. You can build custom Skills for any task: contract generation from templates, reports with corporate branding, specific formats for your industry.
The structure of a SKILL.md
A minimal example of a Skill for corporate reports:
---
name: brand-report
description: Generates PDF reports in a corporate style
with logo, brand colors, and standard
header/footer templates.
---
# Brand Report Generator
## When to use
Trigger: user asks to create a report,
analytics document, or corporate-style file.
## Instructions
1. Use brand colors: #1A1A2E, #E94560
2. Fonts: headings — Montserrat Bold,
body — Open Sans Regular
3. Logo always in the top-right corner
4. Footer: "© 2026 CompanyName. Confidential."
## Python dependencies
- reportlab
- Pillow
Skills can be stored in a GitHub repository and pulled into n8n via the GitHub API. That gives you versioning, shared access, and the ability to update Skills without touching your workflow.
| Where to store Skills | Pros | Cons |
|---|---|---|
| GitHub repo | Versioning, collaboration, CI/CD | Requires an extra API call |
| Claude.ai Settings | Works out of the box, nice UI | Only for Claude.ai, not the API |
| Local folder | Fast, no dependencies | Only for Claude Code |
| n8n Static Data | Everything in one workflow | Harder to maintain |
Test and ship
Before you launch, test every scenario:
- Form Trigger opens at its URL and accepts a prompt + file type
- Switch routes requests correctly (check every branch)
- Anthropic API returns a response with content blocks (check Executions)
- Code Node finds the file_id in the response
- Files API returns the binary file (not a 404)
- Google Drive receives the file with the correct name and extension
- The document opens and has correct formatting
401 from Anthropic — check the x-api-key. Files API 404 — the file_id was extracted incorrectly; verify the recursive function. Empty file — Claude couldn't run the code; check the system prompt and confirm the beta header is correct. Google Drive 403 — the OAuth2 credential needs re-authorization.
Frequently asked questions
What are Claude Skills?
Claude Skills are modular instructions in the SKILL.md format that Claude loads on demand. Each Skill contains YAML metadata and Markdown instructions. Anthropic introduced the format in October 2025 and published it as an open standard in December 2025. Supported by Claude Code, Claude.ai, and the API, plus OpenAI Codex, Cursor, Gemini CLI.
How much does document generation cost?
You pay per Anthropic API token. On Claude Sonnet 4 — ~$3/1M input, $15/1M output. A single document (PDF/DOCX) usually consumes 2,000–5,000 input tokens + 3,000–8,000 output tokens. Cost: ~$0.05–0.15 per document. Code Execution is included in the API price. n8n self-hosted — free.
Can I use my own Python libraries?
Anthropic's Code Execution container ships with a set of pre-installed libraries: reportlab, python-pptx, openpyxl, Pillow, matplotlib, pandas, and more. You can't install arbitrary pip packages — the container is isolated. But for most document generation tasks, this is enough.
Do Skills work with other AI models?
Yes. Anthropic published Agent Skills as an open standard at agentskills.io. The same SKILL.md format is supported by Claude Code, Claude.ai, the Claude API, and OpenAI Codex, Cursor, Gemini CLI, Antigravity, and Windsurf. Build a Skill once — use it everywhere.
How is this different from a regular OpenAI prompt?
Three key differences: Skills load progressively (token savings); Code Execution lets Claude run Python and generate real binary files (not just text); Skills are portable and modular — you can build a library of specializations that scales without bloating the system prompt.