Skill Security Series: Skill Basics
Skill Security Series: Skill Basics
Section titled “Skill Security Series: Skill Basics”Introduction
Section titled “Introduction”Before going through the risks associated with Skills, let’s spend one post on what a Skill actually is, so we have a baseline understanding.
What Is a Skill?
Section titled “What Is a Skill?”In AI, a Skill is exactly what the name suggests: a capability. If we want an agent to have skill A, we need a Skill for skill A — it’s how you give the agent that ability. At its core, a Skill is a prompt written into a Markdown file for the agent to load.
That prompt encodes your experience. You write down the process and the lessons learned for a task, save them to a Markdown file, and in doing so you tell the agent how to carry out that task. Skills can also call scripts: the Markdown file can specify that a particular detail should be handled by a given script, and you place that script in the appropriate directory.
What Are Skills For?
Section titled “What Are Skills For?”In a sense, a Skill is a workflow — similar to workflows in Dify or n8n. Some tasks are a good fit for a workflow, but a Skill can accomplish them too. Not every workflow can be replaced by a Skill, of course; the comparison is only here to make the concept easier to grasp.
So what are Skills good for? Three things:
-
You don’t have to repeat yourself. Say you ask an AI to write a weekly report, and you have requirements about format, file type when saving, and tone. You have to spell those out when you ask, and then spell them out again next week to get the same result — repetitive and redundant. Package those requirements as a Skill, and from then on you just invoke it without restating anything.
-
Updates take effect everywhere at once. Take the same weekly report example: you might use a separate session for each week’s report to make later review easier. If you need to change the storage format — Excel to Markdown, say — you’d otherwise have to restate it in every session. With a Skill, you edit the Skill’s content once and every session picks up the latest version automatically.
-
New sessions keep the context. If you start a new session, you’d normally have to repeat all the earlier requirements for the weekly report. With a Skill, you just invoke it.
So Skills make sense when requirements need to be standardized, when an action repeats, or when you do something often. One caveat: if an existing tool already handles the job — converting between image formats, compressing images, and so on — just use the tool. There’s no need to build a Skill for it.
Also, one Skill should do one thing. Don’t cram multiple tasks into a single Skill, and avoid the “do-everything” Skill — it becomes hard to maintain and optimize, and it makes the agent more error-prone.
What Are the Advantages of Skills?
Section titled “What Are the Advantages of Skills?”Skills caught on because people found they make a lot of things easier:
-
On-demand loading. A conventional prompt dumped in full consumes context space, while a Skill loads only when needed.
-
The file system becomes working memory. With a conventional prompt, the context is the only workspace — all input, processing, and output pile up in one chat box. A Skill turns the file system into the agent’s external memory and workbench.
-
Composable workflows. A conventional prompt corresponds to a single task; it has no idea what other prompts exist, so it can’t coordinate with them. Skills can form a collaborative workflow, with multiple skills working together, each doing its part, to complete more complex tasks.
-
Easier to iterate and maintain. No matter how many sessions there are, they all read the rules from SKILL.md. Change it once and the change applies everywhere, and the file supports version control, so it can be continuously refined.
Skill Example
Section titled “Skill Example”Here’s the basic structure of a Skill.
A skill is a folder (named with lowercase letters and hyphens), containing a SKILL.md file (with SKILL in all caps). The basic structure of SKILL.md looks like this:
---name:weekly-reportdescription: Generates weekly reports. Use when the user asks for a weekly report, work summary, work update, or similar.---Steps:1. Confirm which tasks the user completed this week2. Output in table format: Task | Progress | Notes3. Keep the tone friendly, like a colleague reporting to another colleague4. Save the file as Markdown in the current directoryname: the skill’s name, matching the folder name.
description: a short summary of the skill — what it does and when to use it. The formula is: description = function definition + trigger scenario / trigger words.
The content between the --- markers is metadata, called YAML front matter. The agent reads it at startup to decide which skill to invoke. Everything after the second --- is the skill body, which describes the specific steps, rules, and so on. The body is only read once the agent has decided to invoke that skill.
The key here is the description. It must clearly state the function and the trigger scenario; otherwise the agent won’t know whether to invoke the skill. Keep these rules in mind when writing one:
A poor description can lead the agent to load the wrong skill, wasting time and tokens. It can also lead the agent to conclude it can handle the request itself and skip the Skill entirely — again wasting time and tokens.
-
Follow the formula: description = function definition + trigger scenario / trigger words.
-
Write the description in the third person or as a plain statement — no personal pronouns. For example, instead of “You can use this skill to recognize PDFs and generate statistics tables,” write “Recognizes PDFs and generates statistics tables.”
-
Keep it short: 50–200 characters is the recommended range.
-
Add negative triggers. As you install more skills, several may be able to handle the same task. You can define boundaries in the description — when this skill should not be triggered.
One more thing: before you decide to build a Skill, you need to be thoroughly familiar with the whole process. Otherwise it’s hard to produce a stable skill. Confirm the following first:
- Problem: what problem are you solving?
- Scenario: who uses it, and when?
- Input: what information needs to be provided?
- Output: what should the skill produce?
- Rules: what constraints apply?
- Prohibitions: what must it never do?
On-Demand Loading
Section titled “On-Demand Loading”Skills load on demand, a mechanism also called progressive disclosure:
Loaded at startup: when the agent starts, it loads the YAML front matter of all skills. When the user issues an instruction, the model uses its content to decide which skill to use.
Loaded when used: once the agent has chosen a skill, it loads that skill’s body and executes it.
Loaded when necessary: complex skills may involve more than one SKILL.md. They can have associated files — Markdown references under a references directory, Python scripts under scripts, and static assets such as images and PDFs under assets. These files are only needed when a specific task triggers them; if it isn’t triggered, they aren’t loaded. Hence “loaded when necessary.”
How to trigger them is described in SKILL.md — for example, “when XXX is needed, call scripts/test.py to handle it.” When specifying paths, prefer paths relative to the skill’s root directory and keep the reference only one level deep. Avoid nested references where A points to B and B points to C; that can confuse the agent and inflate token usage.
How Skills Differ from MCP
Section titled “How Skills Differ from MCP”A few concepts come up in the context of agents:
Prompt: the instruction the user gives the AI.
LLM: the agent’s brain — it handles reasoning and issues instructions.
Context: the set of information the agent works with while handling the current task.
Tools: the tools the agent can call, including built-in and extended tools.
Skill: a concrete operating manual written for the agent to follow.
MCP: the standard interface through which external tools connect to the agent.
Skill and MCP are easy to confuse. In one sentence: a Skill tells the agent how to do something, while MCP lets external tools plug into the agent so it can call them.
Some Tips for Using Skills
Section titled “Some Tips for Using Skills”- Although the agent only loads skill metadata at startup, too many skills still consume context. The official recommendation is 20–50 installed skills at most. If the metadata is in Chinese, each character takes more space, so you should reduce that number further. Disable skills you don’t need.
Use layered management as well: put commonly used skills in the global directory, and project-specific ones in the project skill directory. That way the agent doesn’t load every Skill at startup.
-
Keep the
SKILL.mdbody short. Split it up — move different functions into associated files. Aim for under 5,000 tokens, or under 3,800 Chinese characters, so the body doesn’t eat too much context. -
Once a skill is used, its content stays in the current session’s context. Using several complex skills in a row consumes a lot of context; start a new session when appropriate to avoid this.
Conclusion
Section titled “Conclusion”In short, a Skill packages your own experience and hands it to the agent as text and code.
That’s Skill basics for this Skill Security series. Thanks for reading.