Structure a skill so it loads efficiently

Only applies to: Microsoft Copilot harness

To build skills that trigger reliably and use context efficiently, you need to understand how skill content loads.

A skill consists of front matter (name and description), an instruction body, and optional resources and scripts. The agent accesses these components at different stages. As a result, where you place descriptions, instructions, examples, and supporting files affects what context is available and when.

Legacy Azure Bot Service and Bot Framework skills have different runtime, hosting, security, and governance implications and aren't covered in this article.

Structure of a skill

A skill is a single folder that can contain the following components:

  1. SKILL.md: A required file that contains front matter (name and description) and an instruction body.
  2. Resources (optional): Supporting documents, templates, examples, assets, and other files that the agent opens when needed.
  3. Scripts (optional): Executable Python scripts that run in the agent sandbox.

SKILL.md is the only required file, and the skill name must match the name of its parent folder:

skill-name/
├── SKILL.md
├── scripts/
├── references/
└── assets/

Understand how a skill loads

Different parts of a skill load at different stages. This staged loading helps the agent use only the context needed for the current task.

Stage What loads When What it's for
Discovery Front matter: name and description Every turn for every installed skill Determines whether the skill is relevant to the user's request
Activation The SKILL.md body After the orchestrator selects the skill Provides guidelines and examples
Execution Bundled resources Only when the body points at them and the agent decides it needs them Provides additional templates, sample outputs, and scripts

The staged loading model allows skills to scale efficiently. The agent evaluates every installed skill by using only its front matter and loads additional content only after a skill is selected. As a result, the cost of skill discovery remains relatively small, while the skill body and referenced resources load only when needed.

Write front matter that routes the skill

The orchestrator uses the skill's name and description to decide whether to invoke the skill. The instruction body and bundled resources aren't available during this stage.

Tip

Keep the skill name and description concise. Reflect what the skill does and when to use it.

Write the description in words that users are likely to use:

  • Include when it should trigger, such as "Use when the user asks to generate a branded PDF report."
  • If skills could overlap, clarify what the skill isn't for.

Test requests that should trigger the skill and similar requests that shouldn't. Refine the name and description if the skill triggers too broadly or isn't selected when expected.

Focus the skill body on procedure

The body loads once the orchestrator selects the skill and adds the skill as active task context. Include:

  • Steps the agent should follow, in order.
  • Guardrails and constraints that apply to this task.
  • Worked examples of the expected input and output.
  • Edge cases and how to handle them.
  • References to resources and when to use them.

Keep the body lean. Aim for fewer than 500 lines, and include only what the agent doesn't already know. If the agent wouldn't get it wrong without the instruction, cut the instruction. If the agent only needs a detail in some cases, move it to a resource file and specify in the body when to open it.

Store detailed content in resources

Resources are optional files that the agent can open when needed.

  • Supporting docs (.md): Deeper guidance to read on demand.
  • Example files: Templates and sample outputs, in any format.
  • Scripts: Python scripts that run directly in the agent sandbox.

Keep file references one level deep. Avoid chains in which one resource points to another resource. The skill should make it easy for you to identify the file needed for the current task.

Skills best practices

A skill is most useful when it captures expertise the agent doesn't otherwise have:

  • Ground it in reality. Extract the procedure from a real task, or build it from actual runbooks and documentation, rather than from generic advice.
  • Spend context wisely. Include only what the agent doesn't already know.
  • Calibrate control. Give the agent freedom when the task tolerates variation, and be prescriptive when the steps are fragile. Learn more in Balance agent flexibility and control in a skill.
  • Design for disclosure. Keep SKILL.md lean and push detail into resource files that load only when needed.

Clear guidance helps the agent focus on the most relevant information and process for the task. It can reduce unnecessary exploration and might help reduce overall credit consumption.

What to avoid

Avoid the following when creating skills:

Anti-pattern Why avoid it Do this instead
Vague descriptions Weak routing signals make a skill misfire or never trigger State plainly what the skill does and when to use it
Mega-skills Broad, do-everything scope blurs intent and overlaps other skills Split into focused skills with non-overlapping triggers
Fact dumps A skill guides behavior, it doesn't replace a knowledge source Move reference content to knowledge, or to a resource file
Unreviewed skills AI-generated and community skills can carry unsafe or unwanted instructions Treat skills as untrusted code and review before you add them to an agent

Tip

Skills can affect routing, task completion, and output quality. Evaluate skills on the runtime and model your agent uses, and re-evaluate them when either changes.

Next step