AI Agent Skill Granularity: Principles and Practical Design

    Skill granularity in AI agents is primarily a question of where decision-making authority belongs, not how much code each skill contains. This article presents two criteria for defining skill boundaries—meaningful business decisions and independent recovery—and applies them to a competitive analysis assistant. It also covers structured outputs, retry limits, authorization for side effects, and performance measurement.

    1. Start with the Right Question: Who Controls the Next Step?

    When building an AI agent, almost every team eventually debates how finely to split its skills. One common intuition is that smaller skills offer more flexibility. Teams therefore expose authentication checks, page fetching, content parsing, and field validation as separate tools, leaving the model to select them in sequence. Another intuition is that larger skills save tokens, so the entire workflow becomes a single function call.

    Both views are only partly correct. What changes is not just the size of a skill, but whether control returns to the model at each step for another decision.

    Implementing authentication, fetching, and parsing as three internal functions is fundamentally different from exposing them as three tools that the agent must choose in sequence. The former defines code dependencies; the latter adds decision points.

    Before discussing granularity, establish this principle: skill boundaries should follow decision points, not line counts or functional cohesion alone.

    2. Three Misconceptions to Address

    Misconception 1: Internal modules and externally exposed tools should have the same boundaries. Internal reuse and agent-facing entry points should be decoupled. Implementation can be modular down to individual functions, while the agent sees only entry points that represent complete, meaningful business operations.

    Misconception 2: Granularity directly explains execution time. Observing that a fine-grained implementation takes 15 seconds while a coarse-grained one takes 3 seconds does not prove that smaller modules are slower. End-to-end latency includes at least four components: model decision time, network requests, page or document parsing, and retry waits. Without measuring these separately, network variability can easily be mistaken for an architectural problem.

    Misconception 3: Skills can execute but cannot make judgments. Parameter validation, format normalization, and filling in missing fields are legitimate local decisions. The relevant constraint is not whether a skill can make a judgment, but whether that judgment changes the subsequent business path.

    3. Two Practical Criteria for Defining Boundaries

    Use two questions to decide where to split skills:

    1. Does the business process require a new choice at this point? If the next action follows a fixed sequence and involves little business judgment, let code or a workflow orchestrate it. The model does not need to select another tool.
    2. Is independent recovery from this point worthwhile? If a failure requires restarting the entire operation, that step generally does not need a separate entry point. If it can be recovered independently without affecting completed work, exposing it separately may be justified.

    These criteria turn most granularity debates into concrete design questions rather than stylistic preferences.

    4. Example: Boundaries in a Competitive Analysis Assistant

    Consider a competitive analysis assistant. A useful starting point is to divide the process into three stages: collect evidence, compare products and assess gaps, and produce a report.

    These three stages are a starting point for this example, not a fixed number that every project should adopt. Actions that affect external systems require an additional, separate authorization boundary.

    4.1 Collection: Fine-Grained Internals, One External Entry Point

    Expose one semantically complete entry point, such as “collect product information.” Internally, retain separate modules for authentication-state checks, page retrieval, content parsing, field validation, and site-specific adapters. Code or a workflow calls them in a fixed sequence.

    The model does not need to select each step because, once a product URL is available, the page must be fetched and then parsed. This sequence contains few business branches. Moving it into programmatic orchestration reduces decision points and makes failures easier to locate.

    The return contract matters even more. Rather than returning a large block of page text, the entry point should return structured results:

    1. {
    2. "product": {"name": "...", "price": null, "billing_unit": null},
    3. "source_url": "...",
    4. "collected_at": "2026-08-27T09:00:00Z",
    5. "missing_fields": ["price", "billing_unit"],
    6. "pages": [
    7. {"url": "...", "status": "ok"},
    8. {"url": "...", "status": "parse_failed"}
    9. ]
    10. }

    “Collected three pages; one page has no price” is an actionable result. “Collection failed” gives the next layer no indication of what needs to be recovered.

    Structured returns turn exceptions into decision-ready information. This is one of the most effective ways to reduce rework across the workflow.

    The internal modules can also be reused in scenarios such as public sentiment monitoring, while the competitive analysis entry point handles their composition. Code reuse no longer depends on the model assembling the workflow from scratch on every run.

    4.2 Assessment: Where Control Should Return to the Model

    Suppose collection reveals that two products use different billing units: one charges per user, while the other charges per API call.

    This introduces genuine business decisions:

    • Should the billing units be normalized for comparison?
    • Is the missing data acceptable?
    • Is further research worthwhile?
    • Do the information gaps undermine the conclusions?

    These are the decisions where model involvement adds value. They justify returning control to the model, unlike the fixed sequence of fetching and parsing.

    4.3 Reporting: Use Templates First, Models for Expression

    If the comparison results are already structured, generating tables and source references from templates makes verification easier. The model can focus on the parts that require synthesis and wording.

    Do not introduce another autonomous, tool-selecting agent simply because the output includes written text.

    4.4 Execution: Side Effects Require Separate Authorization

    Publishing a report, sending an email, or modifying an external system should require separate authorization and execution checks.

    Permission to generate a file is not permission to send it externally.

    Keep artifact generation and side-effecting actions separate in skill definitions. Artifact generation can run automatically; external actions should require explicit confirmation and retain auditable execution records.

    5. Local Retries: Define What They May Change

    Local retries are appropriate, but every entry point must declare the scope of changes it permits.

    For example:

    • The collection entry point may change fetching parameters and retry counts, but not the basis of the business comparison.
    • The assessment layer may adjust comparison assumptions and follow-up research strategies, but must not directly trigger external actions.

    Clearly defined modification scopes prevent retries from becoming an implicit expansion of authority.

    6. Performance Attribution: Measure Before Changing the Architecture

    Before adjusting skill granularity, add timing and outcome markers to each stage. Break end-to-end latency into four components:

    • Model decision time
    • Network request time
    • Parsing and processing time
    • Retry wait time

    Also track failure and retry rates for each entry point.

    If network requests and parsing dominate, reducing decision points may primarily improve stability and cost rather than single-run latency. If repeated model decisions are the bottleneck, consolidating entry points is the appropriate response.

    Use measurements to determine what needs to change. Avoid rebuilding the entire skill architecture based on a single pair of timing results.

    7. Implementation Checklist

    • Does each exposed entry point correspond to a genuine business choice?
    • Are return values structured, including missing fields and per-page outcomes?
    • Are fixed sequences handled by code or workflows?
    • Are side-effecting actions separately authorized and auditable?
    • Does each entry point define what local retries may modify?
    • Are stage-level timings and failure-rate measurements available to support tuning?

    The goal is not a universally finer or coarser set of skills. It is a structure whose decision points match the complexity of the business process: reusable internals, semantically complete external entry points, controlled judgment, and strictly isolated side effects.

    This structure can be supported by workflow orchestration, logging, and monitoring capabilities on platforms such as Baidu AI Cloud. It also allows teams to adjust boundaries as requirements change without rewriting the underlying implementation.