SKILL.md Configuration Guide: Parsing and Templates for Four Standard Skill Types
This article explains how to structure and configure SKILL.md files for AI coding tools, moving from ad-hoc prompts to engineered, reusable capability packages. It covers the standard Skill directory layout, the four common SKILL.md configuration types (meta-declaration, workflow-directive, resource-index, and interaction-guardrail), and how progressive loading keeps context usage constant regardless of Skill size. You will also find a copy-ready base template, deployment and distribution options, and common mistakes to avoid when building reusable AI agent skills.
1. Introduction: From One-Off Prompts to Engineered Capability Packages
In the early practice of using AI coding tools, developers often wrote task instructions directly into the prompt box of a chat window. This approach seems flexible, but it hits three clear engineering bottlenecks. First, prompt length grows linearly with task complexity and easily exceeds the context window limit. Second, the same instruction logic cannot be reused across different projects, causing duplicated effort. Third, when instructions contain a large amount of background knowledge or business rules, that content continuously occupies context space, even in turns where it is not needed.
To solve these problems, the industry has gradually adopted an idea of “capability packaging”: organizing instructions, reference material, and helper scripts into a standardized directory structure that the AI coding tool loads on demand at runtime. The core configuration file in this structure is named SKILL.md. The essence of this packaging approach is turning “a piece of unmanageable text” into “a software engineering artifact that is versionable, reusable, and incrementally loadable.”
Understanding this shift requires looking at two dimensions: the static structure of file organization and the dynamic behavior of runtime loading. This article is organized around these two dimensions. It systematically reviews the common categories of SKILL.md and provides configuration templates you can apply directly.
2. What a Skill Really Is: A Folder, Not a Prompt
A standard Skill directory usually contains the following:
my-skill/├── SKILL.md # Core instruction file, required├── REFERENCE.md # Detailed reference material, optional├── scripts/ # Helper scripts directory, optional│ └── helper.py└── assets/ # Static resources such as templates and sample data, optional
Among these, SKILL.md is the only required file. It serves two responsibilities:
- Declaring metadata: Through structured fields in the file header, it tells the host environment what this Skill is called, when it should be triggered, and what prerequisites it needs.
- Providing execution instructions: Below the metadata, it describes in natural language the behavior logic, output format, and cautions the Skill should follow once activated.
REFERENCE.md and the scripts/ directory carry the “heavyweight” content. When the task needs to consult a business specification, look up the parameter list of an API, or run a data processing script, the system brings the corresponding content into the current context only at that point. This “load on demand” mechanism is a common design principle for context management in current AI coding tools: content that is not used does not enter the context.
The direct benefit of this design is that the size of a Skill can expand indefinitely, while the context cost of a single invocation stays constant. Developers no longer have to compromise between “instruction completeness” and “context savings.”
3. Four Standard SKILL.md Configuration Types
Based on differences in instruction density, interaction level, and dependent resources, SKILL.md can be grouped into the following four types. In a real project, a single Skill often contains elements of multiple types, but understanding the distinct characteristics of each type helps you consciously divide the structure when writing.
3.1 Meta-Declaration
The core goal of this configuration type is to let the system correctly identify the Skill’s identity and trigger timing. The content itself does not include complex execution logic.
Typical fields include:
---name: pdf-form-fillerdescription: Use when the user needs to fill PDF form fields in bulkversion: 1.0.0tags: [document, automation]---
Design points:
nameshould use lowercase letters and hyphens, and stay consistent with the directory name for easier log tracing and troubleshooting.descriptionis the key basis for trigger matching. It should describe “in what scenario to use it” rather than “what this Skill does.” For example, “Use when the user needs to fill PDF form fields in bulk” is better than “A PDF form filling tool.”- The version number is strongly recommended in team collaboration scenarios to make rollback and dependency management easier.
3.2 Workflow-Directive
This configuration type contains an explicit sequence of steps that defines the complete path of a task from input to output.
A typical structure:
## Execution Workflow1. Receive the source file path provided by the user2. Parse the file structure and extract the fields to process3. Apply validation rules to each field (see Section 2 of REFERENCE.md)4. Generate the output file and write it to the specified directory5. Return a summary of the processing results
Design points:
- Step numbers must be consecutive and unique to avoid ambiguity when the model skips a step during execution.
- If a step has conditional branches, write the decision condition explicitly. For example: “If validation in Step 3 fails, skip that field and mark it as an exception in the final report.”
- For steps that involve external dependencies (such as calling a script or reading a file), note the pre-check logic for the dependency.
3.3 Resource-Index
When a Skill needs to reference external files, SKILL.md does not inline all the content but instead provides index pointers.
A typical form:
## Reference Resources- Field validation rules: see the "Validation Matrix" section of `REFERENCE.md`- Error code lookup table: see `assets/error-codes.json`- Data preprocessing script: located at `scripts/clean.py`; ensure a Python 3.10+ environment before use
Design points:
- Index paths should use relative paths so the Skill directory remains usable after being moved or cloned.
- Each index item should include a one-line note on “when to read this file” to help the runtime decide whether to load it.
- For large reference files (such as specification documents over 500 lines), split them further and mark the specific section in the index rather than loading them in full.
3.4 Interaction-Guardrail
This configuration type defines the behavioral boundaries during Skill execution to prevent output from deviating from expectations.
Typical content:
## Behavioral Constraints- Do not modify the source file; write all output to a new file- When the input file is missing a required field, stop immediately and return an error message; do not attempt to infer a default value- The output format must be JSON; do not wrap it in Markdown code blocks- The maximum number of files processed per run is 50; when exceeded, prompt the user to run in batches
Design points:
- Constraints should be written as decidable rules, avoiding vague phrasing such as “try to” or “appropriately.”
- Safety-related constraints (such as not modifying source files or not making network requests) should be placed near the top of the file to ensure they take priority over subsequent instructions.
- For behaviors prone to ambiguity (such as error handling), state clearly whether to “stop” or “skip and continue.”
4. Runtime Loading Mechanism: Why “Unused Content Stays Out of Context” Matters
After understanding the four configuration types, you also need to understand how the system consumes these files at runtime.
Mainstream AI coding tools generally adopt a progressive loading strategy:
- Initial stage: Only the metadata part of SKILL.md is loaded (the
nameanddescriptionin the YAML header) to decide whether the current task needs to activate the Skill. The context cost at this stage is minimal. - Matching stage: When the task description semantically matches the Skill’s
description, the full body instructions of SKILL.md are loaded. - On-demand stage: During execution, if the process encounters an instruction like “see REFERENCE.md” or “run scripts/xxx.py,” the corresponding resource is loaded only then.
The core value of this mechanism is that the context window is a scarce resource, and any information not used by the current turn is wasted.
Suppose a project has 15 Skills installed, and each Skill’s REFERENCE.md averages 800 lines. With full loading, the reference documents alone would consume tens of thousands of tokens, far exceeding the context limit of most models. Progressive loading ensures that only the content truly needed by the current task is in the context at any given moment.
For developers, this means that when writing SKILL.md you can follow a simple principle: anything not needed by the current step should be moved into REFERENCE.md or scripts/ and referenced through the index.
5. A Base Template You Can Apply
The following is a general SKILL.md template that covers all four configuration types. You can copy it and modify it for your actual scenario:
---name: your-skill-namedescription: Use when [specific scenario description], to [core action]version: 0.1.0tags: [tag1, tag2]---# Skill Overview[1-2 sentences describing this Skill's input, output, and core processing logic]## Prerequisites- [Required environment, files, or configuration]- [Information the user needs to provide in advance]## Execution Workflow1. [Step 1: Receive and validate input]2. [Step 2: Perform core processing]3. [Step 3: Generate output]4. [Step 4: Return a result summary]## Behavioral Constraints- [Constraint 1: safety-related]- [Constraint 2: format-related]- [Constraint 3: exception handling]## Reference Resources- [Resource 1: file path + when to use]- [Resource 2: file path + when to use]
Usage suggestions:
- When writing for the first time, fill in the metadata and execution workflow first, get the main path working, then add constraints and indexes.
- The
versionfield should follow semantic versioning; a major version change indicates a significant adjustment to the instruction logic. tagsare used for retrieval and categorization in team collaboration; keep them to within 3-5.
6. Deployment and Distribution Strategies
Once a Skill is written, you need to consider how to distribute and load it across different environments. There are three common deployment paths:
First: install through the plugin mechanism of an AI coding tool. Some tools offer a Marketplace concept that lets developers register a Skill repository as a plugin source and then install specific Skill groups on demand. This approach suits sharing within a team, with version management handled by the tool itself.
Second: enable directly in an AI chat platform. Some AI platforms aimed at end users have common Skill libraries built in, so users do not need local configuration and can trigger a Skill by mentioning its name in the conversation. Before use, confirm whether the target Skill is already included under the current account’s permissions to avoid redundant deployment.
Third: through API calls. In scenarios that need to integrate Skill capabilities programmatically, you can upload a custom Skill through the standard Skills API or directly call a preset Skill. This approach suits embedding Skills into CI/CD pipelines, automated testing frameworks, or internal enterprise systems.
Which approach to choose depends on three factors: whether the usage scenario is interactive or batch processing, whether the Skill needs frequent iteration, and whether the team already has unified configuration management infrastructure.
7. Common Mistakes and How to Avoid Them
Mistake 1: Writing everything into SKILL.md. This causes every invocation to carry a large amount of irrelevant information. The correct approach is to keep only the core instructions required for execution and split the rest into REFERENCE.md.
Mistake 2: Writing the description as a feature introduction rather than a trigger condition. This significantly reduces the accuracy of automatic matching. Always describe the trigger scenario using the “Use when…” pattern.
Mistake 3: Installing all Skills at once. Too many Skills increase matching ambiguity and may introduce unnecessary metadata overhead. Install selectively based on project needs and periodically clean up Skills that are no longer used.
Mistake 4: Ignoring version management. A Skill’s instruction logic changes as the business evolves, and without version markers, issues become hard to reproduce. Keep all Skill directories in a Git repository and manage them in sync with the business code.
8. Conclusion
The four SKILL.md configuration types—meta-declaration, workflow-directive, resource-index, and interaction-guardrail—form a complete capability packaging unit. By understanding the boundaries and collaboration among these four types, together with the progressive loading mechanism, developers can build highly reusable AI coding capability modules without adding to the context burden.
As a practical path, start with a small but complete Skill: write a clear description, define a 3-5 step execution workflow, and add the necessary safety constraints. Once it works, gradually introduce REFERENCE.md and scripts/. As experience accumulates, abstract high-frequency patterns into team-level templates and eventually build a sustainable, evolving library of capability assets.
