Unlocking Anthropic’s Agent Skill: Build Reusable AI Task Assistants in 3 Steps
This article explains Anthropic’s open‑standard Agent Skill, how it serves as a reusable task specification for Claude, walks through creating a skill with metadata, instructions, and advanced Reference/Script features, and compares Skill with MCP to help developers choose the right tool.
What is an Agent Skill?
Agent Skill is a "task specification" that large language models can consult at runtime, essentially a reusable instruction manual. For example, a customer‑service skill can enforce "first calm the user, then never make promises", while a meeting‑summary skill can require output of participants, agenda items, and decisions.
Basic Workflow: Create a Skill in Three Steps
Step 1 – Create the skill folder
Navigate to the user directory .claude/skill and run: mkdir 会议总结助手 The folder name becomes the skill’s identifier.
Step 2 – Write skill.md
The file contains two parts:
Metadata wrapped by triple dashes, with mandatory name (must match the folder name) and description fields that explain the skill’s purpose.
Instruction – detailed rules, e.g., "The meeting summary must include participants, agenda, and decisions" and optional input‑output examples.
Step 3 – Invoke and validate
In Claude Code, query "what Agent Skills do you have" to see the newly created assistant. Then ask "summarize the following meeting" and paste the transcript. Claude Code asks to enable the skill, then produces a structured summary that follows the rules.
The underlying logic is a three‑stage matching process: first the model receives all skill metadata to find a relevant skill, then it loads the full instruction, and finally it may load additional resources, saving token usage.
Advanced Features: Reference and Script
Reference – Conditional supplemental material
When a skill’s instruction becomes large, Reference lets you attach extra documents that are loaded only if certain conditions are met. For instance, a "Financial Manual.md" can be referenced to flag budget overruns only when the meeting text mentions money, reducing unnecessary token consumption.
Script – Zero‑token automation
Script allows the skill to trigger external code without loading its source into the model. Create a Python file upload.py that handles file uploads, then add a rule in skill.md such as "If the user mentions upload, run upload.py to send the summary to the server." When the user requests "summarize and upload", Claude Code matches the skill, runs the script after user consent, and returns the upload result.
Because only the execution command and result are sent to the model, even a large script consumes virtually no token budget.
Core Mechanism: Progressive Disclosure
Agent Skill uses a three‑layer progressive disclosure design to minimize token usage:
Metadata layer – always loaded; acts as a skill directory.
Instruction layer – loaded only after a skill match; contains detailed rules.
Resource layer – References and Scripts are loaded conditionally, based on triggers such as financial terms or upload requests.
Skill vs. MCP: When to Use Which?
“MCP connects Claude to data, Skills teach Claude what to do with that data.”
MCP supplies external data (e.g., sales records, order status), while Skill defines how to process that data (e.g., formatting a meeting summary). For complex data integration, MCP is preferred; for lightweight rule‑based tasks or simple automation, Skill is more suitable. In many scenarios, combining both yields the most flexible solution.
Conclusion
Since its debut as a task‑specific optimization tool, Agent Skill has evolved into an open standard that addresses repetitive rule definition and token efficiency. Its progressive disclosure—from a searchable metadata catalog to detailed instructions and on‑demand resources—lowers user effort and model cost, while advanced Reference and Script capabilities enable conditional data handling and zero‑token automation.
AndroidPub
Senior Android Developer & Interviewer, regularly sharing original tech articles, learning resources, and practical interview guides. Welcome to follow and contribute!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
