How a Markdown File Can Change AI Behavior
Skill packages are structured prompts that guide large language models toward specific workflows, formats, and decision criteria. This article explains how they work, how their Markdown entry files are loaded and executed, and how to diagnose failures caused by matching issues, file structure, instruction conflicts, context limits, or vague requirements.
1. Where the Problem Comes From
After installing a skill package in an AI coding tool, users often notice that the output style changes significantly for the same instruction. However, it is not always clear what caused the change or whether the skill was activated as intended. When it fails to take effect, the troubleshooting path is often just as unclear.
These issues share the same root cause: a lack of understanding of how a block of text can change a model’s behavior. This is the foundation for designing, selecting, and debugging skill packages. Without it, writing descriptions, choosing operating modes, and coordinating multiple skills becomes a process of trial and error.
2. The Essence of a Skill Package: A Structured Prompt
First, it is important to clarify a common misconception. A skill package is not a plugin or an independently running program. It does not add new underlying capabilities to the model. It is closer to a set of operating guidelines written for the model.
The output of a large language model is determined by its input context. When an instruction is included in that context, the model considers it while generating each token, which changes the direction of the output. A skill package works by placing an organized set of instructions into the context at the appropriate time. It guides the model to follow specific steps and output formats within the capabilities it already has.
For example, giving an experienced engineer a team code review checklist does not change the engineer’s underlying judgment. However, the review results will be organized around the dimensions defined by the checklist. A skill package works in a similar way.
3. Skill Package Directory Structure
my-skill/├── index.md # Required entry file├── templates/ # Output templates│ └── report.md├── references/ # Reference materials, such as team style guides│ └── style-guide.md├── examples/ # Examples of the expected output│ └── sample.md└── scripts/ # Helper scripts that the tool can call└── validate.sh
All directories other than the entry file are optional. Each type of supporting file has a different role:
- Templates constrain the output structure.
- Examples help calibrate the expected style.
- Reference materials provide additional domain knowledge.
- Scripts perform deterministic checks.
Delegating predictable tasks to scripts can reduce the inconsistencies caused by the model’s freedom to improvise.
4. The Two-Part Structure of the Entry File
The entry file consists of two parts: metadata and the main body.
The metadata section appears between two sets of three hyphens and usually uses a key-value format:
---name: api-doc-writerdescription: Generate API documentation from function signatures and code comments. Use when the user asks to write or update API documentation.---
The main body is written in Markdown. It contains the role definition, execution steps, output format, and constraints.
The description field is especially important. Tools commonly use it to determine whether a skill package should be selected for a particular conversation. If the description is too vague, the skill may not be loaded when needed. If it is too broad, the skill may be activated for unrelated tasks.
5. How the Skill Is Processed at Runtime
For a typical request, the process usually has four stages:
- Intent detection: The tool reads the user’s request and compares it with the
descriptionfields of available skill packages. - Loading: After a match is found, the tool reads the entry file’s main body. To control context length, supporting files are usually read only when needed rather than loaded all at once.
- Execution: The model follows the steps in the main body and reads templates or reference materials when necessary.
- Output: The result is returned in the required format. If a script was called, its output can also be used as input for subsequent decisions.
The effectiveness of a skill package depends on three factors:
- Whether it is selected correctly.
- Whether its instructions are clear and executable.
- Whether supporting materials are read at the right time.
If any of these stages fails, the final output may deviate from expectations.
6. Common Failure Causes and a Troubleshooting Order
When troubleshooting, check the following issues in order:
- Description matching: Does the request contain the keywords or intent covered by the description? Use the tool’s logs or debugging information to confirm which skill packages were loaded.
- File location and format: Is the entry file in a directory that the tool scans? Are the metadata delimiters and indentation correct?
- Instruction conflicts: Do the instructions in the main body conflict with global settings or requirements from other skill packages?
- Context contention: Loading too many supporting files at the same time can cause important instructions to be truncated or diluted.
- Vague instructions: Requirements such as “make it more professional” are difficult to execute consistently. Replace them with specific structures, fields, and evaluation criteria.
7. Design Principles
- The description should explain when to use the skill, not merely what it is.
- Use verifiable verbs in instructions, such as “list,” “validate,” and “output as a table.”
- A skill package should solve one category of problem. When its responsibilities become too broad, splitting it into multiple skill packages is usually easier to debug than combining everything in one file.
- Keep only the skill packages that are actually used. Every loaded skill consumes context space and increases the chance of instruction conflicts or unintended activation.
