Agent Skill Packages: Principles and On-Demand Loading
Large language model applications that move from single-turn Q&A to multi-step work often bury stable rules in ever-growing prompts. This article explains skill packages as load-on-demand capability modules, how progressive disclosure saves context, how they differ from tool calls and sub-agents, and how to write, test, version, and retire them.
Where the Problem Comes From
Once LLM applications move from single-turn Q&A to multi-step tasks, prompts grow quickly. Review, troubleshooting, release checks, and data cleaning each have stable rules: what to inspect first, what is forbidden, which output format to use, and how to fall back on failure. Writing those rules into every conversation consumes context and lets behavior drift with wording. Prompt copies maintained by different people also diverge, so production results become hard to reproduce.
A skill package is not another longer system prompt. It turns a repeatable capability into a module: when to enable it, which steps to follow, which scripts and references it needs, and what counts as done. The agent decides whether to load it for the current task, instead of requiring the user to remember “please enable such-and-such mode.”
What a Skill Package Is
Think of a skill package as a capability unit loaded on demand. It usually contains four kinds of content.
First, an instruction file that states the goal, trigger conditions, execution steps, output contract, and prohibitions. This part is required. Second, scripts that take on deterministic work: format validation, file conversion, static checks, batch renaming, and similar tasks. The model judges and orchestrates; scripts perform repeatable computation. Third, reference material for longer specifications, glossaries, examples, and edge cases, so those details are not stuffed into the opening instructions. Fourth, templates and assets, such as report skeletons, checklists, and sample configuration.
A common layout looks like this:
skill-name/SKILL.mdscripts/references/assets/
SKILL.md uses a short preamble for the name, purpose, and trigger cues, then describes the operating procedure. The name should express a capability, not a slogan—for example, “release-note generation” or “API-change verification.” The description should state both what the skill does and what it does not do, so routing can distinguish it from similar skills.
Progressive Disclosure
Context is scarce. Loading the full text, scripts, and references of every skill at startup wastes budget and lets unrelated rules interfere with each other. Progressive disclosure means exposing only enough summary to choose, reading the body after relevance is confirmed, and opening a reference or running a script only when execution reaches that step.
In practice, use three layers. The first is a catalog: name, one-sentence purpose, and typical trigger phrases. The second is the procedure: steps, inputs and outputs, and failure handling. The third is deep material: long specifications, historical cases, and script parameter notes. During matching, the model needs only the first layer. After the user confirms, or when task features clearly match, it enters the second layer. It consults the third layer only for exceptions.
There is also an engineering benefit: skills can evolve independently. Revising one review standard does not require rewriting the entire system prompt, and unrelated tasks do not pay the context cost of the new rules.
How Skills, Tool Calls, and Sub-Agents Divide the Work
These three mechanisms are often mixed together. Separate them by state, permissions, and reuse granularity.
A skill package is about process and standards. It tells the agent how to think about a class of tasks, how to organize artifacts, and when to call tools. It usually does not hold long-lived connections to external systems, and it does not replace authentication.
Tool calls are about capability access. Querying logs, reading and writing object storage, sending messages, and operating a code repository are controlled actions on external systems. A tool should have a clear input schema, permission scope, timeout, and idempotency requirements. A skill may specify when to call which tool and how to interpret the result, but it should not place secrets, accounts, or unlimited permissions in the skill directory.
Sub-agents are about task decomposition. When a problem needs parallel retrieval, independent review, or an isolated context, the main agent can hand a subtask to a narrower executor and define its available tools and return format. A sub-agent is not a substitute for a skill: the skill supplies a reusable procedure, and the sub-agent supplies an isolated execution context. A subtask can load a skill and then call tools.
A simple rule: skills decide the standard to follow, tools decide which systems can be acted on and how, and sub-agents decide which isolated context the work runs in. If a script can compute the result in one pass, do not leave it to multi-turn reasoning. If the step has external side effects, do not disguise it as a pure text instruction.
How to Write a Usable Skill
Start with a task whose boundary is clear, that recurs, and whose acceptance criteria are observable. A scope that is too broad—for example, “help me do all engineering work”—cannot be routed or tested. A scope that is too narrow, such as changing a single punctuation mark, is not worth packaging.
SKILL.md should include:
- Purpose: one sentence describing the output.
- When to use: positive examples and counterexamples. Counterexamples significantly reduce false triggers.
- Inputs: materials the user must provide, and how to ask when they are missing.
- Steps: written in order, with the basis and stop condition for each step.
- Output: structure, required fields, length, and tone.
- Constraints: do not invent data, do not exceed permissions, and do not change files that were not requested.
- Failure handling: fallbacks when information is insufficient, a tool errors, or results conflict.
Use executable language. Avoid phrases that cannot be checked, such as “be as professional as possible” or “optimize appropriately.” When a stable format is required, give a minimal example rather than a long sample, so the model does not copy facts from the example.
Scripts should perform only deterministic logic. Document runtime prerequisites, parameters, and the meaning of failure codes. Do not hard-code environment addresses or secrets in scripts. Keep references short and searchable, and name files by topic. Mark the version of outdated specifications or remove them, so the model does not cite retired rules.
Debugging and Acceptance
Skill defects rarely look like “it cannot run at all.” They more often appear as occasional drift: the skill is not loaded when it should be, it takes over a task it should not, or the steps run but the artifact is missing fields. Debug against repeatable cases, not the feel of a single conversation.
Prepare three kinds of examples. Hit cases: the description matches the skill’s goal, and the expected behavior is to load it and finish according to the procedure. Near-miss cases: the wording is similar but belongs to another skill or should be answered directly, and the expected behavior is not to load it or to refuse clearly. Incomplete cases: a key input is missing, and the expected behavior is to ask first rather than invent an answer.
After each change, record whether routing was correct, whether steps were skipped, whether the output met the contract, whether tools were called unnecessarily, and whether unnecessary long documents were read into context. Turn failed conversations into minimal reproductions and add them to a regression set. Evaluate both quality and cost: a correct result that always reads every reference is still not an acceptable design.
Human sampling remains necessary. Automated checks fit fields, length, banned words, and script exit codes. Whether facts hold and whether trade-offs are reasonable needs domain review. The skill instructions should state which conclusions must be traceable to materials the user provided.
Versioning, Release, and Governance
Once several people use a skill, it enters configuration management. Keep the skill directory in version control, and record the motive and impact of each change. Breaking changes—renaming output fields or reordering steps—should bump the version and keep migration notes.
Before release, run a minimal check: the instruction file exists and can be summarized; the description matches the body; scripts run in a clean environment; there are no secrets, personal data, or internal addresses; and the copyright and source of references are clear. A gradual rollout can enable the skill for a small set of tasks or projects first, watch the false-trigger rate and the rate of manual rework, and then widen the scope.
Follow least exposure for permissions. A skill may recommend a class of tool, but authorization stays with the runtime. Separate read-only retrieval from writes, deletes, and external sends. For steps with external side effects, require explicit confirmation in the skill; do not continue by default.
Retirement needs a design too. Remove an outdated skill from the routing catalog instead of leaving a note that says “not recommended.” Otherwise the model may still select it under a vague description.
A Concrete Scenario
Take “change-note generation” as an example. The trigger is that the user provides a summary of the change, the affected modules, and whether the change is incompatible. The skill’s steps are: check that the input includes scope, risk, and rollback; if anything is missing, list the gaps; if it is complete, emit a fixed structure covering background, change points, compatibility, verification, and rollback. Do not invent performance numbers or interface behavior that were not provided. If a change record exists in the repository, a read-only tool may extract the title and scope, but if that extract conflicts with the user’s material, stop and explain the conflict instead of deciding on its own.
This skill does not perform the actual release and does not modify code. Release belongs to a permissioned tool flow. Code changes belong to a stricter skill or to human review. Once responsibilities are split, routing is more stable and auditing is easier.
Common Mistakes
Treating a skill as a longer persona. A persona changes tone; a skill should change a checkable process. Style without steps and an output contract has limited reuse value.
Putting every rule into one universal skill. Routing gets worse and context grows. Split by task type, and use counterexamples so skills do not compete for the same request.
Using a skill to hide an unreliable tool. When a script or external call fails, expose the error. Do not instruct the model to “fill in a plausible result” to conceal failure.
Ignoring negative constraints. If you only say what to do and not what not to do, the model fills gaps with general habits—refactoring on its own, widening the edit scope, or adding sections that were not requested.
Closing
The value of a skill package is to lift repeated, describable, verifiable work out of ad hoc prompts and into modules: loaded on demand, disclosed in layers, coordinated with tools and subtasks, and able to be versioned, regression-tested, and retired. Start with a task that has a clear boundary, constrain behavior with hit, near-miss, and incomplete cases, then add scripts and references. What you build is not a more ornate prompt, but a maintainable agent capability.
