Skill Granularity for AI Agents: How to Reduce Decision Points Without Losing Modularity
Skill granularity for AI agents is often treated as a question of module size, but latency, cost, and reliability are driven more by how many decisions are exposed to the model. This article provides a practical way to decide when logic should stay inside a workflow and when it should become an agent-facing tool. Using a competitor analysis assistant as an example, it covers two gating questions, structured tool results, authorization gates, scoped retries, and a layered design that preserves reusable internals while limiting model-driven decision points.
When building AI agents, many teams run into the same question: how fine-grained should a Skill be? Finer granularity can appear to improve reuse, but it forces the model to make a new tool-selection decision at every step, which increases latency and uncertainty. Coarser granularity can reduce those decisions, but packing an entire pipeline into one Skill makes failures harder to locate and recover from.
This article presents a practical way to approach the tradeoff and uses a competitor analysis assistant as an example.
1. Clarify a Common Misconception: Module Size and Decision Count Are Different
Many discussions conflate two different choices:
- Splitting a workflow into three small functions
- Exposing those functions as three tools that an agent must select one after another
These choices have very different effects on system behavior.
- Splitting into small functions is a code-engineering decision. It affects readability, testability, and reuse.
- Exposing functions as tools means the model must re-infer what to call next at every step. This affects latency, cost, and error probability.
If one implementation feels like 15 seconds and another feels like 3 seconds, the difference cannot simply be attributed to “small modules are slow.” A better approach is to break a single end-to-end run into its components: model decision time, network request time, and page parsing time. Only after locating the actual bottleneck can you determine whether the problem lies in granularity design or in how the tools are invoked.
In practice, a more effective pattern is often to keep small modules internally while reducing the number of entry points presented to the model. The optimization target is not “make modules bigger” but “make decision points fewer.”
2. Splitting Criteria: Two Core Questions
When deciding whether a step should become an independent Skill or tool entry point, ask two questions:
- At this point, does the business need to make a new choice?
- If this step fails, is it worth recovering from this point independently?
If both answers are no, the step should remain inside code or a workflow rather than being exposed to the model.
Consider product data collection. Once the product URL is available, the next step must be fetching the page. Once the page is available, the next step must be parsing fields. This is a fixed sequence with no business judgment in between. It can be executed sequentially by code, and there is no reason to make the model “think again” at each step.
Conversely, if a step contains real business branches, such as how to resolve inconsistent definitions or whether a data gap is acceptable, that is where control should be returned to the Agent.
3. Implementation: A Competitor Analysis Assistant
3.1 Keep the Crawling Pipeline as Internal Small Modules with a Single External Entry Point
Internally, the pipeline can still be split into small modules for login-state checks, page fetching, content parsing, and field validation. It can even include adapters for different sites. However, these modules should be invoked by a workflow engine or code, not added to the model’s tool-selection list.
The return value of the external entry point is equally important. Instead of returning only a large block of webpage body text, return a structured result, for example:
{"records": [{"name": "Product A","source": "source URL","crawled_at": "crawl time","missing_fields": ["price"]}],"summary": {"total": 3,"success": 2,"failed_pages": ["Page X"]}}
“Three pages collected, one missing price” is an actionable result. A bare message such as “crawl failed” leaves the upper layer with no idea what needs to be fixed. A structured return allows the upstream Agent to make the next decision based on the gap rather than retrying blindly.
Another benefit is reuse. The internal modules can be reused directly by other scenarios, such as social listening, while the competitor-analysis entry point combines them into a complete process. Code reuse then no longer depends on the model assembling the workflow on the fly, which greatly improves stability.
3.2 Return Control to the Agent Where Judgment and Authorization Change
After collection is complete, the scenarios that genuinely require intelligence begin to appear. For example, two products may use different pricing units: one is billed per person, while the other is billed per call volume. In this case, judgments such as whether to normalize the units, whether missing data is acceptable, and whether further investigation is worthwhile are reasonable to hand over to the Agent.
The overall process can be divided into three stages: collect evidence, compare and assess gaps, and produce the report. These boundaries are derived from the current example; they are not a fixed number that every project should copy. Each project should return to the two core questions to define its own boundaries.
The reporting stage can also include a model call to organize the narrative, but that does not mean another Agent with autonomous tool selection is needed. If the comparison results are already structured data, tables and source indexes can be generated from templates, which makes the output easier to validate and more stable.
In addition, actions such as publishing a report, sending email, or modifying external systems must have separate authorization and execution checks. Being able to generate a file does not mean the system has permission to send it externally. There should be a clear human or permission gate between generation and execution.
3.3 Local Retries Are Acceptable, but Their Scope Must Be Explicit
A blanket rule such as “a Skill can execute but must never make judgments” is not suitable for all internal logic. Internal modules can have limited decision-making ability, such as automatically retrying after a network timeout or degrading gracefully after a parsing failure. Two points matter:
- Define the retry scope: what can be retried, the maximum number of attempts, and when the process must stop.
- Define the boundary: local logic must not override business conclusions. Situations outside the established rules must be escalated to the upper layer for decision-making.
In other words, the execution layer can have engineering intelligence, but it must not have business decision-making authority. This is an important principle for keeping the system controllable.
4. Conclusion
The essence of Skill granularity is not a size problem. It is a problem of how decision points are distributed.
A sound architecture is layered:
- Keep fine-grained, reusable, and testable modules at the bottom.
- Use workflows in the middle to lock down fixed sequences.
- Give the Agent control only where business judgment truly branches.
At the same time, use structured return values, clear authorization gates, and retry policies with explicit scope so that failures in every stage can be located and recovered. This design helps reduce latency and cost while keeping the overall system maintainable and controllable.
