AI Agent Skill Granularity: From Decision Boundaries to Reliable Execution

    Designing agent skills is about allocating decision authority, not simply choosing the size of a tool. This article explains how business decisions, failure recovery, permissions, and data contracts should shape skill boundaries. Using a competitive analysis assistant as an example, it shows how to combine modular internals with stable model-facing capabilities, measure performance, and evaluate reliability, maintainability, and safety.

    1. Skill Granularity Is Really About Decision Authority

    When building an AI agent, developers often face a choice: expose login checks, page retrieval, and content parsing as separate skills, or package the entire sequence into a single “collect product information” skill.

    These designs differ in more than functional scope. They can change how the system is controlled. If every small step requires the model to select a tool, generate arguments, and decide what happens next, the execution chain accumulates additional reasoning rounds. If deterministic code handles the fixed sequence instead, the model only needs to participate at meaningful business decision points.

    Before discussing skill granularity, distinguish three layers:

    • Internal modules: Functions, components, or adapters that implement functionality and support testing, reuse, and maintenance.
    • Execution workflows: Logic that sequences module calls, handles retries, passes state, and manages resources.
    • Model-facing skills: Capabilities the model can select, each expressing a clear business intent.

    Internal modules can be fine-grained, and workflows can be complex, without exposing that same granularity to the model. Code structure and model decision structure do not need a one-to-one mapping.

    The goal is neither to minimize all modules nor to maximize the number of tools. It is to reserve genuine judgment for the model and delegate predictable steps to code.

    2. Define a Skill Before Deciding How to Split It

    Across systems, a “skill” may mean a set of instructions, a sequence of tool calls, or an encapsulated workflow. To avoid ambiguity, this article defines a skill as a callable capability with a clear objective, input and output contracts, execution boundaries, and failure semantics.

    Under this definition, a skill should answer four questions:

    1. What business problem does it solve?
    2. What information and permissions are required before invocation?
    3. What result does successful execution provide?
    4. On failure, should the caller retry, supply more information, or change strategy?

    For example, “parse a page” describes a technical operation, while “collect public information about a specified product” describes a business objective. The former is often better suited to an internal component; the latter is easier for a model to understand and select.

    A business-oriented name does not justify unlimited scope, however. “Collect information, analyze it, generate a report, and send it externally” combines data acquisition, reasoning, and external side effects. Those responsibilities usually need additional boundaries.

    3. Use Four Boundaries to Determine Skill Granularity

    Business Decision Boundaries: Is There a Meaningful Choice?

    To decide whether a step should be exposed independently to the model, first ask whether it contains a genuine business branch.

    After retrieving a product page, the system normally needs to extract its contents. After extraction, it normally needs to validate the fields. When that sequence is already determined, the model does not need to repeatedly decide whether to proceed.

    Other questions do require judgment:

    • If the available information is insufficient, should collection expand to more sources?
    • If two sources report conflicting specifications, is further verification needed?
    • If pricing information is missing, should the system keep searching or mark it as unknown in the report?
    • Does the user want to compare performance, or are cost and usage conditions more important?

    These choices affect the final outcome and are appropriate points for model involvement.

    A practical rule is: If the correct next action is almost always the same, keep it inside the workflow. If the next action depends on business meaning, it may warrant a separate skill entry point.

    Recovery Boundaries: Is Independent Recovery Useful?

    Failure recovery is an important reason to separate components, but independent recovery does not necessarily require model exposure.

    Suppose page retrieval succeeds but parsing fails. The system can retain the retrieved page and rerun only the parser, rather than fetching the source again. This is an internal recovery boundary.

    The model needs to intervene only when recovery requires a change in business strategy. For example, after access is denied, should the system use another authorized source? If information is unavailable, should it ask the user to upload a document?

    Design these separately:

    • Execution-system checkpoints for retries and resumable execution.
    • Model-facing business decision points for replanning or requesting assistance.

    This preserves recoverability without making the model responsible for every technical retry.

    Permission Boundaries: Do Actions Have Different Risk Levels?

    Querying public information, reading restricted data, modifying business records, and sending content externally carry different risks. Even when they serve the same business objective, they should not automatically become one opaque operation.

    Actions with external side effects—especially writing, publishing, sending, and deleting—need explicit authorization conditions and, where necessary, human confirmation.

    A login-state check can remain inside a collection workflow. Obtaining credentials, elevating privileges, or handling additional verification must not be bypassed by the workflow. The model should not receive credentials unrelated to the task.

    Permission controls must be enforced by the execution layer, not merely stated in a skill description.

    Data Contract Boundaries: Does an Intermediate Result Have Independent Value?

    An intermediate result deserves an explicit data contract if multiple workflows can reuse it, or if it needs independent auditing, caching, or validation.

    Structured product information, for example, can support competitive comparisons, information retrieval, and periodic change monitoring. It is a useful stable capability output.

    Creating a data contract does not necessarily mean adding another model-facing tool. A system can expose one collection skill while internally producing structured data and retaining the original evidence and processing records.

    4. Layering a Competitive Analysis Assistant

    A competitive analysis assistant can organize its main workflow around three capabilities.

    Information Collection: Let Code Handle the Fixed Workflow

    Expose a “collect product information” skill to the model, with the following steps inside it:

    • Input validation and access-scope checks.
    • Login-state checks.
    • Page or document retrieval.
    • Content extraction and structuring.
    • Field validation.
    • Evidence recording.
    • Cache and recoverable-state management.

    Different sources may require different adapters, but the model does not need to select each adapter individually. If rules can identify the source type, routing should preferably happen in the execution layer.

    The collection result should contain more than a natural-language summary. It should include product fields, missing items, source identifiers, collection timestamps, and evidence locations. This allows downstream analysis to distinguish facts, missing information, and inferences.

    Comparative Analysis: Use the Model for Semantic Judgment

    The analysis stage receives validated structured information and the comparison dimensions specified by the user.

    The model primarily explains differences, identifies applicable conditions, detects conflicts between sources, and states the evidence supporting its conclusions. Numerical calculations, unit conversions, and sorting should use deterministic logic wherever practical.

    When information is insufficient, the analysis result should explicitly identify the gaps rather than fill them with guesses. The execution layer can use those gaps to trigger additional collection or ask the model whether further investigation is worthwhile.

    Report Generation and Delivery: Separate Content from External Actions

    Report generation organizes conclusions, presents evidence, and states uncertainties. It can usually be treated as a separate output stage.

    If the task also involves sending, publishing, or writing to a business system, those actions require a separate authorization boundary. Successfully generating a report does not automatically grant permission to publish it externally.

    This separation prevents content-quality issues and delivery-permission issues from becoming entangled in the same skill.

    5. Fine-Grained Internals, Stable External Capabilities

    The following pseudocode illustrates the design. Its names are descriptive, not actual product interfaces.

    1. Skill: Collect product information (sources, target fields)
    2. Validate source scope and invocation permissions
    3. For each source:
    4. Check for a usable cache
    5. If the cache is unavailable:
    6. Check access conditions
    7. Retrieve raw content
    8. Save a recovery checkpoint
    9. Extract target fields
    10. Validate field types and completeness
    11. Save fields and their supporting evidence
    12. Aggregate results:
    13. Return collected information
    14. Return missing fields
    15. Return execution status for each source

    The model only needs to understand what information it wants to collect. It does not need to control every retrieval, parsing, and validation operation.

    If some sources fail, the skill should return partial results and structured failure information rather than simply mark the entire task as failed. Downstream stages can then decide whether the available information is sufficient and avoid unnecessary repeated work.

    6. Do Not Attribute Latency Differences Directly to Module Size

    If two designs take approximately fifteen seconds and three seconds in a test, that demonstrates a difference under those test conditions. It does not prove that smaller modules are inherently slower.

    Total latency typically consists of:

    Total latency ≈ model decision time + data access time + parsing and processing time + orchestration overhead + retry wait time.

    For workflows with concurrency, the critical path also matters. Adding the duration of every step is not enough.

    Performance investigations should record at least:

    • The number and duration of model calls.
    • The number of tool calls.
    • External request latency.
    • Content parsing time.
    • Cache hits.
    • Retry counts and waiting time.
    • End-to-end latency and tail latency.

    If the model repeatedly selects a predetermined next step, reducing model rounds may improve performance. If network access is the bottleneck, focus on caching, timeouts, and controlled concurrency. If parsing dominates, optimize parsing logic and input size.

    Optimization should follow measurements, not tool counts alone.

    7. Avoid Turning Combined Skills into Giant Black Boxes

    Reducing the number of model-facing entry points does not mean putting all logic into one unobservable function. Excessive consolidation can create several problems:

    • Failures become difficult to locate.
    • Local retries may repeat side effects.
    • Input parameters continually expand.
    • Different permission levels become mixed together.
    • Intermediate results cannot be reused.
    • Complex branches become difficult to test.

    The solution is to retain internal layers, state records, and checkpoints while preserving business-level encapsulation externally.

    For write operations that may execute more than once, implement idempotency or duplicate detection. Reuse completed data retrieval wherever possible. For long-running tasks, allow status queries or resumed execution rather than requiring every operation to finish within a single invocation.

    Stable skill entry points and transparent internal execution are compatible. The former supports model selection; the latter supports system governance.

    8. Evaluate More Than Speed

    Skill granularity should be evaluated across several dimensions, not just latency.

    Task Quality

    Check whether each design accurately meets the user’s objective, omits important fields, or produces unsupported conclusions. Reducing call counts must not come at the expense of information completeness.

    Invocation and Decision Costs

    Record the model rounds, context size, and proportion of unnecessary tool calls required to complete a task. If many calls merely select the only correct next step, more of the process can be handled through workflow orchestration.

    Failure Recovery

    Simulate access timeouts, parsing failures, missing fields, and insufficient permissions. Check whether the system can recover locally, whether it repeats source access, and whether it duplicates external side effects.

    Maintainability and Safety

    Assess whether adding a source requires changes across large portions of the code, whether skill descriptions are ambiguous, and whether the execution layer enforces permission restrictions.

    Use the same task set and execution conditions when comparing designs. Include simple tasks, multi-source tasks, conflicting information, and failure scenarios. Alongside average latency, examine slow requests and failure distributions so that an optimization does not benefit only a small set of straightforward cases.

    9. A Practical Process for Defining Skill Boundaries

    Use the following sequence when designing an agent system:

    1. Map the business workflow. Identify inputs, outputs, branches, permission changes, and external side effects.
    2. Identify deterministic sequences. Delegate actions with a fixed order to code or workflows.
    3. Mark business decision points. Consider model involvement only where semantic judgment or strategy selection is needed.
    4. Define data contracts. Specify input fields, output structures, missing-information representations, and failure types.
    5. Add recovery checkpoints. Preserve reusable intermediate results and limit ineffective retries.
    6. Expose the minimum necessary entry points. Make skill names and descriptions express business objectives directly, and avoid overlapping capabilities.
    7. Refine boundaries through observation. Use actual invocation, failure, and maintenance data to decide whether to split or combine capabilities.

    The guiding principle is: Split internal modules for engineering reuse, organize workflows for recoverability, and design model-facing entry points around business decisions.

    A mature agent system should neither rethink every technical step nor hide every business choice inside a black box. Placing deterministic execution and semantic judgment at the appropriate layers produces clearer skill boundaries, more reliable operation, and an engineering structure that can evolve over time.