Prerequisites
- VS Code with GitHub Copilot
This tutorial uses VS Code, but Agent Skills are an open format. The same skill works in any compatible agent, including Claude Code and OpenAI Codex.
Create the skill
A skill is a folder containing aSKILL.md file. VS Code looks for skills in .agents/skills/ by default. Create .agents/skills/roll-dice/SKILL.md in your project:
.agents/skills/roll-dice/SKILL.md
name— A short identifier for the skill. Must match the folder name.description— Tells the agent when to use this skill. This is how the agent decides whether to activate it.- The body — Instructions the agent follows when the skill activates. Here, the agent is instructed to generate a random number using a terminal command, substituting the number of sides from the user’s request.
Try it out
- Open your project in VS Code.
- Open the Copilot Chat panel.
- Select Agent mode from the mode dropdown at the bottom of the chat panel.
- Type
/skillsto confirm thatroll-diceappears in the list. If it doesn’t, check that the file is at.agents/skills/roll-dice/SKILL.mdrelative to your project root. - Ask: “Roll a d20”
roll-dice skill. It may ask for permission to run a terminal command — allow it. It will run the command and return a random number between 1 and 20.
Tool-use reliability varies across models — some follow skill instructions and run commands consistently, while others may attempt to answer on their own. If the agent responds without running a terminal command, try selecting a different model from the model dropdown.
How it works
Here’s what happened behind the scenes:-
Discovery — When the chat session started, the agent scanned default skill directories and found your skill. It read only the
nameanddescription, just enough to know when the skill might be relevant. -
Activation — When you asked about rolling dice, the agent matched your question to the skill’s description and loaded the full
SKILL.mdbody into context. - Execution — The agent followed the instructions in the body, adapting the terminal command to the number of sides in your request.
Next steps
You’ve created a working Agent Skill. From here:- Best practices — How to write skills that are well-scoped and effective.
- Optimizing skill descriptions — Test and improve your skill’s description so it activates on the right prompts.
- Specification — The complete format reference for
SKILL.mdfiles. - Example skills — Browse real-world skills on GitHub.