A Practical Guide to Agent Skills Engineering: Viewing the World from the Agent's Perspective
This article explains how to design tools and workflows for AI agents by adopting the agent's point of view. It contrasts the traditional "how humans use software" mindset with the reality of agents as high-frequency, literal-minded callers, introduces the concept of bidirectional software where the agent itself is a user, and analyzes the concrete difficulties agents face (scarce context, costly round trips, fragmented state, and poor feedback). It then shows how skills—on-demand expert playbooks with metadata, instructions, and bundled resources—carry domain knowledge through progressive loading, covers writing conventions, and walks through two real skill patterns: Programmatic Tool Calling (PTC) and active clarifying questions. It closes with context-management practices, an observe–diagnose–design–validate–distill methodology, evaluation metrics, security controls, and the general-purpose engineering capabilities enterprises need to support a skill ecosystem.
1. Introduction: A Simple Idea, and Why Model Teams Get There First
Across the engineering work of building agents and intelligent coding tools, two design philosophies are being adopted by more and more teams:
- One is represented by a widely followed intelligent coding tool. Its core developers published a widely read technical write-up that systematically summarized the engineering experience behind Skills, and the phrase “viewing the world from the agent’s perspective” in the title is precisely the central proposition this article unpacks.
- The other has been summarized as “latent demand.” In a public interview, the same team’s core developers pointed out that when building agent products, developers easily fall back on traditional software-engineering habits: they consider only human needs and treat the model as a passive execution tool. Yet an agent is essentially a “bidirectional software” that must serve both the user and the model.
These ideas are not complicated, and they are intuitive to grasp, yet they are usually proposed and put into practice first by the teams that build the models themselves. Rather than attributing this to resource or data advantages, it is more useful to return to the development workflow itself and see where different roles stand in the “observe–design–validate” loop (see Table 1).
| Role | Can observe the model’s real behavior | Can quickly change tool behavior | Can quickly change model capabilities | Loop cycle |
|---|---|---|---|---|
| Model development team | Yes; can trace the full model–tool interaction trajectory | Yes; the tool stack and the model are maintained by the same team | Yes; new capabilities can be shipped and validated quickly | Short |
| External application developers | Limited; usually can only see call parameters and returned results | Depends on how open the platform is | No; must wait for model upgrades | Long |
Model development teams often hold all three capabilities at once. That is why “viewing the world from the agent’s perspective” is no longer just a slogan, but a development workflow that can be executed continuously. The opportunity for application developers lies here: these ideas do not depend on any specific model and can be fully transferred to their own business scenarios, then evolved as model capabilities continue to change.
2. Core Insight: Viewing the World from the Agent’s Perspective
2.1 From “How People Use It” to “How Agents Use It”
Traditional tools and APIs are designed with a human reader in mind by default: documentation is organized around human reading habits, return structures favor semantic hierarchy, and error messages are written for human troubleshooting. Agents face a different reality:
- Different reading behavior: An agent usually does not read documentation page by page. Instead, it uses keyword search to locate fragments, then follows clues within those fragments to continue searching. How information is organized directly determines whether the agent can find the right place.
- Different fault tolerance: People rely on experience to fill in omitted premises, whereas agents execute strictly by the literal text. A vague parameter name or a missing piece of prerequisite explanation can send an agent down the wrong path.
- Different call rhythm: People “think once, call once,” while agents call frequently, in batches, and mechanically. Any tiny loss per call is significantly amplified once multiplied by the number of calls.
As a result, exposing the same capability in different forms to an agent can produce vastly different outcomes. This is exactly what “viewing the world from the agent’s perspective” means: first step into the agent’s situation, observe where it actually gets stuck while solving a problem, and then decide what tools to provide and in what form.
2.2 Bidirectional Software: The Agent Is Also a “User”
Traditional software has only one kind of user—the human. An agent product, by contrast, has at least two kinds of consumers:
- People who use the product directly, who care about whether the result is correct and the process is controllable;
- The agent that calls the model to complete tasks, which cares about whether interfaces are clear, whether information is sufficient, and whether errors are understandable.
This lets us split demand into two layers:
- Explicit demand: what the user wants—“fix this bug,” “generate this document.”
- Latent demand: what the agent actually needs to complete the task, such as sufficiently compact context, structurally stable return results, clear error semantics, and decision points that can be rolled back.
Explicit demand is easy to see and is most often prioritized; latent demand can only be discovered after observing the agent’s real behavior. Once latent demand is ignored, the typical symptom is “a person sitting beside the agent, correcting again and again what the tools themselves should have solved.”
3. Key Problems: What Difficulties Do Agents Hit When Executing Tasks?
3.1 Context Is a Scarce Resource
Although context windows keep growing, they remain a finite and expensive resource. Raw content can only exist in two forms:
- Left in the context: it takes up space and increases the cost of every inference;
- Never entered the context: the agent knows nothing about it.
This requires that information be loadable in layers on demand: provide an overview first, then expand details as needed, rather than stuffing all materials into the context at once.
3.2 Every Round Trip Has a Cost
The basic rhythm of an agent calling tools is “request–result–reason again.” A flow that needs multiple calls is broken into several rounds: each round must re-reason with a growing context, each involves a network round trip, and each carries a chance of interruption or error.
3.3 State Is Scattered Across the Context
In long tasks, completed work, decisions made, and pending items often live only in the conversation history. Once the context is compacted, or a session is interrupted and later resumed, the agent may forget its progress, repeat work, or skip steps.
3.4 Feedback Quality Determines How Well the Agent Self-Corrects
The quality of information a tool returns directly determines whether the agent can correct itself. Returning only “operation failed” leaves it retrying in place; a structured error code plus an actionable fix recommendation lets it get it right in one adjustment.
4. The Form of Distillation: How Skills Carry Domain Experience
To address the difficulties above, a common approach is to distill domain experience into Skills. Their essence is not code that gets called, but an “expert playbook” loaded into the context on demand. A skill usually consists of three parts:
- Metadata: name, description, and applicable scenarios. This stays resident in the context so the model knows when to use it.
- Instructions: step-by-step flows, key decision points, cautions, and completion criteria, loaded only when the skill is triggered.
- Bundled resources: scripts, templates, reference material, and so on, read as the task requires.
The difference between a skill and a “tool” or “function” lies here:
- A tool or function provides an “executable action.”
- A skill provides the knowledge of “how to combine these actions, in what order, and what to do when problems arise.”
This matches how people approach unfamiliar tasks. Rather than memorizing every function signature, you carry a manual that spells out the steps and cautions, along with small scripts you can run directly.
Take a “multi-service cascading failure investigation” as an example. A well-structured skill looks roughly like this (illustrative only):
skills/└── incident-triage/├── SKILL.md # metadata + investigation flow├── checklists/│ ├── database.md # common database-related causes│ └── network.md # common network-related causes└── scripts/└── trace_errors.py # script that aggregates logs by error code
The metadata section of SKILL.md might be written as:
---name: incident-triagedescription: Use when a production service shows rising error rates orslower responses. Follow the flow "confirm impact scope → locate recentchanges → investigate dependencies layer by layer → give remediationrecommendations." Do not use during routine feature development or code review.---
The body must make clear what each step does, what evidence a decision is based on, under what conditions to move to the next step, and by what standard the investigation is considered complete.
4.1 Progressive Loading: Expand on Demand, Avoid Waste
The key mechanism of a skill is progressive loading. At startup, the model sees only the name and description of each skill; once a task matches a skill, its body is loaded; when the body points to a specific file or script, it is read by path. This way the number of skills can keep growing without all of their content crowding the context.
4.2 Writing Conventions: Skills That Are Clear at a Glance and Correct on Use
- State clearly “when to use it and when not to”: Choosing a skill is essentially a retrieval-matching problem. The description should include typical trigger scenarios, keywords, and exclusion conditions to avoid ambiguity with other skills.
- Give a flow in the body, not a textbook: Organize steps in the order the task progresses, stating each step’s input, the basis for decisions, and its completion marker. Avoid piling on background knowledge unrelated to the task.
- Reference resources explicitly: Files and scripts to be read must be given with explicit paths in the body. Avoid vague references that force the model to guess where files live.
- Declare boundaries up front: Destructive operations, operations requiring approval, and operations that must not run automatically should be placed in a prominent position with a clear handling approach.
- Keep maintaining it: When interfaces change or flows are revised, the skill must be updated in sync; otherwise an outdated description becomes a form of misdirection.
5. From Practice: Design Analysis of Two Typical Skills
5.1 Programmatic Tool Calling: Completing Many Calls in One Instruction
The problem: Under the standard tool-calling model, the agent waits for each result to return and re-reasons after every call. If a task requires checking dozens of objects one by one before deciding, it produces dozens of round trips: latency accumulates, intermediate results keep piling up in the context, and any single erroneous round can send the task off track.
The idea: Programmatic Tool Calling (PTC) writes several tool calls and data-processing logic into a single script, submitted to a code-execution environment in one call. At runtime, the script calls the various tools and handles deterministic processing—iteration, filtering, aggregation—by itself, then returns only the summarized result to the model. A sketch:
# Pseudocode: summarize failed builds and their log excerpts for a single releasedef main():builds = []# Walk the commits, keeping only events related to this releasefor commit in list_commits(repo="service-a", since=release_start):status = get_build_status(commit.id)if status.result == "failed":logs = fetch_build_log(commit.id, tail=200) # take only the log tailbuilds.append({"commit": commit.id,"error_codes": extract_error_codes(logs), # extract error codes, don't return full text"log_excerpt": logs[-20:],})return {"total": len(builds),"failed": len(builds),"details": builds[:10], # return only the first 10 entries}
The core principle this script embodies is “data flows inside the script, conclusions return to the context”:
- Intermediate results do not enter the context;
- Aggregation and filtering are done deterministically by code;
- The model focuses on analyzing results and making decisions.
Benefits and prerequisites: PTC’s benefits come mainly from reduced round trips and reduced context usage, and the actual magnitude depends on the task structure. For example, in tasks that require checking and judging item by item, the potential gains are more pronounced. But it holds only under a precondition: the model can reliably write correct scripts. This is precisely a reflection of “the engineering team fully understanding the model’s capabilities”: only when the model’s coding ability reaches a high level of reliability does handing control flow to a script pay off. Conversely, if the scripts the model writes have a high error rate, the extra round trips spent debugging them will offset or even exceed the original gains.
Applicability boundaries:
- When a task needs human confirmation midway, or needs the direction adjusted while observing results, it should not be packed into a single execution;
- When each step has unknown branches and must depend on the previous result to decide the next, serial calls are safer;
- For simple tasks involving only one or two calls, a script actually adds complexity.
The industry also has an approach that places scripts in a cloud sandbox for unified execution. The two ways each have their emphasis:
- Local execution stays closer to the user’s working environment, and data need not leave the local machine;
- Cloud execution makes it easier to manage resource quotas centrally, isolate execution environments, and audit in one place.
Either way, code execution should be built as a foundational capability: the execution environment needs isolation, timeout and resource limits, constraints on network access and file-system permissions, and complete execution logs retained.
5.2 Active Clarifying Questions: From “Guessing” to “Confirming”
The problem: When task information is insufficient, an agent typically has three choices:
- Guess on its own; the result may diverge widely and cause rework.
- Follow up with a free-form text question, leaving the user to compose an answer in their own words.
- Error out or stall, so the task cannot move forward.
The evolution: In designing this capability, teams tried many presentation forms, repeatedly weighing flexibility against structure. In the end, presenting the question along with several candidate options directly to the user and collecting feedback worked best, in the form of a modal dialog. Modal means the flow is explicitly suspended until the user makes a choice, so it neither proceeds on a wrong assumption nor gets buried under other inputs.
Why it works: From the agent’s perspective, the benefits of candidate options are all-around:
- Higher alignment efficiency: clicking an option is easier than reading a long text and composing an answer.
- Earlier exposure of misunderstanding: the options themselves reveal how the agent understands the task, so the user can immediately tell whether that understanding is right.
- Stronger constraints: structured options are easier to parse reliably than free-form replies, so the model’s certainty when advancing the task is higher.
The development team also observed that the model seemed to “like using” this tool. A reasonable inference is that the model likewise needs clear constraints to reduce uncertainty: rather than repeatedly weighing multiple possibilities, it is better to put the key disagreement in front of the user. For the model, this is also a way to lower latent demand.
Usage principles:
- Ask only at key moments: keep the number of questions restrained, focusing on the core disagreements that affect the direction—such as scope of the goal, technology choices, or whether modifying production configuration is allowed.
- Design options sensibly: cover the main possibilities, provide a reasonable recommended option, and always keep an “other” or free-input entry.
- Record the decision: the user’s choice should be clearly recorded as the basis for subsequent steps, so the same question is not asked repeatedly.
6. Practical Extensions: “Active Writing” and “Progressive Disclosure” in Context Management
These two practices are often discussed separately, but viewed together they—like PTC and active questioning—reflect the same principle: whoever understands better how the context is used is better positioned to decide how the context is organized.
- Active writing: The agent can write goals, constraints, and completed items into a structured task file. That way, after the context is compacted or the session restarts, the agent can still read the file to recover its progress. In essence, this moves state from “conversation history” to “persistent storage,” using external storage to compensate for the limits of the context.
- Progressive disclosure: The core is exposing information in layers on demand—both the “metadata–body–resources” hierarchy within a skill, and explanation files loaded by path, such as command descriptions and subdirectory descriptions. The goal is to let the agent see, at each step, only the content most relevant to the current decision.
Combined, the two yield a piece of experience: the context is not merely a “container” to be economized, but a “workspace” that must be actively designed and maintained.
7. Methodology: A Process for Turning Domain Experience into Agent Skills
7.1 The Iteration Process
- Observe: collect real task trajectories, focusing on points of failure, retry, and human intervention.
- Diagnose: determine whether the problem is missing information, context bloat, too many call round trips, or unclear feedback.
- Design: choose the minimal-change solution—adding a skill, adjusting a tool’s return structure, introducing an active question, or switching to script execution.
- Validate: use representative tasks for before-and-after comparison, quantifying changes in success rate and efficiency metrics.
- Distill: turn effective practices into conventions and templates, and record ineffective attempts to avoid repeating the same mistakes.
7.2 Evaluation Metrics
- Effectiveness: task completion rate, first-try success rate, number of human interventions, number of reworks.
- Efficiency: end-to-end latency, number of tool-call rounds, tokens consumed, peak context usage.
It is worth emphasizing that effectiveness and efficiency should be observed together, not through a single metric alone. For instance, active questioning adds a round of interaction but may greatly reduce the rework rate; script execution reduces round trips but may increase the overhead of debugging the script. Only by evaluating within the complete task chain can you reach a reliable conclusion.
7.3 Security and Permission Control
An agent’s capability boundaries directly determine the design space for skills and scripts:
- Least privilege: skills and scripts may only access the resources and data necessary to complete the task.
- Confirmation for high-risk operations: irreversible operations such as deleting data, modifying production configuration, or publishing externally must have a human-confirmation step.
- Full auditability: script inputs and outputs, tool-call parameters, and return results must all be recorded for later traceability.
8. Enterprise Implementation: Supporting a Skill System with General-Purpose Engineering Capabilities
For enterprises that want to build similar capabilities in their own businesses, several kinds of general-purpose capabilities are worth investing in:
- Sandboxed execution environment: using general capabilities such as container platforms or function computing to provide isolation, elasticity, and resource-quota management for script execution;
- Observability: combining logging services with monitoring and alerting to capture complete agent interaction trajectories, providing a data foundation for effectiveness and cost analysis;
- Context and state management: using persistence capabilities such as object storage to save task files and intermediate artifacts, supporting task recovery after context compaction;
- Knowledge and skill repository: centrally managing skill versions, applicable scope, and ownership, with support for canary releases and rollbacks;
- Evaluation pipeline: building a regression evaluation set around core business scenarios, automatically comparing key metrics after any change to skills or tools.
Using Baidu AI Cloud as an example, such capabilities can be implemented by combining general cloud products such as container platforms, function computing, object storage, logging services, and monitoring and alerting. The ultimate goal is not to pile up the number of tools, but to ensure that every capability expansion is built on the continuous observation of the agent’s real behavior.
9. Conclusion
“Viewing the world from the agent’s perspective” sounds abstract, but in practice it is very concrete: first observe where the agent gets stuck in a task, then decide what tool to use and in what form to solve it. Skills, Programmatic Tool Calling, and active clarifying questions are all just different projections of this method in different scenarios.
- For developers, the most valuable shift is to treat the agent as another kind of “user.” When writing documentation, designing interfaces, and defining error-code conventions, asking one more question—“can an agent act correctly based on this?”—eliminates a great deal of latent rework.
- For enterprises, what matters is not the number of skills, but the speed of the observe–design–validate–distill loop and the engineering infrastructure that supports it.
The idea itself is not complicated. The real barrier lies in whether you are willing to keep observing problems from the agent’s point of view, and to repeatedly refine the way humans and agents collaborate as model capabilities steadily advance.
