You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fmt.Printf("Warning: Could not automatically find SKILL.md near the script at %s\n", readmePath)
171
+
}
172
+
return
173
+
}
174
+
175
+
// Otherwise, it might be a built-in skill, or we should look through actual paths.
176
+
// For built-ins, we can point them to the docs.
177
+
fmt.Printf("Skill '%s' is not registered as a custom script skill. If it's built-in (e.g. cron, file_manager, websearch), refer to the core documentation or verify the name.\n", name)
Here is the comprehensive guide on how to create and register custom skills for YAOCC.
4
+
You can extend your capabilities by creating new "Skills". A skill is simply a set of instructions and examples stored in a markdown file. and sometimes is accompanied by a script (Python, Bash, JS, etc.)(js preferred) that you register as a new command. Before creating a skill verify it doest exist yet using `yaocc skills list`.
5
+
6
+
### 1. Create the Script and Skill Definition
7
+
First, create the script and the `SKILL.md` file as usual.
8
+
9
+
To add a new skill:
10
+
1. Create a directory: `skills/<skill_name>/`
11
+
2. Create a file: `skills/<skill_name>/SKILL.md`
12
+
3. Write the skill definition in frontmatter and instructions in the body.
13
+
14
+
#### Example: Creating a "Weather" Skill using `file write`
15
+
16
+
```bash
17
+
yaocc file write skills/weather/SKILL.md "---
18
+
name: weather
19
+
description: Checks the weather of a city.
20
+
---
21
+
# Weather api
22
+
23
+
To check the weather of a city run
24
+
\`\`\`bash
25
+
yaocc skills weather <city>
26
+
\`\`\`
27
+
```
28
+
### 2. Create script and verify it runs
29
+
sometimes you can get away only with SKILL.md
30
+
but sometimes you'll need to create the script, in this case
31
+
32
+
**Note:** You cannot use reserved names like `list`, `register`, `file`, `cron`, etc.
33
+
34
+
#### Example: Creating a "Weather" Skill script
35
+
1. **Create the script:**
36
+
```bash
37
+
yaocc file write skills/weather/weather.js "console.log(`Weather in \${process.argv[2]}: Sunny`);"
38
+
```
39
+
40
+
2. **Verify it runs:**
41
+
verify it runs correctly before you register!
42
+
```bash
43
+
yaocc file run skills/weather/weather.js Paris
44
+
```
45
+
46
+
3. **Register it:**
47
+
Use the `yaocc skills register` command to link a command name to your script.
48
+
very important you can register the skill only after it runs correctly in the previous step
Copy file name to clipboardExpand all lines: pkg/templates/TOOLS.md
+8-62Lines changed: 8 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,75 +18,21 @@ yaocc skills list
18
18
## Creating and Using Skills
19
19
You can extend your capabilities by creating new "Skills". A skill is simply a set of instructions and examples stored in a markdown file. and sometimes is accompanied by a script (Python, Bash, JS, etc.)(js preferred) that you register as a new command. Before creating a skill verify it doest exist yet using `yaocc skills list`.
20
20
21
-
### 1. Create the Script and Skill Definition
22
-
First, create the script and the `SKILL.md` file as usual.
23
-
24
-
To add a new skill:
25
-
1. Create a directory: `skills/<skill_name>/`
26
-
2. Create a file: `skills/<skill_name>/SKILL.md`
27
-
3. Write the skill definition in frontmatter and instructions in the body.
28
-
29
-
#### Example: Creating a "Weather" Skill using `file write`
30
-
31
-
```bash
32
-
yaocc file write skills/weather/SKILL.md "---
33
-
name: weather
34
-
description: Checks the weather of a city.
35
-
---
36
-
# Weather api
37
-
38
-
To check the weather of a city run
39
-
\`\`\`bash
40
-
yaocc skills weather <city>
41
-
\`\`\`
42
-
```
43
-
### 2. Create script and verify it runs
44
-
sometimes you can get away only with SKILL.md
45
-
but sometimes you'll need to create the script, in this case
46
-
47
-
**Note:** You cannot use reserved names like `list`, `register`, `file`, `cron`, etc.
48
-
49
-
#### Example: Creating a "Weather" Skill script
50
-
1. **Create the script:**
21
+
**CRITICAL RULE FOR UNFAMILIAR SKILLS:** If you see a skill in your `<available_skills>` manifest but do not know its precise arguments, you MUST read its documentation first using:
51
22
```bash
52
-
yaocc file write skills/weather/weather.js "console.log(`Weather in ${process.argv[2]}: Sunny`);"
23
+
yaocc skills get <skill_name>
53
24
```
25
+
Do not attempt to guess the arguments of a custom skill before reading its `SKILL.md` body.
54
26
55
-
2. **Verify it runs:**
56
-
verify it runs correctly before you register!
27
+
### Creating a Custom Skill from Scratch
28
+
If the user asks you to create a brand new custom skill, you MUST first read the tutorial to learn the framework mechanics by running:
57
29
```bash
58
-
yaocc file run skills/weather/weather.js Paris
30
+
yaocc skills tutorial
59
31
```
32
+
DO NOT attempt to create a custom skill without reading the tutorial first.
60
33
61
-
3. **Register it:**
62
-
Use the `yaocc skills register` command to link a command name to your script.
63
-
very important you can register the skill only after it runs correctly in the previous step
0 commit comments