Anthropic Agent Skills 與官方 Document Skills(PDF / DOCX / PPTX / XLSX)¶
整理自 Claude 官方文件與
anthropics/skillsrepo(見文末),2026-06-19。介紹 Agent Skills 的運作原理(漸進揭露架構)與最實用的官方 Document Skills。
什麼是 Agent Skill¶
Skill = 一個資料夾,內含指令、腳本、資源,Claude 在相關時按需載入,把通用 agent 變成特定領域的專家。標準見 agentskills.io。
每個 skill 必有一個 SKILL.md:
---
name: pdf-processing
description: Extract text and tables from PDFs, fill forms, merge documents. Use when working with PDF files.
---
# PDF Processing
## Instructions
[Claude 要遵循的步驟]
name:≤64 字、僅小寫+數字+連字號、不可含 claude/anthropic。description:≤1024 字,要寫清楚「做什麼 + 何時用」。
核心架構:漸進揭露(Progressive Disclosure)¶
這是 Skills 省 token 的關鍵——分三層載入:
| 層級 | 何時載入 | Token 成本 | 內容 |
|---|---|---|---|
| L1 Metadata | 啟動就載(一直在) | 每 skill 約 100 tok | name + description |
| L2 Instructions | skill 被觸發時 | < 5k tok | SKILL.md 內文 |
| L3 Resources / Code | 用到才載 | 實質無上限 | 額外 md、腳本、資料;腳本經 bash 執行,程式碼本身不進 context,只回傳輸出 |
所以你可以裝很多 skill 而幾乎不吃 context(平時只有 L1 的描述在),用到哪個才把它的內文與資源拉進來。腳本走 bash 執行、只回結果,比讓模型即時生成等效程式碼更省也更可靠。
官方 Document Skills¶
直接從 agent 生成/編修 Office 檔,生產級:
| Skill | 用途 |
|---|---|
| PPTX | 建簡報、編輯投影片、分析簡報內容 |
| XLSX | 建試算表、分析資料、產生含圖表的報告 |
| DOCX | 建/編輯 Word 文件、排版 |
| 抽取/填表/合併、產生格式化 PDF 報告 |
授權:Document skills 為 source-available(非開源),作為複雜生產級 skill 的參考;repo 內多數其他 skill 為 Apache 2.0。
各平台怎麼用(有差異,別搞混)¶
- Claude API:用 pre-built(
skill_id如pptx/xlsx)需三個 beta header,跑在 code execution container,無網路、不能裝套件。 - claude.ai:建立文件時 pre-built skills 已在背景運作;自訂 skill 以 zip 上傳(Pro/Max/Team/Enterprise)。
- Claude Code:只吃 Custom Skills(檔案系統式,放
~/.claude/skills/或專案.claude/skills/,有完整網路權限)。官方 document skills 可經 plugin 安裝: 之後直接喊:「用 PPTX skill 把這份大綱做成簡報」。
⚠️ Custom skill 不跨平台同步:claude.ai、API、Claude Code 各自管理上傳。
安全提醒¶
只用可信來源的 skill(自製或 Anthropic 官方)。惡意 skill 能指使 Claude 執行與宣稱用途不符的工具/程式碼,造成資料外洩或未授權存取。用第三方 skill 前逐檔審查(SKILL.md、腳本、會不會對外連網)。把裝 skill 當成「裝軟體」看待。
為什麼對你有用¶
- 做研究報告 / KB / 簡報時,PPTX、XLSX、PDF skill 可直接從資料或大綱產出檔案。
- 「漸進揭露」這個架構觀念,和 Context Engineering 的「只放當下需要的 context」是同一套思路——值得套進自己的 agent 設計。
參考來源¶
- Agent Skills — Claude 官方文件(架構與平台差異主要依據)
- anthropics/skills — GitHub(官方 skill repo、Document skills、授權)
- Equipping agents for the real world with Agent Skills — Anthropic Engineering(延伸)