Five Agent Skill Design Patterns and How the Development Ecosystem Evolves
Agent skills work better when task intent, domain rules, output templates, execution steps, and permission boundaries are separated into discoverable, loadable, and verifiable units. This article explains five design patterns—knowledge encapsulation, template generation, workflow orchestration, result validation, and dynamic routing—plus progressive loading and the governance needed to treat skills as maintainable engineering assets.
1. From Stacked Prompts to Skill Engineering
In agent applications, developers often face a contradiction: to help the model understand a task, the system keeps adding background, business rules, and operating requirements. As the context grows longer, the model is more easily distracted by irrelevant information, and both cost and maintenance difficulty rise.
The problem is not only that the prompt is too long. Information of different kinds has not been separated properly.
User intent decides what the current task is. Domain rules decide which behaviors are acceptable. Output templates decide the structure of the result. Execution flow decides the order of steps. Permission rules decide which actions are allowed. When all of this is mixed into one large instruction, the agent must repeatedly judge which rules apply to the current request.
The core of skill design is to organize this information into task units that can be discovered, loaded, and verified, so the model does not have to re-infer every constraint on each run.
A skill file does not automatically give the model new knowledge or execution privileges. It mainly provides task instructions, reference material, and behavioral constraints. Reading files, calling tools, and managing state remain the responsibility of the agent runtime.
The source material mainly shows two approaches: knowledge encapsulation and template generation. Building on that, and on general engineering practice, this article expands skill design into five patterns. The last three are engineering summaries; they are not a line-by-line restatement of any externally published checklist.
2. Basic Skill Structure: A Light Entry Point, Resources Loaded on Demand
A skill can be organized as follows:
task-skill/├── SKILL.md├── references/│ ├── domain-rules.md│ └── acceptance-rules.md├── assets/│ └── output-template.md└── scripts/└── validate_output.py
Not every skill needs every directory, and not every runtime supports the same loading mechanism. The layout expresses a separation of responsibilities:
SKILL.md: states the applicable tasks, trigger conditions, execution steps, and boundaries.references/: stores domain rules, background knowledge, and acceptance criteria.assets/: stores output templates or other static material.scripts/: stores helper logic that must run deterministically. Confirm execution permissions before using it.
The most important principle is this: the skill entry tells the agent when to use the skill and how to start; detailed resources support the actual work.
If the entry file already contains the full business manual, historical cases, and complete templates, the skill has only moved a long prompt to a new location. It has not achieved true on-demand loading.
3. Pattern 1: Knowledge Encapsulation—Making Domain Rules Reusable
3.1 What problem it solves
Knowledge encapsulation fits tasks that already have clear rules, but where the model often misses or misuses them. Examples include:
- Field naming, error responses, and compatibility conventions for service interfaces
- Index usage, pagination, and performance checks for data queries
- Naming, tagging, and environment-isolation rules for infrastructure resources
- Terminology and review standards for internal technical documents
In these tasks, the main difficulty is not performing a complex operation. It is consistently following specific rules. A skill can therefore contain only instructions and reference documents, without scripts.
3.2 How to design it
The entry description should state both the subject and the task type. Compared with “help developers be more productive,” the following is easier to distinguish:
Skill name: API convention checkApplicable tasks:- Add or change a business API- Check request parameters, response structure, and error handling- Review API compatibility and pagination designExecution requirements:1. Read the API convention reference.2. Confirm whether the current task is an addition, a change, or a review.3. Generate or check the result against the applicable rules.4. List conditions that cannot be confirmed. Do not invent business constraints.
An entry description can help a system retrieve or match a skill, but it should not be treated as a fixed “search API” that every agent runtime provides. The actual trigger may depend on keywords, semantic retrieval, rule matching, or other selection logic.
3.3 Key boundaries
Knowledge encapsulation can make rules more visible. It cannot guarantee that the model will always follow them. For critical constraints involving money, permissions, or data consistency, requirements that can be checked by machine should be verified by programs, not left solely to the model reading instructions.
Domain knowledge also needs a version, an owner, and a scope of effect. A stale rule that is followed consistently is often harder to notice than an occasional miss.
4. Pattern 2: Template Generation—Separating Output Structure from Expression Rules
4.1 What problem it solves
Generation tasks often produce content that is roughly correct but not usable as-is. A design report may lack a risk section. A failure analysis may cite no evidence. A review may fail to separate blocking issues from general suggestions.
Template generation separates two kinds of constraints:
- The template defines which sections must appear.
- The style guide defines how each section should be written.
This split reduces repeated description and lets different teams share a structure while keeping their own expression requirements.
4.2 Template example
# Technical design review## Task backgroundState the goal, current state, and constraints.## DesignDescribe the main components, data flow, and key decisions.## Risks and limitsSeparate confirmed risks, assumptions, and items still to be verified.## Validation planList checks, validation methods, and pass conditions.## ConclusionGive the recommendation and the conditions under which it applies.
A matching style guide can require that facts and judgments be written separately, that unverifiable information be marked, that conclusions correspond to earlier evidence, and that content not be invented just to fill the template.
4.3 A template is not rigid output
Templates should distinguish required items from conditional ones. When necessary input is missing, the agent can keep the section and mark it “insufficient information,” or it can ask for the missing material first.
If every task is forced into a full long report, the template adds useless content and context cost. A better approach is to provide a light structure and a full structure for different levels of task complexity, and to state when each applies.
5. Pattern 3: Workflow Orchestration—Breaking Long Tasks into Checkable Stages
5.1 Why a workflow pattern is needed
Knowledge and templates answer “what to follow” and “what the result should look like.” They do not fully answer “what to do first.”
For multi-step work such as requirements analysis, data processing, or change review, jumping straight from input to a conclusion makes it easy to skip prerequisite checks or to carry unconfirmed assumptions into later steps.
Workflow orchestration reduces that risk by executing in stages:
Check inputs→ Clarify goals and constraints→ Collect necessary evidence→ Form a candidate result→ Validate the result→ Output it or request confirmation
5.2 Every stage needs a completion condition
“Analyze the problem” is not a clear enough step. A more effective description states:
- What the input is
- What this stage must produce
- What conditions must be met before continuing
- What to do when information is missing or execution fails
In a change review, for example, input checking is complete only when the change scope, affected objects, and rollback plan are available. If any of these is missing, mark the gap. Do not assume it already exists.
5.3 When to hand work to a deterministic program
As the number of stages grows, natural-language description alone may not be enough. Strict state transitions, failure retries, concurrent tasks, and long waits should be managed by a program. The skill should explain task meaning and the basis for decisions.
In other words, a skill is suited to describing a working method. It should not replace an execution system that needs deterministic guarantees.
6. Pattern 4: Result Validation—Decoupling Generation from Acceptance
6.1 Why format checks are not enough
A complete set of sections does not mean the conclusion is correct. Useful validation should cover at least three layers:
- Structural checks: whether required fields, sections, or data types are present.
- Semantic checks: whether the conclusion matches the input and whether it contradicts itself.
- Execution-boundary checks: whether the output touches unauthorized actions or includes sensitive information.
Field types, length limits, and required items are well suited to deterministic checks. Business reasonableness and completeness of argument can be reviewed with model assistance, but a model judgment should not be treated as proof of correctness.
6.2 Illustrative check logic
The following is a general validation sketch. It does not correspond to any specific product API:
def check_report(report):required = ["background", "design", "risks", "validation"]errors = []for field in required:if field not in report:errors.append(f"missing field: {field}")elif not isinstance(report[field], str):errors.append(f"incorrect field type: {field}")elif not report[field].strip():errors.append(f"empty field: {field}")return errors
This check can only show that some structural requirements are met. It cannot prove that the report is factually accurate. Factual checks still need trusted inputs, evidence tracing, or validation results from the relevant business system.
6.3 Revision loops need a stop condition
When validation fails, the issues can be sent back to the generation stage, but the number of revisions should be limited, and fixable errors should be distinguished from missing input.
If key evidence is absent, repeatedly asking the model to “check again” usually does not solve the problem. The right action is to request more information, hand the task to a person, or state the output limitation clearly.
7. Pattern 5: Dynamic Routing—Select the Skill, Then Load Resources
7.1 What problem it solves
When there are few skills, reading each entry is still acceptable. As the set grows, overlapping descriptions, overlapping scope, and longer call chains become the main problems.
Dynamic routing treats skill selection as its own stage: first classify the task, then load the detailed resources of the candidate skills.
If a user asks to “review an API change note,” the task may involve API conventions, document structure, and change risk at the same time. The router should decide which skill owns the main task and which skills only provide supporting checks, rather than activating every skill indiscriminately.
7.2 Routing must handle ambiguity
An effective skill description should include:
- Applicable tasks
- Typical inputs
- Expected outputs
- Out-of-scope cases
- Conditions that need clarification
Negative boundaries matter especially. An “API convention check,” for example, should state that it does not perform production changes and cannot confirm actual runtime state from the description text alone.
When several skills match, prefer the one that is more specific and has clearer boundaries. If the task intent is still unclear, ask the user. Do not hide ambiguity behind a chain of calls.
7.3 Prevent unbounded delegation
If skills may call other skills, set a call-depth limit, detect repeated calls, and define a termination condition. Otherwise skills can loop, consuming context without adding information.
Routing logs should also record why a skill was chosen, so developers can tell whether the problem is an unclear description, a bad match, or a poorly designed skill.
8. Progressive Loading: Cost Optimization Must Not Come Before Task Correctness
On-demand loading can usually be split into three levels:
- During discovery, read only a short skill description.
- After selection, read the skill entry and the necessary rules.
- When execution reaches the relevant step, read detailed references or templates.
This reduces irrelevant context, but it does not justify promising a fixed percentage of savings. Actual benefit depends on task length, resource size, number of calls, and the runtime.
Useful signals include:
- Context used per task
- Rates of false triggers and missed triggers
- How often the same resource is read again
- Share of first outputs that pass validation
- Extra calls made to fill missing information
- End-to-end time and the amount of human revision
If loading too little causes the model to ask repeatedly, produce wrong results, and rework several times, a shorter single input can still raise total cost. The target should be the total cost of completing one acceptable task, not shrinking one round of input by itself.
9. The Skill Ecosystem: From Personal Experience to Governed Assets
Once skills are used at team scale, what matters is not how many skill files exist, but whether they can be governed.
9.1 Shared description conventions
Skills should use consistent statements of task scope, input requirements, output conventions, and failure handling. A shared format helps retrieval and review. A shared format does not by itself mean compatibility across runtimes; that still has to be tested.
9.2 Manage dependencies and versions
References, templates, and check scripts can all change. A skill should record its version, dependencies, and the reason for each change, so that companion resources do not remain on old rules after the entry file is updated.
9.3 Establish permission boundaries
Skill content cannot replace access control. Reading sensitive material, performing external actions, or changing production resources should require authentication, authorization, and human confirmation where needed, all enforced by the runtime.
Content in external documents should not automatically receive higher priority. In particular, a reference must not change execution boundaries merely because it says to “ignore existing limits.”
9.4 Prove quality with tests
Each skill should have representative examples covering at least normal input, ambiguous input, missing information, conflicting requirements, and requests that exceed authority. After a skill changes, check whether older tasks regress. Do not validate only the new cases.
Skill quality ultimately shows up as accurate task selection, stable results, explainable failures, and no permission overreach—not as a description that merely looks professional.
10. Conclusion: Skill Design Is About Reducing Unnecessary Uncertainty
The five patterns address different engineering problems. Knowledge encapsulation unifies rules. Template generation constrains structure. Workflow orchestration makes steps explicit. Result validation creates an acceptance mechanism. Dynamic routing controls selection and what gets loaded.
They do not require every skill to have a full directory tree, complex scripts, and multi-level calls. A simple task can use only knowledge encapsulation. A task that must be delivered consistently can add templates and validation. A complex task can then add workflow and routing.
A good skill system lets the model use judgment where judgment is needed, reduces guessing where rules are already clear, and places critical constraints in mechanisms that can be verified. For the development ecosystem, that means skills can move from personal prompt collections toward engineering assets with versions, tests, permissions, and clear ownership of maintenance.
