Skill document generation method, electronic device, product, and medium
By using a multi-agent collaborative system, the problem of automatically converting MCP tool definitions into Skill documents was solved, enabling document verifiability and scalable generation, improving generation efficiency and quality, and reducing the development cost of agent business.
Patent Information
- Application Number
- CN202611570098.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies cannot achieve large-scale automated conversion of MCP tool definitions to Skill documents while ensuring the actual usability of the documents for the Agent. There are problems such as parameter filling errors and tool selection bias.
By using a multi-agent collaborative system, including a document generation agent, a quality audit agent, and a semantic evaluation agent, an automated process is built to obtain tool definition information, generate skill documents, and output quantitative evaluation results through hierarchical auditing and semantic evaluation, thereby improving the scalability and quality controllability of the generated documents.
It achieves verifiable and automated conversion from MCP tool definitions to Skill documents, ensuring the accuracy and consistency of the generated documents, reducing the business development cost of intelligent agents, and improving the efficiency and quality of document generation.
Smart Images

Figure CN123159301A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method for generating skill documents, electronic devices, products, and media. Background Technology
[0002] The Model Context Protocol (MCP) provides a standardized specification for accessing external tools for artificial intelligence (AI) agents, enabling large language models to directly call various business tools to complete real-world tasks. Enterprise-level AI agent platforms (such as YOYO Agent) have accumulated a large-scale asset set of MCP tools. However, MCP tool definitions essentially only contain JSON schema structure information, that is, only data structures such as parameter names, data types, whether they are required, default values, and enumeration values, without including the business meaning of the parameters, the actual impact of their values, and the constraints between parameters. Therefore, after obtaining the MCP tool definition, the agent can only mechanically fill in the parameters according to the type, lacking the semantic description, parameter constraint description, calling process, and platform difference guidance required for agent orchestration. In complex multi-tool collaborative tasks, this can easily lead to parameter filling errors and tool selection biases.
[0003] With the rise of next-generation agent frameworks that incorporate skill combination capabilities, the need for skill-based transformation of MCP tools is becoming increasingly urgent. A skill is a standardized Markdown markup language document used on an agent platform to describe how a tool or a set of tools is used. It supplements the JSON schema structure with functional semantics, parameter descriptions, invocation examples, and usage constraints. Therefore, only after MCP tool definitions are converted into skill documents can agents understand the semantics of the tools and make correct parameter filling and tool selection in complex multi-tool tasks.
[0004] Currently, there are three main methods for converting MCP tool definitions into Skill documents, all of which have shortcomings: the manual writing method takes about 1 to 2 days per tool, the format depends on the writer's experience, and it cannot be scaled up to process existing tool assets; the general large language model direct generation method lacks structured prompt constraints, the output format is unstable, generation and quality inspection are disconnected, and it is processed from a single tool perspective, which cannot deal with semantic overlap between documents with similar functions, nor can it verify the actual usability of the document to the Agent; the template filling method simply replaces the original field strings of the tool definition into a preset template, which is essentially a deterministic data transformation and cannot perform semantic processing.
[0005] In summary, current conversion methods cannot achieve large-scale automated conversion of MCP tool definitions to Skill documents while ensuring the actual usability of the documents for the Agent. How to achieve verifiable automated conversion of MCP tool definitions to Skill documents has become an urgent technical problem to be solved. Summary of the Invention
[0006] This application provides a method, electronic device, product, and medium for generating skill documentation, which achieves automated conversion from tool definition to verifiable skill documentation through a multi-agent collaborative system.
[0007] Firstly, this application provides a method for generating skill documents, which includes: obtaining tool definition information; generating skill documents by a document generation agent based on the tool definition information and a prompt word template; performing a graded audit on the skill documents by a quality audit agent to obtain audited skill documents; performing a semantic evaluation on the audited skill documents by a semantic evaluation agent to output a quantitative evaluation result, wherein the quantitative evaluation result is used to measure the accuracy of the audited skill documents and / or to optimize the prompt word template; wherein the skill documents are used by the agent as context input to execute the tool during the inference phase.
[0008] By coordinating document generation agents, quality audit agents, and semantic evaluation agents, an automated chain from document generation and quality auditing to semantic evaluation can be constructed, eliminating reliance on manual writing and individual experience, and improving the scalability and quality control of skills document generation.
[0009] In one possible implementation of the first aspect above, after obtaining the tool definition information, the method further includes: performing heterogeneous normalization processing on the tool definition information to obtain a structured parameter description; and generating a skill document based on the tool definition information and the generated prompt word template by a document generation agent, including: generating a skill document based on the structured parameter description and the generated prompt word template by a document generation agent.
[0010] By normalizing heterogeneous tool definition information, the differences in field naming, nesting levels, and description styles among different tool sources are masked, enabling the subsequent generation of prompt word templates to use structured input. This helps improve the system's compatibility and processing consistency with tool definitions from different sources.
[0011] In one possible implementation of the first aspect described above, the generated prompt template includes at least one of a form-driven generated template and a conversational generated template.
[0012] By providing two generation modes—form-driven template generation and conversational template generation—the form-driven mode is suitable for efficient generation scenarios with large batches of tools, while the conversational mode is suitable for refined generation scenarios with complex parameters, which helps to balance generation efficiency and generation accuracy.
[0013] In one possible implementation of the first aspect described above, the conversational generation template includes at least one of a tool-mode conversational template, a free-mode conversational template, and a guided acquisition template.
[0014] By providing a variety of conversational generation templates, covering different interaction needs such as parameter-by-parameter interactive generation for a single tool, open interactive generation without preset structure, and generation that is actively guided by AI to provide information by users, it is beneficial to improve the scenario adaptability of conversational generation.
[0015] In one possible implementation of the first aspect above, the method further includes: when generating skill documents using a conversational template, performing intent recognition on user input, determining whether the user input intent is to select from existing templates, select multiple templates in batches, or create new tool documents, and entering the corresponding interaction branch based on the determination result.
[0016] By performing intent recognition and de-processing at the start of a dialogue, the document generation agent can automatically select the corresponding interaction flow based on the user's intent, which helps to improve the interaction efficiency and user experience of conversational generation.
[0017] In one possible implementation of the first aspect mentioned above, the skill document includes: a YAML front matter, a first-level heading, a tool command section, a parameter definition section, and an integration workflow section; wherein, the YAML front matter contains the tool name and function description, the tool command section presents the command string in the form of a code block, the parameter definition section presents the parameter name, type, required field markers, and semantic description in a table, and the integration workflow section contains the process of intent parsing and parameter assembly, as well as a description of cross-platform call differences.
[0018] By generating prompt word templates to enforce the output structure of skill documents, the output skill documents will contain a consistent chapter structure regardless of which template is used. This helps to ensure the consistency of the output format and facilitates unified parsing and use by the agent in the subsequent reasoning phase.
[0019] In one possible implementation of the first aspect above, the method further includes: when the skill document belongs to multiple skill documents with similar functions, performing a mergeability determination on the multiple skill documents through a document fusion agent to obtain a determination result, which includes mergeable, conflict-resolvable, and non-mergeable; when the determination result is mergeable or conflict-resolvable, performing semantic fusion on the multiple skill documents through a document fusion agent to generate a fused skill document; when the determination result is non-mergeable, maintaining independent documents and outputting the reason for non-mergeability.
[0020] By using a document fusion agent to perform mergeability determination and semantic fusion on multiple skill documents with similar functions, the redundancy problem caused by the decentralized maintenance of documents can be solved, which is conducive to the global management and structured reorganization of multiple skill documents.
[0021] In one possible implementation of the first aspect above, a document fusion agent performs semantic fusion on multiple skill documents to generate a fused skill document, including: performing deep semantic analysis on the multiple skill documents and outputting analysis results, the analysis results including at least one of a functional domain mapping table, intent clustering results, and parameter overlap matrix; determining a fusion strategy based on the analysis results, the fusion strategy including at least one of an organization scheme, deduplication rules, conflict resolution, and terminology unification; and generating a fused skill document according to the fusion strategy, the fused skill document including at least one of fusion information such as an overview section, a navigation table, a shared parameter section, and cross-integration guidelines.
[0022] Through a three-step semantic fusion process involving deep semantic analysis, fusion strategy formulation, and structured output, the system understands the content structure of each document at the semantic level, identifies overlapping parameter relationships, and formulates deduplication and resolution strategies to generate a fused document containing a new organizational structure not present in the original document. This approach helps improve the quality and usability of multi-document fusion.
[0023] In one possible implementation of the first aspect mentioned above, the mergeability determination includes: functional domain determination, operation complementarity analysis, context sharing check, intent aggregation analysis, and conflict detection; wherein, functional domain determination is used to determine whether the functions described in the document belong to the same business domain; operation complementarity analysis is used to determine whether the operations constitute a logical complementary relationship; context sharing check is used to compare whether the overlap rate of parameter definitions exceeds a preset threshold; intent aggregation analysis is used to determine whether various user intents can be covered by a unified parameter system and operation process; conflict detection is used to check whether parameter names have the same name but different meanings, whether default values are contradictory, and whether constraints are mutually exclusive.
[0024] By using a five-dimensional mergeability assessment, the document's mergeability is analyzed from five dimensions: functional domain, operational complementarity, context sharing, intent aggregation, and conflict detection. The assessment outputs three levels of results: mergeable, conflict-resolvable, and unmergeable. This helps to accurately determine whether multiple documents are suitable for merging and avoids information loss or increased conflict caused by blind merging.
[0025] In one possible implementation of the first aspect described above, the skill documents that pass the audit are obtained by performing a graded audit on the skill documents through a quality auditing agent. This includes: performing a graded audit on the skill documents through the quality auditing agent to obtain audit results; when the audit results contain issues of a predetermined level, the skill documents are corrected based on the audit results by a document generation agent, and the graded audit is re-executed until the audit results do not contain issues of the predetermined level, thus obtaining a skill document that passes the audit. That is, a skill document that passes the audit is obtained when the audit results contain neither critical nor significant issues.
[0026] By establishing a feedback loop between the quality audit agent and the document generation agent, when the audit finds serious or important issues, the document generation agent makes targeted modifications and re-audits, repeating this process until the audit is passed. This helps to continuously improve the quality of skills documents and ensures that the published documents meet quality standards.
[0027] In one possible implementation of the first aspect above, the skill document is subjected to a graded audit by a quality audit agent, which includes: the quality audit agent assesses the quality of the skill document from multiple set dimensions to obtain audit results; wherein the multiple set dimensions include at least one of logical clarity, language accuracy, content redundancy and factual correctness.
[0028] By scoring document quality item by item from four dimensions—logical clarity, language accuracy, content redundancy, and factual correctness—and coding the audit standards into phased inspection instructions, it is beneficial to achieve systematic and reproducible automated quality auditing, avoiding reliance on subjective judgment based on human experience.
[0029] In one possible implementation of the first aspect mentioned above, the degree of graded auditing includes Level 1, Level 2 and Level 3. The audit results of the audited skill documents do not include Level 1 and Level 2 issues. Level 1 issues include functional description errors and missing required parameters. Level 2 issues include inaccurate language expression and improper logical order. Level 3 issues include redundant content and insufficient conciseness of expression.
[0030] By classifying the discovered issues into three levels according to their severity, different handling strategies are adopted for issues of different levels. That is, first-level issues must be corrected before release, second-level issues are recommended to be corrected first, and third-level issues can be corrected as appropriate, which helps to achieve a balance between quality assurance and production efficiency.
[0031] In one possible implementation of the first aspect mentioned above, the semantic evaluation agent includes a use case generation model, a behavior response model, and a semantic evaluation model; the semantic evaluation agent performs semantic evaluation on the audited skill documents and outputs quantitative evaluation results, including: constructing test cases based on the skill documents through the use case generation model; simulating the agent to execute tool calls according to the skill documents through the behavior response model and outputting the actual call results; and comparing the actual call results with the expected results of the test cases through the semantic evaluation model to obtain the quantitative evaluation results.
[0032] By having three independent large model instances—the test case generation model, the behavior response model, and the semantic evaluation model—work collaboratively, a complete evaluation process is achieved, from test case construction and agent-level actual call simulation to semantic-level comparison. This facilitates quantifiable verification of whether an agent can correctly call tools based on skill documents.
[0033] In one possible implementation of the first aspect above, a quantitative evaluation result is obtained by comparing the actual call result with the expected result of the test case through a semantic evaluation model. This includes: comparing the command string of the actual call result with the command string of the expected result at the instruction level to obtain a string comparison result; comparing the parameter key set of the actual call result with the parameter key set of the expected result at the parameter key level to obtain a parameter comparison result; comparing the actual padding value of the actual call result with the expected value of the expected result parameter by parameter at the parameter value level to obtain a padding value comparison result, wherein the comparison at the parameter value level is performed by the semantic evaluation model using semantic equivalence inference; and generating a quantitative evaluation result based on the string comparison result, the parameter comparison result, and the padding value comparison result.
[0034] By adopting a three-layer comparison architecture consisting of instruction layer, parameter key layer, and parameter value layer, the comparison of parameter value layer is upgraded from traditional string exact matching to semantic equivalence reasoning. This can identify parameter values that have the same semantics but different expressions, which helps to improve the accuracy and rationality of the evaluation results.
[0035] In one possible implementation of the first aspect above, the method further includes: identifying insufficiently constrained links in the generated prompt word template based on the quantitative evaluation results, and iteratively optimizing the generated prompt word template to obtain an optimized generated prompt word template.
[0036] By feeding back the quantitative evaluation report output by the semantic evaluation agent to optimize the prompt word template of the document generation agent, weak links with insufficient constraints can be identified and the template can be continuously iterated. This helps to form a self-closed loop of "generation, auditing, evaluation, and optimization" and continuously improve the quality of skill document generation.
[0037] In one possible implementation of the first aspect above, the method further includes: generating an optimized skill document by a document generation agent based on tool definition information and an optimized generation prompt word template.
[0038] By regenerating skill documents using optimized prompt word templates, the effects of template iteration can be applied to the document generation process, continuously improving the quality of the output documents.
[0039] In a second aspect, this application provides an electronic device, including: one or more processors; one or more memories; the one or more memories storing one or more programs, which, when executed by one or more processors, cause the electronic device to perform the method described in any of the first aspects above.
[0040] Thirdly, this application provides a computer-readable storage medium having instructions stored thereon that, when executed on a computer, cause the computer to perform any of the methods described in the first aspect above.
[0041] Fourthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the method described in any of the first aspects above.
[0042] The beneficial effects of the second to fourth aspects mentioned above can be referred to the relevant descriptions in the first aspect and various possible implementations of the first aspect, which will not be repeated here. Attached Figure Description
[0043] Figure 1A The diagram shown is a schematic representation of a multi-agent collaborative system architecture provided in an embodiment of this application.
[0044] Figure 1B The diagram shown is a schematic diagram of the layered architecture of a skill document generation method provided in an embodiment of this application;
[0045] Figure 2 The diagram shown is a schematic of a document generation intelligent agent data processing flow provided in an embodiment of this application;
[0046] Figure 3 The diagram shown is a schematic of a data processing flow for a quality auditing intelligent agent provided in an embodiment of this application.
[0047] Figure 4The diagram shown is a schematic diagram of a semantic evaluation intelligent agent data processing flow provided in an embodiment of this application;
[0048] Figure 5A The diagram shown is a schematic of an automated single-tool skill document generation process provided in an embodiment of this application.
[0049] Figure 5B The diagram shown is a schematic representation of a multi-skill document fusion process provided in an embodiment of this application.
[0050] Figure 5C The diagram shown is a schematic representation of a prompt word template relationship provided in an embodiment of this application.
[0051] Figure 6 The diagram shown is a schematic representation of the overall process of a skill document generation method provided in an embodiment of this application.
[0052] Figure 7 The diagram shown is a flowchart illustrating the fusion processing of multiple skill documents according to an embodiment of this application.
[0053] Figure 8 The figure shown is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0054] Figure 9 The diagram shown is a schematic diagram of the operating system software structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings and specific implementation methods.
[0056] It should also be stated that the steps in the methods and processes in this application are numbered for ease of reference, not to limit the order of steps. If there is an order between the steps, the textual description shall prevail.
[0057] To address the challenge of automating the verifiable conversion of MCP tool definitions into skill documents, this application provides a method for generating skill documents. Specifically, the method acquires tool definition information; a document generation agent generates skill documents based on the tool definition information and a prompt word template; a quality audit agent performs a graded audit on the skill documents to obtain audited skill documents; and a semantic evaluation agent performs a semantic evaluation on the audited skill documents, outputting a quantitative evaluation result. This quantitative evaluation result is used to measure the accuracy of the skill documents and / or to optimize the prompt word template. The skill documents are used by the agent as context input to execute the tool during the inference phase. For example, the tool definition information can be an MCP tool definition, and the skill document can be called a Skill document.
[0058] This application's embodiments utilize a multi-agent collaborative approach to automate the generation process from tool definition to skill documentation. First, a document generation agent, combined with a prompt word template, automates the generation of skill documents, eliminating reliance on manual writing and individual experience, alleviating the bottleneck of large-scale production caused by manual writing, and improving document output efficiency. Second, a quality audit agent performs tiered audits, filtering out documents with high-level issues and implementing basic quality control over output documents, preventing documents with obvious defects from being directly used downstream. Furthermore, a semantic evaluation agent conducts semantic assessments and outputs quantitative evaluation results. This objectively measures the accuracy of skill documents, changing the reliance on subjective human judgment of document quality and making document quality measurable. The quantitative evaluation results can also be used to optimize the prompt word template, providing a basis for iterative constraints in subsequent document generation and facilitating continuous improvement of the generated document quality. Thus, a verifiable automated conversion from tool definition to skill documentation is achieved. Furthermore, the processed skill documents can be used by agents (such as task agents like YOYO agents) as context input to execute tools during the inference phase, thus bridging the conversion link from tool definition to actual tool invocation by the agent. This enables the transformation of tool assets into skill document assets usable by the agent, facilitating the reuse of business assets and reducing the development cost of agent business.
[0059] It is understood that, in the embodiments of this application, "intelligent agent" refers to an artificial intelligence processing unit deployed and running in an electronic device, driven by a large language model, and possessing specific roles and behavioral constraints. Each intelligent agent has an independent role division and an independent behavioral constraint template, and completes the specified semantic processing task within the constraint framework.
[0060] Tool definition information is structured information that describes the tool's functions, commands, and input / output constraints. An example is the MCP tool definition, which includes the tool name, command string, function description, and input / output parameter definitions in JSON Schema format.
[0061] Skill documents, also known as tool skill documents, skill documents, standardized skill documents, agent skill documents, or standardized agent skill documents, are standardized documents that serve as contextual input for agents during the inference phase, guiding them to understand and invoke external tools. They typically include tool function descriptions, parameter definitions, invocation examples, and integration workflows. In this embodiment, the skill document has a pre-defined unified document structure, undergoes hierarchical auditing and semantic evaluation verification, and its semantics are consistent with the MCP tool definition. It can be directly used as contextual input for the agent's inference phase to execute tool invocations.
[0062] In some embodiments, the present application can be applied to the skill-based transformation of MCP tool assets in enterprise-level AI agent platforms. Enterprise-level AI agent platforms have accumulated a large-scale portfolio of MCP tool assets through long-term business experience. Using the skill document generation method provided in this application, these MCP tool definitions can be batch-converted into standardized skill documents for use by the agent framework during the inference phase, achieving asset reuse and reducing development costs.
[0063] like Figure 1A The diagram shown is a schematic of a multi-agent collaborative system architecture provided in an embodiment of this application. The system consists of a normalization processing module, a document generation agent (G), a quality audit agent (A), a semantic evaluation agent (J), and a document fusion agent, covering the complete processing chain from tool definition preprocessing, document generation, quality auditing, semantic evaluation to multi-document fusion.
[0064] The normalization module, as a pre-processing step in the system, is used to convert heterogeneous tool definition information into structured parameter descriptions (i.e., parameter descriptions in a unified format), thus shielding the differences in field naming, nesting levels, and description styles among different tool sources.
[0065] The document generation agent receives normalized parameter descriptions and performs semantic understanding and structured document generation under the constraints of generation prompt templates, outputting standardized skill documents. The behavior of the document generation agent is constrained by four sets of generation prompt templates: form-driven generation template, tool-mode dialogue template, free-mode dialogue template, and guided data collection template.
[0066] The quality auditing agent receives the output from the document generation agent, checks the document quality dimension by dimension according to preset audit standards, and outputs a structured audit report. When the audit results contain serious or important issues, the audit report is fed back to the document generation agent, which makes targeted modifications and resubmits it for auditing, forming a feedback loop.
[0067] The semantic evaluation agent is configured independently of the document generation agent and the quality audit agent, and does not share behavioral constraint templates. The semantic evaluation agent receives the actual invocation output generated by the simulated agent based on the skill document and the expected standard answer, performs semantic-level equivalence reasoning on both, and outputs a quantified evaluation result. This evaluation result feeds back into the document generation agent to optimize the prompt word template.
[0068] When multiple skill documents with similar functions exist, the document fusion agent intervenes, first performing a mergeability determination, and then performing semantic fusion on the documents that are determined to be mergeable or whose conflicts can be resolved, to generate a fused skill document.
[0069] Reference Figure 1B This is a schematic diagram of the layered architecture of the skill document generation method provided in this application embodiment. The architecture sequentially includes a front-end output layer, a quality assurance layer, a core generation layer, and an input parsing layer. Specifically, the input parsing layer is used to parse and transform tool definition information, converting the original tool definition information into structured parameter descriptions to provide standardized input data for the upper layer; the core generation layer relies on the document generation agent to complete the generation of the initial draft of the skill document under the constraint of prompt words, and at the same time relies on the document fusion agent to realize the semantic fusion and merging of multiple skill documents with similar functions; the quality assurance layer includes a two-level verification process, in which a quality audit agent completes the graded audit of documents (also known as graded quality inspection), and then a semantic evaluation agent performs semantic evaluation verification. Unqualified documents can be backed to the core generation layer for revision; the front-end output layer receives the documents that have passed the verification of the quality assurance layer and outputs standardized skill documents (SKILL.md). The output standardized skill documents can be used as context input for the agent in the inference stage to execute tool calls.
[0070] Next Figure 1B The specific implementation details of each module and agent in the multi-agent collaborative system architecture are explained in detail.
[0071] First, normalization processing, also known as heterogeneous schema normalization processing, is a preliminary data processing step in multi-agent collaborative systems. It is used to decouple the heterogeneity of tool definitions and ensure the robustness and consistency of system data processing.
[0072] In some embodiments, the tool definition information is an MCP tool definition, using JSON Schema (i.e., JSON format), which includes the tool name, command string, function description, input parameter schema, output schema, and an optional array of call examples. Different MCP services may differ in field naming, nesting levels, and description styles. For example, some tools name the parameter description field "description," while others name it "desc"; some tools nest parameters under "properties," while others place them directly at the root level.
[0073] The normalization module converts the heterogeneous tool definition information into structured parameter descriptions. These structured descriptions contain standardized parameter fields, each including a parameter name, parameter type, whether it is required, parameter semantics, default value, and enumeration range. Normalization includes operations such as field name mapping, flattening nested structures, and unifying description styles. This allows the subsequent document generation agent to use structured input for its prompt templates, eliminating the need to write differentiated processing logic for tool definitions from different sources.
[0074] Through heterogeneous schema normalization, the multi-agent collaborative system can be compatible with tool definition information from different MCP servers, which is beneficial to improving the system's scalability and adaptability to heterogeneous data sources.
[0075] Second, the document generation agent is the core generation unit of the multi-agent collaborative system, and its behavior is constrained by the generation prompt word template. The constraint mechanism does not adopt a simple instruction method that directly instructs the model to act, but instead encodes the skill document specifications into multi-dimensional executable constraints, enabling the large language model to complete semantic understanding and content generation within a format-controlled framework.
[0076] Specifically, the document generation agent receives a normalized, structured parameter description, executes the corresponding generation process based on the selected generation prompt word template, and outputs a standardized Skill document.
[0077] In some embodiments, the generated prompt word templates include form-driven generation templates and conversational generation templates. The conversational generation templates further include tool-mode conversational templates, free-mode conversational templates, and guided data collection templates. These four templates cover both efficiency-first and accuracy-first strategy requirements.
[0078] Form-driven template generation is designed for efficient batch scenarios where users fill in tool information in a structured form and submit it all at once. In form-driven mode, users fill in all the information in the structured controls at once, and the document generation agent produces a complete document in a single round of dialogue, making it suitable for scenarios requiring efficient generation of large batches of tools.
[0079] The tool-mode dialogue template is used for parameter-by-parameter interactive generation scenarios for a single tool. The free-mode dialogue template is used for open-ended interactive scenarios without a preset structure. The guided data collection template is used for scenarios where AI proactively guides users to provide necessary information according to a structured process. In dialogue mode, the document generation agent proactively guides users to interact parameter by parameter. After each parameter is collected, the semantics are confirmed before proceeding to the next parameter, which is suitable for fine-grained generation scenarios with complex parameters.
[0080] In some embodiments, when generating skill documents using a conversational template, the document generation agent first performs intent recognition upon initiation of the conversation to determine whether the user's intent is "select from existing templates," "select multiple templates in batches," or "create a new tool document," and then proceeds to the corresponding interaction branch. Through intent recognition and branching, conversational generation can automatically select the interaction flow based on the user's actual needs, thus improving interaction efficiency.
[0081] Regarding the output structure, all four sets of generated prompt word templates mandate that the output of the document generation agent must contain at least one of the following structures 1 to 5 in a fixed order.
[0082] Structure 1: YAML Header Metadata Block (YAML front matter), which contains the tool name and a concise description of its functionality, presented in YAML format for easy machine parsing and indexing.
[0083] Structure 2, Level 1 Heading: Presents the tool's formal name as a Level 1 heading in the document.
[0084] Structure 3, the Tool Commands section, presents complete command-line call examples in the form of code blocks, including the command name and how to use all parameters.
[0085] Structure 4, Parameter Definition Section, lists parameter names, parameter types, required fields, and semantic descriptions in tabular form, making parameter information readily apparent.
[0086] Structure 5, Integrated Workflow Section, includes an ASCII flowchart for intent parsing and parameter assembly, and a description of the differences in cross-platform execution calls, guiding the agent to correctly call tools in different platform environments.
[0087] Regardless of the generation template used, the consistency of the output structure is guaranteed by the constraints of the generated prompt word template, rather than by the agent's autonomous compliance. Enforcing a unified output structure helps ensure consistent formatting of the generated skill documents, facilitating unified parsing and use by the agent during the inference phase.
[0088] like Figure 2The diagram shown is a schematic of a document generation intelligent agent data processing flow provided in an embodiment of this application. Figure 2 This demonstrates the complete generation process from structured schema data (i.e., structured parameter descriptions) to standardized skill documentation, which is divided into two stages.
[0089] The first stage is interaction mode matching. After the structured schema data is input, the document generation agent automatically matches one of four generation templates based on the tool's interaction type: form-driven generation template (suitable for form / json parameter-based tools), tool-mode dialogue template (suitable for tool-call interaction tools), free-mode dialogue template (suitable for free text interaction tools), and guided data collection template (suitable for structured guided tools).
[0090] The second stage involves generating Prompt constraints. The matched template data undergoes a triple constraint process: first, structural constraints ensure the document contains necessary chapters, hierarchies, and references; second, language constraints unify sentence structure, terminology, and style; and finally, use case constraints cover cold start scenarios, parameter default scenarios, and error handling scenarios. After this triple constraint filtering, a standardized Skill document is finally output.
[0091] Understandably, the above generation process, through a two-level processing mechanism of "pattern matching and triple constraints," enables MCP tools of different interaction types to generate Skill documents with a unified structure, standardized semantics, and complete use cases.
[0092] Third, the behavior of the quality audit agent is constrained by the quality audit template, and a systematic and automated quality audit is performed on the output of the document generation agent. The agent works by encoding audit standards into phased inspection instructions and checking document quality dimension by dimension, rather than relying on subjective judgment based on human experience.
[0093] Specifically, the quality audit agent receives the skill documents output by the document generation agent, performs a four-dimensional quality assessment and outputs a problem classification, and feeds back to the document generation agent for correction when there are serious or important problems.
[0094] In some embodiments, the quality audit agent scores document quality item by item from four dimensions: logical clarity assesses whether the sequence of process steps is reasonable and whether the dependencies between parameters are correctly expressed; language accuracy assesses whether parameter descriptions are precise and whether there are any ambiguous expressions; content redundancy assesses whether the same information appears repeatedly in multiple places; and factual correctness assesses whether the default values, enumerations, and constraints of parameters are consistent with the schema defined by the original tool. By scoring item by item in four dimensions, audit standards are encoded into reproducible inspection instructions, avoiding reliance on subjective judgment based on human experience.
[0095] In some embodiments, the quality audit agent categorizes identified issues into three levels based on severity: Level 1 is Severe (P0), covering errors in functional descriptions and omissions of required parameters; these issues must be corrected before release. Level 2 is Important (P1), covering inaccurate language and improper logical order; these are recommended for priority correction. Level 3 is Recommendation (P2), covering redundant content and insufficiently concise expressions; correction can be chosen based on the specific circumstances. This three-level grading mechanism employs differentiated processing strategies for issues of varying severity, ensuring both document quality and production efficiency.
[0096] In some embodiments, the output of the quality audit agent is not merely a list of issues, but rather forms a feedback and collaboration mechanism with the document generation agent. When the audit results contain critical or significant issues, the audit report is fed back to the document generation agent, which, driven by correction instructions, makes targeted modifications to the original document and resubmits it for auditing. This cycle continues until the audit is passed or no new critical or significant issues are identified.
[0097] By leveraging the feedback loop between the quality audit agent and the document generation agent, the quality of skills documents can be continuously improved within the automated process, ensuring that the final published documents meet the preset quality standards.
[0098] like Figure 3 The diagram shown is a data processing flow diagram of a quality auditing intelligent agent provided in an embodiment of this application. The diagram illustrates the three-stage progressive auditing process of the quality auditing intelligent agent on the initial draft of the Skill document.
[0099] Specifically, the input to the quality audit agent is a draft Skill document, which undergoes three audit stages. Stage one is functional understanding verification, where parameters in the document are semantically traversed parameter by parameter to confirm that the meaning of each field is correctly understood. Stage two is a four-dimensional quality assessment, comprehensively evaluating document quality from four dimensions: logical clarity, language accuracy, content redundancy, and factual correctness. Stage three is a three-level problem classification, categorizing audit findings into three levels based on severity: Level 1 is severe (blocking omissions), Level 2 is important (semantic contradictions), and Level 3 is recommended (expression optimization).
[0100] After the three-stage audit is completed, the judgment phase begins. If the document has no critical or important issues, it is judged as passed and proceeds to the subsequent evaluation or output process; if critical or important issues exist, it is judged as returned for revision, and the document is returned to the generation agent for regeneration. This process, through a progressive audit mechanism of "understanding verification, quality assessment, and issue classification," ensures that the output Skill document meets usable standards in terms of both functional semantics and document quality.
[0101] Fourth, the semantic evaluation agent is the evaluation layer agent in the multi-agent collaborative system. It is configured independently of the document generation agent and the quality audit agent, and does not share behavioral constraint templates. This agent is primarily used to quantitatively verify whether the agent can correctly invoke tools based on skill documents, upgrading the evaluation criteria from traditional string matching to semantic equivalence reasoning.
[0102] Specifically, the evaluation process of the semantic evaluation agent is completed collaboratively by three independent large model instances: the use case generation model, the behavior response model, and the semantic evaluation model.
[0103] The first step is to construct test cases. An independent test case generation model constructs test cases based on the skill document content. Each test case uses JSONL format and includes three fields: the user's natural language input, the expected command string, and the expected complete response text. These three fields together constitute the complete expectation of a test case. For example, the user's natural language input could be "Call me for a meeting at 9 AM tomorrow," and the expected command string could be "yoyo task create: alarm; event: meeting; datetime: 9 AM tomorrow."
[0104] The second step is to simulate the actual invocation by the intelligent agent. An independent behavioral response model simulates the agent's real behavior, receiving user input and skill documents as input. Based on the integrated workflow in the documents, it performs intent parsing, parameter extraction, and command construction, producing the actual command string and response text.
[0105] The third step is multi-dimensional comparison. The actual output of the behavioral response model is compared with the expected value of the test cases at three levels: at the instruction level, the output command string is compared with the expected command to check for consistency in command name and parameter structure; at the parameter key level, all parameter keys are extracted from the output command and compared with the expected key set to check for missing or redundant parameters; at the parameter value level, the actual filled value is compared with the expected value parameter by parameter. This three-layer comparison architecture, from coarse to fine, achieves comprehensive verification of the agent's invocation results.
[0106] The fourth step is semantic equivalence reasoning. The parameter value comparison does not use exact string matching; instead, semantic evaluation models perform semantic equivalence reasoning. The semantic evaluation model receives the actual and expected values of the parameters and determines whether they are semantically equivalent. For example, if the actual value is "9 AM tomorrow" and the expected value is "9 AM tomorrow morning," they are semantically equivalent, and the semantic evaluation model determines it as a match.
[0107] After the evaluation is completed, the semantic evaluation agent outputs a quantitative evaluation report, which includes the three-layer pass rate for each use case and the overall semantic matching accuracy. This quantitative evaluation report feeds back into the document generation agent to optimize the generation prompt word template, driving continuous template iteration by identifying weaknesses in insufficient constraints.
[0108] By using independent semantic evaluation by a semantic judgment agent, the actual usability of skill documents can be quantitatively verified, solving the problem of inaccurate evaluation results caused by traditional evaluation methods that rely on exact string matching.
[0109] like Figure 4 The diagram shown is a schematic of a semantic evaluation intelligent agent data processing flow provided in an embodiment of this application. Figure 4 This demonstrates a four-step workflow for semantic evaluation agents, used to verify the practical usability of Skill documents for agents.
[0110] Figure 4 The first step of the process is test case generation. Taking the standardized skill document (SKILL.md) as input, the test case generation model constructs test cases covering typical scenarios, outputting a JSONL file of test cases. The second step is behavioral response. The test cases are input into the behavioral response model, which simulates the behavior of a real agent and generates actual outputs according to the guidance of the Skill document. The third and fourth steps are comparison and evaluation. The actual outputs of the behavioral response model are compared with preset standard (Golden) answers. First, structured verification is performed through string / key comparison, and then semantic discrimination is performed by the semantic evaluation model, finally outputting an evaluation report (i.e., a quantitative evaluation report). This process, through a closed-loop mechanism of "test case generation, simulated response, and comparison and evaluation," verifies the usability of the Skill document based on the actual operating effect of the agent, overcoming the shortcomings of traditional quality inspection which only focuses on document format and cannot verify actual operating effects.
[0111] like Figure 5A The diagram illustrates an automated generation process for a single-tool skill document according to an embodiment of this application. This process takes an MCP tool definition (JSON Schema) as input and outputs a standardized SKILL.md document through four steps. Specifically, Figure 5AStep S1, as shown, is the parsing and transformation step, which parses the JSON Schema of the MCP tool and converts it into a structured parameter description, extracting structural information such as parameter names, types, required fields, and default values. Step S2 is the Prompt-driven document generation step, which automatically generates a draft Skill document based on multiple Prompt templates (supporting both form and dialogue modes). Step S3 is the AI quality inspection step, which conducts a quality review of the draft document through a three-stage progressive audit, four-dimensional quality assessment, and a three-level problem classification (P0 / P1 / P2). If a preset level of problem (i.e., serious or important) is found, the document is returned for revision. Step S4 is the evaluation and verification step, which verifies the actual usability of the document for the agent through use case generation, simulated calls, multi-dimensional comparison, and semantic evaluation. The final output of this process is a standardized SKILL.md file containing a YAML parameter table and an ASCII flowchart, realizing end-to-end automated transformation from tool structure definition to usable Skill document.
[0112] Fifth, when multiple skill documents with similar functions exist, a document fusion agent intervenes. The agent's behavior is constrained in stages by two sets of prompt word templates: the feasibility analysis template constrains its analytical behavior, and the semantic fusion generation template constrains its generation behavior. The constraints of the two sets of templates are causally dependent; the judgment result of the analysis template determines whether the generation template is activated.
[0113] Specifically, the document fusion agent first performs a five-dimensional mergeability determination, and then performs a three-step semantic fusion on documents that are determined to be mergeable or whose conflicts can be resolved.
[0114] Phase One: Constraint Analysis Behavior, namely, Five-Dimensional Mergeability Determination. Under the constraints of the merge feasibility analysis template, the document fusion agent analyzes the mergeability of documents one by one from five dimensions:
[0115] 1. Functional Domain Determination: Determine whether the functions described in the document belong to the same business domain. For example, "Create Alarm" and "Modify Alarm" both belong to the alarm clock management domain, while "Create Alarm" and "Make a Phone Call" belong to different domains.
[0116] 2. Operational Complementarity Analysis: Determine whether operations constitute a logically complementary relationship. For example, creation, modification, deletion, and query form a complete data operation loop and complement each other.
[0117] 3. Context sharing check: Check whether the tool shares the call context and parameter space, specifically comparing whether the overlap rate of parameter definitions exceeds a preset threshold.
[0118] 4. Intent aggregation analysis: Determine whether various user intents can be uniformly expressed, that is, whether a unified parameter system and operation process can be designed to cover all intents.
[0119] 5. Conflict detection: Check for cases where parameter names are the same but have different meanings, whether default values are contradictory, and whether constraints are mutually exclusive.
[0120] After the five-dimensional analysis is completed, the document fusion agent outputs a three-level judgment result. Documents that meet all five conditions are mergingable; documents with conflicts that can be resolved by renaming parameters, unifying default values, or aligning terminology are resolvable; documents with irresolvable functional conflicts are not mergingable, and the document retains its independent document status while outputting the specific reasons why it cannot be merged.
[0121] Phase Two: Constraint Generation Behavior, i.e., Three-Step Semantic Fusion. The document fusion agent performs three-step semantic fusion under the constraints of the semantic fusion generation template only if Phase One determines the document is mergingable or the conflict has been resolved.
[0122] The first step is deep semantic analysis. This involves understanding the semantic structure of each skill document and outputting a functional domain mapping table, intent clustering results, and parameter overlap matrix.
[0123] The second step is to formulate a fusion strategy. Based on the analysis results, a fusion plan is developed, including: determining the chapter structure of the fused document; defining deduplication rules and merging strategies for duplicate parameters in the parameter table; renaming and mapping conflict resolution records and unifying default values; and standardizing terminology to ensure consistent terminology throughout the document.
[0124] The third step is structured output. The resulting merged skill document, in addition to containing all the valid information from the original document, adds the following structures: an overview section (including functional domain descriptions and sub-functional relationships), a navigation table (quick navigation anchors for each sub-functionality), a shared parameter section (centralized definitions of parameters shared across sub-functionalities, referenced by each sub-functionality section rather than repeatedly defined), and cross-integration guidelines (methods for combining and calling sub-functionalities). These structures were not present in the original independent document.
[0125] The fundamental difference between simple splicing and document fusion lies in the fact that simple splicing connects multiple skill documents end-to-end without any semantic analysis. The result is that redundant information is preserved as is, conflicting information coexists, and no new structure is added. In contrast, the semantic fusion operation performed by the document fusion agent operates at the semantic level. It first determines whether the documents can be merged, and then decides how to merge them. Redundancy is identified and merged, conflicts are detected and resolved, and new organizational structures that were not present in the original documents are introduced.
[0126] like Figure 5B The diagram shown is a schematic of a multi-skill document fusion process provided in an embodiment of this application. Figure 5BThis paper illustrates the fusion process of a document fusion agent handling multiple skill documents. The process takes multiple skill documents (SKILL.md) as input. First, an LLM semantic model performs five-dimensional judgment and three-level classification, categorizing the relationships between documents into three types: mergeable, conflict-resolvable, and unmergeable. Different processing strategies are adopted for different classification results: documents determined to be mergeable directly enter the fusion stage; documents determined to have resolvable conflicts first implement conflict resolution schemes, including parameter renaming, default value unification, and terminology alignment, eliminating conflicts before entering fusion; documents determined to be unmergeable remain independent, and an explanation of why they cannot be merged is output. Then, a three-step structured fusion stage is performed: first, deep semantic analysis is conducted; then, a fusion strategy is formulated; and finally, a structured result is output. The final result is a fused version of the skill document (SKILL.md), achieving the goals of redundancy removal, conflict resolution, and structural reorganization. This process, through the mechanism of "semantic judgment, classification processing, and structured fusion," solves the problems of semantic overlap, parameter conflicts, and inconsistencies in terminology between functionally similar skill documents, making document sets in multi-tool collaborative scenarios more streamlined and unified.
[0127] Understandably, the traditional approach of generating skill documentation using large language models typically involves directly handing over the tool definition along with a simple "Please generate skill documentation" to the large model. Its fatal flaw lies in the uncontrollable output, manifesting as a mix of JSON and Markdown formats, inconsistent YAML metadata, varying flowchart formats, and missing platform-specific information. In contrast, this application provides a multi-dimensional Prompt template-driven document generation method. It breaks down the skill documentation format specifications into multi-dimensional structured Prompt constraints, covering the entire document generation, quality control, and fusion process through six sets of collaborative templates.
[0128] As an example, such as Figure 5C The diagram shown is a schematic representation of the Prompt template relationships provided in an embodiment of this application. Figure 5CThe six Prompt templates shown are divided into two groups based on their purpose: generation and merging. The generation group includes template files 1 to 4. Template file 1 (skill-generator.md) uses a form-driven mode, allowing users to fill out a form and generate a complete document with a single click. Template file 2 (chat-tool-mode.md) uses a conversational mode, generating documents through interactive question-and-answer sessions with each parameter. Template file 3 (chat-free-mode.md) uses a free-conversation mode, supporting unconstrained open-ended generation. Template file 4 (chat-guide.md) uses a guided data collection mode, where AI actively guides users to input data according to a structured process. The merging group includes two templates, template files 5 and 6. Template file 5 (merger-analyze.md) is used for mergibility determination, and template file 6 (merger-generate.md) is used for semantic fusion generation, serving the two stages of multi-document fusion respectively. Understandably, the four sets of generation templates each independently produce standardized Skill documents, while the two sets of merging templates analyze and integrate multiple documents, ultimately converging all paths to output a standardized SKILL.md file.
[0129] like Figure 6 The diagram shown is a schematic representation of the overall process of a skill document generation method provided in this application embodiment. This method can be applied to electronic devices, such as smartphones, tablets, personal digital assistants, wearable devices, and other terminal devices with data processing capabilities, or servers or cloud computing platforms. The method includes the following steps:
[0130] S601, Obtain tool definition information.
[0131] Tool definition information refers to structured data that describes the functions and invocation methods of external tools.
[0132] In some embodiments, the tool definition information is an MCP tool definition, using JSON Schema, which includes the tool name, command string, function description, input parameter schema, output schema, and an optional array of call examples.
[0133] S602 performs heterogeneous normalization processing on the tool definition information to obtain a structured parameter description.
[0134] As mentioned earlier, heterogeneous normalization converts tool definition information from different sources and in different formats into structured parameter descriptions, masking differences in field naming, nesting levels, and description styles.
[0135] By traversing the tool parameters, parameter names, parameter types, whether they are required, default values, parameter descriptions, and calling examples are uniformly extracted. Heterogeneous parameter types are then standardized and mapped to eliminate heterogeneous differences in the output data of different MCP servers. This provides regular and unified input data for the subsequent generation of standardized documents, avoiding interference with the quality of document generation caused by chaotic original input formats.
[0136] S603 generates skill documents using a document generation agent based on structured parameter descriptions and generated prompt word templates.
[0137] As an example, the generated prompt template includes at least one of form-driven generation templates and conversational generation templates. Therefore, this application can adapt to two different document generation scenarios: it can achieve batch, efficient, and fully automatic document generation through form-driven templates, and it can achieve refined, interactive, and customized document generation through conversational generation templates, adapting to different tool complexities and user needs.
[0138] Conversational generation templates include at least one of tool-mode conversational templates, free-mode conversational templates, and guided data collection templates. Different conversational templates cater to different user conversational needs, thus improving the user interaction experience.
[0139] The document generation agent performs semantic understanding and structured document generation under the constraints of the selected generation prompt template (form-driven generation template or conversational generation template), and outputs a standardized skills document containing YAML front matter, first-level headings, tool command sections, parameter definition sections, and integrated workflow sections.
[0140] The YAML front matter includes the tool name and function description, the tool command section presents the command string in the form of code blocks, the parameter definition section presents the parameter name, type, required field markers and semantic descriptions in the form of tables, and the integration workflow section contains the process of intent parsing and parameter assembly as well as the explanation of cross-platform call differences.
[0141] Therefore, by using preset prompt templates, the overall structure, content paradigm, and expression logic of skill documents can be strictly standardized, avoiding problems such as document format chaos, missing content, and semantic deviation caused by the unconstrained free generation of large models, thus ensuring the standardization and normalization of output documents.
[0142] In some embodiments, when generating skill documents using a conversational template, this application performs intent recognition on user input to determine whether the user's input intent is to select from existing templates, select multiple templates in batches, or create a new tool document, and enters the corresponding interactive branch based on the determination result. Therefore, it can automatically adapt to different user operation intents, realize intelligent branch jumps in the interactive process, eliminate the need for users to manually switch working modes, simplify the operation process, accurately match the corresponding document generation logic, and improve the intelligence and adaptability of interactive document generation.
[0143] S604 uses a quality auditing agent to perform tiered audits on skill documents and determines whether the audit results contain issues of a preset level.
[0144] As an example, the quality auditing agent assesses the quality of skills documents across multiple dimensions, including logical clarity, language accuracy, content redundancy, and factual correctness, and categorizes identified issues into three levels based on severity. Furthermore, the quality auditing agent determines whether the audit results contain issues of a preset level, i.e., whether they include Level 1 or Level 2 issues.
[0145] Understandably, pre-defined level issues, namely critical and / or important issues, are core problems that directly affect the accuracy of tool function descriptions, parameter completeness, and document logical usability. These issues can directly lead to the agent's inability to accurately understand tool capabilities, incorrect assembly of call parameters, and ultimately, tool call failures or abnormal call results. Therefore, this application treats these two types of issues as defects that must be rectified, and prevents unqualified documents from being released at the source through mandatory audit verification.
[0146] S605, when the audit results contain issues at a preset level, the document generation agent corrects the skill document based on the audit results and returns to step S604 to re-execute the graded audit.
[0147] When the audit results do not contain any issues at the preset level (i.e., neither Level 1 nor Level 2 issues), the skills document that has passed the audit is obtained, and the process proceeds to the next step, S606.
[0148] In other words, when the audit results contain issues at a preset level, the electronic device uses a document generation agent to revise the skill document based on the audit results and re-executes the graded audit until the audit results no longer contain issues at the preset level, resulting in a skill document that has passed the audit, thus achieving a complete closed-loop feedback.
[0149] Therefore, through a closed-loop iterative mechanism of auditing, correction, and re-examination, serious and important quality defects in documents can be reduced or even eliminated, ensuring that the final output skill documents are accurate and reliable in core contents such as functional descriptions, parameter configurations, and logical arrangements, and meeting the basic quality requirements for intelligent agent tool calls.
[0150] S606 uses a semantic evaluation agent to perform semantic-level evaluation on audited skill documents and outputs quantitative evaluation results.
[0151] As an example, a semantic judgment agent includes: a use case generation model, a behavior response model, and a semantic judgment model.
[0152] Specifically, the semantic evaluation agent constructs test cases based on the generated skill documents through the use case generation model; simulates the agent (such as the YOYO agent or other task agents) to execute tool calls according to the skill documents through the behavior response model, and outputs the actual call results; and compares the actual call results with the expected results of the test cases through the semantic evaluation model to obtain quantitative evaluation results.
[0153] In other words, the semantic evaluation agent constructs test cases through a use case generation model, simulates actual agent invocation through a behavioral response model, and performs three-layer comparison and semantic equivalence reasoning through a semantic evaluation model, outputting a quantitative evaluation report that includes the pass rate of each use case at the three layers and the overall semantic matching accuracy. Therefore, compared with the traditional manual subjective evaluation mode, the embodiments of this application realize the automated, standardized, and quantitative evaluation of skill document usability, which can accurately reflect the actual ability of the document to support the agent's tool invocation.
[0154] As an example, the semantic evaluation agent uses a semantic evaluation model to compare the command string of the actual call result with the command string of the expected result at the instruction layer to obtain a string comparison result; at the parameter key layer, it compares the parameter key set of the actual call result with the parameter key set of the expected result to obtain a parameter comparison result; at the parameter value layer, it compares the actual filled value of the actual call result with the expected value of the expected result parameter by parameter to obtain a filled value comparison result. The comparison at the parameter value layer is performed by the semantic evaluation model through semantic equivalence inference; and a quantitative evaluation result is generated based on the string comparison result, the parameter comparison result, and the filled value comparison result.
[0155] Therefore, by conducting multi-level, fine-grained comparison and verification, and by introducing semantic equivalence reasoning to avoid misjudgment caused by literal matching, the accuracy and authenticity of the quantitative evaluation results are significantly improved, taking into account both the rigor of the calling rules and the rationality of semantic adaptation.
[0156] S607. Based on the quantitative evaluation results, identify the links with insufficient constraints in the generated prompt word template, and iteratively optimize the generated prompt word template.
[0157] The quantitative evaluation results are used to measure the accuracy of skill documentation and to identify insufficient constraints in the generated prompt word template, driving continuous iterative optimization of the template. The optimized generated prompt word template can be used for the generation of subsequent skill documentation, forming a self-closing loop.
[0158] In some embodiments, the electronic device generates optimized skill documents through a document generation agent based on tool definition information and optimized generation prompt word templates. In this case, the present application constructs a complete self-optimizing closed loop of "document generation - hierarchical auditing - semantic evaluation - template optimization - regeneration," which can continuously address the constraints of the prompt word templates, iteratively optimize document generation rules, and continuously improve the overall quality and standardization of subsequent batch-generated skill documents, reducing the cost of manual debugging and correction.
[0159] In summary, the skill document generation method provided in this application realizes a complete automated chain from tool definition acquisition to skill document generation, auditing, evaluation and optimization, which is conducive to improving the scalability, quality controllability and verifiability of skill document generation.
[0160] Reference Figure 7 The diagram shown illustrates a process for fusing multiple skill documents according to an embodiment of this application. The process is executed by an electronic device with data processing capabilities. Specifically, when multiple skill documents with similar functions exist, the electronic device can perform merging determination and semantic fusion through a document fusion agent. The specific process includes the following steps:
[0161] S701, obtain multiple skill documents with similar functions.
[0162] S702 performs a mergeability determination on multiple skill documents through a document fusion intelligent agent and obtains the determination result.
[0163] The above-mentioned determination results can be mergeable, conflictable but resolvable, or unmergeable.
[0164] As an example, multiple skill documents with similar functions often have problems such as overlapping parameters, inconsistent wording, complementary operational logic, or conflicting local content. Simply storing them independently will increase the burden on the agent's retrieval and understanding. This application uses a logic of first determining and then merging documents to balance the value of document integration with the accuracy of content, and avoids semantic confusion caused by blind merging.
[0165] Through intelligent merging determination and semantic fusion mechanisms, similar skill documents are organized, deduplicated, and conflict-resolved, forming structured and integrated fused documents that are more suitable for batch tool calls by intelligent agents and reuse of business scenarios.
[0166] In some embodiments, the above-mentioned mergeability determination includes: functional domain determination, operation complementarity analysis, context sharing check, intent aggregation analysis, and conflict detection; wherein, functional domain determination is used to determine whether the functions described in the document belong to the same business domain; operation complementarity analysis is used to determine whether the operations constitute a logical complementary relationship; context sharing check is used to compare whether the overlap rate of parameter definitions exceeds a preset threshold; intent aggregation analysis is used to determine whether various user intents can be covered by a unified parameter system and operation process; conflict detection is used to check whether parameter names have the same name but different meanings, whether default values are contradictory, and whether constraints are mutually exclusive.
[0167] Therefore, by using a five-dimensional comprehensive compliance assessment, the feasibility of merging multiple skill documents can be objectively and accurately evaluated, effectively avoiding problems such as semantic conflicts, logical confusion, and parameter errors caused by blind merging. This provides a reliable and objective basis for subsequent semantic fusion processing, ensuring the accuracy and usability of the merged documents.
[0168] S703, when the determination result is that the documents can be merged or the conflict can be resolved, the document fusion agent performs semantic fusion on multiple skill documents to generate a fused skill document.
[0169] In some embodiments, the specific process for generating a fusion skills document includes: performing deep semantic analysis on multiple skills documents and outputting analysis results, the analysis results including at least one of the following: functional domain mapping table, intent clustering results, and parameter overlap matrix; determining a fusion strategy based on the analysis results, the fusion strategy including at least one of the following: organizational scheme, deduplication rules, conflict resolution, and terminology standardization; generating a fusion skills document according to the fusion strategy, the fusion skills document including at least one of the following fusion information: overview section, navigation table, shared parameter section, and cross-integration guidelines.
[0170] In particular, by using deep semantic analysis to mine the business relationships, parameter overlaps and common user intents among multiple documents, and relying on standardized fusion strategies to complete document reconstruction, unlike simple text splicing, it can effectively unify terminology, eliminate duplicate content, resolve parameter conflicts, and generate fusion skill documents with clearer structure, more distinct hierarchy and stronger integration.
[0171] Understandably, conventional skill documentation is organized independently by tool, resulting in significant parameter redundancy and logical duplication among tools with similar functions. Independent maintenance is costly, but blindly merging can lead to document chaos. Therefore, this application provides a two-stage processing mechanism: the first stage is mergibility determination, evaluating from five dimensions—functional domain, operational complementarity, context sharing, intent aggregation, and conflict detection—to determine whether merging is possible, whether conflicts are solvable, or whether merging is not possible. The second stage is semantic fusion generation, sequentially performing deep semantic analysis, fusion strategy formulation, and structured output. A large model understands the semantics, designs a solution, and generates a fused document containing unified navigation and shared parameter segments. Unlike simple splicing, this mechanism achieves redundancy removal, conflict resolution, and structural reorganization based on semantic understanding, combining merging security with semantic-level deduplication capabilities.
[0172] S704, when the determination result is that it cannot be merged, keep the documents separate and output the reason why it cannot be merged.
[0173] Therefore, the embodiments of this application can realize the fusion processing of multiple skill documents with the same source and similar functions, solve the problems of scattered storage of multiple documents, content redundancy, parameter conflict and high maintenance cost, and improve the integrity and maintainability of skill documents.
[0174] In some embodiments, this application provides a skill documentation generation platform, such as the YOYOClaw SkillToolkit platform. This platform provides a system interface and supports end-to-end processing from MCP tool definition to standardized Skill documentation. It mainly comprises four functional modules: a single tool generation module, a multi-document merging module, a document preview and editing module, and an AI evaluation report module. The single tool generation module allows users to select a target agent and fill in basic tool information (tool name, command, description), automatically generating a complete Skill document containing tool commands, parameter definitions, and integration workflows. The multi-document merging module supports batch uploading of multiple Skill documents, with AI performing mergeability analysis and semantic fusion. The document preview and editing module provides a structured document details view, covering functional descriptions, command formats, integration workflows, and intent recognition routes, and supports inputting test cases for immediate verification. The AI evaluation report module automatically generates test cases and performs semantic-level evaluation, outputting a comparison table of expected and actual outputs for each test case. Overall, this platform integrates tool definition parsing, document generation, multi-document fusion, and quality verification into a unified workflow, enabling the Skillification transformation of large-scale tool assets.
[0175] Understandably, the aforementioned skills document generation platform provides users with a visual interface and an integrated workflow, while the normalization processing module, document generation agent, quality audit agent, semantic evaluation agent, and document fusion agent mentioned above are the core processing engines behind the platform. The platform's single-tool generation function corresponds to the collaborative link between the normalization processing module and the document generation agent and quality audit agent; the multi-document merging function is driven by the document fusion agent, performing five-dimensional mergibility determination and three-step semantic fusion; the document preview and editing function presents the standardized output of the document generation agent in a structured view for users to review and fine-tune; the AI evaluation report function calls the semantic evaluation agent, outputting quantitative evaluation results through a three-model separation architecture of use case generation, behavior response, and semantic evaluation.
[0176] Next, the hardware structure of the electronic device that performs skill document generation in the embodiments of this application will be described.
[0177] Figure 8 A schematic diagram of the hardware structure of an electronic device is shown according to an embodiment of this application. This electronic device can be a terminal device with data processing capabilities, such as a smartphone, tablet computer, personal digital assistant, or wearable device, or it can be a server or cloud computing platform.
[0178] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identity module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0179] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0180] Processor 110 may include one or more processing units, such as application processors, modem processors, graphics processors, image signal processors, controllers, video codecs, digital signal processors, baseband processors, and / or neural network processors. The controller may serve as the central nervous system and command center of electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0181] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are being used repeatedly.
[0182] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc. The data storage area may store data created during the use of the electronic device 100, etc. In this embodiment, the internal memory 121 can be used to store the program code for a skill document generation method and the generated skill documents.
[0183] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. In this embodiment, electronic device 100 can communicate with the server where the large language model is located through wireless communication module 160 to obtain the inference results of the large language model, so as to realize the functions of document generation agent, quality audit agent, semantic evaluation agent, and document fusion agent.
[0184] like Figure 9 The diagram shown is a schematic representation of the operating system software structure of an electronic device according to an embodiment of this application. The operating system of the electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the application uses the layered architecture Android system as an example to illustrate the system software structure of the electronic device 100.
[0185] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0186] The application layer may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and browser, instant messaging applications, etc. In this embodiment, the application layer may also include a smart assistant application (such as YOYO Assistant), which has a trained task model deployed within it, capable of executing tool calls based on skill documents to complete the user's condition-triggered tasks.
[0187] The application framework layer provides application programming interfaces and programming frameworks for applications in the application layer, including a window manager, content provider, view system, phone manager, resource manager, notification manager, etc. In this embodiment, the application framework layer may also include a skill document generation service framework, providing API interfaces for services such as skill document generation, quality auditing, semantic evaluation, and document fusion for upper-layer applications to call.
[0188] The Android runtime consists of core libraries and a virtual machine, responsible for scheduling and managing the Android system. System libraries can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing libraries, and a 2D graphics engine. The kernel layer is the layer between hardware and software, and at least includes display drivers, camera drivers, audio drivers, and sensor drivers.
[0189] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the above-described method embodiments. The computer-readable storage medium can be a storage unit inside an electronic device or an external storage device accessible by the electronic device.
[0190] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps in the above-described method embodiments.
[0191] Various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or combinations of these implementation methods. Embodiments of this application can be implemented as computer program modules or module code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0192] Computer program modules or module code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0193] Module code can be implemented using a high-level modular language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used to implement module code when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0194] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or via other computer-readable storage media. Therefore, machine-readable storage media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, optical discs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable storage media include any type of machine-readable storage media suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0195] In this specification, the reference to "an embodiment" or "an embodiment" means that a specific feature, structure, or characteristic described in connection with the embodiment is included in at least one exemplary implementation or technology disclosed according to an embodiment of this application. The appearance of the phrase "in an embodiment" in various places in the specification does not necessarily refer to the same embodiment.
[0196] The disclosure of embodiments of this application also relates to means for performing operations in text. This means may be specifically constructed for the claimed purpose or may include a general-purpose computer selectively activated or reconfigured by a computer program stored in a computer. Such a computer program may be stored in a computer-readable storage medium, such as, but not limited to, any type of disk, including floppy disks, optical disks, CD-ROMs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), EPROM, EEPROM, magnetic or optical cards, application-specific integrated circuits (ASICs), or any type of medium suitable for storing electronic instructions, and each may be coupled to a computer system bus. Furthermore, the computer mentioned in the specification may include a single processor or may employ an architecture designed for multiple processors with increased computing power.
[0197] Furthermore, the language used in this specification has been primarily chosen for readability and instructional purposes and may not have been chosen to depict or limit the disclosed subject matter. Therefore, the embodiments disclosed in this application are intended to illustrate, and not limit, the scope of the concepts discussed herein.
Claims
1. A method for generating skill documents, characterized in that, The method includes: Obtain tool definition information; The document generation agent generates skill documents based on the tool definition information and generated prompt word templates. The skill documents are subjected to a graded audit by a quality auditing agent to obtain the skill documents that have passed the audit. A semantic evaluation agent performs semantic evaluation on the audited skill documents and outputs quantitative evaluation results. The quantitative evaluation results are used to measure the accuracy of the audited skill documents and / or to optimize the generated prompt word template. The skill document is used by the agent as a context input execution tool during the reasoning phase.
2. The method according to claim 1, characterized in that, After obtaining the tool definition information, the method further includes: Heterogeneous normalization processing is performed on the tool definition information to obtain a structured parameter description; The document generation agent generates skill documents based on the tool definition information and the generated prompt word template, including: The document generation agent generates the skill document based on the structured parameter description and the generation prompt word template.
3. The method according to claim 2, characterized in that, The generated prompt template includes at least one of form-driven generated templates and conversational generated templates.
4. The method according to claim 3, characterized in that, The dialogic generation template includes at least one of the following: tool mode dialog template, free mode dialog template, and guided acquisition template.
5. The method according to claim 4, characterized in that, The method further includes: When generating the skill document using the conversational generation template, intent recognition is performed on the user input to determine whether the user input intent is to select from existing templates, select multiple templates in batches, or create a new tool document, and the corresponding interaction branch is entered based on the determination result.
6. The method according to claim 1, characterized in that, The skills document includes: YAML header metadata block, first-level headings, tool command section, parameter definition section, and integration workflow section; The YAML header metadata block contains the tool name and function description; the tool command section presents the command string in the form of a code block; the parameter definition section presents the parameter name, type, required field markers and semantic descriptions in the form of a table; and the integration workflow section contains the process of intent parsing and parameter assembly, as well as a description of cross-platform call differences.
7. The method according to claim 1, characterized in that, The method further includes: When the skill document belongs to multiple skill documents with similar functions, the document fusion agent performs a mergeability determination on the multiple skill documents to obtain a determination result, which includes mergeable, conflict-resolvable, and non-mergeable. When the determination result is that the documents can be merged or the conflict can be resolved, the document fusion agent performs semantic fusion on the multiple skill documents to generate a fused skill document. When the determination result is that the documents cannot be merged, keep them as separate documents and output the reason why they cannot be merged.
8. The method according to claim 7, characterized in that, The step of performing semantic fusion on the multiple skill documents through the document fusion agent to generate a fused skill document includes: Deep semantic analysis is performed on the multiple skill documents, and the analysis results are output. The analysis results include at least one of the following: functional domain mapping table, intent clustering results, and parameter overlap matrix. Based on the analysis results, a fusion strategy is determined, which includes at least one of the following: organizational scheme, deduplication rules, conflict resolution, and terminology standardization. The fusion skills document is generated according to the fusion strategy. The fusion skills document includes at least one of the following fusion information: overview section, navigation table, shared parameter section, and cross-integration guide.
9. The method according to claim 7, characterized in that, The mergeability determination includes: functional domain determination, operation complementarity analysis, context sharing check, intent aggregation analysis, and conflict detection; Specifically, the functional domain determination is used to determine whether the functions described in the document belong to the same business domain; the operation complementarity analysis is used to determine whether the operations constitute a logical complementary relationship; the context sharing check is used to compare whether the overlap rate of parameter definitions exceeds a preset threshold; the intent aggregation analysis is used to determine whether various user intents can be covered by a unified parameter system and operation process; and the conflict detection is used to check whether parameter names have the same name but different meanings, whether default values are contradictory, and whether constraints are mutually exclusive.
10. The method according to claim 1, characterized in that, The process of performing a graded audit on the skill documents through a quality auditing intelligent agent to obtain audited skill documents includes: The quality auditing agent performs a tiered audit on the skill document to obtain the audit results; When the audit results contain issues of a preset level, the document generation agent corrects the skill document based on the audit results and re-executes the graded audit until the audit results no longer contain the issues of the preset level, thus obtaining a skill document that has passed the audit.
11. The method according to claim 10, characterized in that, The step of performing a graded audit on the skill documents through a quality auditing agent includes: The quality audit agent performs a quality assessment of the skill document from multiple defined dimensions to obtain the audit results; The multiple setting dimensions include at least one of the following: logical clarity, language accuracy, content redundancy, and factual correctness.
12. The method according to claim 11, characterized in that, The graded audit is divided into three levels: Level 1, Level 2, and Level 3. The preset level of problems includes at least one of Level 1 and Level 2 problems. Level 1 problems include incorrect function descriptions and missing required parameters. Level 2 problems include inaccurate language and improper logical order. Level 3 problems include redundant content and insufficient conciseness of expression.
13. The method according to claim 1, characterized in that, The semantic evaluation agent includes: a use case generation model, a behavior response model, and a semantic evaluation model; The semantic evaluation agent performs semantic evaluation on the audited skill documents and outputs quantitative evaluation results, including: Test cases are constructed based on the skill document using the test case generation model; The behavioral response model simulates an agent executing tool calls based on the skill document, and outputs the actual call results. The actual call result is compared with the expected result of the test case using the semantic evaluation model to obtain the quantitative evaluation result.
14. The method according to claim 13, characterized in that, The actual call result is compared with the expected result of the test case using the semantic evaluation model to obtain the quantitative evaluation result, including: The command string of the actual call result is compared with the command string of the expected result at the instruction level to obtain the string comparison result; The parameter key set of the actual call result is compared with the parameter key set of the expected result at the parameter key layer to obtain the parameter comparison result; The actual filled value of the actual call result is compared with the expected value of the expected result parameter by parameter by parameter in the parameter value layer to obtain the filled value comparison result. The comparison of the parameter value layer is performed by the semantic evaluation model to perform semantic equivalence inference. The quantitative evaluation result is generated based on the string comparison result, the parameter comparison result, and the padding value comparison result.
15. The method according to any one of claims 1 to 14, characterized in that, The method further includes: Based on the quantitative evaluation results, the insufficient constraints in the generated prompt word template are identified, and the generated prompt word template is iteratively optimized to obtain an optimized generated prompt word template.
16. The method according to claim 15, characterized in that, The method further includes: The document generation agent generates optimized skill documents based on the tool definition information and the optimized generation prompt word template.
17. An electronic device, characterized in that, include: One or more processors; One or more memories; the one or more memories storing one or more programs that, when executed by the one or more processors, cause the electronic device to perform the method of any one of claims 1 to 16.
18. A computer-readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 16.
19. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, implements the method of any one of claims 1 to 16.
