AI Agent Skill Granularity: A Practical Guide to Splitting Skills by Decision Boundaries
This guide explains how to decide whether an AI Agent skill should be fine-grained or coarse-grained. It argues that granularity is really about how decision-making authority is allocated: only hand control back to the model when business semantics change and a new choice is required. You will find two criteria for setting skill boundaries, a three-layer reference architecture for a competitor research assistant, rules for local retries, and a deployment checklist covering structured return contracts, independent authorization for side effects, and performance measurement.
1. The Real Issue: Granularity Is About Decision Authority
When building an AI Agent, teams most often argue over one question: should a skill be split finely or kept coarse? On the surface this looks like a question of module size. In practice, it is a question of how decision authority is allocated.
Implementing “login check, page fetching, content parsing” as three internal functions is a completely different architecture from exposing them as three tools that the model must select in sequence. In the first case, code calls them in a fixed order. In the second, the model has to re-run the reasoning step of “what should I do next?” at every stage. Every additional entry point exposed to the model adds one more decision overhead, one more context fill, and one more chance of failure.
So the first principle for judging granularity is: only hand control back to the model when the business semantics change and a new choice has to be made. If the next action is nearly deterministic once the previous result is available, it should be encapsulated inside the skill and orchestrated by code rather than by the model.
Performance needs to be handled rigorously. Small modules are not necessarily slower. Latency should be measured in three separate segments: model decision time, network request time, and parsing and validation time. If you observe noticeable latency, first identify which segment contributes most of it, then decide whether to merge entry points or optimize the implementation, instead of attributing the problem to “too fine a split” based on intuition.
2. Decision Criteria: Two Questions That Set the Boundary
I usually rely on just two questions to define a skill boundary:
- Does the business need to make a new choice at this point? If yes, this is a skill boundary. If no, keep encapsulating.
- Is it worth recovering from failure at this point on its own? If yes, this is an independent unit that can be retried and observed. If no, merge it into the upper-level flow.
These two questions correspond to “decision density” and “recovery value.” They are far more reliable than formal metrics such as lines of code or number of functions, because formal metrics cannot reflect the points where business semantics break.
3. Reference Architecture: Separating Three Layers of Responsibility
Take a representative scenario: a competitor research and analysis assistant. A sensible split is not by technical steps but by layers of responsibility.
3.1 Collection Layer: Small Internal Modules, a Single External Entry
Internally you keep small modules for login state checks, page retrieval, body parsing, field validation, and site adapters, but externally you expose only one semantically complete skill, for example “collect product information.”
Skill: collect_product_info(links)|- Login state / permission check|- Fetch each link (with timeout and retry)|- Parse and extract fields|- Select site adapter└- Validate fields and mark missing ones
The reason is straightforward: once you have product links, the next step is necessarily to fetch the pages; once you have a page, the next step is necessarily to parse it. There is almost no business judgment here, so the fixed order can be left to code. This reuses the internal modules (the same collection capability can also serve use cases such as public opinion monitoring) and avoids having the model assemble the flow on the spot every time.
More important is the return contract. A skill should not just return a large block of page text; it should return a structured result:
{"records": [{ "name": "...", "price": null, "unit": null }],"sources": [{ "url": "...", "fetched_at": "...", "status": "ok" }],"missing_fields": ["price", "billing_unit"],"partial": true,"failed_pages": [{ "url": "...", "reason": "timeout" }]}
“Fetched 3 pages, 1 of which is missing the price” is a result the upper layer can act on. The words “collection failed” leave the upper layer with nothing to recover from. A processable partial result is the prerequisite for the Agent to make a correct judgment.
3.2 Judgment Layer: Where Control Really Goes Back to the Model
After collection, suppose two products use inconsistent billing units (one per seat, one per API call). Whether to unify the units, whether missing data is acceptable, and whether an additional follow-up lookup is worthwhile: these are the judgment points that need the model.
The overall flow can be divided into “collect evidence → compare and assess gaps → produce the report.” Note that these three boundaries come from the current case; not every project should copy the same fixed number. The answer on granularity is always determined by business semantics.
3.3 Execution Layer: Authorization and Side Effects Must Be Separate
Publishing a report, sending an email, or modifying an external system should have independent authorization and execution checks. Being able to generate a file does not mean you have permission to send it externally. Side-effect skills must have their own boundary, along with confirmation mechanisms, idempotency design, and operation auditing, so that a single misjudgment by the model cannot reach an external system directly.
The reporting step can include one model call to organize the wording, but there is no need to introduce another Agent that autonomously selects tools for this. If the comparison results are already structured, generating tables and a source index from a template is actually easier to validate.
4. Local Retries: Define What They Are Allowed to Change
You do not have to constrain all internal logic with the rule that “skills only execute and never judge.” A more practical approach is to allow local retries while making their scope of change explicit:
- Allowed to retry: network timeouts, a single parse failure, or switching the parsing strategy when field extraction comes back empty;
- Not allowed to change on its own: the target link scope, the data unit definitions, or external sending actions;
- Every retry is written to logs and monitoring alerts to keep the chain observable.
In a general cloud environment, these capabilities are typically provided by basic categories such as logging services, monitoring and alerting, message queues, and object storage, without relying on any proprietary interface.
5. Deployment Checklist
- Does each externally exposed skill correspond to a real business choice?
- Is the skill’s return value structured and processable as a partial result?
- Have fixed-order flows been pushed down into code orchestration?
- Do side-effect operations have independent authorization and auditing?
- Has the performance issue been broken down and measured across the three segments of decision, network, and parsing?
Split this way, the Agent makes significantly fewer decisions, the chain becomes more stable, and the results are easier to validate.
