---
title: Which steps in a Skill should become tools?
canonical: "https://xiaofeng.dev/en/writing/skill-deterministic-tools/"
pubDate: 2026-11-11
updatedDate: 2026-11-22
author: 唐小锋 Xiaofeng TANG
description: "The previous article , \"How to Orchestrate Multiple Skills Using a Master Control Skill to Achieve Automated Delivery ,\" introduced a market research…"
tags: [Agent Skills, AI Agents, CLI, Deterministic Workflows]
---

The previous article [, "How to Orchestrate Multiple Skills Using a Master Control Skill to Achieve Automated Delivery](/writing/skill-suite-orchestration/) ," introduced a market research workflow I designed. This article continues the discussion on the execution boundaries: which tasks require agent-based judgment, and which can be encapsulated into tools.

In software engineering, determinism is usually translated as "deterministic", which means that the same input and running conditions produce the same result. Anthropic's tool design article also uses this concept to distinguish between traditional programs and agents that may produce different responses[4]. Here, determinism emphasizes that the execution is repeatable, but the quality of the result still needs to be verified.

## Why is deterministic convergence necessary?

Uncertainty can be introduced at any stage of the workflow. User instructions may be ambiguous, and the agent's understanding, retrieval, and execution may also be flawed. If subsequent stages directly use unchecked deliverables, localized problems can propagate along the process, affecting the final delivery.

- **A single reliable step does not guarantee the reliability of the entire process.** Even assuming all ten steps must succeed, and each step has a 90% success rate assuming previous steps succeed, the probability of the entire process succeeding is only about 35%. Multiplying these success rates one by one illustrates the need to pay attention to the accumulated risk of failure at each stage of a long process.
- **Clearly defined rules can reduce uncertainty in execution.** By fixing steps such as data manipulation, structure parsing, and format conversion into tools, the chances of agents making ad-hoc decisions and repeatedly generating implementations are reduced, allowing the model to focus on research, understanding, and judgment.
- **Phased verification can reduce the propagation of problems to the next stage.** After checking the output through code verification, skill self-check, or sub-Agent review, it is handed over to the next step [5]. After the data format is correct, it is still necessary to confirm that the map actually reads and displays the content; after the social media collection is completed, the text and images should also be checked. Verification should have clear standards and be compared with the actual output.

This is my understanding of deterministic convergence: gradually stripping away clearly defined operations and arranging verification for each stage's deliverables. Routine verification doesn't have to wait until a complete evaluation system is established before starting; first check the current delivery, then progressively evaluate its performance on different tasks, allowing the process to continuously improve.

## Identifying Certainty in the Process

"Write the defined parts into code" is a simple principle. What's really needed is to identify which operations in the process already have clear rules and can be repeatedly executed by the program. Map visualization, social media data collection, and research result organization have gradually helped me form my judgment criteria. Below, I've used colors to distinguish between steps that require model judgment, steps that are executed by code, and steps that combine both.

```mermaid
%%{"init: {'flowchart': {'padding': 1, 'rankSpacing': 8, 'nodeSpacing': 12"}, 'themeVariables': {'fontSize': '16px'}}}%%
flowchart LR
    A["Requirements"] --> B["Research"]
    B --> C["Import"]
    C --> D["Map"]
    D --> E["Delivery"]
    E -. on demand .-> F["Social media"]
    E -. on demand .-> G["Verification"]
    E -. on demand .-> H["Insights"]
    classDef judgment fill:#fff5e9,stroke:#ae6319,color:#242b36;
    classDef fixed fill:#edf5ff,stroke:#285b96,color:#242b36;
    classDef mixed fill:#f2f0fa,stroke:#65548e,color:#242b36;
    class A,B,G,H judgment;
    class D fixed;
    class C,E,F mixed;
```

<div style="text-align:center;font-size:14px;line-height:1.8;margin:12px 0 24px;"><span style="color:#ae6319;margin-right:12px;">● Model judgment </span><span style="color:#285b96;margin-right:12px;">● Code execution </span><span style="color:#65548e;">● The two work together</span></div>

After delivery, the dotted line connects to three optional branches, corresponding to social media data collection, expanded product verification, and insight demonstration, which can be called up as needed by the central control.

The import process in the diagram includes review and data organization, while delivery includes presenting and verifying the results. Certainty is often only apparent when broken down into stages: review and information classification require model judgment, while field validation and saving can be performed by programs. The following three experiences correspond to map applications, social media data collection, and the organization of research results before importation, respectively.

## The first lesson learned: Make maps reusable.

Three different approaches were explored in the implementation of the map. Each adjustment was based on testing the original assumptions through actual use.

### Option 1: Generate a single HTML file, which is continuously modified by the Agent.

Initially, I planned to have the AI ​​generate a single HTML file from the research results, placing the data, presentation logic, and interactions in the same file for easy opening and delivery. Subsequent adjustments would then be handled by the agent.

Actual needs were more dynamic than anticipated. Users would adjust the research scope, add products, revise data, or change analysis dimensions after viewing the map. The demands on the agent differ greatly between generating a single page and maintaining accuracy across multiple rounds of adjustments. I initially overestimated the agent's ability to reliably modify HTML. Data and page logic were tightly coupled; even a single data update could affect the display and interaction code.

### Option 2: Modify and preview using Live Artifacts

Subsequently, I tried Live Artifacts, using Claude's Artifacts feature to modify and preview interactive artifacts next to the dialogue [2]. Claude's product design served as a transitional solution during the exploration phase, but continuous map updates still required a clear data organization method. Filtering, switching dimensions, and viewing details should all be based on stable application capabilities.

### Option 3: Separate data from Next.js applications and use tools to constrain operations.

Next, I stored the data independently and used a continuously maintained Next.js project for display and interaction. At the time, I assumed that once the page logic was fixed, the Agent could simply modify the JSON to meet the requirements. This second overestimation occurred in data manipulation. Correct JSON syntax does not guarantee that modifications meet application requirements. Field meanings, object relationships, and content requiring synchronous updates all have their own constraints. The Agent's ability to adhere to these constraints during repeated modifications remained unstable.

Finally, the data structure, operation entry, input validation, saving and display have clear code implementation. Supplementing product information is completed through data operations, filtering uses existing interactions, and adding new application capabilities involves code modification. Next.js is the implementation choice, and stability comes from the whole set of data conventions and operation rules. Anthropic's Skill writing suggestions also mention that error-prone operations that emphasize consistency should reduce the model's degree of freedom and provide specific scripts [3].

Delivery also involves the user environment. Installing the entire Next.js project requires handling dependencies and startup configuration. I've encapsulated application execution and data operations into a CLI for unified dependency management and startup. Once users have their Node.js environment ready, they can use the Skill to guide the Agent's calls without needing to configure the web project themselves. Map adjustments, involving research and judgment, data operations, and application capability modifications, also have their own handling methods.

**Looking back on this evolution, what I repeatedly did was to propose hypotheses and then verify them using real-world tasks. Each time I encountered unexpected problems, I revised my understanding of the Agent's capabilities and user needs, gradually clarifying the boundaries that needed to be encapsulated.**

## The second lesson learned: Encapsulate the technical details of social media data collection.

Social media data collection requires reading data from various sources, organizing the text and images, and providing it to users for viewing and analysis. Initially, I used prompts to structure the collection steps, with the agent submitting content, reading the returned results, and organizing the materials according to the instructions. After multiple executions, I found that the agent did not consistently follow the same path to submit and collect content. Even with the same goal, the actual execution path would change, and the process specifications in the prompts were insufficient to guarantee stable execution.

Further breaking down the process, a significant portion of the data collection involves detailed code. The API returns HTML or JSON fragments, requiring understanding of field meanings, parsing the DOM and citation structure, extracting the main text, associating images, and formatting the data. These processes rely on known data structures and extraction rules, with the Agent performing ad-hoc parsing and combination in each round, adding unnecessary complexity.

I will encapsulate the submission and collection chain, the result parsing, content extraction and layout into a tool so that similar tasks follow a consistent processing path. The Agent is responsible for selecting query content, judging relevance and conducting analysis, while the tool is responsible for executing explicit collection and parsing rules. Anthropic's tool design article also suggests moving some processing inside the tool, returning meaningful information, and reducing the burden brought by the underlying technical identification [4].

**This experience led me to a direct conclusion: whenever there are explicit code processing details in a process, they should be encapsulated into tools. With fixed implementations for interface calls, structure parsing, and content extraction, the agent can focus its attention on the data collection target and material analysis.**

## The third lesson learned: Separate Deep Research from Formatting

Initially, I wanted Deep Research to directly output the JSON format required by the application, allowing research results to be directly integrated into the application. However, in practice, errors frequently occurred in the output format. The research tasks of finding, understanding, and analyzing data also bear the constraints of complex data structures. In this project, the additional formatting work increased the cost of subsequent corrections. Furthermore, the continuous evolution of the application structure meant that formatting adjustments constantly affected the way research prompts and existing results were used.

I understand Deep Research as a form of agency search. It requires understanding the results of each round of searches, identifying gaps in evidence, discovering questions worth pursuing, and then adjusting the search strategy. Logical reasoning, semantic mining, and question discovery are at the core of this type of research task. I hope to minimize formatting requirements so that research agents can focus their attention on these tasks.

Later, I chose the flat and straightforward Markdown as the intermediate format to reduce nested structures and field constraints. This allowed Deep Research to fully express the research content first, and then the data was organized and formatted separately during import. The research results were preserved, and format adjustments only required modifications to subsequent processing steps. The organization process still involved judgment; information identification and classification may require model involvement, while fields, types, required fields, and import requirements were checked by the program.

Anthropic's step-by-step workflow also has a similar idea: assigning divisible tasks to successive steps, adding program checks, and reducing the task complexity of each step [5]. This made me realize that responsibility decomposition often precedes deterministic encapsulation. The format requirements must be simple enough so that the data structures for research and application can evolve separately.

**Let Deep Research focus on the research itself, leaving formatting and validation to later stages. Choose simple, error-free intermediate formats to reduce additional constraints on research tasks, and let the tools handle the explicit formatting rules.**

## Which signals indicate the need for tools or scripts?

- **The execution path for the same task changes repeatedly.** Even though the prompts clearly state the steps, the Agent still uses different paths when executing the task multiple times, resulting in inconsistent outcomes. This indicates that key processes need to be fixed in the code.
- **The process involves explicit code processing details.** Operations such as API calls, HTML and JSON parsing, DOM and citation extraction, and image association rely on known structures and rules and should be encapsulated into tools to avoid ad-hoc implementations in each round.
- **Research tasks are constrained by format requirements.** Output structures frequently contain errors, or adjustments to application fields constantly affect research prompts. It's advisable to first use a simple intermediate format, then delegate conversion and validation to subsequent stages.
- **The same type of result requires repeated manual checks.** Fields, relationships, and imported results already have clear checking standards, which are suitable for being automated; parts that require semantic judgment are then reviewed by the Agent.

These signals need to be verified through real-world tasks. The evolution of mapping solutions reminds me that we must first formulate hypotheses, then examine the execution results, and continuously refine our judgments on requirements and agent capabilities in order to gradually find the appropriate encapsulation boundaries.

## Related Links

[1] How to orchestrate multiple skills using a master skill to achieve automatic delivery [https://xiaofeng.dev/writing/skill-suite-orchestration/](https://xiaofeng.dev/writing/skill-suite-orchestration/)

[2] Claude official: What are artifacts and how do I use them? [https://support.claude.com/en/articles/17153992-what-are-artifacts-and-how-do-i-use-them](https://support.claude.com/en/articles/17153992-what-are-artifacts-and-how-do-i-use-them)

[3] Anthropic: Skill authoring best practices [https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)

[4] Anthropic: Writing effective tools for agents [https://www.anthropic.com/research/writing-tools-for-agents](https://www.anthropic.com/research/writing-tools-for-agents)

[5] Anthropic: Building effective agents [https://www.anthropic.com/research/building-effective-agents](https://www.anthropic.com/research/building-effective-agents)
