Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Agent Skills

Agent Skills

An agent is an intelligent agent and Skills means skills; Agent Skills are the core tool that solidifies professional knowledge and workflow conventions into reusable assets.

An Agent Skill is essentially a modular Markdown file that teaches AI tools (such as Claude, GitHub Copilot, Cursor, etc.) to perform specific tasks. It supports automatic triggering, team sharing, and engineering management, completely eliminating repetitive prompt input.

The essence of Agent Skills is not a tool, but rather:

A combination of behavioral norms + professional knowledge + when-to-use timing

Reference for basic Skills content:Skills Tutorial

Core form:

How Agent Skills work

The key to Agent Skills is progressive disclosure, loaded in three layers:

Supported tools and environments

Currently mainly supported:

Why do we need Skills? What problems do they solve?

Ordinary AI agents (such as Claude or Copilot) are smart, but tend to make mistakes when lacking specific context. For example:

Agent Skills solve these problems:

Quick understanding of core concepts

Concept Analogy Purpose
Skill A standalone Swiss Army knife tool or a cooking recipe A complete kit for accomplishing a specific task (such as writing an email or analyzing data).
Instruction The user manual for a tool or the steps of a recipe Tells Claude exactly what to do, how to think, and what format to output.
Knowledge The parts list of a tool or background information on a recipe's ingredients Upload files (such as product manuals or API docs) as the Skill's dedicated knowledge base.
Tool A special attachment on a tool (such as a bottle opener) Defines external APIs or functions the Skill can call to fetch data or perform actions.

Skill execution flow


The minimal structure of a Skill

my-skill/

└── SKILL.md   (唯一必需)

SKILL.md basic template:

---

name: your-skill-name

description: What it does and when Claude should use it

---



# Skill Title



## Instructions

Clear, concrete, actionable rules.



## Examples

- Example usage 1

- Example usage 2



## Guidelines

- Guideline 1

- Guideline 2

Metadata fields:

Field Required Description
name No The Skill's display name; defaults to the directory name; only lowercase letters, digits, and hyphens are supported (max 64 characters)
description Recommend The Skill's purpose and use cases; Claude uses it to decide whether to apply it automatically
argument-hint No Parameter hints shown during autocomplete, such as [issue-number]、[filename] [format]
disable-model-invocation No Set to true Prevents Claude from triggering automatically; manual invocation only /name (defaults to false)
user-invocable No Set to false From the / Hidden from the menu, used as a background enhancement (defaults to true)
allowed-tools No Tools Claude may use without authorization when the Skill is active
model No The model used when the Skill is active
context No Set to fork when running in a subagent context
agent No Subagent type (used with context: fork)
hooks No Skill lifecycle hook configuration

Skills support inserting dynamic variables in their content:

Variables Description
$ARGUMENTS All arguments passed in when the Skill is invoked
$ARGUMENTS[N] Access arguments by index, such as $ARGUMENTS[0]
$N Shorthand form, such as $0 represents the first argument
${CLAUDE_SESSION_ID} The current session ID, used for logs, temp files, and associated output

For example:

---

name: session-logger

description: 记录当前会话活动

---



Please write the following content to the log file:



logs/${CLAUDE_SESSION_ID}.log



$ARGUMENTS

Call:



/session-logger 用户登录成功

A session-specific log record is actually generated.

The core composition of a SKILL.md file

Take Claude's PDF document editing skill as an example: Claude can natively parse PDFs but cannot manipulate them directly (such as filling in forms); this skill fills that gap.

Multi-file Skills (progressive disclosure)

The progressive disclosure mechanism

The figure below shows how the context window changes when a user message triggers a skill:

Recommended directory structure

To avoid context bloat:

Recommended structure:

my-skill/

├── SKILL.md

├── reference.md

├── examples.md    # 存放示例文件

└── scripts/

    └── helper.py


The First Skill

Let's forget the complicated creation process for now and start first with using a ready-made Skill to begin, and feel the convenience it brings.

Create the Skill directory

Skills are stored in ~/.claude/skills/ (personal global) or in .claude/skills/ under the project directory (project-specific).

This section tests under the project directory; first create a directory claude-test:

mkdir claude-test

Enter that directory and create the skills directory and files:



mkdir -p .claude/skills/python-naming-standard

Write the configuration file SKILL.md

Create SKILL.md in the directory; this is the brain of the Skill, telling Claude when to use it.

---

name: Python 内部命名规范技能

description: 当用户要求重构、审查或编写 Python 代码时,请参考此规范。

---



## 指令

1. 所有的内部辅助函数必须以 `_internal_` 前缀命名。

2. 如果发现不符合此规则的代码,请自动提出修改建议。

3. 在执行 `claude commit` 前,必须检查此规范。



## Reference Example

- 正确:`def _internal_calculate_risk():`

- 错误:`def _calculate_risk():`

Field requirements:

After creation, the file structure is as follows:

Your project should now look like this:

my-project/

├─ src/

│  └─ test.py              # 项目源码

├─ .claude/

│  ├─ skills/

│  │  └─ hello-world/

│  │     ├─ skill.md       # Skill 定义(YAML + Instructions,机器可执行)

│  │     └─ README.md      # Skill 说明(人类阅读,可选)

│  └─ config.yml           # Claude 项目级配置(可选)

├─ .gitignore

└─ README.md               # 项目整体说明

Next, run the following command in the terminal to start Claude Code:

claude

Enter the task:

帮我写一个计算用户折扣的函数

Claude will then scan the installed Skills, find that your request involves "Python code writing", and match python-naming-standard.

It will generate the following code according to the requirements in SKILL.md:

def _internal_get_discount(user_score):

    # Calculate logic...

    return discount

Add resource files (optional)

We can also add the following directories under .claude/skills/:

Add in the same folder:

Then reference them in SKILL.md:

查看示例 commit:./examples/good-commit.txt

运行脚本:使用工具执行 ./scripts/process.py


Official marketplace

Besides writing your own, you can also leverage the Agent Skills open standard released in late 2025:

We can register this repository as a Claude Code plugin marketplace simply by running the following command in Claude Code:



/plugin marketplace add anthropics/skills

Then you can use /plugin to view it:

Steps to install a specific skill set:

We can also install both types of plugins directly via commands:



/plugin install document-skills@anthropic-agent-skills

/plugin install example-skills@anthropic-agent-skills

**Note:** skills installed via plugins are located under ~/claude/plugins/marketplaces/.

After plugin installation, you need to restart Claude Code.

To use a skill, simply mention its name in your instruction. For example, after installing the document-skills plugin, you can give Claude Code an instruction like:

使用 PDF 技能提取 path/to/some-file.pdf 文件中的表单字段

Or create a PPT:



创建一个 Agent Skill 的演示文稿

You can see that it called /document-skills:pptx:

and started generating:

Then it will tell you the location of the generated file:


A Collection of Agent Skills Resources

Resource description link
Skill aggregation portal https://skills.sh/
Skills marketplace (Chinese interface) https://skillsmp.com/zh
Official Agent Skills standard site https://agentskills.io
Anthropic official engineering article (practical concepts behind Agent Skills) https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills
VS Code Copilot Agent Skills documentation https://code.visualstudio.com/docs/copilot/customization/agent-skills
Anthropic official Skills GitHub repository https://github.com/anthropics/skills
Curated list of Claude skills (Awesome series) https://github.com/ComposioHQ/awesome-claude-skills
A collection of software development automation workflow Skills https://github.com/obra/superpowers
A Skill that auto-generates Skills (official example) https://github.com/anthropics/skills/tree/main/skills/skill-creator