Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Skills Description

Skills Description

The skill description is the most important part of a skill; it determines whether the agent can correctly recognize when the skill should be activated. This section teaches you how to write effective skill descriptions.


Why Description Is Important

The skill description plays a key role in the process of the agent loading a skill:

If the description is poorly written, the agent may:

Tip: The quality of a skill description directly affects the usability of the skill. It is worth investing time to optimize the description.


Basic Structure of a Description

A good skill description should contain two parts:

  1. Description: describe what the skill can do
  2. Trigger conditions: explain under what circumstances to use it
description: 从 PDF 文件中提取文本和表格,填写 PDF 表单,合并多个 PDF。处理 PDF 文档或用户提及 PDF、表单或文档提取时使用。

#                         ↑ Function description                                      ↑ Trigger condition


Techniques for Writing Effective Descriptions

1. Include specific trigger keywords

Include specific words and phrases that users may use in the description. These keywords help the agent identify relevant tasks.

Good description:



description: 提取 PDF 文本和表格,填写表单,合并 PDF。使用场景:处理 PDF 文件、提取文档内容、填写 PDF 表单、合并多个 PDF、用户提及「PDF」「提取」「表单」「合并」等关键词。

2. Make the description specific rather than general

Avoid overly broad descriptions, which prevent the agent from making accurate judgments.



# Bad description - too vague

description: 帮助处理各种文件。



# Good description - specific and clear

description: 处理图像文件,包括调整大小、转换格式、应用滤镜。使用场景:处理图片、调整图像尺寸、转换图片格式。

3. Describe multiple usage scenarios

List the different scenarios in which the skill may apply to help the agent match more accurately.



description: 执行代码审查,检查安全漏洞、代码质量和性能问题。使用场景:代码审查、PR 审查、代码检查、安全扫描、质量评估、用户要求「review」「检查代码」「安全性」等。

4. Distinguish similar skills

If you have multiple related skills, ensure their descriptions are clearly distinct.



# Skill 1: PDF Text Extraction

name: pdf-extract

description: 从 PDF 文件中提取文本内容和表格数据。使用场景:提取 PDF 文字、读取 PDF 内容、PDF 转文本、用户提及「PDF 提取」「读取 PDF」等。



# Skill 2: PDF Form Handling

name: pdf-form

description: 填写 PDF 表单字段,提取表单数据。使用场景:填写 PDF 表单、填充表单字段、PDF 表单数据处理、用户提及「PDF 表单」「填写表单」等。


Description Length Control

The maximum length of the description field is 1024 characters. But this is not a target; the description should be concise and accurate.

Case Recommended length
Simple skills 50-100 characters
Medium-complexity skills 100-200 characters
Complex skills 200-400 characters

Note: a description is not better simply because it is longer. An overly long description may contain too much irrelevant information and instead interfere with the agent's judgment.


Testing and Optimizing Descriptions

After creating a skill, you should test whether the description can correctly trigger the skill. The testing steps are as follows:

1. Basic function test

Test using keywords contained in the description to confirm the skill can be activated.

2. Edge case test

Test some scenarios that might trigger but should not.

3. Iterative optimization

Adjust the description based on the test results:

Optimization examples:



# Initial version - may miss reports

description: 提取 PDF 文本。



# Optimized version - reduce false negatives

description: 从 PDF 文件中提取文本内容和表格数据。使用场景:提取 PDF 文字、读取 PDF 内容、PDF 转文本。



# Final version - further optimization

description: 从 PDF 文件中提取文本内容和表格数据。使用场景:提取 PDF 文字、读取 PDF 内容、PDF 转文本、用户提及「PDF 提取」「读取 PDF」「PDF 文字」「PDF 内容」等关键词时使用。


Common problems and solutions

Problem 1: The skill is always activated

This indicates the description is too broad. The solution is to add more qualifiers and usage scenarios.

Solutions:



# Before modification - too broad

description: 处理文本。



# Modified - more specific

description: 使用正则表达式处理和转换文本字符串。使用场景:文本匹配、字符串替换、模式提取、数据清洗。

Problem 2: The skill is never activated

This indicates the description lacks keywords users may use. The solution is to add more trigger words.

Solutions:



# Before modification - too few keywords

description: 优化数据库查询。



# Modified - Added more trigger words

description: 优化 SQL 查询性能,分析执行计划,添加索引。使用场景:SQL 优化、查询慢、数据库性能、调优索引、执行计划分析。

Problem 3: The wrong skill is activated

This indicates the descriptions of multiple skills are too similar. The solution is to make the descriptions more distinctive.

Tip: regularly testing and optimizing your skill descriptions is a good habit. As usage scenarios increase, you may find the description needs adjustment.