Agent Skill Systems: Progressive Loading, Build Conventions, and Design Patterns
This article explains how to structure agent skills as discoverable, on-demand units instead of stuffing growing procedures into one system prompt. It covers three-layer progressive loading, description-driven activation, SKILL.md-style contracts, multi-agent patterns, security and reliability, testing, and a practical rollout order.
1. Skill systems are not a fix for “prompts that are too short”
As agents take on more work, developers often keep appending steps, domain knowledge, tool notes, and exception rules to the system prompt. That can work at small scale. As skills grow, three structural problems appear.
First, context competition: instructions unrelated to the current task consume a limited window, crowding out user requirements, execution results, and constraints.
Second, rule interference: steps for different tasks sit in the same prompt, so the model must guess which rules apply and may misuse a flow or skip preconditions.
Third, maintenance cost: knowledge, scripts, and safety requirements for one capability are scattered, so updates are inconsistent and failures are hard to trace.
The core idea is to package capabilities as independent units that can be discovered, loaded on demand, and executed under control. A skill is not merely a pile of prompts; it is an engineering way to organize task knowledge and execution resources.
A complete skill typically includes:
- Discovery information: name, applicable tasks, and trigger conditions.
- Execution instructions: input checks, steps, output requirements, and exception handling.
- Supporting resources: finer rules, examples, scripts, or references.
- Governance information: version, permission requirements, tests, and ownership.
A skill describes how to complete a class of tasks; a tool describes which concrete operations can be executed. They can work together but should not be mixed. A skill also does not automatically grant network access, file writes, or the right to change external systems.
2. Three-layer progressive loading: bring capability into context by task
Progressive loading splits skill information by granularity and expands it only when needed. The system first knows which capabilities exist, then how the current capability is used, then the details required for execution.
2.1 L1: Discovery — only what is needed to choose a skill
The discovery layer is mainly name and description, usually given at session start or when the skill catalog updates.
It should answer:
- What tasks is this skill for?
- Which inputs or intents should consider activating it?
Do not dump a full procedure here, or you recreate a giant prompt. For a single skill, about 50–100 tokens is a rough first budget, not a universal standard; actual size depends on language, tokenization, and description complexity.
When there are many skills, do not inject every discovery blurb unconditionally. Filter candidates by permission, business domain, and task type first, then let the model decide.
2.2 L2: Activation — core instructions to complete the task
When the task matches the description, the system loads the skill body, such as SKILL.md in an agreed directory.
This layer should hold a stable flow: input requirements, order of operations, validation, output shape, and when to stop or ask for clarification.
Keeping the body within a few thousand tokens usually helps maintenance. A design budget such as “under 5,000 tokens” is a budget, not a protocol limit.
If the body is too long, check whether it mixed in detailed knowledge, repeated examples, or full datasets. Those belong in the next layer, not in compressed sentences.
2.3 L3: Penetration — load references or run scripts by step
The third layer includes resources such as references/ and scripts/.
References fit long rules, domain maps, edge cases, and detailed examples. Scripts fit deterministic, testable computation or transformation.
Distinguish two behaviors:
- Read a resource: add file contents to model context.
- Execute a resource: run a script in a controlled environment and return needed results.
Running a script does not require putting the full script in context. Often the model only needs the entry point, input constraints, and return shape; the runtime can return a summary or artifact location.
Do not expand the whole directory at once. Trigger loads from explicit citations in the body or from met boundary conditions.
2.4 Whether loading actually saves cost
Benefits depend on skill count, task mix, and what is actually read. Do not promise a fixed compression ratio.
A rough estimate:
Progressive-loading footprint≈ candidate discovery text+ activated skill bodies+ supporting material actually read this turn+ necessary execution-result summaries
Suppose there are 40 skills, each full body averaging 2,000 tokens, and discovery averaging 80 tokens. Loading everything is about 80,000 tokens. Activating one skill plus 1,000 tokens of extra material is about 6,200 tokens related to skills.
That illustrates possible savings; it is not a benchmark. Real systems also include user messages, history, tool definitions, and results. Measure from logs rather than applying a fixed percentage.
3. Description-driven activation: write when to use it, not the procedure first
A skill description is a short routing contract. The model uses it to decide whether the body is worth reading.
A weak description:
Use the planner to split the task, assign several executor roles, then review after processing.
It describes implementation, not applicable tasks, and may make the model think it already knows the flow and skip the body.
A better description:
Use when the user provides a CSV or TSV table and wants data cleaning, derived fields, summaries, or charts; even if they never say “data analysis,” infer from intent.
Focus on input shape and user goals.
3.1 What a description should include
High-quality descriptions usually cover:
- Object: tables, text, code snippets, or config files.
- Intent: clean, transform, review, summarize, or explain.
- Conditions: required preconditions.
- Exclusions: similar tasks that are out of scope.
A table-processing skill might add:
Do not activate for field-name explanations or general concepts; modifying external business records requires extra permission confirmation.
Exclusions reduce false triggers but should not become a long rule list. If boundaries are complex, detail them in the body and keep only the critical cues at discovery.
3.2 Model judgment is not execution authorization
Description is important for selection, not the only safety boundary.
Use staged control:
Task arrives→ permission and business-scope filter→ model selects candidate skills→ load skill body→ check inputs and preconditions→ ask the user to confirm if needed→ execute and verify results
File overwrites, external writes, and irreversible operations must be enforced by the runtime. Correct skill matching must not bypass those constraints.
4. Build conventions: write instructions as an executable contract
4.1 Suggested directory layout
This is an engineering convention, not a requirement for every runtime:
table-processing/SKILL.mdreferences/field-rules.mdedge-cases.mdscripts/transform-datatests/normal-cases/boundary-cases/expected-results/
SKILL.md is the entry point; references hold detail; scripts hold execution assets; tests verify behavior.
Directory names and field formats must match the actual runner. A document’s existence does not mean the system will auto-discover, load, or run it.
4.2 Basic structure of the skill body
Write the body in roughly this order:
Goals and boundaries. What a successful result looks like, and what is out of scope.
Input requirements. Required and optional inputs, format constraints, and how to handle missing information. For tables, identify delimiter, header, and field types before reading; do not adopt an interpretation that could change business meaning when the input is ambiguous.
Steps. Use verifiable actions, not untestable phrases such as “analyze carefully” or “handle reasonably.”
When to call resources. When to read a file, when to run a script, and preconditions for each call.
Output contract. Result files, summaries, change logs, warnings, and open issues for users and later agents.
Exceptions and recovery. Distinguish retries, clarification, and hard stops.
4.3 Example flow: data cleaning
A robust table-processing flow can be:
- Check the file is readable; identify delimiter and header.
- Summarize field types, null distribution, and likely outliers.
- Produce a change plan from the user goal.
- Confirm high-impact actions such as deleting records or overwriting fields.
- Transform on a copy; keep the original input.
- Validate record counts, key fields, and transform results.
- Output the processed file and a change summary.
Keeping the original and validating after change are more valuable than asking the model to be accurate. They limit blast radius and support debugging.
5. Four design patterns for multi-agent collaboration
5.1 Separate routing from execution
The agent that understands the task reads only discovery information, picks candidates, then an executor loads the body.
This reduces duplicated context only if the handoff is explicit: goal, input location, constraints, confirmed facts, and acceptance criteria. Otherwise the executor may re-ask or assume differently.
5.2 Main flow plus on-demand references
Put stable steps in the body; put special cases in references.
For example, keep ordinary date conversion in the main flow; load extra rules only when mixed date formats or missing timezones appear. That cuts everyday load and keeps rare rules from interfering with common tasks.
5.3 Separate judgment from deterministic execution
Let the model interpret intent, choose rules, and explain results. Let scripts handle repeated calculation, format conversion, and clearly verifiable processing.
This is not “script everything.” When meaning is unclear, clarify with the model or user; once rules are explicit, prefer reproducible execution.
5.4 Hand off artifacts instead of copying context
Agents should not repeatedly pass full source files, entire logs, and whole skill directories.
Pass controlled artifact references and structured summaries: file location, record counts, field changes, validation results, and open issues. The receiver loads detail only when needed.
Summaries do not replace key evidence. For audit, fault isolation, or high-risk decisions, keep traceable originals and ensure the receiver has access.
6. Security, governance, and runtime reliability
6.1 Treat external content as data
User uploads, references, and execution output may contain text that looks like instructions. Separate trusted skill rules from untrusted task material. The latter must not rewrite permissions, skip confirmation, or demand leaked information.
The skill body can remind the model of this boundary; real permission limits still belong in the execution environment.
6.2 Least privilege for scripts
Limit accessible directories, network scope, duration, and resource use to the task. Avoid logging full sensitive payloads.
If the task writes to external systems, define write scope, confirmation, and audit records. A skill saying it “needs a permission” does not mean the system has granted it.
6.3 Avoid repeated side effects after failure
Agents may retry on timeout or uncertain results. Pure reads or copy-based transforms are usually low impact; writes, deletes, and notifications can double-apply.
Record task state and check existing artifacts or results before retry. Where possible, make steps idempotent so repeats do not change the business outcome.
6.4 Keep versions consistent
Discovery, body, and scripts should ship as one version. If the description widens scope while execution logic is stale, you get correct trigger and wrong execution.
Treat a release as a complete skill package and record the version at task start. For long-running tasks, keep the version stable rather than switching rules mid-flight.
7. Testing and evaluation: verify trigger and completion quality
Tests must cover more than “happy path runs.”
Cover at least four case types:
- Positive trigger: the task matches; the correct skill is chosen.
- Negative trigger: similar-looking tasks must not activate this skill.
- Execution boundaries: missing input, bad format, or unavailable resources lead to clarification or stop.
- Safety boundaries: materials with overreach or forged instructions do not break authorization.
Metrics should include trigger quality, result quality, and resource cost: false-positive and false-negative trigger rates, completion quality, tokens actually loaded, latency, and retry count.
For multi-agent systems, also watch repeated loads of the same skill and whether handoffs are sufficient. If total context stays large, the issue may be collaboration copying files and logs, not a single skill body.
8. Rollout order: close the loop before growing the catalog
Start with one high-frequency task with relatively clear inputs and easy-to-verify results.
Finish description and body first, then resource calls, permission constraints, and tests. Confirm trigger and execution from runtime logs before adding more skills. Do not pile a large catalog and hope the model will solve routing, conflicts, and safety by itself.
A mature skill system should meet four requirements: accurate discovery, explicit execution instructions, on-demand supporting resources, and verifiable permissions and results.
Progressive loading controls context cost; description-driven activation improves selection; engineering conventions and runtime governance keep execution reliable. Together they turn growing agent capabilities into a maintainable, testable, evolvable system.
