The Complete Guide to Creating Skills for AI Agents
This guide explains how to create reusable Skills for AI agents and large language models. It covers why a skill layer reduces repeated context setup, the minimal folder structure built around SKILL.md, and progressive disclosure for controlling context usage. You will also find two common application paths, a step-by-step authoring workflow with a quality checklist, team governance practices, and frequent anti-patterns to avoid.
1. Why a Skill Layer Matters
When working with large language models, a recurring cost is context rebuilding. Every time a new session starts, the user has to restate the role definition, input format, processing steps, acceptance criteria, and style preferences. This repeated explanation wastes time and makes output quality vary from session to session.
A Skill turns the tacit knowledge of how to complete a certain class of task into an explicit, versionable instruction package. It is usually just a plain folder containing a structured instruction document plus optional scripts, templates, and reference material. The model loads the relevant instructions when needed, so an established workflow can be reproduced reliably without a long conversational setup.
Skills do not expand model capability. They add process constraints and knowledge injection. They are best suited to repeatable workflows: producing a frontend page skeleton from a specification, running research with a consistent method, generating documents that follow a team style guide, or orchestrating a multi-step batch process. For agents that already support tool calling, a skill adds the methodology layer and organizes scattered tool calls into a reliable chain.
There are roughly three audiences: developers who want the model to follow a fixed process consistently, advanced users who want less repeated explanation and more consistent output, and teams that need shared collaboration standards across an organization.
2. Minimal Viable Structure: What a Skill Contains
A well-formed skill directory usually looks like this:
my-skill/├── SKILL.md # Required: name, when-to-use description, main instructions├── references/ # Optional: specification details, domain knowledge, boundaries├── templates/ # Optional: output skeletons, style baselines└── scripts/ # Optional: deterministic processing scripts
The instruction document is best split into two parts. The header holds metadata that lets the model quickly decide when to use the skill. The body holds the operational instructions that describe how to do the work. The quality of the when-to-use description in the metadata directly determines whether the skill triggers correctly, so it should state the task type, the characteristics of the input, and the cases where it does not apply, avoiding vague wording.
3. Progressive Disclosure: Controlling the Context Budget
The core technique in skill design is layered loading. The first layer loads only the name and when-to-use description, which uses very little context. The second layer loads the main instructions once a match is determined. The third layer reads reference material and templates on demand. This keeps trigger accuracy high while avoiding a single large dump of text.
Practical advice: keep the main instructions within a few hundred lines, move lengthy specifications, example collections, and edge cases into the reference material, and state in the body when to read which file. Scripts should encapsulate deterministic logic such as format validation, data conversion, and batch renaming, leaving uncertain judgment to the model.
4. Two Typical Application Paths
Path one, a standalone skill. The focus is the basic structure, planning, and general-purpose scenarios, with the goal of having the model reliably reproduce a class of document, design, or analysis workflow.
Path two, a skill combined with tool calling. When external tool interfaces already exist, the skill takes on orchestration and knowledge responsibilities: it defines the call order, retry strategy on failure, parameter validation rules, and the format for summarizing results, turning raw interface capability into an end-to-end workflow.
5. Authoring Steps and Quality Checklist
- Define the boundaries: state the input, output, acceptance criteria, and prohibited actions.
- Get it working first, then optimize: validate feasibility with a minimal instruction set, then add detail step by step.
- Make instructions executable: use imperative sentences and numbered steps, and avoid vague adjectives.
- Provide positive and negative examples: examples constrain output shape better than adjectives.
- Build an evaluation set: prepare several typical inputs with expected results, and run regression checks after every change.
- Version control: keep the skill in a code repository and record the reason for each change.
Example instruction snippet:
## When to useUse when the user asks for a page structure generated from a specification, or for research findings in a unified format.## Steps1. Read the fields and constraints in the specification, list what is missing, and ask all questions at once.2. Generate the skeleton following templates/page.md, without introducing undeclared dependencies.3. Run scripts/check.py to validate the structure, and fix and retry as prompted if it fails.
6. Team Collaboration and Governance
Team-level adoption requires consistency and maintainability: standardize the directory layout and naming; set up a review process where skill changes come with evaluation results; redact sensitive information and avoid writing internal data into reference material; split skills by business domain to keep the complexity of each skill under control. If cloud execution is involved, common capabilities such as container platforms, object storage, logging services, and monitoring and alerting can support version distribution, execution traceability, and anomaly tracking.
7. Common Anti-Patterns
A when-to-use description that is too broad and causes false triggers; main instructions that pile in all knowledge and bloat the context; goals written without steps; a missing evaluation set that leaves iteration without a baseline; and deterministic work handed to the model instead of a script. The way to avoid these is to separate judgment from computation, and to layer specifications separately from process.
In short, the value of a skill is that it is captured once and reused over the long term. Start with the minimal structure, use progressive disclosure to control cost, and let an evaluation set drive iteration, and agent output moves from randomly usable to reliably controllable.
