SKILL.md files inside a named directory. This page covers everything you need to know to write effective skills.
File Structure
Place skills in the appropriate directory depending on scope:/my-skill invocation). The SKILL.md file contains optional YAML frontmatter and the skill’s prompt content.
On Windows,
%APPDATA% typically resolves to C:\Users\<YourUser>\AppData\Roaming.Frontmatter Reference
All Frontmatter Fields
| Field | Type | Default | Description |
|---|---|---|---|
name | string | directory name | Display name of the skill |
description | string | none | Shown in slash command completions |
argument-hint | string | none | Hint shown after the command name (e.g., [filename]) |
model | string | current model | Override the model used when running this skill |
subagent | boolean | false | Run the skill as a subagent instead of inline |
agent | string | none | Run the skill as a subagent using a specific custom subagent profile |
allowed-tools | list | all tools | Restrict which tools the skill can use |
permissions | object | inherit | Permission overrides for this skill |
triggers | list | [user, model] | How the skill can be invoked |
Model Override
Use themodel field to run a skill with a different model than the one active in the current session. This is useful for using a faster model for simple tasks or a more capable model for complex ones:
--model CLI flag (e.g., opus, sonnet, swe, codex). See Models for the full list. After the skill completes, the session returns to the previously active model.
Running Skills as Subagents
By default, a skill’s prompt is injected into the current conversation — the agent processes it inline. You can instead run a skill as a subagent, which spawns an independent worker with its own context window. This is useful for skills that perform focused, self-contained tasks where you don’t want the output to clutter the main conversation. There are two ways to run a skill as a subagent:subagent: true
Set subagent: true to run the skill as a subagent using the default subagent_general profile:
agent: <profile>
Use the agent field to run the skill as a subagent with a specific custom subagent profile:
agent value must match the name of a registered subagent profile (either built-in like subagent_explore / subagent_general, or a custom profile you’ve defined). The subagent inherits the profile’s system prompt, tool restrictions, and model — while the skill’s content becomes the task.
If both
agent and subagent are set, agent takes precedence. The model field on the skill overrides the subagent profile’s model when both are specified.Skills running as subagents do not spawn nested subagents — if the skill is already executing inside a subagent, it runs inline instead to prevent infinite recursion.
Orchestrating Subagents Using Skills
Because skills can run as subagents, you can use them to orchestrate multi-step work. Define a set of subagent skills that each handle a focused task, then write a regular skill that invokes them. The outer skill becomes the orchestrator — it calls each subagent, collects the results, and decides what to do next. For example, here are two subagent skills and an orchestrator that coordinates them:/health-check runs the orchestrator in the main agent. It calls /research-changes, which spawns a subagent to explore the repo. Once that finishes, it calls /validate-tests, which spawns another subagent to run the tests. The orchestrator then synthesizes both results into a final summary.
A subagent skill will never use a subagent when calling other skills, even if those skills have subagent: true — they run inline instead. This means you don’t need to worry about unbounded nesting. The orchestration pattern is always one level deep: the orchestrator spawns subagents, and those subagents execute everything else inline.
Prompt Content
The body of the SKILL.md file (after the frontmatter) is the prompt that gets injected when the skill is invoked.Dynamic Content
Skills support three types of dynamic content in the prompt body:- Arguments
- File Inclusion
- Command Output
Interpolate user-provided arguments:
$1,$2, etc. — Individual positional arguments$ARGUMENTS— All arguments as a single string
Permissions
Skills can define their own permission scope using the same syntax as the main permissions config:allow— These scopes are auto-approved during skill executiondeny— These scopes are blocked during skill executionask— These scopes always prompt the user
Skill permissions are additive to (not replacing) the session’s base permissions. A skill cannot grant permissions that are denied at a higher level (project or organization config).
Allowed Tools
Restrict which tools the skill can use:read, edit, grep, glob, exec
You can also allow MCP tools:
Examples
Code Review Skill
Component Generator
Deployment Checklist
Search Expert
Tips
Keep prompts focused
A skill should do one thing well. Create multiple skills rather than one mega-skill.
Include examples
Show the agent what good output looks like in your prompt.
Use allowed-tools
Restricting tools makes skills safer and more predictable.
Test with /skill-name
Invoke your skill and iterate on the prompt until the output is what you want.

