Definition
Each app can have a skills.ts
file that contains the agent skills. The skills are defined as an array of objects with the following keys:
Skill declaration
The handler function to process check skill requests:
src/skills/check.ts
export const checkDomain: Skill[] = [
{
skill: "/check [domain]",
handler: handler,
examples: ["/check vitalik.eth", "/check fabri.base.eth"],
description: "Check if a domain is available.",
params: {
domain: {
type: "string",
},
},
},
];
Converted parameters
This is the parameters extracted from the user request:
{
"skill": "check",
"params": {
"domain": "vitalik.eth"
}
}
Properties
- skill: The name of the skill.
- description: The description of the skill.
- examples: Examples of how to use the skill.
- params: Defines the parameters required for the skill with its property name.
- default: The default value for the parameter. This can be any type.
- values:
[]
An array of strings that defines the accepted values for the parameter. - plural: If true, the parameter is an array.
- type: The type of the parameter. It can be one of the following:
number
: The parameter is a number.string
: The parameter is a string.username
: The parameter is a username.quoted
: The parameter is a quoted string.address
: The parameter is an address.prompt
: The parameter is a prompt.url
: The parameter is a URL.