Agent Skills in Practice: From SKILL.md Files to Reusable Workflows
This article explains how to write agent skills that turn unstable task execution into explicit, reusable instructions. It covers why skills are needed, how they differ from plugins, the three-stage discovery and on-demand loading mechanism, directory placement and priority overrides, how to structure metadata and instruction bodies, steps for building reusable workflows, and common pitfalls to avoid.
Agent Skills in Practice: From SKILL.md Files to Reusable Workflows
1. Why a Skill Layer Is Needed
When teams use AI coding tools or agent runtime frameworks, they often run into the same problem: model capabilities keep improving, but the way work gets done stays inconsistent. The same code review task might require running static checks first one day and jump straight into line-by-line commentary the next. The same release note ends up in three different formats depending on who writes it. The root cause is not the model; it is that the process was never written down explicitly.
The skill mechanism addresses exactly this: it turns the execution conventions for a class of tasks from verbal experience and personal habits into instruction assets that live in a local directory, can be discovered automatically, and can be invoked explicitly. A skill typically has two parts — structured metadata in the file header that describes “who I am and when to use me,” and a body of natural-language instructions that specify “what steps to follow and what output format to produce.”
It is worth emphasizing that a skill is an instruction layer independent of both the model and the tools. It is not bound to any particular model, and it does not extend runtime capabilities, so it can be migrated across models and will not break when the toolchain changes.
2. Skills vs. Plugins: Draw the Line First
Many teams conflate the two from the start, which drives maintenance costs up sharply. One sentence captures the difference:
- A plugin defines what the runtime can do. It usually requires code, and is responsible for registering new tools, interfaces, or event hooks.
- A skill defines the order and standards a task should follow. It requires no code at all and registers no tools.
Once loaded, a skill enters the current agent’s context as instruction text. It adds no new capability; it orchestrates existing ones: reading and writing files, running shell commands, searching code, calling intermediary endpoints in external systems, and so on. This boundary brings two direct benefits. First, non-engineering roles such as testing, documentation, and operations can also contribute to process capture, since they only need to write Markdown. Second, capability extension is decoupled from process standards, so changes to the toolset do not require rewriting process documents.
The test is simple: if you want the agent to have one more action available, that is a plugin; if you want the agent to do the same thing to the same standard every time, that is a skill.
3. Discovery, Directories, and Loading: A Three-Stage Mechanism
Mature runtime frameworks usually split skill handling into three stages, and understanding them is a prerequisite for writing good skills.
- Discovery: scan a set of agreed directories and identify candidate skill files.
- Parsing and cataloging: read the header metadata and aggregate names and descriptions into a lightweight “session catalog.”
- On-demand loading: only when the task semantics match a description, or the user explicitly names a skill, is the full body read into context.
The core of this design is the context budget. Each ordinary request carries only a few dozen words of catalog information, while the actual operating manual — often thousands of words — enters context only when needed. This leads to an important writing principle: the description determines the hit rate; the body determines execution quality. A vague description means the skill never triggers; a loose body means output stays unstable even when it does.
4. Placement and Priority Overrides
Skills generally live in agreed directories. There are four common choices: a framework-specific directory under the project root, a cross-tool shared directory under the project root, a personal directory under the user’s home directory, and additional directories specified explicitly through configuration.
Priority usually follows “the closer the scope, the higher the priority,” as illustrated below (lower number means higher priority):
100 Project-specific directory200 Project shared directory300 Custom directory set via configuration400 User-specific directory500 User shared directory
When skills share the same name, the higher-priority source wins. This is very useful in practice: an individual can maintain a general version at the user level, while a project holds an override tailored to its own tech stack — preserving both personal efficiency and team consistency. It is also a risk point: when troubleshooting “why isn’t my skill taking effect,” the first step should be to check whether a same-named skill with higher priority is overriding it.
5. How to Write the Instruction File
Metadata
The file header uses YAML-style structured description and must contain at least a name and a description. Use lowercase letters and hyphens for the name, keep it semantically clear, and avoid colliding with existing skills. The description must state both “what it does” and “when to use it,” because matching relies on semantic similarity — describing only the function without the scenario noticeably lowers the hit rate.
A bad example is “handle code.” A good example is “Run a standardized review of changes before commit; use when the user asks for a code review, a pre-merge check, or a quality gate.”
Body
The body is an operating manual for the agent, and should consistently contain five blocks:
- Prerequisites: which files, environment variables, or tools must be available.
- Steps: numbered and verifiable, avoiding vague phrasing such as “as appropriate.”
- Pass/fail criteria: what counts as a pass, and what must halt execution and report back.
- Output format: a template skeleton that can be applied directly.
- Boundaries and prohibitions: what must not be done, for example no modifying production configuration and no skipping tests.
Illustrative structure:
---name: pre-merge-reviewdescription: Run a standardized pre-merge review of changes; use when the user asks for a code review or pre-merge check---## Prerequisites- The list of changed files has been identified- Static check commands are runnable within the project## Steps1. Read the change scope and list affected modules2. Run static checks and unit tests, and save the raw output3. Review item by item across four categories: correctness / security / readability / test coverage4. Output a conclusion: pass / needs changes / blocked## Output Format| Category | Issue | Location | Suggestion |## Prohibitions- Do not modify any production environment configuration- Do not return a "pass" conclusion when tests fail
6. Putting Reusable Workflows in Place
- Pick high-frequency tasks: start with tasks repeated more than three times a week whose output format must be consistent.
- Get it working before formalizing it: run it manually two or three rounds and write the real pitfalls into the body rather than writing from imagination.
- Split into small units: one skill handles one thing; chain multiple skills for complex flows so each can be iterated independently.
- Bring it under version control: commit project-level skills with the code, route changes through review, and treat body edits the same as code edits.
- Build acceptance samples: prepare three to five typical inputs with expected outputs as a regression baseline.
- Trim periodically: delete entries that have gone unmatched for a long time or have been overridden, and keep the catalog clean.
7. Common Pitfalls
- Descriptions that are too broad, so unrelated requests trigger them and pollute the context.
- Bodies that are too long, stuffing an entire specification in, consuming budget and lowering adherence.
- Overlapping with plugin responsibilities by trying to “add capabilities” through a skill, which ultimately cannot execute.
- Ignoring priority and misjudging the effective source while debugging.
- Missing stop conditions, leaving the agent retrying repeatedly on an abnormal path.
8. Summary
The value of skills is not making the agent smarter, but making a team’s working standards capturable, distributable, and reviewable. Three things are enough to get started: understand the capability boundary between skills and plugins; understand the context constraints created by discovery and on-demand loading; and write skills in the form of “scenarios in the metadata, steps and criteria in the body.” To bring skills into an enterprise development process, you can combine common cloud capabilities such as a unified container platform, logging services, and monitoring and alerting to observe and audit skill invocations and outputs centrally, so that process standards genuinely run over the long term.
