AI Agent Skill Granularity: Split on Decision Boundaries

    Agent skill granularity is not about large versus small modules. It is about how many times the model must choose. This article explains why only real business forks should be exposed as skills, how to separate maintainability from decision space, how to attribute latency, and four practical split criteria—plus a competitor-analysis example and a checklist.

    Ask the right question: granularity is about how many decisions the model makes

    Debates about Agent skill granularity often sound like “one large skill versus three small ones.” The real question is simpler: how many points on this path require the model to choose again?

    Implementing login checks, page fetch, and content parsing as three internal functions is a different architecture from registering them as three tools the Agent must pick in sequence. The first is deterministic code. The second runs “intent understanding → candidate filtering → parameter generation” at every step. Function calls do not reason; tool selection does.

    So the first design rule is: expose a fork to the model only when business semantics actually branch.

    Common mistake: treating code maintainability as a reason to expose skills

    Many splits come from engineering hygiene: single responsibility, loose coupling, short files. Those rules are right at the code layer. Applied directly to Agent capability boundaries, they fail.

    • Single responsibility limits the blast radius of code changes.
    • Skill granularity limits the size of the model’s decision space and error rate.

    The goals differ. A collection pipeline with five internal steps can still expose one public entry. Small modules remain; the caller is a workflow or code, not the model.

    Performance attribution: do not blame end-to-end latency on granularity

    Comparisons like “the small-module design took 15 seconds, the large-module design took 3 seconds” only show that two implementations differed in one observation. They do not prove that small modules are inherently slow. Split end-to-end time into three parts:

    1. Model decision time: number of candidate skills, description length, and history size.
    2. Network and external dependency time: request count, retries, rate limits, cold starts.
    3. Local compute time: parsing, validation, serialization.

    Only the first grows clearly with the number of exposed entries. If extra latency after a split comes mainly from the second (for example two extra requests for one field), merging entries will not fix it and can enlarge the failure domain. Put observability first: instrument every model decision, external call, and local compute span, then use logs and alerts to see the latency mix before optimizing.

    Four practical split criteria

    Criterion 1: Does the business actually need a new choice?

    After you have a product URL, the next step is always fetching the page; after the page, parsing. When the next step is unique, there is no choice—do not expose a separate skill.

    Criterion 2: Is it worth recovering from this point after failure?

    If parse failure is cheap to retry by rerunning the whole chain, do not expose it. If fetch already succeeded and is expensive (session, quota, anti-bot limits), keep a re-entry point.

    Criterion 3: Side effects and idempotency boundaries

    Steps with external side effects (writes, submits, billing) should be independent, explicit, confirmable skill boundaries—not silently chained.

    Criterion 4: Context budget

    Every exposed skill consumes description and example tokens. Too many entries dilute attention and raise mis-selection. Keep the number of skills available in one turn bounded, and use layered routing (domain first, then action) instead of a flat list.

    Example: granularity for a competitor-analysis assistant

    Expose one entry, collect product material. Keep small modules inside:

    1. collect_product_material(url)
    2. ├─ ensure_session() # session check and refresh
    3. ├─ fetch_page(url) # fetch with retry/backoff
    4. ├─ parse_content(html) # extract main content
    5. ├─ validate_fields(data) # completeness and type checks
    6. └─ dispatch(site, ...) # site-adapter routing

    The model does one job: decide whether the user gave a URL or a broader analysis intent, then call once. Site and login differences stay in adapters and code branches.

    When you should split finer

    • There is a real human confirmation between two actions.
    • The actions serve different roles or permissions.
    • An action needs its own quota or audit trail.
    • Recovery cost differs enough that you need resume-from-breakpoint.

    Checklist

    1. For each exposed skill, can you name the alternative if it is not chosen? If not, merge.
    2. Is end-to-end latency attributed to decision / network / compute?
    3. Are internal small modules still there, with only the caller changed?
    4. Are side-effect steps independent and confirmable?
    5. Is the number of skills in one turn bounded, with layered routing if needed?

    Conclusion: The right measure of skill granularity is not size. It is decision boundaries and recovery boundaries. Fold unique-next-step work inside; leave true forks, confirmation, and isolated recovery to the model. That is how you balance accuracy, latency, and operability.