Agent Skill File Classification and Templates: A Practical Guide
This guide explains how agent skills should be structured as directories rather than long prompts, how the commonly referenced twenty entry files break down into examples and templates, the four skill categories, how dynamic loading keeps context usage under control, and a reusable template skeleton with common integration pitfalls. It is written for developers who want a maintainable, on-demand skill system.
1. First, a common misconception: a skill is not a prompt, it is a directory structure
When developers first encounter the idea of a “skill,” many assume it is just a longer system prompt. That assumption leads to two immediate problems: everything gets pushed into the context at once, so token consumption becomes unpredictable; and skills contaminate each other, leaving the model unsure which set of rules applies.
A more sound model is this: one skill maps to one folder. Inside the folder, an entry file carries the “instructions and routing” role, while heavy reference material, scripts, and templates are split into separate files. At runtime, the agent reads only the entry file’s metadata to judge relevance, loads the body only after a task actually matches, and fetches referenced material on demand. Content that is not needed never enters the context, and that is the single most important design principle of the whole mechanism.
This structure mirrors “lazy loading” and “load on demand” in software engineering: bulky, slow-changing resources are decoupled from decision logic, so the context window only carries what the current task genuinely requires.
2. What makes up the twenty skill files: count examples and templates separately
Around the skill ecosystem, a frequent point of confusion is that “the numbers do not add up.” The usual cause is counting the starter template as part of the example set. The accurate split is this: the examples directory holds several complete skills you can reference directly, the templates directory holds one blank skeleton, and the two together make up the twenty entry files that are often mentioned.
The distinction matters in practice:
- Examples teach “what to write,” covering different task types and description styles;
- Templates handle “how to write it,” keeping only structure and placeholders so example content is not mistaken for a specification;
- The actual specification should be maintained separately, defining field meanings, directory conventions, and loading behavior, with both examples and templates conforming to it.
So before integrating, read the specification first, then the template, and finally pick examples as needed, rather than copying the whole example set into your project.
3. Four categories of skills by purpose
Example skills generally fall into four categories, and the key difference between them shows up in how the trigger description is written.
- Document processing: reading, generating, converting, and validating structured documents. The trigger description should state the file type and the output form, for example “use when generating or checking a formatted report.”
- Code and engineering: code generation, refactoring, review, and test coverage. The description should state the language/framework scope and the expected output, avoiding vague phrasing like “handles code” that cannot be evaluated.
- Data and analytics: table cleaning, metric calculation, visualization, and explanations of statistical definitions. The description should include the shape of the data and common task verbs.
- Workflow and collaboration: task breakdown, template filling, multi-step orchestration, and result aggregation. The description should convey the trigger moment, such as “use when a task spans multiple stages and intermediate artifacts must be preserved.”
The value of the classification is not the naming itself, but helping maintainers judge whether a new skill duplicates an existing one, whether a description overreaches, and which layer a resource file belongs in.
4. Dynamic loading: how the context budget is saved
Dynamic loading can be understood in three steps.
Step one, metadata stays resident. The name and description at the top of the entry file are always visible, take up very little space, and are used for relevance judgment.
Step two, the body loads on demand. Only after a match does the main instruction get read into the context.
Step three, resources load on demand again. Reference documents, scripts, and sample data are read only when the instructions explicitly point to them.
A schematic entry file looks like this:
---name: report-reviewdescription: Use when generating or checking a structured report or verifying section completeness---# GoalProduce a report in the established section order and flag missing items.# Steps1. Read template/report.md to confirm the section skeleton2. Fill in each section, marking missing information as to be confirmed3. Run scripts/check.py for a completeness check# Constraints- Do not invent data; output "to be confirmed" when there is no basis- See REFERENCE.md for details, read it only when field definitions are needed
The matching directory could be:
report-review/├── SKILL.md├── REFERENCE.md├── template/report.md└── scripts/check.py
This layout compresses a single skill’s “resident cost” down to a description of a few dozen words, which keeps the overall context budget under control.
5. A template skeleton you can apply directly
A blank template should keep four blocks: metadata, applicability and non-applicability boundaries, execution steps, and a resource index. Skeleton example:
---name: <kebab-case-name>description: <one sentence on what it does + when to trigger, avoid vague phrasing>---# Applicable scenarios- <scenario one>- <scenario two># Not applicable- <explicitly excluded cases, to reduce false triggers># Execution steps1. <which resources to read>2. <main actions and decision criteria>3. <output and self-check method># Resource index- REFERENCE.md: <when to read>- scripts/: <when to run>
Keep three measures in mind while writing: the description must be decidable, the steps must be executable, and the boundaries must be stated explicitly. Missing any one of the three, and the skill degrades into a vague prompt.
6. Integration paths and common pitfalls
Integration paths differ by entry point. On the command line, you typically add a plugin marketplace address and then install a specific group as needed. On the web side, some example capabilities may already be built in, so confirm availability before deciding whether to deploy locally. On the API side, you generally use preset skills or upload a custom skill package, following the official quickstart documentation to get the call chain working. Whichever path you take, install on demand rather than all at once; otherwise the growing set of descriptions significantly raises the probability of false triggers.
Common pitfalls include counting the template as an example, writing descriptions too broadly, stuffing large blocks of reference material into the entry file, shipping scripts without run instructions, and failing to define non-applicability boundaries. Avoiding each of these noticeably improves the maintainability of the skill system.
When engineering support is needed, you can store reference material in object storage, run scripts on a container platform, and track invocation behavior with logging services and monitoring alerts. Baidu AI Cloud offers corresponding capabilities in these general categories, and you can integrate according to your team’s existing architecture.
