Agent skills
Agents discover skills
load only the name and description of each available skill
Models activate matched skills
determine to use the skill if it matches the task
Skills to be executed
agents follow the instructions including the code if needed
Introduction
Agent skills are a lightweight, open format for extending AI agent capabilities with specialized knowledge, workflows, and code.
At its core, a skill is a self-contained folder that packages executable scripts alongside a SKILL.md file. While SKILL.md provides the metadata (name and description) and instructions telling an agent when and how to act, the bundled scripts/ supply the deterministic code needed to reliably execute the task, optionally supported by any additional resources.
- skill-name/
- SKILL.mdrequired: metadata + instructions
- scripts/optional: executable code the agent can run
- ...optional: additional files or directories
Agent skills are useful for repeatable tasks to be executed through consistent workflow with domain expertise, where the workflow could be recorded by AI as well.
To learn more, please visit https://agentskills.io/ for more information.
Interaction model
An agent skill is loaded in stages. At startup, the agent reads only each skill's name and description. When a task matches a skill, it reads the whole SKILL.md. Optionally, it will follow the instructions in the skill to execute the scripts or access other files for information.
Scaffold code
A self-contained folder. A SKILL.md with the two required fields in its frontmatter, then the instructions.
---
name: skill-name
description: What this skill does, and when to use it, in one line.
---
# Skill name
## Steps
1. Run `python scripts/tool.py --help` to see the options.
2. ... the next thing to do ...
## Output
State what the result is expected.The block between the two --- lines is YAML frontmatter. Every skill must have a name, the same as its folder name, and a description of what it does and when to use it. name uses lowercase letters, digits and hyphens, and must match the folder. Everything below the frontmatter is the skill body: plain text in Markdown format that the model reads after it activates the skill.
For the scripts/ scaffold, it could be CLI tools. Please refer to the CLI tool lesson for detailed information.
Tips: a best practice is to keep the skill body to concise, move long material into references/, and put repeatable workflow into scripts/ for reliability.
The full specification of agent skills can be found on its official website.
Discovery
Agent skills must be put in specific locations so that they can be discovered and used.
Below exemplifies how to set up agent skills on VSCode. The full instructions can be found here.
The skills can be located in the project directory where those skills can only utilized by the project, or in a global directory where the skills can be shared across different compatible tools.
.copilot/skills/ relative to the project directory
~/.copilot/skills/ absolute to the home directoryYou may refer to this link to find out how to setup the agent skills in your clients.
Code example
Type a request in natural language and inpsect the internal process.
- skills/
- unit-conversion/
- SKILL.md
- scripts/
- temp_convert.py
- invoice-pdf/
- SKILL.md
- commit-message/
- SKILL.md
---
name: unit-conversion
description: Convert temperatures between Celsius and Fahrenheit. Use when the user asks to convert a temperature or mentions °C or °F.
---
# Unit conversion
Run the bundled script. Do not do the arithmetic yourself.
python scripts/temp_convert.py <value> --to <celsius|fahrenheit>
--to is the unit to convert INTO.
Example: "100F in C" -> python scripts/temp_convert.py 100 --to celsius#!/usr/bin/env python3
"""Convert a temperature between Celsius and Fahrenheit."""
import argparse
def main():
parser = argparse.ArgumentParser(
description="Convert a temperature between Celsius and Fahrenheit.",
epilog="example: python temp_convert.py 100 --to fahrenheit",
)
parser.add_argument("value", type=float, help="The temperature to convert")
parser.add_argument(
"--to",
choices=["celsius", "fahrenheit"],
required=True,
help="Unit to convert into",
)
args = parser.parse_args()
if args.to == "fahrenheit":
result = args.value * 9 / 5 + 32
else:
result = (args.value - 32) * 5 / 9
print(f"{result:.1f}")
if __name__ == "__main__":
main()